/* Night Fit styles */
:root {
  --night: #141a33;
  --night-2: #222b52;
  --ink: #1d2232;
  --muted: #5c6378;
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e1e4ee;
  --gold: #f3b84b;
  --gold-dark: #d99a25;

  --firm: #d6403a;
  --firm-tint: #fdeceb;
  --medium: #2a69df;
  --medium-tint: #e8effd;
  --plush: #1c9a68;
  --plush-tint: #e2f5ec;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 51, .06), 0 8px 24px rgba(20, 26, 51, .07);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus, h1:focus, h2:focus { outline: none; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--night);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 22px; font-weight: 600; letter-spacing: .2px; }
.logo svg { width: 30px; height: 30px; }
.logo b { color: var(--gold); font-weight: 800; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { color: #dfe3f3; text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topnav .nav-quiz { background: var(--gold); color: var(--night); margin-left: 6px; }
.topnav .nav-quiz:hover { background: #f7c869; color: var(--night); }
.topnav .nav-shop { display: none; }
@media (max-width: 720px) {
  .topnav .nav-cat { display: none; }
  .topnav .nav-shop { display: inline-block; }
  .topnav a { padding: 7px 10px; font-size: 14px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-lg { padding: 16px 30px; font-size: 18px; }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--night); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--night-2); }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: #f7c869; }
.btn-light { background: #fff; color: var(--night); }
.btn-ghost { background: transparent; color: var(--night); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px #c9cedd; }
.btn-link { background: none; color: var(--muted); padding-left: 8px; padding-right: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink); }

/* ---------- night sky ---------- */
.hero, .results-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 80% 0%, #2c3770 0%, var(--night) 60%);
  color: #fff;
}
.stars {
  position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 52%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 76%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 84%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 54% 88%, #fff 50%, transparent 51%);
}
.hero-inner, .results-hero-inner { position: relative; max-width: 760px; margin: 0 auto; padding: 56px 16px 64px; }
.results-hero-inner { padding: 36px 16px 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--gold); margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; }
.lede { font-size: 18px; color: #d4d9ee; margin: 16px 0 28px; max-width: 600px; }

/* ---------- welcome ---------- */
.legend-wrap { max-width: 960px; margin: 0 auto; padding: 40px 16px 24px; }
.section-title { font-size: 22px; font-weight: 800; margin: 8px 0 16px; }
.section-sub { color: var(--muted); margin: -8px 0 16px; }
.legend { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.legend-item { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border-top: 5px solid; }
.legend-item h3 { font-size: 18px; margin-bottom: 4px; }
.legend-item p { margin: 0; color: var(--muted); font-size: 15px; }
.legend-item .dot { flex: 0 0 18px; height: 18px; border-radius: 50%; margin-top: 2px; }
.legend-item.firm { border-color: var(--firm); } .legend-item.firm .dot { background: var(--firm); }
.legend-item.medium { border-color: var(--medium); } .legend-item.medium .dot { background: var(--medium); }
.legend-item.plush { border-color: var(--plush); } .legend-item.plush .dot { background: var(--plush); }
.how { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.how b { flex: 0 0 32px; height: 32px; border-radius: 50%; background: var(--night); color: var(--gold); display: grid; place-items: center; }

/* ---------- quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--firm), var(--medium), var(--plush)); border-radius: 99px; transition: width .35s ease; }
.quiz-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 22px; }
.step-count { margin: 0 0 6px; color: var(--muted); font-weight: 700; font-size: 14px; }
.quiz-card h2 { font-size: clamp(24px, 4.6vw, 30px); font-weight: 800; }
.q-sub { color: var(--muted); margin: 8px 0 20px; }

.options { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .options { grid-template-columns: 1fr 1fr; }
  .options-positions { grid-template-columns: repeat(3, 1fr); }
}
.option {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 44px 16px 16px;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
  min-height: 64px;
}
.option:hover { border-color: #c3c9da; }
.option.selected { border-color: var(--night); background: #f6f7fc; box-shadow: 0 0 0 3px rgba(20, 26, 51, .08); }
.opt-text { display: flex; flex-direction: column; }
.opt-label { font-weight: 800; font-size: 17px; }
.opt-desc { color: var(--muted); font-size: 14px; }
.opt-icon { flex: 0 0 auto; color: var(--night); display: grid; place-items: center; }
.opt-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.options-positions .option { flex-direction: column; align-items: flex-start; padding: 16px; }
.options-positions .opt-icon svg { width: 72px; height: 45px; stroke-width: 3; }
.options-positions .opt-icon svg circle { fill: currentColor; stroke: none; }
.tick { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: #fff; }
.tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.option.selected .tick { background: var(--night); border-color: var(--night); }
.option.selected .tick svg { opacity: 1; }
.option[role="radio"] .tick { border-radius: 50%; }

.option .swatch { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #c8cdd9; }
.option.comfort.firm .swatch { background: var(--firm); }
.option.comfort.medium .swatch { background: var(--medium); }
.option.comfort.plush .swatch { background: var(--plush); }
.option.comfort.firm.selected { border-color: var(--firm); background: var(--firm-tint); }
.option.comfort.medium.selected { border-color: var(--medium); background: var(--medium-tint); }
.option.comfort.plush.selected { border-color: var(--plush); background: var(--plush-tint); }
.option.comfort.firm.selected .tick { background: var(--firm); border-color: var(--firm); }
.option.comfort.medium.selected .tick { background: var(--medium); border-color: var(--medium); }
.option.comfort.plush.selected .tick { background: var(--plush); border-color: var(--plush); }

@media (max-width: 480px) {
  .quiz { padding: 16px 12px 40px; }
  .quiz-card { padding: 22px 16px; }
  .option { padding: 14px 40px 14px 14px; gap: 12px; }
  .opt-icon svg { width: 28px; height: 28px; }
  .options-positions .option { flex-direction: row; align-items: center; }
  .options-positions .opt-icon svg { width: 56px; height: 35px; }
}
.quiz-nav { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
.quiz-nav [data-action="next"] { margin-left: auto; }

.screen-enter { animation: enter .3s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen-enter { animation: none; } * { scroll-behavior: auto !important; } }

/* ---------- results ---------- */
.results-hero h1 { font-size: clamp(28px, 5.5vw, 40px); font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fit-pill, .mini-pill { display: inline-block; border-radius: 999px; color: #fff; font-weight: 800; }
.fit-pill { padding: 4px 20px; }
.mini-pill { padding: 1px 10px; font-size: 13px; margin-left: 6px; vertical-align: 1px; }
.fit-pill.firm, .mini-pill.firm { background: var(--firm); }
.fit-pill.medium, .mini-pill.medium { background: var(--medium); }
.fit-pill.plush, .mini-pill.plush { background: var(--plush); }
.profile { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: #e6e9f6; }

.results { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.card-flat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.tuner { margin-top: -20px; position: relative; padding: 18px 18px 16px; margin-bottom: 28px; }
.tuner-label { font-weight: 800; display: block; margin-bottom: 8px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 99px;
  background: linear-gradient(90deg, var(--firm) 0%, var(--medium) 50%, var(--plush) 100%); outline: none; margin: 8px 0 6px;
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--night); box-shadow: var(--shadow); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--night); cursor: grab; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--gold); }
.slider-ends { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.slider-ends .firm { color: var(--firm); } .slider-ends .medium { color: var(--medium); } .slider-ends .plush { color: var(--plush); }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { border: 0; background: none; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg-btn.on { background: var(--night); color: #fff; }
.select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.select select { font: inherit; font-weight: 700; color: var(--ink); border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card.top { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.card-img { position: relative; aspect-ratio: 64 / 41; background: linear-gradient(135deg, #eef0f6, #dfe3ee); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.noimg::after { content: "Photo coming soon"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.comfort-tag { position: absolute; left: 12px; top: 12px; color: #fff; font-weight: 800; font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.comfort-tag.firm { background: var(--firm); } .comfort-tag.medium { background: var(--medium); } .comfort-tag.plush { background: var(--plush); }
.top-tag { position: absolute; right: 12px; top: 12px; background: var(--gold); color: var(--night); font-weight: 800; font-size: 13px; padding: 3px 12px; border-radius: 999px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; color: var(--muted); }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; }
.rating svg { width: 14px; height: 14px; fill: var(--gold); }
.rating span { color: var(--muted); font-weight: 600; }
.card .name { font-size: 18px; font-weight: 800; }
.match-row { display: flex; align-items: center; gap: 12px; }
.match-label { font-size: 13px; font-weight: 800; color: var(--night); background: #fff4dc; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.match-label.alt { background: var(--bg); color: var(--muted); }
.meter { position: relative; flex: 1; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--firm), var(--medium), var(--plush)); }
.meter span { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--night); transform: translate(-50%, -50%); }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.why li { display: flex; gap: 6px; font-size: 14px; }
.why svg { flex: 0 0 16px; height: 16px; margin-top: 3px; fill: none; stroke: var(--plush); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.feel { margin: 0; color: var(--muted); font-size: 14px; font-style: italic; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: auto; padding-top: 4px; }
.price span { color: var(--muted); font-size: 14px; }
.price strong { font-size: 20px; }
.price .from { width: 100%; font-size: 13px; }
.card-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.more-wrap { text-align: center; margin: 20px 0 8px; }
.empty { background: var(--card); border-radius: var(--radius); padding: 24px; color: var(--muted); grid-column: 1 / -1; text-align: center; }
.tip { background: #fff8e8; border-left: 4px solid var(--gold); border-radius: var(--radius-sm); padding: 14px 16px; margin: 20px 0; }
#alt-wrap, #bases-wrap { margin-top: 36px; }
.section-note { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }
.grid-bases { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.base-card .name { font-size: 16px; }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.features li { background: var(--medium-tint); color: #1d4fae; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }

.contact {
  margin-top: 40px; background: var(--night); color: #fff; border-radius: 20px; padding: 26px 22px;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
}
.contact h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.contact p { margin: 0; color: #d4d9ee; max-width: 620px; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.results-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }

.card .name a { color: inherit; text-decoration: none; }
.card .name a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- welcome extras ---------- */
.hero-link { display: inline-block; margin-left: 18px; color: #dfe3f3; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.hero-link:hover { color: #fff; }
@media (max-width: 520px) { .hero-link { display: block; margin: 16px 0 0; } }
.cat-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cat-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 64 / 41; background: var(--night-2); box-shadow: var(--shadow); color: #fff; text-decoration: none; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 14px; background: linear-gradient(transparent, rgba(20, 26, 51, .85)); font-size: 14px; }
.cat-tile b { display: block; font-size: 20px; }
.fit-guide { margin: 12px 0 0; color: #d4d9ee; font-size: 17px; }
.guide-line { margin: 0; font-size: 15px; color: #333a4d; }

/* ---------- shop ---------- */
.shop-hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 80% 0%, #2c3770 0%, var(--night) 60%); color: #fff; }
.shop-hero-inner { position: relative; max-width: 1120px; margin: 0 auto; padding: 28px 16px 44px; }
.shop-hero h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; margin-bottom: 14px; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-tab { color: #dfe3f3; text-decoration: none; font-weight: 700; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); font-size: 15px; }
.cat-tab span { opacity: .7; font-weight: 600; margin-left: 2px; }
.cat-tab:hover { background: rgba(255, 255, 255, .08); }
.cat-tab.on { background: #fff; color: var(--night); border-color: #fff; }
.shop { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.shop-filters { margin-top: -24px; position: relative; padding: 18px; display: grid; gap: 14px; margin-bottom: 18px; }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.search input:focus { border-color: var(--night); outline: none; }
.filter-group { display: grid; gap: 8px; }
.filter-label { font-weight: 800; font-size: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.comfort-filter { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.comfort-chip { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.comfort-chip .dot { flex: 0 0 14px; height: 14px; border-radius: 50%; margin-top: 3px; }
.comfort-chip b { display: block; font-size: 15px; }
.comfort-chip small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.comfort-chip.firm .dot { background: var(--firm); } .comfort-chip.medium .dot { background: var(--medium); } .comfort-chip.plush .dot { background: var(--plush); }
.comfort-chip.firm.on { border-color: var(--firm); background: var(--firm-tint); }
.comfort-chip.medium.on { border-color: var(--medium); background: var(--medium-tint); }
.comfort-chip.plush.on { border-color: var(--plush); background: var(--plush-tint); }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.type-chip span { color: var(--muted); font-weight: 600; }
.type-chip.on { background: var(--night); border-color: var(--night); color: #fff; }
.type-chip.on span { color: #c5cbe3; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--night); }
.shop-count { color: var(--muted); font-weight: 700; font-size: 14px; margin: 0 0 12px; }
a.card-img { display: block; }
.type-line { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: -4px; }
.card-body > .meter { flex: none; width: 100%; margin: 4px 0; }
.shop-card .name { font-size: 16px; }
.quiz-band { margin-top: 36px; background: var(--night); color: #fff; border-radius: 20px; padding: 24px 22px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.quiz-band h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.quiz-band p { margin: 0; color: #d4d9ee; }

/* ---------- product page ---------- */
.product { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.back-link { display: inline-block; color: var(--night); font-weight: 700; text-decoration: none; margin-bottom: 16px; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.product-top { display: grid; gap: 24px; grid-template-columns: 1fr; }
.product-top > *, .product-body > * { min-width: 0; } /* let long thumb rows / tables shrink instead of widening the page */
.product-name { overflow-wrap: anywhere; }
@media (min-width: 860px) { .product-top { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.gallery-main { position: relative; aspect-ratio: 64 / 41; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #eef0f6, #dfe3ee); box-shadow: var(--shadow); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main.noimg::after { content: "Photo coming soon"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: 0 0 76px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { border-color: var(--night); }
.info { display: flex; flex-direction: column; gap: 12px; }
.product-name { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.comfort-row { display: flex; align-items: center; gap: 12px; }
.comfort-row .mini-pill { margin-left: 0; font-size: 14px; padding: 3px 12px; }
.comfort-num { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.info .feel { font-size: 15px; }
.price.big strong { font-size: 28px; }
.price.big { margin-top: 0; }
.match-box { background: #fff8e8; border-radius: var(--radius-sm); padding: 14px 16px; }
.match-box-head { font-weight: 800; margin-bottom: 8px; }
.product-body { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 32px; }
@media (min-width: 860px) { .product-body { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.detail-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.detail-block .section-title { margin-top: 0; }
.detail-block h3 { font-size: 16px; font-weight: 800; margin: 18px 0 4px; }
.detail-block p { margin: 0 0 10px; color: #333a4d; }
.pos-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.pos { display: flex; align-items: center; gap: 10px; border-radius: var(--radius-sm); padding: 10px 12px; border: 2px solid var(--line); font-size: 14px; }
.pos .opt-icon svg { width: 48px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pos .opt-icon svg circle { fill: currentColor; stroke: none; }
.pos.great { border-color: var(--plush); background: var(--plush-tint); }
.pos.good { border-color: #b9c9ef; background: var(--medium-tint); }
.pos.meh { color: var(--muted); }
.facts { margin: 0; display: grid; gap: 8px; }
.facts div { display: flex; gap: 12px; }
.facts dt { flex: 0 0 130px; font-weight: 800; }
.facts dd { margin: 0; color: #333a4d; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 700; color: var(--muted); width: 45%; }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }

/* ---------- quote builder ---------- */
.topbar { position: sticky; top: 0; z-index: 40; }
.nav-quote { position: relative; display: inline-flex !important; align-items: center; gap: 6px; }
.nav-quote svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-quote b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--night); font-size: 12px; display: inline-grid; place-items: center; }
.nav-quote b[hidden] { display: none; }
@media (max-width: 720px) { .nav-quote-text { display: none; } }
.logo span { white-space: nowrap; }
.nav-quiz .short { display: none; }
@media (max-width: 440px) {
  .nav-quiz .long { display: none; }
  .nav-quiz .short { display: inline; }
  .topbar { padding: 10px 12px; }
  .logo { font-size: 20px; }
}
.qline-select { display: block; }
.qline-select select { width: 100%; }
.btn-block { width: 100%; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); background: var(--night); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 14px; align-items: center; z-index: 60; max-width: calc(100% - 32px); transition: transform .25s ease; font-size: 15px; }
.toast.show { transform: translate(-50%, 0); }
.toast a { color: var(--gold); font-weight: 800; white-space: nowrap; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 19, 38, .55); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; background: #fff; border-radius: 18px; padding: 22px 20px 18px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { font-size: 20px; font-weight: 800; margin: 2px 0 4px; padding-right: 30px; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.choice-list { display: grid; gap: 8px; margin-top: 12px; }
.choice { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 14px; cursor: pointer; font-size: 15px; }
.choice:hover, .choice:focus-visible { border-color: var(--night); }
.choice.pref { border-color: var(--gold); background: #fff8e8; }

.quote { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.quote-title { font-size: clamp(26px, 5vw, 34px); font-weight: 800; margin-bottom: 14px; }
.qsteps { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.qsteps li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.qsteps b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 13px; }
.qsteps li.current { color: var(--night); border-color: var(--night); }
.qsteps li.current b { background: var(--night); color: #fff; }
.qsteps li.done b { background: var(--plush); color: #fff; }
.quote-layout { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .quote-layout { grid-template-columns: 1fr 340px; } .quote-side { position: sticky; top: 76px; } }
.quote-layout > * { min-width: 0; }
.quote-side { padding: 20px; }
.quote-side h2, .review-block h2, .quote-form h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.qlines { display: grid; gap: 12px; margin: 16px 0; }
.qline { display: grid; grid-template-columns: 96px 1fr auto; grid-template-areas: "img main price" "img qty remove"; gap: 8px 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; align-items: center; }
.qline-img { grid-area: img; align-self: start; border-radius: 10px; overflow: hidden; aspect-ratio: 64 / 41; background: #eef0f6; }
.qline-img img { width: 100%; height: 100%; object-fit: cover; }
.qline-main { grid-area: main; min-width: 0; display: grid; gap: 3px; }
.qline-name { font-weight: 800; color: var(--ink); text-decoration: none; }
.qline-name:hover { text-decoration: underline; }
.qline-opt { font-size: 14px; color: var(--muted); }
.qline-select select { max-width: 100%; font-size: 14px; padding: 5px 8px; }
.qline-sku { font-size: 12px; color: var(--muted); }
.soft-tag { color: var(--plush); font-weight: 800; }
.qline .qty { grid-area: qty; justify-self: start; }
.qline-price { grid-area: price; text-align: right; display: grid; gap: 1px; }
.qline-price strong { font-size: 17px; }
.qline-price s { color: var(--muted); font-size: 13px; }
.qline-price small { color: var(--plush); font-size: 12px; font-weight: 700; }
.qline-remove { grid-area: remove; justify-self: end; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
@media (max-width: 520px) { .qline { grid-template-columns: 72px 1fr; grid-template-areas: "img main" "img price" "qty remove"; } .qline-price { text-align: left; } }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { border: 0; background: none; width: 34px; height: 32px; font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--bg); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }
.bundle-banner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: #fff8e8; border: 2px dashed var(--gold); border-radius: var(--radius); padding: 12px 14px; }
.bundle-banner p { margin: 0; font-size: 15px; }
.bundle-banner.on { background: var(--plush-tint); border-color: var(--plush); border-style: solid; }
.badge-bundle, .badge-protect { display: inline-block; font-weight: 800; letter-spacing: .06em; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.badge-bundle { background: var(--gold); color: var(--night); }
.badge-protect { background: var(--night); color: var(--gold); }
.totals { margin: 0 0 16px; display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; white-space: nowrap; }
.totals .save dt, .totals .save dd { color: var(--plush); }
.totals .grand { border-top: 2px solid var(--line); padding-top: 10px; font-size: 19px; }
.totals .grand dt, .totals .grand dd { color: var(--ink); font-weight: 800; }
.totals .note dt { font-size: 13px; }
.quote-intro { color: var(--muted); margin: 0 0 16px; }
.upsell { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.upsell.protect { border-top: 5px solid var(--night); }
.upsell.bundle { border-top: 5px solid var(--gold); }
.upsell-head { margin-bottom: 16px; }
.upsell-head h2 { font-size: 22px; font-weight: 800; margin: 10px 0 6px; }
.upsell-head p { margin: 0 0 6px; color: #333a4d; }
.bundle-status { font-size: 14px; color: var(--muted) !important; }
.bundle-status.on { color: var(--plush) !important; }
.grid-suggest { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.suggest-card .name { font-size: 15px; }
.suggest-card .card-body { gap: 6px; }
.quote-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 18px; }
.quote-nav .back-link { margin: 0; }
.quote-form { padding: 22px; max-width: 760px; }
.quote-form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.quote-form legend { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.quote-form .row { display: flex; flex-wrap: wrap; gap: 12px; }
.field { flex: 1 1 220px; display: grid; gap: 4px; margin-bottom: 4px; }
.field.small { flex: 0 1 130px; }
.field.grow { flex: 2 1 260px; }
.field label { font-weight: 700; font-size: 14px; }
.field .opt { font-weight: 600; color: var(--muted); }
.field input, .field select { font: inherit; font-size: 16px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--night); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--firm); background: var(--firm-tint); }
.field-error { margin: 0; color: var(--firm); font-size: 13px; font-weight: 700; }
.delivery.mirrored input, .delivery.mirrored select { background: var(--bg); color: var(--muted); }
.same-q { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 12px; font-weight: 700; }
.same-q label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; cursor: pointer; }
.same-q input { width: 18px; height: 18px; accent-color: var(--night); }
.review-block { padding: 20px; margin-bottom: 16px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.qtable th { width: auto; }
.qtable .num { text-align: right; white-space: nowrap; }
.qtable small { color: var(--muted); }
.form-status { margin: 12px 0 0; color: var(--firm); font-weight: 700; font-size: 14px; }
.done-box { padding: 28px 22px; max-width: 760px; margin: 0 auto; text-align: center; }
.done-box .qtable { text-align: left; margin-top: 16px; }
.done-check { width: 56px; height: 56px; border-radius: 50%; background: var(--plush); color: #fff; font-size: 30px; display: grid; place-items: center; margin: 0 auto 10px; }
.done-box h2 { font-size: 26px; font-weight: 800; }
.done-id { color: var(--muted); }
.done-total { font-size: 18px; }
.quote-empty h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.buy-box { display: grid; gap: 10px; background: var(--bg); border-radius: var(--radius-sm); padding: 14px; }
.buy-select { display: grid; gap: 4px; }
.buy-select select { width: 100%; font-size: 15px; }
.buy-one { font-weight: 700; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.buy-row .btn { flex: 1 1 200px; }
@media print { .toast, .modal-backdrop, .qsteps, .quote-nav, .nav-quote { display: none !important; } .topbar { position: static; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 16px 32px; text-align: center; }
.site-footer p { max-width: 760px; margin: 4px auto; }
.noscript { padding: 24px 16px; text-align: center; }

/* ---------- print ---------- */
@media print {
  .topbar, .tuner, .more-wrap, .results-actions, .card-actions, .contact-btns, #alt-wrap { display: none !important; }
  body { background: #fff; }
  .results-hero { background: #fff; color: #000; }
  .results-hero .chip { color: #000; border-color: #999; }
  .stars { display: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .contact { background: #fff; color: #000; border: 1px solid #ccc; }
  .contact p { color: #000; }
}
