:root {
  --green: #08734d;
  --green-light: #eaf5ef;
  --text: #1d2925;
  --muted: #596961;
  --border: #dce5df;
  color: var(--text);
  background: #f7f9f8;
  font-family: system-ui, -apple-system, "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #e87b32;
  outline-offset: 3px;
}
.container { width: 100%; max-width: 1920px; margin: 0 auto; padding: 0 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 1; padding: 12px; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Header and search */
.site-header { background: #fff; border-bottom: 1px solid var(--border); padding: 22px 0; }
.header-layout { display: grid; grid-template-columns: 232px minmax(0, 640px) 1fr; align-items: center; gap: 24px; }
.site-name { font-size: 2rem; font-weight: 800; letter-spacing: -.05em; text-decoration: none; line-height: 1.2; }
.site-name-dot { color: #e87b32; }
.site-brand p { margin: 6px 0 0; font-size: .75rem; color: var(--muted); }
.header-note { justify-self: end; margin: 0; color: var(--muted); font-size: .8rem; }
input, select, button { font: inherit; min-height: 44px; border: 1px solid #aabdb2; border-radius: 6px; padding: 9px 12px; background: #fff; color: var(--text); }
button { color: #fff; background: var(--green); border-color: var(--green); cursor: pointer; font-weight: 600; }
button:hover { background: #075c3e; }
.search-form { display: flex; gap: 8px; min-width: 0; }
.search-form input[type="search"] { min-width: 0; width: 100%; background: #f7f9f8; }
.search-form input::placeholder { color: #64756c; opacity: 1; }
.search-form button { flex-shrink: 0; padding-inline: 24px; }

/* Catalog heading */
.catalog-layout { --catalog-top-gap: 28px; --filter-viewport-gap: 16px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: var(--catalog-top-gap); padding-bottom: 32px; }
.catalog-results { min-width: 0; }
.breadcrumb-nav { margin-bottom: 16px; }
.genre-breadcrumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.genre-breadcrumbs li { min-width: 0; }
.genre-breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.genre-breadcrumbs a { color: var(--muted); }
.genre-breadcrumbs [aria-current="page"] { color: var(--text); }
.list-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 24px; margin-bottom: 12px; }
.list-heading-text { grid-column: 1 / -1; grid-row: 1; min-width: 0; padding-right: 80px; }
.list-heading h1 { overflow-wrap: break-word; line-break: strict; text-wrap: pretty; }
.heading-phrase { display: inline-block; max-width: 100%; }
.list-toolbar { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.list-order-summary { margin: 8px 0 0; color: var(--green); font-size: .95rem; font-weight: 600; }
h1 { margin: 0; font-size: 1.6rem; line-height: 1.5; }
.result-count { grid-column: 1; grid-row: 2; margin: 0; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.result-count strong { color: var(--text); font-size: 1.1rem; }
.result-count span { display: inline-block; }
.sort-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.sort-form label { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.sort-form select { min-width: 0; max-width: 100%; font-size: .85rem; }
.sort-form button { font-size: .85rem; flex-shrink: 0; }

/* Cards: column count follows the actual results area, including the sidebar. */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 20px 16px; }
.product-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.product-card:hover { border-color: #a4c4b3; box-shadow: 0 3px 12px #1d29250a; }
.product-image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; border-bottom: 1px solid #edf1ee; }
.image-placeholder { display: grid; place-items: center; color: var(--muted); background: #f0f4f1; font-size: .9rem; }
.product-image-fallback[hidden] { display: none !important; }
.product-body { display: flex; flex-direction: column; flex: 1; padding: 12px; overflow-wrap: anywhere; }
.product-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 10px; height: 4.8em; font-size: .95rem; font-weight: 600; line-height: 1.6; }
.product-prices { margin: 0 0 12px; }
.product-prices dt { color: var(--muted); font-size: .8rem; }
.product-prices dd { margin: 0; font-variant-numeric: tabular-nums; }
.unit-price { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #edf1ee; }
.unit-price dt { color: var(--green); font-size: .75rem; }
.unit-price dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; color: var(--green); line-height: 1.35; margin-top: 4px; }
.unit-price-value { min-width: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.035em; }
.price-unit { white-space: nowrap; font-size: .85rem; font-weight: 600; }
.unit-price-unavailable { font-size: 1.1rem; font-weight: 700; }
.product-detail { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 3px 0; }
.product-detail dd { margin-left: auto; text-align: right; font-size: .95rem; font-weight: 600; }
.product-detail dd span { font-size: .8rem; font-weight: 400; }
.product-data-note { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 6px; font-size: .75rem; line-height: 1.5; color: var(--muted); text-align: left; }
.product-data-note dt { font-size: inherit; }
.product-data-note time { display: inline-block; white-space: nowrap; }
.fetched-at-compact { display: none; }
.product-data-note dd { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.product-card .product-data-note dd { flex-wrap: nowrap; }
.price-disclaimer-info { flex-shrink: 0; text-decoration: none; }
.price-disclaimer-direct { display: inline-flex; align-items: center; white-space: nowrap; }
.price-disclaimer-link { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted); text-decoration: underline; }
.price-disclaimer-link:hover { color: var(--green); }
.info-button { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; min-width: 24px; min-height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 400; line-height: 1; text-decoration: none; }
.info-button:hover, .info-button[aria-expanded="true"] { background: var(--green-light); color: var(--green); }
.info-button[hidden], .info-popover[hidden] { display: none; }
.list-order-summary .info-button { margin-inline-start: 4px; }
.info-popover { position: fixed; z-index: 100; width: min(420px, 88vw); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); box-shadow: 0 4px 18px #1d29251a; font-size: .875rem; line-height: 1.8; overflow-wrap: anywhere; }
.info-popover h2 { margin: 0 28px 12px 0; font-size: inherit; font-weight: 700; }
.info-popover p { margin: 0 0 12px; }
.info-popover > p:last-child { margin-bottom: 0; }
.info-popover-close { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.info-popover-close:hover { background: var(--green-light); color: var(--green); }
.product-review dd { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; white-space: nowrap; }
.product-card .product-review dd { min-width: 0; max-width: 100%; flex-wrap: wrap; white-space: normal; }
.product-review .product-review-average,
.product-review .product-review-star { font-size: inherit; font-weight: inherit; }
.product-review .product-review-star { color: #946800; }
.product-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 44px; margin-top: auto; padding: 9px 6px; border: 1px solid #b4cfbf; border-radius: 6px; font-size: .85rem; font-weight: 600; text-decoration: none; text-align: center; }
.product-link:hover { background: var(--green-light); border-color: var(--green); }
.empty-message { grid-column: 1 / -1; padding: 48px 20px; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.empty-message h2 { margin: 0; font-size: 1.1rem; }
.empty-message p { color: var(--muted); font-size: .9rem; }

/* Hierarchical genre navigation */
.catalog-sidebar { position: sticky; top: var(--filter-viewport-gap); min-width: 0; }
.genre-filter { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.genre-filter-heading { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 700; list-style: none; cursor: pointer; }
.genre-filter-heading::-webkit-details-marker { display: none; }
.genre-filter-heading::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.1rem; }
.genre-filter[open] > .genre-filter-heading::after { content: "−"; }
.genre-heading-mobile, .genre-filter-current { display: none; }
.genre-filter-content { padding: 8px 10px 14px; border-top: 1px solid #edf1ee; max-height: calc(100dvh - 130px); overflow-y: auto; scrollbar-width: thin; }
.genre-tree { list-style: none; padding: 0; margin: 0; }
.genre-tree .genre-tree { margin-left: 10px; border-left: 1px solid var(--border); }
.genre-link, .genre-all { display: flex; align-items: center; min-height: 44px; padding: 8px; border-radius: 5px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; font-size: .85rem; }
.genre-all { margin-bottom: 4px; }
.genre-leaf { padding-left: 52px; }
.genre-link:hover, .genre-all:hover { background: #f2f7f4; }
.genre-link.is-selected, .genre-all.is-selected { color: var(--green); background: var(--green-light); font-weight: 700; box-shadow: inset 3px 0 var(--green); }
.genre-link.is-ancestor { color: var(--green); font-weight: 600; }
.genre-branch-heading { display: flex; align-items: center; min-height: 44px; }
.genre-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.genre-toggle:hover { background: #f2f7f4; }
.genre-toggle-icon { width: 20px; height: 20px; }
.genre-toggle[aria-expanded="true"] > .genre-toggle-icon { transform: rotate(90deg); }
.genre-branch-heading > .genre-link { flex: 1; min-width: 0; }
.genre-more-toggle { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 8px 8px 52px; border: 0; color: var(--green); background: #fff; font-size: .85rem; cursor: pointer; }
.genre-more-toggle::after { content: "+"; margin-left: auto; }
.genre-more.is-expanded > .genre-more-toggle::after { content: "−"; }
.genre-more-toggle:hover { background: #f2f7f4; }
.genre-more-hide, .genre-more.is-expanded > .genre-more-toggle > .genre-more-show { display: none; }
.genre-more.is-expanded > .genre-more-toggle > .genre-more-hide { display: inline; }
.genre-more > .genre-tree { margin-left: 0; border-left: 0; }
.genre-unavailable { color: var(--muted); font-size: .85rem; margin: 12px 8px; }

/* Pagination and attribution */
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin: 32px 0; }
.pagination-controls, .pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-pages { justify-content: center; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination-controls > span, .pagination-pages > li > span { display: flex; justify-content: center; align-items: center; min-width: 40px; min-height: 44px; padding: 8px; border-radius: 6px; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--green-light); text-decoration: underline; }
.pagination-current { color: #fff; background: var(--green); font-weight: 700; }
.pagination [aria-disabled="true"], .pagination-ellipsis { color: var(--muted); }
.pagination-summary { flex-basis: 100%; margin: 0; text-align: center; color: var(--muted); font-size: .85rem; }
.product-rank-row { display: flex; align-items: center; flex: 0 0 32px; padding: 0 10px; }
.product-rank { display: flex; align-items: baseline; gap: 2px; padding: 3px 10px; border-radius: 6px; background: var(--green); color: #fff; font-size: 1.1rem; font-weight: 800; line-height: 1.2; }
.product-rank span { font-size: .75rem; font-weight: 600; }

/* Home: compact search, genre shortcuts, and the shared product cards. */
.home-layout { max-width: 1280px; margin: 0 auto; padding-bottom: 48px; }
.home-hero { margin: 24px 0 32px; padding: 32px 24px; border: 1px solid #d5e8dc; border-radius: 12px; background: var(--green-light); text-align: center; }
.home-eyebrow { margin: 0 0 8px; color: var(--green); font-size: .8rem; font-weight: 600; }
.home-hero h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.035em; text-wrap: balance; }
.home-title-phrase { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.home-subtitle { margin: 10px 0 20px; font-size: .95rem; color: var(--muted); text-wrap: balance; }
.home-hero .search-form { max-width: 640px; margin: 0 auto; text-align: left; }
.home-hero .search-form input[type="search"] { background: #fff; }
.home-section { margin-bottom: 36px; }
.home-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.home-section h2, .home-about h2 { margin: 0; font-size: 1.3rem; }
.home-section-heading > a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .85rem; font-weight: 600; }
.home-section-heading p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.popular-genre-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.popular-genre-tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.popular-genre-tile:hover { border-color: var(--green); background: var(--green-light); }
.popular-genre-image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #fff; border-bottom: 1px solid #edf1ee; }
.popular-genre-placeholder { display: grid; place-items: center; background: #f0f4f1; color: var(--muted); font-size: .85rem; font-weight: 400; }
.popular-genre-name { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 12px; text-align: center; }
.popular-genre-symbol { display: grid; place-items: center; aspect-ratio: 1; border-bottom: 1px solid #edf1ee; background: var(--green-light); font-size: clamp(2.5rem, 5vw, 5rem); }
.popular-genre-status { padding: 0 8px 8px; color: var(--muted); text-align: center; font-size: .75rem; font-weight: 400; }
.home-empty { grid-column: 1 / -1; margin: 0; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); }
.home-product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.home-more { margin-top: 24px; text-align: center; }
.home-more-link { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 10px 24px; border: 1px solid #b4cfbf; border-radius: 8px; background: #fff; font-weight: 600; text-decoration: none; }
.home-more-link:hover { border-color: var(--green); background: var(--green-light); }
.home-about { padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.home-about p { margin: 12px 0 0; font-size: .95rem; }
.home-about .home-about-note { color: var(--muted); font-size: .8rem; }
.empty-message h3 { margin: 0; font-size: 1.1rem; }

/* Information pages */
.information-page { max-width: 800px; margin: 24px auto 48px; padding: 24px 32px; border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow-wrap: anywhere; }
.information-home-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; font-size: .85rem; }
.information-page h1 { margin-bottom: 24px; }
.information-page section { margin-top: 28px; }
.information-page h2 { margin: 0 0 12px; font-size: 1.15rem; scroll-margin-top: 24px; }
.information-page p { margin: 12px 0; }
.information-page ul { padding-left: 1.5em; }
.information-page li + li { margin-top: 8px; }
.information-formula { padding: 16px; border-radius: 6px; background: var(--green-light); font-weight: 600; }
.contact-email { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
.information-page .information-date { margin-top: 28px; color: var(--muted); font-size: .85rem; }

/* Common footer */
.site-footer { border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.footer-content { padding-top: 24px; padding-bottom: 20px; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; margin-bottom: 12px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.footer-content p { margin: 0 0 12px; }
.footer-site-name { font-size: 1.1rem; font-weight: 700; }
.footer-site-name a { text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 20px; }
.footer-bottom p { margin: 0; }

@media (max-width: 1280px) {
  .catalog-layout { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .home-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .container { padding-inline: 24px; }
  .header-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .header-note { display: none; }
  .catalog-layout { gap: 20px; }
  .list-toolbar { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }
}

@media (max-width: 900px) {
  .home-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 819px) {
  .catalog-layout { grid-template-columns: 232px minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .information-page { margin: 20px auto 32px; padding: 20px 16px; }
  .information-page h2 { font-size: 1.05rem; }
  .home-hero { margin: 20px 0 24px; padding: 24px 16px; }
  .home-hero h1 { font-size: clamp(1.25rem, 4.5vw, 1.5rem); }
  .home-subtitle { font-size: .9rem; }
  .home-section { margin-bottom: 28px; }
  .home-section h2, .home-about h2 { font-size: 1.15rem; }
  .popular-genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .popular-genre-tile { font-size: .95rem; }
  .popular-genre-name { padding: 10px 8px; }
  .home-about { padding: 20px 16px; }
  .home-layout { padding-bottom: 32px; }
  .container { padding-inline: 16px; }
  .site-header { padding: 8px 0; }
  .header-layout { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .site-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .site-name { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.6rem; }
  .site-brand p { margin: 0; }
  .search-form input[type="search"] { font-size: 1rem; }
  .search-form button { padding-inline: 16px; }
  .catalog-layout { --catalog-top-gap: 4px; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .catalog-sidebar { position: static; }
  .genre-heading-desktop { display: none; }
  .genre-heading-mobile { display: inline; }
  .genre-filter-heading { flex-wrap: wrap; padding: 12px; font-size: .9rem; }
  .genre-filter-current { display: inline; color: var(--muted); font-size: .8rem; font-weight: 400; overflow-wrap: anywhere; }
  .genre-filter-content { max-height: 60dvh; }
  .breadcrumb-nav { margin-bottom: 4px; overflow-x: auto; }
  .genre-breadcrumbs { flex-wrap: nowrap; width: max-content; min-width: 100%; overflow-wrap: normal; }
  .genre-breadcrumbs li { flex-shrink: 0; white-space: nowrap; }
  .genre-breadcrumbs a, .genre-breadcrumbs [aria-current="page"] { display: inline-flex; align-items: center; min-height: 44px; }
  .genre-breadcrumbs [aria-current="page"] { font-weight: 600; }
  .list-heading { gap: 4px 8px; margin-bottom: 8px; }
  .list-heading-text { padding-right: 0; }
  .list-order-summary { margin-top: 2px; font-size: .875rem; }
  .result-count { font-size: .8rem; }
  .result-count strong { font-size: inherit; }
  h1 { font-size: 1.3rem; }
  .list-toolbar { grid-column: 1 / -1; grid-row: 3; }
  .sort-form { flex: 1 1 176px; }
  .sort-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sort-form select { flex: 1; width: 100%; font-size: 1rem; padding-inline: 8px; }
  .product-card .fetched-at-full { display: none; }
  .product-card .fetched-at-compact { display: inline; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 16px 12px; }
  .home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pagination-pages { grid-column: 1 / -1; grid-row: 1; gap: 2px; }
  .pagination-pages a, .pagination-pages > li > span { min-width: 32px; padding: 8px 6px; }
  .pagination-controls { justify-content: flex-start; }
  .pagination-pages + .pagination-controls { justify-content: flex-end; }
  .pagination-summary { grid-column: 1 / -1; }
}

@media (max-width: 479px) {
  .popular-genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container { padding-inline: 12px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .product-body { padding: 10px; }
  .product-name { font-size: .85rem; margin-bottom: 8px; }
  .unit-price-value { font-size: 1.5rem; }
  .unit-price dt { font-size: .7rem; }
  .price-unit { font-size: .75rem; }
  .product-detail dt { font-size: .75rem; }
  .product-detail dd { font-size: .85rem; }
  .product-review { flex-wrap: nowrap; column-gap: 4px; }
  .product-review dt { flex: 0 0 auto; font-size: .7rem; white-space: nowrap; }
  .product-review dd { min-width: 0; flex-wrap: wrap; gap: 0 2px; font-size: .75rem; white-space: normal; }
  .product-review .product-review-average { white-space: nowrap; }
  .product-review .product-review-count { max-width: 100%; font-size: .7rem; }
  .product-link { font-size: .75rem; }
}

@media (max-width: 359px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
}

.product-card.is-manually-hidden { background: #f2f2ed; border-style: dashed; }
.product-visibility-form { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: #586457; font-size: 12px; }
.product-visibility-form button { padding: 3px 9px; border: 1px solid #bdc8ba; border-radius: 4px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.product-visibility-form button:disabled { cursor: wait; opacity: .6; }
.sort-form .admin-visibility-filter { display: flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 12px; }
.admin-visibility-filter input { min-height: 0; margin: 0; padding: 0; }
.admin-visibility-note { color: #586457; font-size: 12px; }
.admin-visibility-status:empty { display: none; }
.admin-visibility-status { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 10; width: min(560px, calc(100% - 32px)); padding: 12px 16px; border: 1px solid #bdc8ba; border-radius: 6px; background: #f1f7ed; color: #284625; box-shadow: 0 2px 12px #0002; }
.admin-visibility-status.is-error { background: #fff3ee; color: #802e1d; }

@media (max-width: 767px) {
  .sort-form .admin-visibility-filter { flex-basis: 100%; }
}

/* Product links retain the existing card layout and text colors. */
.product-image-link { display: block; color: inherit; text-decoration: none; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--green); text-decoration: underline; }
.product-image-link:focus-visible, .product-name a:focus-visible { outline-offset: -3px; }

/* Product details */
.product-detail-page { max-width: 1500px; margin: 0 auto; padding: 28px 0 48px; }
.product-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 40px; padding: 32px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.product-detail-image-panel { min-width: 0; }
.product-detail-image { display: block; width: 100%; height: auto; max-height: 640px; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.product-detail-image.image-placeholder { display: grid; }
.product-detail-info { min-width: 0; overflow-wrap: anywhere; }
.product-detail-info h1 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
.product-detail-description { margin-top: 16px; }
.product-catchcopy { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.8; white-space: pre-line; }
.product-detail-reviews { margin: 16px 0 4px; }
.product-detail-reviews dd { margin: 0; }
.product-detail-reviews .product-review { justify-content: flex-start; column-gap: 12px; }
.product-detail-reviews .product-review dd { margin-left: 0; }
.product-detail-prices { margin: 16px 0 12px; }
.product-detail-prices .unit-price { padding: 20px; border: 0; border-radius: 8px; background: var(--green-light); }
.product-detail-prices .unit-price dt { font-size: .85rem; }
.product-detail-prices .unit-price-value { font-size: clamp(2rem, 3.5vw, 3.25rem); }
.product-detail-prices .price-unit { font-size: 1rem; }
.product-detail-prices .product-data-note { margin-bottom: 12px; font-size: .8rem; }
.product-detail-info .product-detail { padding: 8px 0; border-bottom: 1px solid #edf1ee; }
.product-detail-info .product-detail dt { font-size: .85rem; }
.product-detail-info .product-detail dd { min-width: 0; max-width: 100%; font-size: 1rem; }
.product-purchase-link { width: 100%; min-height: 52px; margin-top: 20px; padding: 12px; border-color: var(--green); background: var(--green); color: #fff; font-size: 1rem; }
.product-purchase-link:hover { background: #075c3e; color: #fff; }
.product-detail-metadata { margin: 16px 0 0; }
.product-detail-info .share-controls { margin-left: auto; }
.product-detail-info .share-panel { left: auto; right: 0; }
.product-recommendations { margin-top: 36px; min-width: 0; }
.product-recommendations h2 { margin: 0 0 12px; font-size: 1.3rem; }
.recommendations-note { margin: 0 0 16px; color: var(--muted); font-size: .85rem; }
.recommendation-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.genre-ranking-link { margin: 20px 0 0; overflow-wrap: anywhere; }
.genre-ranking-link a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@media (max-width: 1100px) {
  .product-overview { gap: 24px; padding: 24px; }
  .recommendation-grid { gap: 12px; }
}

@media (max-width: 767px) {
  .product-detail-page { padding-top: 20px; padding-bottom: 32px; }
  .product-overview { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px; }
  .product-detail-image { max-height: 420px; }
  .product-detail-info h1 { font-size: 1.1875rem; }
  .product-detail-prices .unit-price { padding: 16px; }
  .product-recommendations { margin-top: 28px; }
  .product-recommendations h2 { font-size: 1.15rem; }
  .recommendation-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(240px, 85%); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
  .recommendation-grid .product-card { scroll-snap-align: start; }
  .product-detail-reviews .product-review { flex-wrap: wrap; }
}

/* Shared sidebar / full-screen filter form */
.product-filters { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.filter-modal-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.filter-modal-heading h2 { margin: 0; font-size: 1.1rem; }
#close-filters, .open-filters { display: none; }
.filter-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.product-filters .genre-filter { border: 0; }
.product-filters .genre-filter-content { max-height: none; overflow: visible; }
.product-filters .genre-link { gap: 8px; cursor: pointer; }
.product-filters input[type="checkbox"] { flex-shrink: 0; min-height: 20px; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--green); }
.product-filters .genre-link:has(input:checked) { color: var(--green); background: var(--green-light); font-weight: 700; box-shadow: inset 3px 0 var(--green); }
.product-filters .genre-all { width: 100%; background: #fff; border: 1px solid var(--border); color: var(--green); text-align: left; }
.detail-filters { border-top: 1px solid var(--border); }
.detail-filters > summary { min-height: 48px; padding: 12px; font-weight: 700; cursor: pointer; }
.detail-filter-fields { display: grid; gap: 18px; padding: 12px; }
.detail-filter-fields fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.detail-filter-fields legend { margin-bottom: 8px; font-weight: 600; }
.detail-filter-fields label { display: block; min-width: 0; font-size: .85rem; }
.detail-filter-fields input, .detail-filter-fields select { display: block; width: 100%; min-width: 0; margin-top: 4px; padding-inline: 8px; font-size: 16px; }
.filter-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.review-filter-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.review-filter-option { position: relative; cursor: pointer; }
.review-filter-option input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.review-filter-option span { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 44px; padding: 8px 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; text-align: center; font-size: .75rem; overflow-wrap: anywhere; }
.review-filter-option input:checked + span { border-color: var(--green); background: var(--green-light); color: var(--green); font-weight: 600; }
.review-filter-option input:focus-visible + span { outline: 3px solid #e87b32; outline-offset: 3px; }
.filter-help { margin: 0; font-size: .8rem; color: var(--muted); }
.filter-actions { display: grid; flex-shrink: 0; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 12px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; background: #fff; }
.filter-actions button { padding-inline: 8px; font-size: .8rem; }
.filter-clear { color: var(--green); background: #fff; }
.filter-clear:hover { background: var(--green-light); }
.filter-errors, .errorlist { color: #a52222; background: #fff4f4; padding: 12px; overflow-wrap: anywhere; font-size: .85rem; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 4px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; overflow-wrap: anywhere; }
.active-filters > a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 44px; padding: 4px 10px; font-size: .85rem; }
.clear-search { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.filter-chip > span:first-child { min-width: 0; }
.filter-chip > span:last-child { flex-shrink: 0; }
.filter-chip { border: 1px solid #b4cfbf; border-radius: 22px; background: var(--green-light); text-decoration: none; }
.filter-dialog { padding: 0; border: 0; }
.filter-dialog::backdrop { background: #1d292580; }

/* Shared list and detail controls */
.share-controls { position: relative; width: fit-content; max-width: 100%; margin-top: 12px; font-size: .8rem; }
.share-controls summary { display: flex; align-items: center; gap: 6px; width: fit-content; min-width: 44px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; list-style: none; }
.share-controls summary::-webkit-details-marker { display: none; }
.share-controls summary:hover { background: #f7f9f8; }
.list-heading > .share-controls { grid-column: 2; grid-row: 1; justify-self: end; margin: 0; }
.list-heading .share-controls summary { gap: 4px; padding: 6px 8px; white-space: nowrap; }
.share-panel { position: absolute; top: 100%; left: 0; z-index: 5; width: 320px; max-width: calc(100vw - 68px); max-height: 60dvh; overflow-y: auto; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: 0 4px 16px #1d29251a; }
.list-heading .share-panel { left: auto; right: 0; max-width: calc(100vw - 32px); }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-actions button, .share-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--green); background: #fff; border: 1px solid #b4cfbf; border-radius: 6px; font-size: inherit; text-decoration: none; }
.share-actions button:hover, .share-actions a:hover { background: var(--green-light); }
.share-actions [hidden], .share-manual[hidden] { display: none; }
.share-manual { display: block; margin-top: 12px; }
.share-manual input { display: block; width: 100%; min-width: 0; margin-top: 4px; font-size: 16px; }

@media (min-width: 768px) {
  /* ページヘッダーの実測高を差し引き、初期表示でも操作ボタンを画面内に収める。 */
  .catalog-sidebar .product-filters { max-height: calc(100dvh - var(--filter-page-header-height, 8rem) - var(--catalog-top-gap) - var(--filter-viewport-gap)); }
}

@media (min-width: 768px) and (max-height: 400px) {
  .catalog-layout { --catalog-top-gap: 8px; --filter-viewport-gap: 8px; }
  .filter-modal-heading, .filter-actions { padding-block: 8px; }
}

@media (max-width: 767px) {
  .list-heading > .share-controls { grid-row: 2; }
  .catalog-sidebar { display: none; }
  .open-filters { display: block; flex: 0 0 auto; min-height: 44px; padding: 8px 10px; font-size: .85rem; }
  .filter-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; overflow: hidden; overscroll-behavior: none; }
  .filter-dialog[open] { display: flex; }
  .filter-dialog .product-filters { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; }
  .filter-modal-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--border); }
  #close-filters { display: block; }
  .filter-modal-heading button { flex-shrink: 0; background: #fff; color: var(--green); }
  .filter-scroll { flex: 1; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .filter-dialog .detail-filter-fields { padding: 20px 16px; gap: 24px; }
  .filter-actions { flex-shrink: 0; padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .filter-actions button { min-height: 48px; font-size: .95rem; }
}
