/* Beat the Test Price: styles. Tokens and rules are in DESIGN-SYSTEM.md. */
@font-face {
  font-family: "Atkinson Next";
  src: url("../fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf8f3;
  --card: #ffffff;
  --ink: #1b2433;
  --ink-2: #5e6672;
  --line: #e9e3d9;
  --chip: #f3ede4;
  --on-ink: #ffffff;
  --good: #2f6b4f;
  --good-bg: #e6f1ea;
  --sand: #f7edd8;
  --sand-ink: #6e4e12;
  --rose: #fbe6e2;
  --rose-ink: #7f2e26;
  --focus: #2f5f8f;
  --r: 18px;
  --tap: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12161d; --card: #1b212b; --ink: #edeae4; --ink-2: #a3abb5; --line: #2c3440; --chip: #232a35;
    --on-ink: #12161d; --good: #86c9a6; --good-bg: #1d3127; --sand: #312a1b; --sand-ink: #e5c886;
    --rose: #3a2523; --rose-ink: #f2a69c; --focus: #8fb8e0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12161d; --card: #1b212b; --ink: #edeae4; --ink-2: #a3abb5; --line: #2c3440; --chip: #232a35;
  --on-ink: #12161d; --good: #86c9a6; --good-bg: #1d3127; --sand: #312a1b; --sand-ink: #e5c886;
  --rose: #3a2523; --rose-ink: #f2a69c; --focus: #8fb8e0; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font: 17px/1.55 "Atkinson Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
a { color: var(--ink); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
}
.brand { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border: none; background: transparent; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aim-pill { text-decoration: none; flex: none; font-size: 14px; font-weight: 700; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 6px 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Stage progress */
.stage { padding: 0 20px 6px; }
.stage-label { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; margin-bottom: 6px; }
.stage-track { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stage-fill { height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width 0.3s ease; }

/* Menu */
.menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 4px 12px 8px; padding: 6px 16px; }
.menu a, .menu button {
  display: block; width: 100%; padding: 14px 0; text-decoration: none; color: var(--ink); background: none; border: none;
  border-bottom: 1px solid var(--line); text-align: left; cursor: pointer;
}
.menu a:last-child, .menu button:last-child { border-bottom: none; }

/* Screens */
main { flex: 1; padding: 8px 20px 150px; outline: none; }
.view { animation: enter 0.2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } .stage-fill { transition: none; } }
h1 { font-size: 27px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; margin: 12px 0 10px; }
h2 { font-size: 19px; font-weight: 600; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-2); font-size: 17px; }
.small { font-size: 15px; color: var(--ink-2); }
.micro { font-size: 13px; color: var(--ink-2); }

/* Numbers use the system font: Atkinson's slashed zero reads like a symbol in prices. */
.num, .num-inline, .price, .aim-pill, .trio .v, dl.lines dd, .vs, .barbox .tlabel, .axis { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

/* Fact chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink);
  background: var(--chip); border-radius: 999px; padding: 6px 12px;
}
.chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Answer cards */
.answers { display: grid; gap: 10px; margin: 16px 0; }
.answer {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  text-decoration: none; color: var(--ink); transition: border-color 0.15s ease, transform 0.15s ease;
}
.answer:active { transform: scale(0.99); }
.answer .txt { flex: 1; }
.answer strong { display: block; font-weight: 600; font-size: 18px; }
.answer .sub { display: block; color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.answer .go { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.answer.first { border-color: var(--ink); }
.answer[aria-pressed="true"] { border-color: var(--ink); background: var(--chip); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 2px 8px; margin-bottom: 4px; }

/* Test toggles (choose my own) */
.toggles { display: grid; gap: 8px; margin: 14px 0; }
.toggle {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  min-height: var(--tap); padding: 12px 16px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: var(--card);
}
.toggle .t { font-weight: 600; }
.toggle .d { font-size: 14px; color: var(--ink-2); }
.toggle .box { flex: none; width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--line); display: grid; place-items: center; }
.toggle[aria-pressed="true"] { border-color: var(--ink); }
.toggle[aria-pressed="true"] .box { background: var(--ink); border-color: var(--ink); }
.toggle[aria-pressed="true"] .box::after { content: ""; width: 10px; height: 5px; border: 2px solid var(--on-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* Cards and target */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 14px 0; }
.aim { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.aim .num { font-size: 34px; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; font-size: 15px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 12px 0 4px; }
.trio .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trio .l { font-size: 13px; color: var(--ink-2); }
.barbox { position: relative; height: 56px; margin: 6px 4px 0; }
.barbox .track { position: absolute; top: 24px; left: 0; right: 0; height: 8px; background: var(--line); border-radius: 999px; }
.barbox .range { position: absolute; top: 24px; height: 8px; background: var(--chip); border: 1px solid var(--ink-2); border-radius: 999px; }
.barbox .dot { position: absolute; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); transform: translateX(-4px); }
.barbox .tick { position: absolute; top: 16px; width: 3px; height: 24px; border-radius: 2px; background: var(--good); transform: translateX(-1px); }
.barbox .tlabel { position: absolute; top: 0; font-size: 12px; font-weight: 700; color: var(--good); white-space: nowrap; transform: translateX(-50%); }
.barbox .tlabel.tl-left { transform: none; }
.barbox .tlabel.tl-right { transform: translateX(-100%); }
.axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }

/* Options */
.pick { border: 2px solid var(--ink); }
.pick .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pick .name { font-weight: 700; font-size: 19px; }
.pick .price { font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums; }
.vs { display: inline-block; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin: 6px 0; }
.vs.good { color: var(--good); background: var(--good-bg); }
.vs.over { color: var(--ink-2); background: var(--chip); }
.facts { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 4px; font-size: 15px; color: var(--ink-2); }
.facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); margin: 0 8px 2px 0; }
.warn { font-size: 14px; color: var(--sand-ink); margin: 4px 0 10px; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 10px 0; overflow: hidden; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; background: transparent; border: none; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .name { font-weight: 600; }
.row .price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.row .meta { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }

/* Checkout lines */
dl.lines { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0; font-variant-numeric: tabular-nums; }
dl.lines dt { color: var(--ink-2); }
dl.lines dd { margin: 0; padding-left: 12px; text-align: right; }
dl.lines .total { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
ol.next { padding: 0; margin: 6px 0 0; list-style: none; counter-reset: s; }
ol.next li { counter-increment: s; position: relative; padding: 0 0 14px 40px; }
ol.next li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--chip); display: grid; place-items: center; font-size: 14px; font-weight: 700;
}

/* Notes */
.note-sand { background: var(--sand); color: var(--sand-ink); border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 14px 0; }
.note-sand a { color: var(--sand-ink); }
.note-rose { background: var(--rose); color: var(--rose-ink); border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 14px 0; }
.note-rose a { color: var(--rose-ink); }
.sources { font-size: 13px; color: var(--ink-2); margin-top: 20px; }
.sources a { color: var(--ink-2); }
.draft { font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 16px; }
.links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.links a:last-child { border-bottom: none; }
.links a span { display: block; font-weight: 400; color: var(--ink-2); font-size: 15px; }

/* Comparing moment */
.comparing { min-height: 50vh; display: grid; place-content: center; text-align: center; gap: 14px; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); opacity: 0.25; animation: pulse 0.9s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: 0.6; } }

