/* Colors and fonts come from config/site.json as CSS variables (see <style>:root in each page). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; background: var(--surface); padding: 10px 16px; border-radius: 12px; }
.skip:focus { left: 16px; }
.small { font-size: 12px; line-height: 1.6; color: var(--text-sub); }

/* header */
.site-header { background: var(--surface); border-bottom: 2px solid var(--line-header); position: relative; z-index: 10; }
.header-inner { max-width: 1368px; margin: 0 auto; padding: 0 36px; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.logo span { font-family: var(--font-heading); font-size: 30px; line-height: 1; color: var(--button); }
.nav-desktop { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-desktop a, .nav-mobile nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: 12px; font-size: 16px; font-weight: 500; text-decoration: none; }
.nav-desktop a:hover, .nav-mobile nav a:hover { background: var(--slot); }
.nav-desktop a.strong, .nav-mobile nav a.strong { font-weight: 700; }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary { list-style: none; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav { position: absolute; right: 0; top: 52px; min-width: 200px; padding: 8px; display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--line-soft); border-radius: 16px; box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 14%, transparent); }

/* page frame with side banner slots */
/* Partners disclosure at the very top of pages that carry Partners links */
.disclosure-top { margin: 0; padding: 10px 16px; background: var(--butter); color: var(--text); border-bottom: 2px solid var(--line-header); font-size: 14px; font-weight: 700; line-height: 1.5; text-align: center; }

.wrap { display: flex; justify-content: center; align-items: flex-start; gap: 24px; padding: 28px 36px 64px; }
/* Banners stay in the page flow: no fixed, sticky or edge-pinned banners. Only one kind is ever on screen —
   side rails above 1380px, the single narrow-screen banner (.ad-mobile) at 1380px and below. app.js fills
   only slots that are visible, so the hidden kind is never fetched. Slots clip anything wider than their box,
   so a banner can never cover the content or make the page scroll sideways. */
.rail { width: 160px; flex-shrink: 0; overflow: hidden; }
main { flex: 1 1 0; min-width: 0; max-width: 1000px; display: flex; flex-direction: column; gap: 56px; }
.ad-mobile { display: none; justify-content: center; }
.ad-slot { max-width: 100%; overflow: hidden; }
.ad-slot iframe { max-width: 100%; }
@media (max-width: 1380px) {
  .rail { display: none; }
  .ad-mobile { display: flex; }
}
@media (max-width: 331px) { .ad-mobile { margin: 0 -16px; } }   /* use the page's side padding so 300px still fits */
@media (max-width: 299px) { .ad-mobile { display: none; } }     /* too narrow for a 300px banner: no slot, no script */

/* banner placeholders (shown only when a banner code file is empty) */
.ad { border: 2px dashed var(--slot-line); border-radius: 16px; background: var(--slot); color: var(--text-sub); font-size: 13px; text-align: center; padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.ad b { font-size: 15px; color: var(--text); }
.ad-rail { min-height: 600px; }
.ad-inline { width: 300px; max-width: 100%; min-height: 250px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 11px 18px; border: 2px solid transparent; border-radius: 12px; font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--button); color: var(--button-text); }
.btn-primary:hover { filter: brightness(0.93); }
.btn-outline { background: var(--surface); border-color: var(--text); color: var(--text); }
.btn-outline:hover { background: var(--slot); }
.btn-round { border-radius: 999px; }
.btn-lg { min-height: 54px; padding: 15px 32px; font-size: 18px; }
.btn-block { display: flex; width: 100%; }
.btn.is-pending { background: var(--surface); color: var(--text-sub); border: 2px dashed var(--slot-line); cursor: default; filter: none; }

