/* Woolly · Direction A: editorial trust.
   Paper, ink and one deep accent. Serif headlines, sans interface, tabular figures.
   Status colours are reserved for price verdicts and fit; every pair passes WCAG AA. */
:root {
  /* palette */
  --paper: #FAF8F4; --surface: #FFFFFF; --sunken: #F2EFE8; --line: #E4DFD5; --line-strong: #CFC8BA;
  --ink: #1A1C24; --ink-2: #4A4D57; --ink-3: #62656F;
  --accent: #2B3A8C; --accent-hover: #1F2B6E; --accent-soft: #E6E9F5;
  --good: #1D6B47; --good-bg: #E3F1E8;
  --typical: #7A5A0E; --typical-bg: #F6EED9;
  --wait: #A3322A; --wait-bg: #F7E4E1;
  --pending: #4A4D57; --pending-bg: #ECE8E0;
  --wool: #F2C14E; /* mascot and the occasional highlight only */
  /* type */
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  /* shape and space */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --shadow: 0 1px 2px rgba(26, 28, 36, .06), 0 4px 16px rgba(26, 28, 36, .06);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }
.i { width: 18px; height: 18px; flex: none; }

/* ---- Type scale: 12 / 13 / 14 / 16 / 18 / 22 / 28 / 36 / 48 ---- */
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
.display { font: 600 clamp(34px, 5vw, 52px)/1.08 var(--serif); letter-spacing: -.015em; }
.h1 { font: 600 clamp(28px, 3.6vw, 36px)/1.15 var(--serif); letter-spacing: -.01em; }
.h2 { font: 600 clamp(22px, 2.6vw, 28px)/1.2 var(--serif); }
.h3 { font: 600 18px/1.3 var(--sans); }
.lede { font-size: 18px; color: var(--ink-2); max-width: 60ch; }
.kicker { font: 500 13px/1.3 var(--sans); color: var(--ink-3); margin-bottom: var(--s2); }
.label { font: 500 12px/1.3 var(--sans); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.meta { font-size: 13px; color: var(--ink-3); }
.small { font-size: 14px; } .muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.code { font: 500 13px var(--mono); letter-spacing: .02em; }
.strong { font-weight: 600; }
.center { text-align: center; }
a.link, button.link { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.link:hover, button.link:hover { color: var(--accent-hover); }

/* ---- Layout ---- */
.page { max-width: 1160px; margin: 0 auto; padding: var(--s5) max(16px, env(safe-area-inset-left)) 120px; display: flex; flex-direction: column; gap: var(--s6); }
.page.narrow { max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack-l { display: flex; flex-direction: column; gap: var(--s5); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.between { justify-content: space-between; } .row.top { align-items: flex-start; } .row.wrap { flex-wrap: wrap; } .row.base { align-items: baseline; }
.grow { flex: 1; min-width: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.desk { display: none !important; }
.head-row { display: flex; flex-direction: column; gap: var(--s3); }

/* ---- Header / tabs / footer ---- */
.topnav { position: sticky; top: 0; z-index: 20; background: rgba(250, 248, 244, .94); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.topnav-in { max-width: 1160px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 600 21px/1 var(--serif); letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; }
.topnav .links { display: none; gap: 2px; }
.topnav .links a { padding: 8px 12px; font-size: 15px; color: var(--ink-2); border-radius: var(--r-sm); }
.topnav .links a:hover { color: var(--ink); background: var(--sunken); }
.topnav .links a.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.topnav .right { display: flex; gap: var(--s2); align-items: center; }
.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font: 500 12px var(--sans); color: var(--ink-3); }
.tabs a .i { width: 22px; height: 22px; stroke-width: 1.75; }
.tabs a.on { color: var(--accent); }
body.no-tabs .tabs { display: none; }
.footer { border-top: 1px solid var(--line); margin-top: var(--s7); }
.footer-in { max-width: 1160px; margin: 0 auto; padding: var(--s5) 16px 100px; display: flex; flex-direction: column; gap: var(--s3); font-size: 14px; color: var(--ink-2); }
.footer nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---- Buttons & controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-sm); font: 600 15px var(--sans); white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.secondary:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn.quiet { color: var(--accent); padding: 0 8px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 14px; font-weight: 600; }
.input, .select select { width: 100%; height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); padding: 0 14px; font-size: 16px; }
.input:focus, .select select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.select { position: relative; }
.select select { appearance: none; padding-right: 40px; }
.select .i { position: absolute; right: 12px; top: 15px; color: var(--ink-3); pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); border-left: 1px solid var(--line-strong); }
.seg button:first-child { border-left: 0; }
.seg button[aria-checked="true"], .seg a.on { background: var(--ink); color: #fff; }
.seg a { padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); border-left: 1px solid var(--line-strong); }
.seg a:first-child { border-left: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch:focus-within i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Surfaces ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.sunken { background: var(--sunken); border-color: transparent; }
.callout { border-left: 3px solid var(--accent); padding: 2px 0 2px var(--s4); color: var(--ink-2); font-size: 15px; }
.disclose { font-size: 14px; color: var(--ink-2); background: var(--sunken); border-radius: var(--r-sm); padding: var(--s3) var(--s4); }
.disclose b { color: var(--ink); }

/* ---- Status ---- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; font: 600 12.5px var(--sans); white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.good { color: var(--good); background: var(--good-bg); }
.status.typical { color: var(--typical); background: var(--typical-bg); }
.status.wait { color: var(--wait); background: var(--wait-bg); }
.status.pending { color: var(--pending); background: var(--pending-bg); }
.progress { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.progress b { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.weeks { display: inline-flex; gap: 3px; vertical-align: middle; }
.weeks i { width: 7px; height: 14px; border-radius: 2px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.weeks i.on { background: var(--accent); box-shadow: none; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font: 500 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link-row { cursor: pointer; }
.table tbody tr.link-row:hover td { background: #FCFBF8; }
.table .r { text-align: right; }
.table td .sub { display: block; font-size: 13px; color: var(--ink-3); }
.table td b { font-weight: 600; }
.dl { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; font-size: 15px; }
.dl dt, .dl dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--ink-3); }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* ---- Home ---- */
.hero { display: grid; gap: var(--s6); padding-top: var(--s4); }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.hero .meta { margin-top: var(--s2); }
.tracker-head { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s4) var(--s3); }
.tracker-head .progress { max-width: 240px; }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s5); counter-reset: s; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); }
.steps-list li::before { content: counter(s); font: 600 22px/1 var(--serif); color: var(--accent); }
.steps-list h3 { margin-bottom: 4px; }
.steps-list p { color: var(--ink-2); font-size: 15px; }
.search { display: flex; gap: var(--s2); }
.search .input { flex: 1; }
.examples { font-size: 14px; color: var(--ink-3); }
.examples button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.shortlist .sl-row { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.shortlist .sl-row:last-of-type { border-bottom: 0; }
.rank { font: 600 16px var(--serif); color: var(--accent); }

/* ---- Quiz ---- */
.quiz { max-width: 1160px; margin: 0 auto; padding: var(--s5) max(16px, env(safe-area-inset-left)) var(--s7); display: grid; gap: var(--s6); }
.quiz-main { display: flex; flex-direction: column; gap: var(--s4); max-width: 600px; }
.quiz-top { display: flex; align-items: center; gap: var(--s3); }
.quiz-top .progress { flex: 1; }
.q-title { font: 600 clamp(26px, 3.4vw, 34px)/1.15 var(--serif); }
.options { display: flex; flex-direction: column; gap: var(--s2); }
.opt { display: flex; align-items: center; gap: var(--s3); padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-strong); text-align: left; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--ink-3); }
.opt b { display: block; font-weight: 600; font-size: 16px; }
.opt small { color: var(--ink-3); font-size: 14px; }
.opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; position: relative; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.on .radio { border-color: var(--accent); }
.opt.on .radio::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.opt kbd { font: 500 12px var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.hint { font-size: 15px; color: var(--ink-2); min-height: 24px; }
.quiz-nav { display: flex; gap: var(--s3); align-items: center; }
.quiz-aside { display: flex; flex-direction: column; gap: var(--s4); }
.answers { margin: 0; }
.answers dd { font-weight: 500; }
.answers .now { color: var(--accent); }

/* ---- Matches ---- */
.summary { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 15px; color: var(--ink-2); }
.summary b { color: var(--ink); font-weight: 600; }
.pick-list { display: grid; gap: var(--s4); }
.pick { display: flex; flex-direction: column; gap: var(--s4); }
.pick.first { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: baseline; }
.pick-head .rank { font-size: 22px; }
.pick-head h3 { font: 600 22px/1.2 var(--serif); }
.pick-head .brand-n { font-size: 14px; color: var(--ink-3); }
.price-big { font: 600 22px var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.price-big small { display: block; font: 400 13px var(--sans); color: var(--ink-3); }
.why { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.why li { padding-left: 18px; position: relative; }
.why li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.vs { font-size: 14px; color: var(--ink-3); }
.pick .actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
details.illus { border-top: 1px solid var(--line); padding-top: var(--s3); }
details.illus summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 6px; }
details.illus summary::-webkit-details-marker { display: none; }
details.illus summary .i { width: 16px; height: 16px; transition: transform .15s; }
details.illus[open] summary .i { transform: rotate(90deg); }
details.illus .sim { margin-top: var(--s3); }

/* ---- Price page ---- */
.price-hero { display: grid; gap: var(--s5); }
.price-now { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.price-now .amt { font: 600 44px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.code-tag { font: 500 13px var(--mono); padding: 4px 8px; border: 1px dashed var(--line-strong); border-radius: 4px; color: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .future { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.chart text { font: 12px var(--sans); fill: var(--ink-3); }
.chart .pt { fill: var(--accent); }
.chart .val { font-weight: 600; fill: var(--ink); }
.alert-form { display: flex; flex-direction: column; gap: var(--s2); }
.alert-form .row { gap: var(--s2); }
.alert-form .input { flex: 1; }

/* ---- Compare ---- */
.cmp-wrap { overflow-x: auto; }
.cmp { min-width: 560px; }
.cmp th:first-child, .cmp td:first-child { width: 22%; color: var(--ink-3); font-size: 14px; position: sticky; left: 0; background: var(--surface); }
.cmp thead th { vertical-align: bottom; text-transform: none; letter-spacing: 0; font: 400 13px var(--sans); color: var(--ink-3); background: var(--surface); }
.cmp thead b { display: block; font: 600 18px/1.2 var(--serif); color: var(--ink); margin-top: 2px; }
.cmp thead select { margin-top: 8px; width: 100%; max-width: 200px; height: 34px; font-size: 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 0 8px; }
.cmp tr.same td { color: var(--ink-3); }
.cmp tr.same td:first-child::after { content: ' · same'; }
.cmp .best { font-weight: 600; color: var(--good); }

/* ---- Couples ---- */
.pair-steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: var(--s3); }
.pair-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: var(--s2); font-size: 15px; }
.pair-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font: 600 12px/20px var(--sans); text-align: center; color: var(--ink-2); }
.pair-steps li.done::before { content: '✓'; background: var(--good-bg); color: var(--good); border-color: transparent; }
.link-box { display: flex; gap: var(--s2); }
.link-box .input { flex: 1; font: 14px var(--mono); color: var(--ink-2); }
.firm-scale { position: relative; height: 56px; margin: var(--s2) 12px 0; }
.firm-scale .bar { position: absolute; left: -12px; right: -12px; top: 14px; height: 4px; background: var(--sunken); border-radius: 2px; }
.firm-scale .spot { position: absolute; top: 9px; height: 14px; border-radius: 3px; background: var(--good-bg); box-shadow: inset 0 0 0 1.5px var(--good); min-width: 14px; }
.firm-scale .pin { position: absolute; top: 2px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 600 13px var(--sans); color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.firm-scale .ticks { position: absolute; left: -12px; right: -12px; top: 36px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.pin.a, .dot.a { background: var(--accent); } .pin.b, .dot.b { background: #8B6B1E; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.m-pick { display: flex; flex-direction: column; gap: var(--s2); }
.m-pick .who { font-size: 14px; color: var(--ink-2); }

/* ---- Trial ---- */
.trial-bar { position: relative; padding: 28px 0 22px; }
.trial-bar .progress { height: 10px; border-radius: 5px; }
.trial-bar .tick { position: absolute; top: 22px; width: 2px; height: 22px; background: var(--ink-3); }
.trial-bar .tick span { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.trial-bar .now { position: absolute; top: 0; transform: translateX(-50%); font: 600 13px var(--sans); color: var(--accent); white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline li.done { color: var(--ink-3); }
.timeline .sub { font-size: 13px; color: var(--ink-3); display: block; }
.checkin-btns { display: flex; flex-wrap: wrap; gap: var(--s2); }
textarea { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line-strong); padding: 12px 14px; background: var(--surface); resize: vertical; line-height: 1.5; font-size: 15px; }

/* ---- Try a bed ---- */
.lab { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
.lab > * { min-width: 0; }
.lab-stage { display: flex; flex-direction: column; gap: var(--s3); }
.lab-line { font-size: 16px; min-height: 52px; }
.lab-controls { display: flex; flex-direction: column; gap: var(--s4); }
.bed-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.bed-list button { text-align: left; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 14px; line-height: 1.3; }
.bed-list button small { display: block; color: var(--ink-3); font-size: 12.5px; }
.bed-list button[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* ---- Article (methodology) ---- */
.article { max-width: 720px; display: flex; flex-direction: column; gap: var(--s5); }
.article h2 { font: 600 24px/1.25 var(--serif); margin-top: var(--s4); }
.article p, .article li { font-size: 17px; line-height: 1.65; color: var(--ink); }
.article ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.placeholder { background: var(--typical-bg); color: var(--typical); padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* ---- Modal & toast ---- */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(26, 28, 36, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); width: 100%; max-width: 520px; max-height: 94vh; overflow: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s5) var(--s5) max(var(--s5), env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--s4); }
.share-wrap { background: var(--sunken); border-radius: var(--r-md); padding: var(--s4); display: flex; justify-content: center; }
#share-canvas { height: min(50vh, 440px); width: auto; aspect-ratio: 4 / 5; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.share-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Bed illustration ---- */
.sim { position: relative; display: block; }
.sim svg { width: 100%; height: auto; display: block; overflow: visible; }
.sim .l-comfort { fill: #FFFFFF; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.sim .l-trans { fill: #EEEAE2; }
.sim .l-support { fill: #E2DCD0; }
.sim .support path { fill: none; stroke: #9B927F; stroke-width: 1.6; stroke-linejoin: round; }
.sim .support.grid rect { fill: #fff; stroke: #9B927F; stroke-width: 1.2; }
.sim .support.latex circle { fill: #F6F3EC; }
.sim .shell { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.sim .frame, .sim .leg { fill: #3A3D47; }
.sim .pillow { fill: #F4F1EA; stroke: var(--ink); stroke-width: 1.4; }
.sim .body, .sim .head { fill: #3D4C9E; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.sim .eye { display: none; }
.sim .spine { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.sim .spine.good { stroke: #9FE0BF; stroke-dasharray: none; }
.sim .spine.meh { stroke: #F2D58A; stroke-dasharray: 6 4; }
.sim .spine.bad { stroke: #F4A39C; stroke-dasharray: 2 4; }
.sim .pp { transition: color .3s; pointer-events: none; }
.sim .zz { display: none; }
.sim .heat-w { fill: none; stroke: #C46B5E; stroke-width: 1.6; stroke-linecap: round; opacity: .7; }
.sim .air-a { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 8 60; animation: flow 1.8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -68; } }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: 13px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid; }
.legend i.good { border-color: #4FAE81; } .legend i.meh { border-color: #D9A93A; border-top-style: dashed; } .legend i.bad { border-color: #D2655B; border-top-style: dotted; }

/* ---- Desktop ---- */
@media (min-width: 900px) {
  .desk { display: revert !important; }
  .mob { display: none !important; }
  .tabs { display: none; }
  .topnav-in { padding: 0 32px; height: 64px; }
  .topnav .links { display: flex; }
  .page { padding: var(--s7) 32px var(--s8); gap: var(--s7); }
  .footer-in { padding: var(--s6) 32px; flex-direction: row; justify-content: space-between; }
  .head-row { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); align-items: start; padding-top: var(--s5); }
  .steps-list { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
  .quiz { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s8); padding-top: var(--s7); }
  .pick-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price-hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .lab { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .match-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
  .modal { align-items: center; padding: var(--s5); }
  .modal-card { border-radius: var(--r-lg); }
  .toast { bottom: 32px; }
  .footer-in { padding-bottom: var(--s6); }
}
@media (max-width: 899px) {
  .match-grid { display: flex; flex-direction: column; gap: var(--s4); }
  .table.tracker td:nth-child(3), .table.tracker th:nth-child(3), .table.tracker td:nth-child(4), .table.tracker th:nth-child(4) { display: none; }
  .share-btns { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Refinements */
.topnav .right { display: none; }
@media (min-width: 900px) { .topnav .right { display: flex; } body.in-quiz .topnav .right { display: none; } }
.quiz-main [data-slot="mob"] .sim svg { max-height: 108px; }
@media (max-width: 899px) {
  .cmp { min-width: 0; font-size: 14px; }
  .cmp thead tr, .cmp tbody tr { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
  .cmp thead th:first-child { display: none; }
  .cmp tbody td:first-child { grid-column: 1 / -1; position: static; padding: 12px 12px 0; border-bottom: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .cmp td, .cmp th { padding: 8px 12px 12px; }
  .cmp tbody tr { border-bottom: 1px solid var(--line); }
  .cmp tbody td { border-bottom: 0; }
  .cmp thead b { font-size: 16px; }
  .cmp thead select { max-width: none; }
  .cmp .status { white-space: normal; }
}
@media (max-width: 899px) { .cmp tbody td:first-child, .cmp thead th:first-child { width: auto; } }
.field .seg { display: flex; } .field .seg > * { flex: 1; text-align: center; }

/* ---- Product pictures ---- */
.bed-pic { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bed-pic svg, .bed-pic img { display: block; width: 100%; height: auto; }
.bed-pic img { aspect-ratio: 16 / 10; object-fit: contain; background: var(--surface); border-radius: var(--r-sm); }
.bed-pic figcaption { font-size: 12px; color: var(--ink-3); }
.bed-pic.card { background: var(--sunken); border-radius: var(--r-sm); padding: 10px 12px 8px; margin: -4px -4px 0; }
.bed-pic.card svg { max-height: 150px; }
.bed-pic.lg svg { max-height: 240px; }
.bed-pic.sm { width: 110px; margin-bottom: 6px; }
.bed-pic.xs { width: 64px; flex: none; }
.bed-cell { display: flex; align-items: center; gap: 12px; }
.pic-panel { display: flex; flex-direction: column; gap: 10px; }
.m-head { display: flex; gap: 12px; align-items: flex-start; }
.m-head .bed-pic.xs { width: 72px; margin-top: 4px; }
.table.record td { padding: 10px 8px; vertical-align: top; }
.table.record .input { height: 40px; font-size: 15px; padding: 0 10px; min-width: 90px; }
.table.record td:nth-child(6) .input { min-width: 180px; }
.table.record input[type="checkbox"] { width: 18px; height: 18px; margin-top: 10px; accent-color: var(--accent); }
.table.record .delta { margin-top: 4px; }
@media (max-width: 899px) { .bed-cell .bed-pic.xs { width: 48px; } .bed-pic.card svg { max-height: 120px; } }
@media (min-width: 900px) {
  .pic-panel { flex-direction: row; align-items: center; gap: 24px; }
  .pic-panel .bed-pic.lg { width: 280px; flex: none; }
  .pic-panel .bed-pic.lg figcaption { display: none; }
  .pic-panel > .meta::before { content: 'Illustration of a typical build; exact layers vary by brand. '; }
}
.disclosure { margin-top: calc(var(--s3) * -1); }

/* ---- The reveal: eight become three ---- */
.reveal { gap: var(--s5); }
.rv-caption { font: 500 18px/1.4 var(--sans); min-height: 76px; opacity: 0; }
.rv-caption.in { animation: rv-in .45s ease-out forwards; }
@keyframes rv-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rv-chart { display: flex; flex-direction: column; }
.rv-axis, .rv-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.rv-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); padding-bottom: 6px; }
.rv-ticks i { font-style: normal; }
.rv-row { height: 46px; border-top: 1px solid var(--line); opacity: 0; transform: translateY(8px); order: var(--i);
  transition: opacity .5s, transform .5s, height .6s cubic-bezier(.2, .8, .2, 1), border-color .4s; overflow: hidden; }
.rv-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; line-height: 1.2; min-width: 0; }
.rv-name small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-rank { width: 0; overflow: hidden; font: 600 20px var(--serif); color: var(--accent); transition: width .4s; flex: none; }
.rv-track { position: relative; height: 100%; }
.rv-bar { position: absolute; top: 17px; height: 12px; border-radius: 6px; background: var(--line-strong); transition: background .5s; }
.rv-band { position: absolute; top: 0; bottom: 0; background: var(--good-bg); box-shadow: inset 2px 0 0 var(--good), inset -2px 0 0 var(--good); opacity: 0; transform: scaleX(0); transition: opacity .4s, transform .7s cubic-bezier(.2, .8, .2, 1); }
.rv-air { position: absolute; top: 14px; font: 500 11px/18px var(--sans); font-style: normal; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; opacity: 0; transition: opacity .4s; white-space: nowrap; }
.rv-price { text-align: right; font-size: 14px; color: var(--ink-2); transition: color .4s; }
.s1 .rv-row { opacity: 1; transform: none; transition-delay: calc(var(--i) * 70ms); }
.s2 .rv-row { transition-delay: 0s; }
.s2 .rv-row.over { opacity: .28; }
.s2 .rv-row.over .rv-price { color: var(--wait); text-decoration: line-through; }
.s3 .rv-band { opacity: 1; transform: none; }
.s3 .rv-row.over .rv-band { opacity: 0; }
.s3 .rv-row.fits:not(.over) .rv-bar { background: var(--good); }
.s4 .rv-row:not(.over) .rv-air { opacity: 1; }
.s5 .rv-row { order: var(--o); }
.s5 .rv-row:not(.pick) { height: 0; opacity: 0; border-color: transparent; }
.s5 .rv-row.pick { height: 64px; opacity: 1; }
.s5 .rv-row.pick .rv-rank { width: 20px; }
.s5 .rv-row.pick .rv-bar { background: var(--accent); }
.s5 .rv-row.pick .rv-price { color: var(--ink); font-weight: 600; text-decoration: none; }
.s5 .rv-air { opacity: 0 !important; }
@media (min-width: 900px) { .rv-axis, .rv-row { grid-template-columns: 170px minmax(0, 1fr) 80px; } .rv-caption { font-size: 20px; min-height: 60px; } }

/* Couples: pins travel in from the ends, then the shared band opens */
.firm-scale .pin { animation: pin-in 1.1s cubic-bezier(.2, .8, .2, 1) backwards; }
.firm-scale .spot { animation: spot-in .6s ease-out 1s backwards; }
@keyframes pin-in { from { left: var(--from); } }
@keyframes spot-in { from { transform: scaleX(0); opacity: 0; } }
.btn[hidden] { display: none; }
.rv-bar { top: calc(50% - 6px); }
.rv-air { top: calc(50% - 9px); }
.rv-name > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-price { font-size: 13px; white-space: nowrap; }
.reveal.s5 .rv-row.pick:not(.over) .rv-bar { background: var(--accent); }
@media (max-width: 899px) { .rv-axis, .rv-row { grid-template-columns: 112px minmax(0, 1fr) 70px; gap: 8px; } }
.rv-air { box-shadow: 0 0 0 2px var(--paper); }

/* Size switch */
.size-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.size-pick .select { min-width: 132px; }
.size-pick .select select { height: 40px; font-size: 15px; }
.size-pick .select .i { top: 11px; }

/* Try before you buy */
.try-card .stores { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.try-card .stores li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--paper); border-radius: var(--r-sm); font-size: 14px; }
.test-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.test-steps li { font-size: 16px; }
.test-steps label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.test-steps input[type="checkbox"] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.test-steps input:checked + span { color: var(--ink-3); }
.test-steps small { display: block; margin: 6px 0 0 30px; }
.timer { display: flex; align-items: center; gap: 12px; margin: 10px 0 0 30px; }
.timer-n { font: 600 32px var(--sans); min-width: 84px; }
.test-card .seg { display: flex; } .test-card .seg button { flex: 1; }
.more-stores summary { cursor: pointer; margin: 4px 0 8px; }

/* Over-budget matches */
.pick.over-budget { background: var(--paper); border-style: dashed; }
.over-tag { margin: 0; }
.rv-price small { display: block; font-size: 11px; color: var(--wait); font-weight: 500; }
.reveal.s5 .rv-row.pick.over { opacity: 1; }
.reveal.s5 .rv-row.pick.over .rv-price { text-decoration: none; }

/* ===== Woolly Rest design system (Nov 15, 2026) ===== */
:root { --muted: #8B8B8B; /* large text only: 3.21:1 on cream */ --thead: #F6F3EC; --r-md: 14px; --art: #F7F6F2; }
body { line-height: 1.65; }
/* Eyebrows: small uppercase, letter-spaced, bold. Secondary grey, not muted, so 11px text passes AA. */
.kicker { font: 700 11px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
/* Buttons */
.btn { border-radius: 8px; padding: 0 20px; font-weight: 700; }
.btn.primary { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn.secondary { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.secondary:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Status badges: pills, no dot */
.status { border-radius: 999px; padding: 5px 10px; font: 700 12.5px/1.2 var(--sans); }
.status::before { display: none; }
/* Tables */
.table th { background: var(--thead); color: var(--ink); font: 700 12px var(--sans); letter-spacing: .08em; }
/* Cards and panels */
.panel { border-radius: var(--r-md); }
.pick.first { border: 2px solid var(--accent); box-shadow: none; }
.pick-head .rank { font: 700 32px/1 var(--serif); }
.pick-eyebrow { margin: 0 0 -6px; }
/* Eight-segment progress */
.segs { display: flex; gap: 6px; margin: 4px 0; max-width: 360px; }
.segs i { flex: 1; height: 10px; border-radius: 999px; background: var(--pending-bg); }
.segs i.on { background: var(--accent); }
/* Illustrations: on a panel the colour of the artwork, captions in HTML */
.art-panel { margin: 0; background: var(--art); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.art-panel img { display: block; width: 100%; height: auto; }
.art-panel figcaption { font-size: 13px; color: var(--ink-3); text-align: center; padding: 0 16px 14px; }
.hero { align-items: center; }
.hero-art img { aspect-ratio: 3 / 2; object-fit: cover; }
.pair-panel { display: grid; gap: var(--s5); align-items: center; }
.timeline-art .tl-labels { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left; font-size: 13px; }
.bed-pic figcaption { text-align: center; }
.trial-head { gap: 16px; }
.trial-mascot { width: 72px; height: 72px; flex: none; }
/* Firmness diagram */
.fscale { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; display: grid; gap: 8px; }
.fs-axis, .fs-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; align-items: center; font-size: 14px; }
.fs-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.fs-ticks i { font-style: normal; }
.fs-track { position: relative; height: 12px; background: var(--sunken); border-radius: 999px; }
.fs-track i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; }
.fscale figcaption { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
@media (min-width: 900px) {
  .pair-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s7); }
}
.timeline-art img { aspect-ratio: 12 / 5; object-fit: cover; object-position: 50% 62%; max-height: 380px; }
.timeline-art .tl-labels { padding-top: 6px; }
