:root {
  --public-ink: #123a30;
  --public-text: #202c28;
  --public-muted: #6d7773;
  --public-orange: #e66f23;
  --public-ivory: #faf8f3;
  --public-line: #e4e5e1;
  --public-soft: #f4f5f2;
}

body:not(.admin) {
  background: #fff;
  color: var(--public-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.55;
}

body:not(.admin) section { margin-bottom: 0; }

body:not(.admin) .site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  padding: 12px max(4vw, 20px);
  border-color: var(--public-line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(8px);
}

body:not(.admin) .brand {
  color: var(--public-ink);
  font-size: 1.35rem;
  letter-spacing: .02em;
}

body:not(.admin) .brand small { display: none; }

.header-search {
  display: flex;
  width: min(480px, 42vw);
  margin-left: auto;
}

.header-search input {
  width: 100%;
  min-width: 0;
  border-radius: 7px 0 0 7px;
  border-right: 0;
}

.header-search button {
  border-radius: 0 7px 7px 0;
}

body:not(.admin) .site-header nav { gap: 18px; margin-left: 24px; }
body:not(.admin) .site-header nav a { color: var(--public-ink); text-decoration: none; font-size: .9rem; }

body:not(.admin) main {
  width: min(1180px, calc(100% - 40px));
  padding: 32px 0 72px;
}

.home-hero {
  max-width: 820px;
  padding: 20px 0 28px;
}

.home-hero h1 {
  margin: 0 0 20px;
  color: var(--public-ink);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.25;
  letter-spacing: -.03em;
}

.primary-search {
  display: flex;
  width: 100%;
}

.primary-search input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #9ca5a1;
  border-radius: 9px 0 0 9px;
  font-size: 1rem;
}

.primary-search button {
  min-width: 86px;
  border-radius: 0 9px 9px 0;
  background: var(--public-ink);
}

.popular-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  color: var(--public-muted);
  font-size: .86rem;
}

.popular-searches strong { color: var(--public-text); }
.popular-searches a { color: var(--public-ink); text-decoration: none; }

.section-block {
  margin: 0 calc(50% - 50vw);
  padding: 28px max(calc((100vw - 1180px) / 2), 20px);
}

.section-block:nth-of-type(even) { background: var(--public-ivory); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--public-ink);
  font-size: 1.45rem;
}

.section-link { color: var(--public-orange); font-weight: 700; text-decoration: none; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--public-line);
  border-left: 1px solid var(--public-line);
}

.category-grid a {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 12px;
  border-right: 1px solid var(--public-line);
  border-bottom: 1px solid var(--public-line);
  color: var(--public-ink);
  text-align: center;
  text-decoration: none;
  font-weight: 650;
}

.category-grid a:hover { background: #fff; color: var(--public-orange); }

.more-categories { margin-top: 12px; }
.more-categories summary { cursor: pointer; color: var(--public-orange); font-weight: 700; }
.more-categories[open] summary { margin-bottom: 12px; }

.product-grid { gap: 16px; }

.product-shelf {
  display: grid;
  grid-auto-columns: minmax(235px, 280px);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.product-shelf .product-card { scroll-snap-align: start; }

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--public-line);
  border-radius: 9px;
  background: #fff;
}

