/* The public laptop check: one screen, like a speed test. Used only by form-test/public/index.html.
   The local prototype keeps device-test/public/styles.css. */
:root {
  --bg: #060a16;
  --ink: #eef2ff;
  --soft: #9aa6c8;
  --dim: #66729a;
  --line: rgba(150, 175, 255, 0.13);
  --panel: rgba(16, 24, 50, 0.66);
  --panel-2: rgba(28, 40, 80, 0.5);
  --cyan: #38e1ff;
  --violet: #7c8cff;
  --good: #3ef0a4;
  --warn: #ffb547;
  --buy: #ffd166;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3, summary, th, td, label, li, .note, .status, .g-sub, .wait-line { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--cyan); }
button { font-family: inherit; }
.sr-only, .trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 700px at 50% 38%, #0f1a3a 0%, rgba(6, 10, 22, 0) 70%), var(--bg); }
.orb { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: 0.32; }
.o1 { left: -12vmax; top: -16vmax; background: #1b3a8f; animation: drift 26s ease-in-out infinite alternate; }
.o2 { right: -16vmax; bottom: -22vmax; background: #0d6a73; animation: drift 32s ease-in-out infinite alternate-reverse; }
.grid-lines { position: absolute; inset: 0; opacity: 0.35;
  background-image: linear-gradient(rgba(130, 160, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(130, 160, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 45%, #000 20%, transparent 75%); }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.08); } }

/* ---------- top bar */
.bar { display: flex; align-items: center; gap: 14px; padding: 12px clamp(16px, 2vw, 28px); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 650 16px/1 var(--display); letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; color: var(--cyan); }
.tag { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--soft); white-space: nowrap; }
.bar-nav { margin-left: auto; display: flex; gap: 6px; }
.nav-btn { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03); color: var(--soft); font-size: 13px; cursor: pointer; white-space: nowrap; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.nav-btn:hover { color: var(--ink); border-color: rgba(150, 175, 255, 0.35); background: rgba(255, 255, 255, 0.06); }

/* ---------- the stage: three columns on a laptop screen */
.stage { display: grid; gap: clamp(12px, 1.4vw, 22px); padding: 4px clamp(16px, 2vw, 28px) 0; }
.panel { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--panel), rgba(10, 16, 34, 0.6)); backdrop-filter: blur(12px); }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.p-head h2 { font: 650 13px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.count { font: 12px/1 var(--mono); color: var(--dim); white-space: nowrap; }
body[data-phase="run"] .readings .count { color: var(--cyan); }
body[data-phase="done"] .count { color: var(--good); }

/* live readings */
.rows .row { display: grid; grid-template-columns: 10px minmax(0, 0.95fr) minmax(0, 1.25fr); gap: 10px; align-items: center; padding: clamp(3px, 0.6vh, 6px) 2px; border-top: 1px solid var(--line); font-size: 13px; }
.rows .row:first-child { border-top: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); opacity: 0.6; transition: background 0.3s, box-shadow 0.3s, opacity 0.3s; }
.r-name { color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-val { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; transition: color 0.3s; }
.row[data-state="ok"] .dot { background: var(--good); opacity: 1; box-shadow: 0 0 10px rgba(62, 240, 164, 0.7); }
.row[data-state="ok"] .r-val { color: var(--ink); }
.row[data-state="warn"] .dot { background: var(--warn); opacity: 1; box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); }
.row[data-state="warn"] .r-val { color: var(--warn); }
.row[data-state="run"] { background: linear-gradient(90deg, rgba(56, 225, 255, 0) 0%, rgba(56, 225, 255, 0.1) 50%, rgba(56, 225, 255, 0) 100%) 0 0 / 200% 100%; animation: sheen 1.4s linear infinite; border-radius: 8px; }
.row[data-state="run"] .dot { background: var(--cyan); opacity: 1; box-shadow: 0 0 12px var(--cyan); animation: blink 0.9s ease-in-out infinite; }
.row[data-state="run"] .r-name, .row[data-state="run"] .r-val { color: var(--ink); }
.row.pop .dot { animation: pop 0.5s var(--ease); }
.row.pop .r-val { animation: slidein 0.45s var(--ease); }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.8); } 100% { transform: scale(1); } }
@keyframes slidein { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

.more-card { display: block; width: 100%; margin-top: 12px; padding: 12px 14px; border: 1px dashed rgba(150, 175, 255, 0.28); border-radius: 14px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.more-card:hover { border-color: var(--cyan); background: rgba(56, 225, 255, 0.05); }
.mc-title { display: block; font-weight: 650; font-size: 14px; text-wrap: balance; }
.mc-title::after { content: " →"; color: var(--cyan); }
.mc-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--soft); text-wrap: pretty; }

/* ---------- the centre: headline, gauge, questions */
.core { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.core h1 { font: 700 clamp(24px, 1.1vw + 1.6vh, 36px)/1.05 var(--display); letter-spacing: -0.03em; }
.lead { margin-top: 6px; max-width: 44ch; color: var(--soft); font-size: 14px; text-wrap: balance; }

.gauge { --g: clamp(220px, min(46vh, 31vw), 390px); position: relative; width: var(--g); height: var(--g); margin-top: clamp(4px, 1.2vh, 14px); }
.g-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g-track { fill: none; stroke: rgba(150, 175, 255, 0.1); stroke-width: 18; stroke-linecap: round; }
.g-fill { fill: none; stroke: url(#g-grad); stroke-width: 18; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.g-ptrack { fill: none; stroke: rgba(150, 175, 255, 0.08); stroke-width: 3; stroke-linecap: round; }
.g-prog { fill: none; stroke: var(--violet); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; opacity: 0.9; }
.g-head { fill: #fff; opacity: 0; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 14px var(--cyan)); transition: opacity 0.3s; }
body[data-phase="run"] .g-head, body[data-phase="done"] .g-head { opacity: 1; }
.g-ticks line { stroke: rgba(170, 190, 255, 0.22); stroke-width: 1.5; stroke-linecap: round; }
.g-ticks line.major { stroke: rgba(170, 190, 255, 0.45); stroke-width: 2; }
.g-ticks text { fill: var(--dim); font: 600 9.5px var(--mono); text-anchor: middle; dominant-baseline: middle; }
.g-ticks text.lit { fill: var(--ink); }

.g-sweep { position: absolute; inset: 9%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(56, 225, 255, 0) 0deg, rgba(56, 225, 255, 0) 290deg, rgba(56, 225, 255, 0.16) 350deg, rgba(56, 225, 255, 0) 360deg);
  mask-image: radial-gradient(circle, transparent 55%, #000 56%, #000 70%, transparent 71%); }
body[data-phase="run"] .g-sweep { opacity: 1; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the start button sits in the gauge, then becomes "Run again" under it */
.go { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; translate: -50% -50%; border: 0; border-radius: 50%; cursor: pointer;
  color: #04111c; font: 750 calc(var(--g) * 0.085)/1 var(--display); letter-spacing: -0.02em;
  background: radial-gradient(circle at 30% 25%, #b8f6ff 0%, var(--cyan) 38%, #5b7cff 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 12px 40px rgba(56, 225, 255, 0.35), 0 0 80px rgba(91, 124, 255, 0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.go::before, .go::after { content: ""; position: absolute; inset: -10%; border-radius: 50%; border: 2px solid rgba(56, 225, 255, 0.45); animation: halo 2.6s var(--ease) infinite; pointer-events: none; }
.go::after { animation-delay: 1.3s; }
.go:hover { transform: scale(1.04); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset, 0 16px 50px rgba(56, 225, 255, 0.5), 0 0 110px rgba(91, 124, 255, 0.5); }
.go:active { transform: scale(0.97); }
.go:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
@keyframes halo { 0% { transform: scale(0.92); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
body[data-phase="run"] .go { opacity: 0; transform: scale(0.3); pointer-events: none; transition: transform 0.45s var(--ease), opacity 0.3s, scale 0.45s var(--ease); }
body[data-phase="done"] .go { top: auto; bottom: 1%; width: auto; aspect-ratio: auto; translate: -50% 0; padding: 8px 16px; border-radius: 999px; font: 600 13px/1 var(--font);
  color: var(--soft); background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 1px var(--line) inset; animation: fadeup 0.5s 1.6s var(--ease) both; }
body[data-phase="done"] .go::before, body[data-phase="done"] .go::after { display: none; }
body[data-phase="done"] .go:hover { color: var(--ink); transform: none; }

.g-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--g) * 0.012); opacity: 0; pointer-events: none; transition: opacity 0.4s 0.15s; }
body[data-phase="run"] .g-read, body[data-phase="done"] .g-read { opacity: 1; }
.g-label { font: 650 calc(var(--g) * 0.036)/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
/* --fit (check.js) shrinks the price until it clears the tick labels: a Mac's system font has wider digits, and its
   range often has four digits and a comma */
.g-num { display: flex; align-items: baseline; font: 750 calc(var(--g) * 0.15 * var(--fit, 1))/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; transition: font-size 0.5s var(--ease); }
.g-num .cur { margin-right: 0.22em; font-size: 0.42em; font-weight: 650; color: var(--soft); letter-spacing: 0; align-self: flex-start; margin-top: 0.22em; }
.g-high { display: inline-block; max-width: 0; overflow: hidden; opacity: 0; transition: max-width 0.7s var(--ease), opacity 0.5s; }
.g-sub { font-size: calc(var(--g) * 0.042); color: var(--soft); }
.gauge.ready .g-num { font-size: calc(var(--g) * 0.112 * var(--fit, 1)); }
.gauge.ready .g-high { max-width: 4em; opacity: 1; }
.gauge.ready .g-label { color: var(--good); }
/* drop-shadow on the whole number, not text-shadow: the sliding "–high" part clips its own glow into a box */
.gauge.ready .g-num { color: #fff; filter: drop-shadow(0 0 16px rgba(62, 240, 164, 0.4)); }
.gauge.bump .g-num { animation: bump 0.35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.06); } }
.gauge.ready::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(62, 240, 164, 0.7), 0 0 60px rgba(62, 240, 164, 0.35); animation: ring 1.1s var(--ease) both; }
@keyframes ring { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px currentColor; color: var(--good); animation: fly 1s var(--ease) forwards; }
.burst i:nth-child(3n) { background: var(--cyan); color: var(--cyan); width: 6px; height: 6px; }
.burst i:nth-child(3n+1) { background: #fff; color: #fff; width: 5px; height: 5px; }
@keyframes fly { 0% { transform: rotate(var(--a)) translateX(calc(var(--g) * 0.18)) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateX(calc(var(--g) * var(--d))) scale(0.2); opacity: 0; } }

.status { min-height: 1.45em; margin-top: 2px; max-width: 46ch; font-size: 13.5px; color: var(--soft); }
.status b { color: var(--ink); font-weight: 600; }

.asks { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; width: min(100%, 470px); margin-top: clamp(8px, 1.6vh, 16px); text-align: left; }
.ask p { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--soft); }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { padding: 8px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.25s, color 0.25s; }
.choice:hover { color: var(--ink); }
.choice[aria-pressed="true"] { background: linear-gradient(180deg, rgba(124, 140, 255, 0.45), rgba(56, 225, 255, 0.25)); color: #fff; box-shadow: 0 0 0 1px rgba(150, 175, 255, 0.35) inset; }
/* after the price: point at each question in turn until it's answered */
.ask p { transition: color 0.3s; }
.ask.nudge p { color: var(--cyan); }
.ask.nudge p::before { content: "↓"; display: inline-block; margin-right: 6px; animation: hop 1s ease-in-out infinite; }
.ask.nudge .choices { border-color: rgba(56, 225, 255, 0.7); animation: beckon 1.6s ease-in-out infinite; }
.ask.answered p::after { content: " ✓"; color: var(--good); }
@keyframes hop { 50% { transform: translateY(3px); } }
@keyframes beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(56, 225, 255, 0); } 50% { box-shadow: 0 0 0 5px rgba(56, 225, 255, 0.16), 0 0 24px rgba(56, 225, 255, 0.35); } }
.choice:focus-visible, .nav-btn:focus-visible, .tabs [role="tab"]:focus-visible, .d-tabs button:focus-visible, .more-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.note { margin-top: 10px; max-width: 46ch; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, 0.35); background: rgba(255, 181, 71, 0.08); color: #ffd79a; font-size: 13px; }
.note.ok { border-color: rgba(62, 240, 164, 0.35); background: rgba(62, 240, 164, 0.08); color: #b9ffe0; }

/* ---------- results: every way to sell it */
/* the price sentence from app.js is kept for QA; its "how exact" part is shown under the gauge instead */
.offer { display: none; }
.wait-line { margin-bottom: 10px; font-size: 13px; color: var(--soft); }
.skel { display: grid; gap: 9px; }
.skel i { display: block; height: 26px; border-radius: 8px; background: linear-gradient(90deg, rgba(150, 175, 255, 0.05), rgba(150, 175, 255, 0.11), rgba(150, 175, 255, 0.05)) 0 0 / 200% 100%; }
.skel i:nth-child(2n) { width: 82%; } .skel i:nth-child(3n) { width: 64%; }
body[data-phase="run"] .skel i { animation: sheen 1.6s linear infinite; }
body[data-phase="done"] .wait-line, body[data-phase="done"] .skel { display: none; }
body:not([data-phase="done"]) .ladder, body:not([data-phase="done"]) .deal { display: none; }

.ladder { list-style: none; padding: 0; display: grid; gap: 2px; }
.ladder li { --w: 0; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 5px 10px 8px; border-radius: 10px; font-size: 13px;
  animation: fadeup 0.5s calc(1.35s + var(--i, 0) * 70ms) var(--ease) both; }
.ladder li::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform-origin: left; transform: scaleX(var(--w)); opacity: 0.75; animation: grow 0.9s calc(1.45s + var(--i, 0) * 70ms) var(--ease) both; }
.ladder li.flat::after { background: repeating-linear-gradient(90deg, rgba(150, 175, 255, 0.35) 0 6px, transparent 6px 10px); transform: none; opacity: 0.6; }
.l-name { color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.l-note { display: none; }
.l-links { grid-column: 1 / -1; margin-top: -2px; font-size: 12px; line-height: 1.3; }
.l-links a { margin-right: 12px; color: var(--cyan); text-decoration: none; white-space: nowrap; }
.l-links a:hover { text-decoration: underline; }
.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 0; }
.deal-head { font: 650 12px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.ladder li.best { background: rgba(62, 240, 164, 0.08); box-shadow: 0 0 0 1px rgba(62, 240, 164, 0.3) inset; }
.ladder li.best .l-name { color: var(--ink); }
.ladder li.best .l-name::before { content: "Best · "; color: var(--good); font-weight: 650; }
.ladder li.best .l-val { color: var(--good); }
.ladder li.best::after { background: linear-gradient(90deg, var(--cyan), var(--good)); opacity: 1; }
/* money in and money out never look alike: plain numbers on bars are what the seller gets (green for the best),
   a gold price tag is what a shop charges — the refurbished row here and every laptop in "Your next laptop" */
.dir { flex: none; padding: 2px 8px; border: 1px solid; border-radius: 999px; font: 650 10.5px/1.3 var(--font); letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.dir.get { color: var(--good); border-color: rgba(62, 240, 164, 0.4); }
.dir.pay { color: var(--buy); border-color: rgba(255, 209, 102, 0.45); }
.p-head .dir, .deal-top .dir { margin-block: -3px; } /* the label must not make the head taller: the panel has no height to spare */.ladder li.shop .l-val, .pk-val { justify-self: end; padding: 0 8px 0 15px; border-radius: 0 6px 6px 0; color: #1c1503; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: radial-gradient(circle at 9px 50%, rgba(8, 12, 28, 0.9) 0 2px, transparent 2.6px), var(--buy);
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%); }
.ladder li.shop::after { background: linear-gradient(90deg, rgba(255, 209, 102, 0.2), var(--buy)); opacity: 0.6; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
.ladder li.flat { animation-name: fadeup; }
.ladder.static li, .ladder.static li::after { animation: none; }

.deal { display: flex; flex-direction: column; margin-top: 10px; border: 1px solid rgba(255, 209, 102, 0.22); border-radius: 14px; background: linear-gradient(180deg, rgba(255, 209, 102, 0.055), rgba(255, 209, 102, 0.015)); animation: fadeup 0.6s 1.9s var(--ease) both; overflow: hidden; }
.tab-panels { min-height: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { padding: 10px 6px; border: 0; background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; transition: color 0.2s, box-shadow 0.25s; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--cyan); }
.tab-panels > div { padding: 12px 14px 14px; font-size: 13px; }
.pick-head { margin-bottom: 8px; color: var(--soft); }
.pick-head b { color: var(--ink); font-size: 15px; }
.notify p { color: var(--soft); }
.notify form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 8px; }
.notify input { min-width: 0; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, 0.25); color: var(--ink); font: inherit; }
.notify input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.notify-msg { margin-top: 6px; color: var(--soft); }
.notify-msg:empty { display: none; }

.picks { list-style: none; padding: 0; display: grid; gap: 6px; }
.picks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 7px 10px; border: 1px solid rgba(255, 209, 102, 0.14); border-radius: 11px; background: rgba(6, 10, 24, 0.35); }
.picks li.top { border-color: rgba(255, 209, 102, 0.42); background: rgba(255, 209, 102, 0.06); }
.pk-name { font-weight: 650; }
.pk-val { align-self: start; }
.pk-val small { font-size: 11px; font-weight: 600; opacity: 0.75; }
.pk-note { grid-column: 1 / -1; color: var(--soft); font-size: 12.5px; }
.pk-note b { color: var(--ink); font-weight: 650; }
.pick-head b.get { color: var(--good); }
.pk-links { grid-column: 1 / -1; margin-top: 3px; font-size: 0; line-height: 0; text-wrap: balance; }
.pk-links a { display: inline-block; margin: 0 6px 2px 0; padding: 4px 10px; border: 1px solid rgba(56, 225, 255, 0.35); border-radius: 999px; font-size: 12px; line-height: 1.3; text-decoration: none; color: var(--cyan); transition: background 0.2s; }
.pk-links a:hover { background: rgba(56, 225, 255, 0.1); }
/* check.js adds .stack when the three links can't share one line: one per line, never 2 + 1 */
.pk-links.stack a { display: block; width: fit-content; margin: 0 0 4px; }
.fine { margin-top: 8px; font-size: 12px; color: var(--dim); }
/* the commission line under the ladder: check.js adds it only once an AFF value is filled */
.l-aff { margin: 6px 10px 0; animation: fadeup 0.5s 1.8s var(--ease) both; }
body:not([data-phase="done"]) .l-aff { display: none; }

.ext-offer { margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(62, 240, 164, 0.4); border-radius: 14px; font-size: 13px; }
.ext-offer p { margin-bottom: 6px; color: var(--soft); }
.ext-offer .ext-head { color: var(--ink); font-weight: 650; font-size: 14px; }
.ext-small { font-size: 12px; }

/* ---------- buttons used in the drawer and forms */
.btn { display: inline-block; padding: 9px 16px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #7ee9ff, var(--cyan)); color: #04111c; font: 650 13px/1.2 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform 0.15s, box-shadow 0.2s; }
.btn:hover { box-shadow: 0 6px 22px rgba(56, 225, 255, 0.35); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 1px rgba(150, 175, 255, 0.35) inset; }
.btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- footer */
.foot { padding: 10px clamp(16px, 2vw, 28px) 12px; text-align: center; }
.foot p { margin-inline: auto; max-width: 110ch; font-size: 12px; color: var(--dim); text-wrap: balance; }
.foot a { color: var(--soft); }

/* ---------- drawer with the optional tests, the summary and the working */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(2, 4, 12, 0.55); backdrop-filter: blur(3px); animation: fade 0.25s both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; display: flex; flex-direction: column; width: min(760px, 100vw); border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #0d1530, #090f22); box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5); animation: slide 0.4s var(--ease) both; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.d-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.d-head h2 { font: 700 20px/1.2 var(--display); letter-spacing: -0.01em; }
.d-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--soft); font-size: 15px; cursor: pointer; }
.d-close:hover { color: var(--ink); border-color: rgba(150, 175, 255, 0.4); }
.d-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px 20px 0; border-bottom: 1px solid var(--line); }
.d-tabs button { padding: 9px 4px; border: 0; background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 -2px 0 transparent; }
.d-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--cyan); }
.d-tabs button.done::after { content: " ✓"; color: var(--good); }
.d-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 28px; }
.pane h3 { font: 700 18px/1.25 var(--display); }
.pane .sub { margin-top: 4px; max-width: 62ch; color: var(--soft); font-size: 14px; }
.actions { margin-top: 12px; font-size: 0; line-height: 0; }
.actions .btn { margin: 0 8px 8px 0; }
.pane .rows { margin-top: 10px; }
.pane .rows .row { grid-template-columns: 10px minmax(0, 170px) minmax(0, 1fr); padding: 9px 2px; }
.pane .r-val { white-space: normal; text-align: left; text-wrap: balance; overflow: visible; }

