/* TimedPrep. Mobile first; system fonts; no framework. One file for the public pages, the test player,
   the result screen and the dashboard. */
:root {
  --ink: #131a26;
  --ink-2: #1f2a3c;
  --text: #18202e;
  --muted: #566074;
  --line: #dfe4ec;
  --bg: #f5f6fa;
  --card: #ffffff;
  --accent: #ffb020;
  --accent-dark: #e89a0c;
  --accent-ink: #101828;
  --link: #1d4ed8;
  --ok: #17794a;
  --ok-bg: #e6f5ec;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --warn-bg: #fff6e0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(19, 26, 38, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg);
}
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(28px, 6.2vw, 44px); margin: 0 0 14px; }
h2 { font-size: clamp(22px, 4.6vw, 30px); margin: 0 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
p { margin: 0 0 14px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 76px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 18px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8a5a00; margin: 0 0 10px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 4px 0; }

/* Header */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.logo { font-weight: 800; font-size: 20px; color: #fff; text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: #d5dcea; text-decoration: none; font-size: 15px; white-space: nowrap; }
.nav a:hover { color: #fff; }
.nav a.btn { color: var(--accent-ink); }
@media (max-width: 760px) { .nav .nav-link { display: none; } .nav { gap: 12px; } }
body.in-test .site-header, body.in-test .site-footer { display: none; }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 10px; padding: 13px 22px; cursor: pointer; transition: background 0.15s; line-height: 1.25;
}
.btn:hover { background: var(--accent-dark); }
.btn.small { padding: 7px 14px; font-size: 15px; }
.btn.wide { display: block; width: 100%; }
.btn.big { font-size: 19px; padding: 16px 26px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #c5cddb; }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.is-busy { opacity: 0.6; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.buy-note { color: var(--bad); font-size: 14px; margin: 8px 0 0; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: #fff; padding-block: 34px 40px; }
.hero h1 { color: #fff; }
.hero .eyebrow { color: var(--accent); }
.hero .lede { font-size: 18px; color: #d5dcea; max-width: 640px; }
.hero a { color: #ffd98a; }
.hero-sub { font-size: 15px; color: #b9c2d3; max-width: 640px; margin: 0; }
.hero-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .hero { padding-block: 56px 64px; } .hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; } }

/* Start panel on a test landing page */
.start { background: #fff; color: var(--text); border-radius: var(--radius); padding: 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); }
.start-clock { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.t-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; letter-spacing: 0.01em; }
.t-clock.big { font-size: 44px; line-height: 1; color: var(--ink); }
.t-clock.is-low { color: var(--bad); }
.start ul { margin: 0 0 14px; padding-left: 20px; font-size: 15px; }
.start li { margin: 2px 0; }
.start .small { margin: 10px 0 0; }
.start a { color: var(--link); }
#last-result { background: var(--warn-bg); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 15px; color: var(--text); }

/* Sections */
.section { padding-block: 36px; }
.section.tight { padding-top: 22px; }
.section.alt { background: #fff; border-block: 1px solid var(--line); }
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .cards.four { grid-template-columns: repeat(4, 1fr); } .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; }
.cards .card { margin: 0; }
.card h2 { font-size: 21px; }
.card h3 { margin-top: 0; }
a.card { display: block; text-decoration: none; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.pick .pick-name { font-size: 20px; font-weight: 800; color: var(--ink); display: block; }
.pick .pick-meta { color: var(--muted); font-size: 15px; display: block; margin: 2px 0 10px; }
.pick .pick-go { font-weight: 700; color: var(--link); }
.facts { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 0 0 8px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact b { display: block; font-size: 24px; line-height: 1.15; color: var(--ink); }
.fact span { font-size: 14px; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.ticks li { padding: 4px 0 4px 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 11px; height: 6px; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }
.helper select, .r-role-pick select, input[type="email"], input[type="text"], input[type="date"] {
  font: inherit; padding: 11px 12px; border: 2px solid #c5cddb; border-radius: 10px; background: #fff; color: var(--text); width: 100%; max-width: 420px;
}
.helper label { display: block; font-weight: 600; margin: 12px 0 4px; }
.helper [data-helper-out] { margin-top: 16px; }
.helper-two .btn { margin: 0 6px 8px 0; }
.source-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.source-table th, .source-table td { text-align: left; vertical-align: top; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); }
.source-table th { width: 34%; font-weight: 600; }
.mix { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px 18px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .mix { grid-template-columns: 1fr 1fr; } }
.mix li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--line); padding: 3px 0; }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); }
details.faq p { margin: 10px 0 0; }

/* Plans */
.plans { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 700px) { .plans { grid-template-columns: 1fr 1fr; align-items: start; } }
.plan { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.plan.is-best { border-color: var(--accent); box-shadow: var(--shadow); }
.plan h3 { margin: 0 0 4px; font-size: 20px; }
.plan-flag { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin: 0 0 8px; }
.plan-price { margin: 0 0 10px; }
.price { font-size: 34px; font-weight: 800; color: var(--ink); }
.plan .ticks { font-size: 15.5px; }
.plan select { margin: 0 0 10px; font: inherit; padding: 9px 10px; border: 2px solid #c5cddb; border-radius: 10px; width: 100%; background: #fff; }
.r-terms { font-size: 15.5px; }

/* Article pages */
.article { padding-block: 26px 40px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); }
.article .lede { font-size: 19px; color: #36415a; }
.article .updated { font-size: 14px; color: var(--muted); }
.article h2 { margin-top: 34px; }
.article table { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 480px; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; background: #fff; }
.article thead th { background: #eef1f6; }
.article li { margin: 4px 0; }
.note { background: var(--warn-bg); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; }
.note p:last-child, .keyfacts ul { margin-bottom: 0; }
.keyfacts { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 6px; margin: 0 0 18px; }
.cta-box { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px; margin: 22px 0; }
.cta-box p { color: #d5dcea; margin: 0 0 12px; }
.cta-box strong { color: #fff; }
.cta-box .btn { margin: 0 8px 8px 0; }
.cta-box .btn.ghost { color: #fff; border-color: #56637a; }
.sample { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
.sample-tag { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }
.related { list-style: none; padding: 0; display: grid; gap: 8px; }
.related a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-decoration: none; font-weight: 600; }
.guide-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
@media (min-width: 700px) { .guide-list { grid-template-columns: 1fr 1fr; } }
.guide-list a { display: block; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.guide-list b { display: block; color: var(--link); }
.guide-list span { font-size: 14.5px; color: var(--muted); }

/* Footer */
.site-footer { background: var(--ink); color: #b9c2d3; padding-block: 28px 34px; font-size: 14.5px; margin-top: 30px; }
.site-footer a { color: #d5dcea; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.foot-cols { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
@media (min-width: 760px) { .foot-cols { grid-template-columns: repeat(3, 1fr); } }
.foot-cols h2 { font-size: 14px; color: #fff; margin: 0 0 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { padding: 3px 0; }
.disclaimer { border-top: 1px solid #2c384d; padding-top: 14px; margin: 0; font-size: 13.5px; line-height: 1.5; }

/* ---------- The question (player, review, drills, samples) ---------- */
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.q-text { white-space: pre-line; font-size: 18px; line-height: 1.5; margin: 0 0 12px; overflow-wrap: anywhere; }
.fig-stem { margin: 4px 0 14px; color: var(--text); max-width: 100%; }
.fig-stem svg, .opt-fig svg { display: block; width: 100%; height: auto; }
.fig-matrix { width: 72%; max-width: 260px; }
.fig-target { width: 34%; max-width: 120px; min-width: 96px; }
.fig-wide { width: 100%; max-width: 520px; }
.fig-analogy { width: 76%; max-width: 300px; }
.fig-fold { width: 100%; max-width: 400px; }
.pairs { margin: 0 0 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 15.5px; }
.pair { display: grid; grid-template-columns: 22px 1fr 1fr; gap: 4px 12px; padding: 7px 8px; border: 1px solid var(--line); border-bottom-width: 0; align-items: baseline; }
.pair:last-child { border-bottom-width: 1px; border-radius: 0 0 8px 8px; }
.pair:first-child { border-radius: 8px 8px 0 0; }
.pair-n { color: var(--muted); font-size: 13px; }
.pair-l, .pair-r { white-space: nowrap; }
/* A pair that does not fit on one line is stacked, left over right, never wrapped (bank SPEC, section 3).
   The longest strings in the bank are 38 characters; the font shrinks just enough for them to fit the
   narrowest phone (monospace: 0.6 em a character; 84 px is everything around the text). */
@media (max-width: 620px) {
  .pair { grid-template-columns: 16px 1fr; gap: 2px 6px; padding: 6px; }
  .pair-r { grid-column: 2; }
  .pairs { font-size: min(15.5px, calc((100vw - 84px) / 23.2)); }
  .q-card { padding: 14px 12px; }
}
.data-table { border-collapse: collapse; margin: 0 0 4px; font-size: 16px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 6px 12px; text-align: right; white-space: nowrap; }
.data-table th:first-child { text-align: left; }
.data-table thead th { background: #eef1f6; }

.opts { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: #fff;
  border: 2px solid #c9d1de; border-radius: 12px; padding: 12px 14px; cursor: pointer; min-height: 52px; position: relative;
}
.opt:hover:not([disabled]) { border-color: #7d8aa3; }
.opt-key { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #eef1f6; font-weight: 700; font-size: 14px; display: grid; place-items: center; color: var(--ink); }
.opt-label { overflow-wrap: anywhere; }
.opt.is-picked { border-color: var(--ink); background: #f0f3f9; }
.opt.is-picked .opt-key { background: var(--ink); color: #fff; }
.opt[disabled] { cursor: default; opacity: 1; color: var(--text); }
.opt.is-right { border-color: var(--ok); background: var(--ok-bg); }
.opt.is-right .opt-key { background: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.is-wrong .opt-key { background: var(--bad); color: #fff; }
.opt-mark { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
/* Figure options: 3 per row on a phone (four options: 2 x 2), one row from 480 px up. */
.opts-fig { grid-template-columns: repeat(3, 1fr); }
.opts-fig.opts-n4, .opts-fig.opts-n2, .opts-fig.opts-2col { grid-template-columns: repeat(2, 1fr); }
.opts-fig.opts-2col .opt-fig { max-width: 170px; }
.opts-fig .opt { flex-direction: column; gap: 6px; padding: 8px 8px 10px; align-items: center; }
.opts-fig .opt-fig { width: 100%; max-width: 124px; }
.opts-fig .opt-mark { margin: 0; }
@media (max-width: 400px) { .opts-fig { gap: 6px; } .opts-fig .opt { padding: 6px 4px 8px; } }
@media (min-width: 480px) {
  .opts-fig.opts-n5 { grid-template-columns: repeat(5, 1fr); }
  .opts-fig.opts-n4 { grid-template-columns: repeat(4, 1fr); }
  .opts-fig.opts-n3 { grid-template-columns: repeat(3, 1fr); max-width: 420px; }
}
.explain { background: #f0f3f9; border-radius: 10px; padding: 12px 14px; margin: 12px 0 0; font-size: 16px; }
.explain.is-ok { background: var(--ok-bg); }
.explain.is-bad { background: var(--bad-bg); }

/* ---------- The test ---------- */
.test { max-width: 760px; margin: 0 auto; padding: 0 12px 96px; }
.t-top { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 10px 2px 8px; }
.t-top-in { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.t-top .t-clock { font-size: 24px; color: var(--ink); }
.t-count { font-size: 15px; color: var(--muted); font-weight: 600; }
.t-bar { height: 5px; background: #dfe4ec; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.t-bar-fill { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }
.t-stage { padding-top: 6px; }
/* The answer button is always reachable: it sticks to the bottom of the screen. */
.t-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(245, 246, 250, 0.96); border-top: 1px solid var(--line);
  padding: 10px max(12px, calc((100vw - 736px) / 2)) calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.t-foot .t-next { flex: 1 1 auto; max-width: 340px; }
.t-foot .t-hint { flex: 1 1 0; min-width: 0; }
.t-next.is-skip { background: #fff; border-color: #c5cddb; color: var(--ink); }
@media (max-width: 520px) { .t-foot .t-hint { display: none; } .t-foot .t-next { max-width: none; } .test[data-nav="free"] .t-foot .btn { padding-inline: 10px; flex: 1 1 0; font-size: 15.5px; } }
.t-wait { text-align: center; padding: 60px 10px; }
.t-grid-title { font-size: 20px; }
.t-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 12px; }
@media (min-width: 520px) { .t-grid { grid-template-columns: repeat(10, 1fr); } }
.t-cell { font: inherit; font-weight: 700; padding: 10px 0; border-radius: 10px; border: 2px solid #c9d1de; background: #fff; color: var(--ink); cursor: pointer; min-height: 44px; }
.t-cell.is-seen { border-color: #7d8aa3; }
.t-cell.is-done { background: var(--ink); border-color: var(--ink); color: #fff; }
.t-cell.is-cur { outline: 3px solid var(--accent); outline-offset: 1px; }
.t-confirm { position: fixed; inset: 0; z-index: 40; background: rgba(19, 26, 38, 0.6); display: grid; place-items: center; padding: 16px; }
.t-confirm-in { background: #fff; border-radius: var(--radius); padding: 22px; max-width: 440px; width: 100%; }
.t-confirm-in label { display: block; font-weight: 600; margin: 8px 0 4px; }
.t-confirm-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.t-confirm-btns .btn { flex: 1 1 150px; }
.pace-bar { position: relative; height: 10px; background: #dfe4ec; border-radius: 5px; margin-top: 6px; overflow: hidden; }
.pace-you { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); }
.pace-you.is-behind { background: var(--bad); }
.pace-even { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--ink); z-index: 2; }
.pace-note { font-size: 15px; font-weight: 600; margin: 6px 2px 8px; min-height: 24px; }

/* ---------- Result ---------- */
#stage:not([hidden]) { padding-block: 10px 30px; }
.result { max-width: 760px; margin: 0 auto; padding: 12px 14px 20px; }
.r-head { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px 18px; margin: 0 0 14px; }
.r-head .eyebrow { color: var(--accent); }
.r-score { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; }
.r-raw { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.r-of { font-size: 22px; color: #b9c2d3; font-weight: 600; }
.small-score .r-raw { font-size: 48px; color: var(--ink); }
.small-score .r-of { color: var(--muted); }
.r-line { color: #d5dcea; margin: 0 0 14px; }
.r-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 560px) { .r-tiles { grid-template-columns: repeat(4, 1fr); } }
.r-tile { background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 10px 12px; }
.r-tile-v { font-size: 22px; font-weight: 800; }
.r-tile-l { font-size: 13.5px; color: #b9c2d3; line-height: 1.3; }
.r-tile-s { font-size: 12.5px; color: #8e99ad; }
.r-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 0 0 14px; }
.r-block h2 { font-size: 22px; }
.r-rank { padding-left: 20px; margin: 0 0 12px; }
.r-pct { font-size: 18px; }
.pct-bar { position: relative; height: 14px; background: linear-gradient(90deg, #f3d9d7, #f7edcf 50%, #d5ecdf); border-radius: 7px; margin: 22px 0 12px; }
.pct-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: #9aa5b8; }
.pct-you { position: absolute; top: -22px; transform: translateX(-50%); font-size: 12.5px; font-weight: 800; color: var(--ink); }
.pct-you::after { content: ""; position: absolute; left: 50%; top: 19px; width: 4px; height: 20px; margin-left: -2px; background: var(--ink); border-radius: 2px; }
.r-role-pick { display: block; font-weight: 600; margin: 0 0 12px; }
.r-role-pick select { display: block; margin-top: 4px; }
.r-role-verdict { border-radius: 10px; padding: 10px 12px; }
.r-role-verdict.is-under { background: var(--bad-bg); }
.r-role-verdict.is-in { background: var(--ok-bg); }
.r-role-list { columns: 2; column-gap: 20px; padding-left: 18px; font-size: 15px; margin: 0 0 12px; }
@media (max-width: 480px) { .r-role-list { columns: 1; } }
.r-skip { border-color: #f1c6c2; }
.r-skip-list { list-style: none; padding: 0; margin: 0 0 10px; }
.r-skip-list li { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; align-items: baseline; }
.r-skip-q { font-weight: 800; }
.r-skip-ms { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--bad); }
.r-skip-o { color: var(--muted); font-size: 14px; }
.chart { margin: 6px 0 14px; }
.chart svg { display: block; width: 100%; height: auto; max-width: 560px; }
.chart svg.strip { height: 70px; max-width: none; }
.chart .ax { stroke: #c5cddb; stroke-width: 1; }
.chart .even { stroke: #7d8aa3; stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; }
.chart .you { stroke: #d97706; stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.chart .you-dot { fill: #d97706; }
.chart .lbl { font-size: 10px; fill: #566074; font-family: inherit; }
.s-ok { fill: #2e9e68; } .s-bad { fill: #cf4a41; } .s-blank { fill: #9aa5b8; } .s-none { fill: #dfe4ec; }
.chart-key span[class^="key-"] { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-left: 6px; }
.key-you { background: #d97706; } .key-even { background: #7d8aa3; } .key-ok { background: #2e9e68; } .key-bad { background: #cf4a41; } .key-blank { background: #9aa5b8; }
.r-types { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 330px; }
.r-types th, .r-types td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.r-types thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
.r-types tbody th { font-weight: 600; }
.frac.is-low { color: var(--bad); font-weight: 700; }
.mini { display: block; height: 5px; width: 64px; background: #f3d9d7; border-radius: 3px; margin-top: 3px; overflow: hidden; }
.mini-fill { display: block; height: 100%; background: #2e9e68; }
.is-slow { color: var(--bad); font-weight: 700; }
.r-sections { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef1f6; border-radius: 999px; padding: 3px 12px; font-size: 14px; }
.r-offer { background: #fff; border: 2px solid var(--accent); border-radius: var(--radius); padding: 20px 16px; margin: 0 0 14px; }
.r-offer h2 { font-size: 24px; }
.r-diag { padding-left: 20px; margin: 0 0 12px; font-weight: 600; }
.r-offer-lede { font-size: 17px; }
.rv-list { border-top: 1px solid var(--line); }
.rv { border-bottom: 1px solid var(--line); }
.rv summary { display: grid; grid-template-columns: 40px 1fr auto auto auto; gap: 8px; padding: 10px 0; cursor: pointer; font-size: 15.5px; align-items: baseline; list-style: none; }
.rv summary::-webkit-details-marker { display: none; }
.rv-n { font-weight: 800; }
.rv-s { font-weight: 700; font-size: 14px; }
.rv-ok .rv-s { color: var(--ok); } .rv-bad .rv-s { color: var(--bad); } .rv-blank .rv-s, .rv-none .rv-s { color: var(--muted); }
.rv-ms { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 42px; text-align: right; }
.rv-lock { font-size: 12px; background: #eef1f6; border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.rv-body { padding: 4px 0 16px; }
.rv-locked { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; font-size: 15.5px; }
.r-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin: 18px 0; }

/* ---------- Dashboard ---------- */
.app-main { max-width: 760px; margin: 0 auto; padding: 16px 14px 40px; min-height: 60vh; }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-head h1 { font-size: 28px; margin-bottom: 4px; }
.app-back { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin: 0 0 12px; }
.app-back h1 { font-size: 24px; margin: 0; flex: 1 1 100%; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0 14px; padding-bottom: 2px; }
.tab { font: inherit; font-weight: 700; font-size: 15px; white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 2px solid #c5cddb; background: #fff; color: var(--ink); cursor: pointer; }
.tab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tests { list-style: none; padding: 0; margin: 0 0 8px; }
.tests li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tests-name { font-weight: 700; }
.tests-score { grid-column: 1; font-size: 14px; color: var(--muted); }
.tests-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 12px; align-items: center; }
.forecast { font-size: 19px; }
.tr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.tr-row h3 { margin: 0 0 2px; }
.tr-row p { margin: 0; }
.ladder { list-style: none; padding: 0; margin: 0; }
.ladder li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ladder-name { font-weight: 600; }
.ladder-btns { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; }
@media (min-width: 620px) { .ladder li { grid-template-columns: 1fr auto auto; } .ladder-btns { grid-column: auto; } }
.pips { display: inline-flex; gap: 4px; }
.pip { width: 14px; height: 8px; border-radius: 4px; background: #dfe4ec; }
.pip.is-on { background: var(--ok); }
.plan-list { list-style: none; padding: 0; margin: 0 0 8px; }
.plan-list li { padding: 5px 0; }
.plan-list input { width: 18px; height: 18px; vertical-align: -3px; }
.row input[type="date"] { max-width: 200px; display: block; margin-top: 4px; }
.code { font-size: 20px; letter-spacing: 1px; background: var(--warn-bg); border: 2px dashed var(--accent); border-radius: 8px; padding: 2px 10px; white-space: nowrap; }
.app-foot { margin-top: 18px; }
.app-drill .t-foot .btn { max-width: 340px; flex: 1 1 auto; }
.app-drill { padding-bottom: 90px; }

/* Cheat sheet: one printed page */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; font-size: 15px; line-height: 1.45; }
.sheet h1 { font-size: 24px; margin-bottom: 8px; }
.sheet h2 { font-size: 17px; margin: 14px 0 6px; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.sheet h3 { font-size: 15px; margin: 10px 0 4px; }
.sheet p, .sheet ul { margin: 0 0 8px; }
.sheet ul { padding-left: 18px; }
.sheet li { margin: 1px 0; }
.sheet table { border-collapse: collapse; width: 100%; margin: 0 0 8px; }
.sheet th, .sheet td { border: 1px solid #c5cddb; padding: 3px 7px; text-align: left; vertical-align: top; }
.sheet-foot { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media print {
  @page { margin: 11mm; }
  body { background: #fff; font-size: 10.5pt; }
  .site-header, .site-footer, .no-print { display: none !important; }
  .app-main { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; font-size: 10pt; line-height: 1.32; }
  .sheet h1 { font-size: 15pt; } .sheet h2 { font-size: 11pt; margin-top: 7pt; } .sheet h3 { font-size: 10pt; }
}

/* Simple pages: sign-in, welcome, restore */
.box-page { max-width: 520px; margin: 0 auto; padding: 28px 16px 40px; min-height: 55vh; }
.box-page label { display: block; font-weight: 600; margin: 12px 0 4px; }
.box-page input { max-width: none; }
.box-page .btn { margin-top: 14px; }
.msg { border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.msg.ok { background: var(--ok-bg); } .msg.no { background: var(--bad-bg); }
.r-jump { margin: 14px 0 0; }
.r-role-more summary { cursor: pointer; color: var(--link); margin: 0 0 8px; }