/* Buttons and bottom bar */
.btn {
  display: block; width: 100%; min-height: var(--tap); border-radius: 999px; padding: 14px 20px; cursor: pointer;
  font-weight: 700; font-size: 17px; text-align: center; text-decoration: none; border: 2px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.quiet { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 14px 20px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to top, var(--paper) 75%, rgba(0, 0, 0, 0));
}
.cta .inner { max-width: 480px; margin: 0 auto; }
.cta .micro { text-align: center; margin: 8px 0 0; }
.noscript { padding: 20px; }

/* Named comparison */
.compare { font-size: 15px; color: var(--ink-2); margin: 2px 0 10px; }
.compare strong { color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

/* Creator mode: large site name for screen recordings */
body.creator .brand { font-size: 22px; letter-spacing: -0.02em; }
body.creator .bar { padding-top: calc(env(safe-area-inset-top) + 16px); padding-bottom: 14px; border-bottom: 2px solid var(--ink); }

/* Intro: provider names compress into the header pill */
.intro { position: fixed; inset: 0; z-index: 15; background: var(--paper); display: grid; place-items: center; padding: 80px 20px 40px; cursor: pointer; }
.intro-box { max-width: 440px; text-align: center; }
.intro-title { font-size: 19px; font-weight: 600; margin: 0 0 16px; }
.intro-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.intro-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 600; opacity: 0; will-change: transform, opacity; }
.intro-chip svg { width: 15px; height: 15px; fill: none; stroke: var(--good); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.intro-sub { font-size: 13px; color: var(--ink-2); margin: 16px 0 0; }
.intro-skip { position: absolute; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 20px); background: none; border: none; color: var(--ink-2); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px; }