/* section panels */
.panel { --pad-x: 48px; border-radius: 32px; padding: 44px var(--pad-x); display: flex; flex-direction: column; gap: 28px; }
.panel-white { background: var(--surface); border: 2px solid var(--line-soft); }
.panel-pink { background: var(--pink); }
.panel-mint { background: var(--mint); }
.section-head { display: flex; flex-direction: column; gap: 6px; }
.section-head h2, .sub-title { font-family: var(--font-heading); font-weight: 400; line-height: 1.25; }
.section-head h2 { font-size: 36px; }
.sub-title { font-size: 28px; }
.section-head p { font-size: 16px; color: var(--text-sub); }
.panel-pink .section-head p { color: var(--pink-sub); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* hero */
.hero { background: var(--butter); border-radius: 32px; padding: 48px 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 32px; overflow: hidden; }
.hero-text { flex: 1 1 420px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.badge { background: var(--surface); border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 700; color: var(--accent); }
.hero h1 { font-family: var(--font-heading); font-weight: 400; font-size: 64px; line-height: 1.15; }
.hero p { font-size: 18px; line-height: 1.6; color: var(--text-body); }
.hero-art { flex: 0 1 300px; display: flex; justify-content: center; }
.hero-art img { width: 280px; }

/* finder */
.finder-form { display: flex; flex-direction: column; gap: 24px; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.q legend { padding: 0; margin-bottom: 12px; font-size: 17px; font-weight: 700; }
.q-note { font-size: 14px; font-weight: 400; color: var(--text-sub); }
.q-error { font-size: 14px; font-weight: 700; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 46px; padding: 10px 20px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 16px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--button); }
.chip[aria-pressed="true"] { background: var(--button); border-color: var(--button); color: var(--button-text); font-weight: 700; }
.chip.square { border-radius: 12px; padding: 10px 22px; }
.chip.square[aria-pressed="true"] { background: var(--text); border-color: var(--text); }
.text-input { width: 100%; min-height: 50px; padding: 0 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 16px; }
.text-input:focus { border-color: var(--button); }
.btn-submit { align-self: flex-start; min-width: 240px; }

/* results */
.results { border-top: 2px dashed var(--line); padding-top: 26px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.results-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.results-title h3 { font-family: var(--font-heading); font-weight: 400; font-size: 28px; }
.cond { background: var(--pink); color: var(--pink-text); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note { background: var(--slot); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--text-body); }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.result { display: flex; flex-direction: column; }
.box { width: 100%; min-height: 340px; padding: 14px; border: 2px solid var(--line); border-radius: 20px; background: var(--peach); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; }
.box:hover img { animation: wiggle 0.5s ease-in-out; }
.box-title { font-size: 15px; font-weight: 700; }
.box-hint { font-size: 13px; color: var(--text-sub); }
.card { min-height: 340px; flex-grow: 1; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; animation: pop 0.35s ease-out; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.card-num { font-size: 13px; font-weight: 700; color: var(--accent); }
.card-name { font-size: 16px; font-weight: 700; line-height: 1.4; }
.card-price { font-size: 13px; color: var(--text-sub); }
.instead { font-size: 12px; font-weight: 700; color: var(--pink-text); }
.card-reason { font-size: 13px; line-height: 1.55; color: var(--text-body); flex-grow: 1; }
.swipe-hint { display: none; font-size: 13px; color: var(--text-sub); }
@keyframes pop { from { opacity: 0; transform: scale(0.92) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }

/* photo placeholder */
.photo { height: 120px; background: var(--photo); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-sub); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* tiles (picks, popular, related) */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--surface); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.tile-line { border: 2px solid var(--line); border-radius: 20px; }
.tile .photo { height: 160px; }
.tile-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.tile-body .btn { margin-top: auto; }
.tile-name { font-size: 18px; font-weight: 700; line-height: 1.4; }
.small-name { font-size: 16px; }
.tile-reason { font-size: 14px; line-height: 1.6; color: var(--text-body); }
.tag { align-self: flex-start; background: var(--pink); color: var(--pink-text); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; }
.tag-mint { background: var(--mint); color: var(--mint-strong); }

/* popular */
.popular-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 44px; font-size: 15px; border-color: var(--mint-line); color: var(--mint-text); }
.tab:hover { border-color: var(--mint-strong); }
.tab[aria-pressed="true"] { background: var(--mint-strong); border-color: var(--mint-strong); color: var(--button-text); }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-note { font-size: 15px; color: var(--mint-text); }
.rank { font-size: 14px; font-weight: 700; color: var(--mint-strong); }
.pending-box { background: var(--surface); border-radius: 20px; padding: 40px 24px; text-align: center; font-size: 16px; color: var(--mint-text); }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-sub); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* detail */
.detail-main { display: flex; flex-wrap: wrap; gap: 36px; padding: 36px; background: var(--surface); border: 2px solid var(--line-soft); border-radius: 32px; }
.photo-lg { flex: 1 1 340px; height: auto; min-height: 340px; border-radius: 24px; font-size: 15px; }
.detail-info { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.detail-info h1 { font-size: 30px; line-height: 1.3; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-price { font-size: 15px; color: var(--text-sub); }
.detail-price b { font-size: 22px; color: var(--text); }
.thought { background: var(--slot); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.thought-label { font-size: 13px; font-weight: 700; color: var(--pink-text); }
.thought-text { font-size: 16px; line-height: 1.7; color: var(--text-body); }
.info-boxes { display: flex; flex-wrap: wrap; gap: 20px; }
.info-box { flex: 1 1 300px; border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.info-box h2 { font-size: 17px; font-weight: 700; }
.info-box ul, .box-section ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.8; color: var(--text-body); }
.bg-butter { background: var(--butter); }
.bg-mint { background: var(--mint); }

/* landing */
.l-hero { background: var(--butter); border-radius: 32px; padding: 40px 44px; display: flex; flex-direction: column; gap: 14px; }
.l-hero h1 { font-family: var(--font-heading); font-weight: 400; font-size: 42px; line-height: 1.25; }
.l-hero p { font-size: 17px; line-height: 1.7; color: var(--text-body); }
.l-hero .small { font-size: 13px; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.link-row-label { margin-right: 6px; font-size: 14px; font-weight: 700; }
.link-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 18px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 15px; text-decoration: none; }
a.link-chip:hover { border-color: var(--button); }
.link-chip[aria-current] { background: var(--button); border-color: var(--button); color: var(--button-text); font-weight: 700; }
.link-chip-strong { border-color: var(--button); color: var(--accent); font-weight: 700; }
/* every product, by budget (/p/) */
.all-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.all-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.all-list li:last-child { border-bottom: 0; }
.all-list a { font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none; }
.all-list a:hover { color: var(--button); text-decoration: underline; }
.all-price { font-size: 14px; color: var(--text-sub); }
.band-filter { margin-top: 6px; }
.how-to p { margin: 0; font-size: 16px; line-height: 1.85; color: var(--text-body); }
.how-to-sub { margin: 18px 0 0; font-size: 18px; line-height: 1.4; color: var(--text); }
.how-to-list { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.how-to-list dt { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.how-to-list dd { margin: 0; font-size: 16px; line-height: 1.85; color: var(--text-body); }
.how-to-faq dt::before { content: "Q. "; color: var(--button); }
.price-stale { display: inline-block; margin-left: 4px; font-weight: 700; color: var(--accent); }
.l-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.l-item { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px; background: var(--surface); border: 2px solid var(--line); border-radius: 24px; }
.l-item .photo { flex: 0 0 180px; height: 180px; border-radius: 16px; }
.l-item-body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.l-item-name { font-size: 19px; font-weight: 700; line-height: 1.4; }
.l-item-reason { font-size: 15px; line-height: 1.7; color: var(--text-body); }
.l-item-actions { flex: 0 0 150px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.box-section { background: var(--surface); border: 2px solid var(--line-soft); border-radius: 28px; padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.btn-start { align-self: flex-start; }

/* static pages */
.prose { background: var(--surface); border: 2px solid var(--line-soft); border-radius: 28px; padding: 36px 40px; line-height: 1.8; }
.prose h1 { font-family: var(--font-heading); font-weight: 400; font-size: 36px; line-height: 1.25; margin-bottom: 16px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p { margin: 0 0 12px; color: var(--text-body); }
.prose ul { margin: 0 0 12px; padding-left: 20px; color: var(--text-body); }

/* footer */
.site-footer { background: var(--footer); border-top: 2px solid var(--line-soft); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer-name { font-family: var(--font-heading); font-size: 26px; color: var(--button); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; font-size: 15px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer p { font-size: 14px; line-height: 1.7; color: var(--footer-text); }
.site-footer p.small { font-size: 13px; }

/* narrower screens: results scroll sideways */
@media (max-width: 900px) {
  .result-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--pad-x)); padding: 0 var(--pad-x) 8px; scroll-padding: 0 var(--pad-x); }
  .result { flex: 0 0 220px; scroll-snap-align: start; }
  .swipe-hint { display: block; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* mobile */
@media (max-width: 760px) {
  .disclosure-top { font-size: 13px; padding: 8px 16px; }
  .header-inner { padding: 0 16px; min-height: 64px; }
  .logo span { font-size: 26px; }
  .logo img { width: 30px; height: 30px; }
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .wrap { padding: 16px 16px 40px; }
  main { gap: 28px; }
  .hero { padding: 28px 22px 24px; border-radius: 28px; gap: 16px; }
  .hero-text { gap: 16px; }
  .badge { font-size: 14px; padding: 7px 14px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 16px; }
  .hero .btn-lg { width: 100%; font-size: 17px; }
  .hero-art { flex-basis: 100%; }
  .hero-art img { width: 170px; }
  .panel { --pad-x: 20px; padding: 24px var(--pad-x); border-radius: 28px; gap: 20px; }
  .section-head h2 { font-size: 28px; }
  .section-head p { font-size: 14px; }
  .sub-title { font-size: 24px; }
  .finder-form { gap: 20px; }
  .q { gap: 8px; }
  .q legend { font-size: 16px; margin-bottom: 8px; }
  .q-note { font-size: 13px; }
  .chips { gap: 8px; }
  .chip { min-height: 44px; padding: 8px 16px; font-size: 15px; }
  .chip.square { padding: 8px 16px; }
  .text-input { min-height: 48px; padding: 0 16px; font-size: 16px; }
  .btn-submit { align-self: stretch; }
  .results-title h3 { font-size: 26px; }
  .results-title { flex-direction: column; align-items: flex-start; gap: 8px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { gap: 12px; }
  .tile .photo { height: 130px; }
  .grid-4 .tile .photo { height: 100px; }
  .grid-4 .tile-body { padding: 12px; gap: 5px; }
  .grid-4 .small-name { font-size: 15px; }
  .grid-4 .btn { font-size: 13px; padding: 10px 8px; }
  .detail-main { padding: 20px; gap: 20px; border-radius: 24px; }
  .photo-lg { min-height: 220px; }
  .detail-info h1 { font-size: 24px; }
  .l-hero { padding: 28px 22px; border-radius: 28px; }
  .l-hero h1 { font-size: 30px; }
  .l-hero p { font-size: 16px; }
  .l-item { padding: 16px; gap: 14px; }
  .l-item .photo { flex: 1 1 100%; height: 150px; }
  .l-item-actions { flex: 1 1 100%; flex-direction: row; }
  .l-item-actions .btn { flex: 1 1 0; }
  .box-section { padding: 24px 20px; }
  .btn-start { align-self: stretch; }
  .prose { padding: 24px 20px; }
  .prose h1 { font-size: 30px; }
  .footer-inner { padding: 24px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