.product-card-link { display: block; color: inherit; text-decoration: none; }
.product-image-wrap { aspect-ratio: 1.18; overflow: hidden; background: #fff; }
.product-image { width: 100%; height: 100%; object-fit: contain; }
.product-card-body { padding: 13px 14px 15px; }

.product-name {
  display: -webkit-box;
  min-height: 3em;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--public-text);
  font-size: .96rem;
  font-weight: 650;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.discovery-score { color: var(--public-muted); font-size: .83rem; }
.discovery-score strong { margin-left: 3px; color: var(--public-orange); font-size: 1.35rem; }
.review-line { color: var(--public-muted); font-size: .82rem; white-space: nowrap; }
.review-star { color: #e2a227; }
.product-price { margin: 9px 0 8px; color: #111; font-size: 1.22rem; font-weight: 750; }
.reason-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-tag { padding: 3px 8px; border-radius: 4px; background: var(--public-soft); color: #53605b; font-size: .72rem; }

.product-list { display: grid; border-top: 1px solid var(--public-line); }
.product-list .product-card { border: 0; border-bottom: 1px solid var(--public-line); border-radius: 0; }
.product-list .product-card-link { display: grid; grid-template-columns: 190px 1fr; }
.product-list .product-image-wrap { aspect-ratio: 1; }
.product-list .product-card-body { display: flex; flex-direction: column; justify-content: center; }

.search-heading { margin-bottom: 18px; }
.search-heading h1 { margin: 0; color: var(--public-ink); font-size: 1.75rem; }
.search-heading p { margin: 5px 0 0; color: var(--public-muted); }

.public-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(170px, 220px)) auto;
  gap: 10px;
  margin: 0 0 24px;
  padding: 16px;
  background: var(--public-ivory);
}

.public-filters input,
.public-filters select { width: 100%; min-width: 0; }

.empty { padding: 36px 0; color: var(--public-muted); }

.breadcrumbs { margin-bottom: 20px; color: var(--public-muted); font-size: .78rem; }
.breadcrumbs a { color: var(--public-ink); }

.product-detail {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.1fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: start;
}

.detail-media { position: sticky; top: 92px; }
.detail-image { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--public-line); }
.detail-shop { margin: 0 0 7px; color: var(--public-muted); font-size: .82rem; }
.detail-title { margin: 0; color: var(--public-text); font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.4; }
.official-name { margin: 12px 0; color: var(--public-muted); font-size: .8rem; }
.detail-price { margin: 20px 0 5px; color: #111; font-size: 2rem; }
.detail-review { margin: 0 0 20px; color: var(--public-muted); }
.detail-score { padding: 20px 0; border-top: 1px solid var(--public-line); border-bottom: 1px solid var(--public-line); }
.detail-score-head { display: flex; align-items: baseline; justify-content: space-between; }
.detail-score-head h2 { margin: 0; color: var(--public-ink); font-size: 1rem; }
.detail-score-head strong { color: var(--public-orange); font-size: 2.5rem; }
.score-bars { display: grid; gap: 9px; margin-top: 16px; }
.score-row { display: grid; grid-template-columns: 105px 1fr 60px; gap: 10px; align-items: center; font-size: .78rem; }
.score-track { height: 6px; overflow: hidden; border-radius: 10px; background: #e9eae7; }
.score-fill { display: block; height: 100%; background: var(--public-ink); }
.detail-cta { display: inline-block; margin-top: 24px; padding: 13px 20px; border-radius: 7px; background: var(--public-orange); color: #fff; text-decoration: none; font-weight: 700; }
.detail-note { margin-top: 12px; color: var(--public-muted); font-size: .76rem; }
.related-section { margin-top: 56px; }

body:not(.admin) footer { background: var(--public-ink); }

@media (max-width: 760px) {
  body:not(.admin) .site-header { min-height: 58px; padding: 10px 16px; flex-wrap: wrap; }
  body:not(.admin) .brand { font-size: 1.18rem; }
  body:not(.admin) .site-header nav { display: flex; margin-left: auto; gap: 12px; }
  body:not(.admin) .site-header nav a:first-child { display: none; }
  body:not(.admin) .site-header nav a { font-size: .78rem; }
  .header-search { display: none; }
  body:not(.admin) main { width: calc(100% - 32px); padding: 18px 0 52px; }
  .home-hero { padding: 8px 0 20px; }
  .home-hero h1 { margin-bottom: 14px; font-size: 1.65rem; }
  .primary-search input { padding: 13px 14px; }
  .primary-search button { min-width: 70px; }
  .popular-searches { gap: 5px 13px; font-size: .78rem; }
  .section-block { padding: 22px 16px; }
  .section-heading { margin-bottom: 14px; }
  .section-heading h2 { font-size: 1.2rem; }
  .section-link { font-size: .82rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid a { min-height: 62px; padding: 10px 8px; font-size: .86rem; }
  .product-shelf { grid-auto-columns: minmax(214px, 74vw); margin-right: -16px; }
  .product-list .product-card-link { grid-template-columns: 116px 1fr; }
  .product-list .product-card-body { padding: 10px 0 10px 12px; }
  .product-list .product-name { min-height: 2.8em; margin-bottom: 4px; font-size: .86rem; line-height: 1.4; }
  .product-list .discovery-score strong { font-size: 1.05rem; }
  .product-list .product-price { margin: 4px 0; font-size: 1rem; }
  .product-list .reason-tag { font-size: .65rem; }
  .search-heading h1 { font-size: 1.35rem; }
  .public-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .public-filters input { grid-column: 1 / -1; }
  .public-filters button { grid-column: 1 / -1; }
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-media { position: static; }
  .detail-title { font-size: 1.35rem; }
  .official-name { max-height: 4.5em; overflow: hidden; }
  .detail-price { font-size: 1.65rem; }
  .score-row { grid-template-columns: 90px 1fr 52px; }
}

@media (min-width: 761px) {
  .product-grid:not(.product-shelf):not(.product-list) { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Home visual direction v2 */
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 350, 'GRAD' 0, 'opsz' 32; }
body:not(.admin) .site-header { padding-inline: max(calc((100vw - 1180px) / 2), 28px); }
body:not(.admin) .brand { display: grid; line-height: 1.05; text-decoration: none; }
body:not(.admin) .brand small { display: block; margin-top: 4px; color: var(--public-muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; }
.desktop-nav { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.mobile-menu { display: none; }
.home-hero { min-height: 500px; max-width: none; margin: -32px calc(50% - 50vw) 0; padding: 72px max(calc((100vw - 1180px) / 2), 28px) 44px; background: #f4f0e7 url('/static/images/home-hero-v2.png') center / cover no-repeat; }
.hero-copy { width: min(510px, 48vw); }
.eyebrow { margin: 0 0 12px; color: var(--public-orange); font-size: .82rem; font-weight: 750; }
.home-hero h1 { margin-bottom: 16px; font-size: clamp(2.5rem, 4.5vw, 4.1rem); line-height: 1.12; }
.hero-lead { margin: 0 0 28px; color: #33453f; line-height: 1.9; }
.home-hero .primary-search { width: min(500px, 100%); box-shadow: 0 8px 26px rgb(42 57 50 / 10%); }
.home-hero .primary-search input { border-color: #dedbd3; background: rgb(255 255 255 / 94%); }
.home-hero .primary-search button { min-width: 62px; background: var(--public-orange); }
.home-hero .primary-search button .material-symbols-outlined { display: block; font-size: 24px; }
.home-hero .popular-searches { display: grid; gap: 7px; }
.home-hero .popular-searches span { display: flex; flex-wrap: wrap; gap: 7px; }
.home-hero .popular-searches a { padding: 5px 10px; border-radius: 18px; background: rgb(255 255 255 / 72%); font-size: .76rem; }
.section-block { padding-block: 42px; }
.section-block:nth-of-type(even) { background: #fff; }
.section-heading h2 { font-size: 1.35rem; }
.category-section { background: #fff; }
.category-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; border: 0; }
.category-grid a { min-height: 108px; gap: 8px; border: 1px solid #e7e3da; border-radius: 9px; background: #fcfbf8; font-size: .84rem; }
.category-grid a:hover { border-color: #b7c5bf; background: #f7faf8; }
.category-icon { color: var(--public-ink); font-size: 34px; }
.featured-section, .ranking-section { background: #fcfbf8; }
.product-shelf { grid-auto-columns: minmax(220px, 270px); }
.product-card { box-shadow: 0 3px 14px rgb(29 49 41 / 5%); }
.purpose-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.purpose-grid a { display: grid; gap: 7px; min-height: 96px; padding: 20px; border-radius: 9px; color: var(--public-ink); text-decoration: none; }
.purpose-grid a:nth-child(1) { background: #f6f0f4; }
.purpose-grid a:nth-child(2) { background: #eef6f2; }
.purpose-grid a:nth-child(3) { background: #eef4f8; }
.purpose-grid a:nth-child(4) { background: #eef6ee; }
.purpose-grid span { color: var(--public-muted); font-size: .78rem; }
.ranking-tabs { display: flex; gap: 4px; margin: -4px 0 18px; padding: 5px; border-radius: 8px; background: #f4f3ef; }
.ranking-tabs a { padding: 9px 20px; border-radius: 6px; color: var(--public-muted); text-decoration: none; font-size: .84rem; }
.ranking-tabs a.active { background: #e8f0ec; color: var(--public-ink); font-weight: 700; }
.score-intro { display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 50px; background: #f8f5ed; }
.score-intro h2 { margin: 0; color: var(--public-ink); }
.score-intro p:last-child { margin: 0; }
@media (max-width: 760px) {
  body:not(.admin) .site-header { padding-inline: 16px; }
  body:not(.admin) .brand .brand-service { display: block; margin-top: 3px; font-size: .64rem; }
  .desktop-nav { display: none; }
  .mobile-menu { position: relative; display: block; margin-left: auto; }
  .mobile-menu summary { display: grid; place-items: center; cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu nav { position: absolute; right: 0; top: 38px; display: grid; min-width: 170px; padding: 8px; border: 1px solid var(--public-line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgb(20 50 40 / 14%); }
  .mobile-menu nav a { padding: 10px; }
  body:not(.admin) main { width: calc(100% - 32px); padding-top: 18px; }
  .home-hero { min-height: 0; margin-top: -18px; padding: 36px 16px 28px; background: #fbfaf7; }
  .hero-copy { width: 100%; }
  .home-hero h1 { font-size: 2rem; }
  .hero-lead { display: none; }
  .home-hero .primary-search { box-shadow: none; }
  .category-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .category-grid a { min-height: 92px; padding: 9px 3px; font-size: .62rem; line-height: 1.35; }
  .category-icon { font-size: 25px; }
  .product-shelf { grid-auto-columns: minmax(142px, 44vw); gap: 10px; }
  .product-card-body { padding: 9px 10px 11px; }
  .product-name { font-size: .78rem; }
  .product-facts { gap: 3px; }
  .review-line { font-size: .68rem; }
  .discovery-score { font-size: .68rem; }
  .discovery-score strong { font-size: 1rem; }
  .product-price { font-size: .95rem; }
  .reason-tags { display: none; }
  .purpose-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .purpose-grid a { min-height: 84px; padding: 14px; font-size: .82rem; }
  .ranking-tabs { overflow-x: auto; }
  .ranking-tabs a { flex: 0 0 auto; padding: 8px 12px; }
  .score-intro { grid-template-columns: 1fr; gap: 12px; }
}

/* Category and ranking layout corrections */
.product-list { grid-template-columns: 1fr; }
.category-filters { grid-template-columns: minmax(260px, 1fr) minmax(180px, 220px) auto; }
.ranking-tabs { flex-wrap: wrap; }
@media (max-width: 760px) {
  .category-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-filters input, .category-filters button { grid-column: 1 / -1; }
  .product-grid:not(.product-shelf):not(.product-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-grid:not(.product-shelf):not(.product-list) .product-card-body { padding: 10px; }
  .product-grid:not(.product-shelf):not(.product-list) .product-name { font-size: .8rem; }
  .ranking-tabs { flex-wrap: nowrap; }
}
/* UI refinement v2 */
.product-card { position: relative; }
.product-featured,
.product-ranking { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-shelf { scrollbar-width: none; }
.product-shelf::-webkit-scrollbar { display: none; }
.product-featured .discovery-score strong,
.product-ranking .discovery-score strong { font-size: 1.12rem; }
.rank-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border: 1px solid #d8d5cd;
  border-radius: 5px;
  background: rgb(255 255 255 / 94%);
  color: var(--public-ink);
  font-size: .75rem;
  font-weight: 750;
}
.rank-1 { border-color: #c9ad68; background: #fffaf0; }
.rank-2 { border-color: #b6bec0; background: #f8faf9; }
.rank-3 { border-color: #c9a17d; background: #fff9f4; }
.category-grid a { transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.category-grid a:focus-visible,
.purpose-grid a:focus-visible,
.ranking-tabs a:focus-visible,
.product-card-link:focus-visible { outline: 3px solid rgb(230 111 35 / 34%); outline-offset: 2px; }
.home-hero { min-height: 440px; padding-top: 54px; padding-bottom: 36px; }
.home-hero .primary-search input { border-width: 2px; }
.purpose-grid a { transition: border-color .16s ease, transform .16s ease; border: 1px solid transparent; }
.purpose-grid a:hover { border-color: #cfd8d3; transform: translateY(-1px); }

@media (max-width: 980px) and (min-width: 761px) {
  .product-featured,
  .product-ranking { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .home-hero { padding-top: 28px; padding-bottom: 24px; }
  .product-featured,
  .product-ranking { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-featured .product-card:nth-child(n+5),
  .product-ranking .product-card:nth-child(n+5) { display: none; }
  .rank-badge { top: 7px; left: 7px; padding: 3px 7px; font-size: .66rem; }
  .home-hero { min-height: 0; }
  body:not(.admin) .site-header .desktop-nav { display: none; }
}