.preview { display: block; width: 260px; max-width: 100%; margin-top: 12px; border-radius: 12px; background: #000; }
.kb { margin-top: 14px; display: grid; gap: 4px; }
.kb-row { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 4px; }
.key { height: 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.03); color: var(--soft); font-size: 11px; white-space: nowrap; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.kb-row.opt .key { border-style: dashed; }
.key.hit { background: rgba(62, 240, 164, 0.16); border-color: var(--good); color: var(--good); border-style: solid; }
.pad { position: relative; margin-top: 12px; height: 170px; border: 1px dashed rgba(150, 175, 255, 0.3); border-radius: 12px; background: rgba(255, 255, 255, 0.02); display: grid; place-items: center; touch-action: none; }
.pad-hint { max-width: 30ch; padding-inline: 56px; text-align: center; color: var(--soft); font-size: 13px; text-wrap: balance; }
.corner { position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(150, 175, 255, 0.35); }
.corner[data-c="tl"] { top: 10px; left: 10px; } .corner[data-c="tr"] { top: 10px; right: 10px; }
.corner[data-c="bl"] { bottom: 10px; left: 10px; } .corner[data-c="br"] { bottom: 10px; right: 10px; }
.corner.hit { border-color: var(--good); background: rgba(62, 240, 164, 0.18); }
.question { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.question p { font-weight: 600; }
.spec { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13.5px; }
.spec th, .spec td { padding: 9px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec th { width: 34%; padding-right: 14px; font-weight: 600; color: var(--soft); }
.spec td { overflow-wrap: anywhere; }
.src { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); }
.offer-notes { margin-top: 10px; padding-left: 18px; color: var(--soft); font-size: 14px; }
.offer-notes:empty { display: none; }
.offer-notes li { margin: 4px 0; }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 650; }
#work-source, #save-note { margin-top: 10px; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #fff; cursor: pointer; }
.overlay p { padding: 12px 20px; border-radius: 999px; background: rgba(0, 0, 0, 0.75); color: #fff; }

/* ---------- the clean start, like a speed test: the headline and Start, nothing else.
   On Start the gauge draws in and the live readings slide in from the left;
   when the price lands, every way to sell it slides in from the right.
   On a laptop screen the panels keep their place in the grid (hidden, not removed), so the gauge never moves. */
body { overflow-x: clip; }
.g-svg { transform-origin: 50% 50%; transition: opacity 0.6s var(--ease), transform 0.9s var(--ease); }
body[data-phase="idle"] .g-svg { opacity: 0; transform: scale(0.82) rotate(-40deg); }
body[data-phase="idle"] .go { scale: 1.2; }
.bar-nav { transition: opacity 0.5s 0.4s; }
body[data-phase="idle"] .bar-nav { visibility: hidden; opacity: 0; }
.asks { transition: opacity 0.5s 0.55s, transform 0.6s 0.55s var(--ease); }
body[data-phase="idle"] .asks { visibility: hidden; opacity: 0; transform: translateY(12px); }
.stage > .panel { visibility: hidden; }
body:not([data-phase="idle"]) .readings { visibility: visible; animation: in-left 0.85s 0.12s var(--ease) both; }
body[data-phase="done"]:not(.no-price) .results { visibility: visible; animation: in-right 0.85s 0.95s var(--ease) both; }
@keyframes in-left { from { opacity: 0; transform: translateX(calc(-100% - 40px)); } }
@keyframes in-right { from { opacity: 0; transform: translateX(calc(100% + 40px)); } }
/* below a laptop screen the panels stack under the gauge, so hidden ones take no room */
@media not all and (min-width: 1000px) and (min-height: 560px) {
  .core { order: -1; }
  body[data-phase="idle"] .readings, body:not([data-phase="done"]) .results, body.no-price .results, body[data-phase="idle"] .asks { display: none; }
}

/* ---------- layouts */
/* a laptop screen: everything in one view, no page scroll */
@media (min-width: 1000px) and (min-height: 560px) {
  body { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  /* equal side columns keep the gauge on the page's centre line */
  .stage { grid-template-columns: minmax(250px, 1fr) minmax(380px, 1.25fr) minmax(290px, 1fr); min-height: 0; }
  .panel { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(150, 175, 255, 0.25) transparent; display: flex; flex-direction: column; }
  .more-card { margin-top: auto; }
  .rows { margin-bottom: 12px; }
  .core { justify-content: center; min-height: 0; }
  .status { min-height: 2.9em; } /* the two-line "Done in…" sentence doesn't nudge the centred gauge */
  /* results: the ladder stays whole, the tab underneath scrolls inside itself */
  .results .deal { flex: 1 1 auto; min-height: 150px; }
  .results .tab-panels { flex: 1 1 auto; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(150, 175, 255, 0.25) transparent; }
  .results .ext-offer { flex: none; }
}
@media (min-width: 1000px) and (max-height: 700px) { .lead, .more-card .mc-sub { display: none; } .bar { padding-block: 8px; } .rows { margin-bottom: 8px; } }
/* tablets: the gauge on top, readings and results side by side */
@media (min-width: 700px) and (max-width: 999.98px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 8px; }
  .core { grid-column: 1 / -1; grid-row: 1; }
  .gauge { --g: clamp(240px, 46vw, 360px); }
}
@media (max-width: 699.98px) {
  .bar { flex-wrap: wrap; row-gap: 10px; }
  .bar-nav { order: 3; width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-btn { padding-inline: 6px; overflow: hidden; text-overflow: ellipsis; }
  .stage { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; }
  .core { order: -1; }
  .gauge { --g: clamp(220px, 82vw, 340px); }
  .asks { grid-template-columns: minmax(0, 1fr); }
  .d-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pane .rows .row { grid-template-columns: 10px minmax(0, 1fr); }
  .pane .rows .r-val { grid-column: 2; }
  .notify form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .choice { font-size: 12px; } .tabs [role="tab"] { font-size: 12px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; }
  .go::before, .go::after, .g-sweep, .burst { display: none; }
}
