/* Ready for the Road. Road-sign motifs: highway-green guide-sign cards with an inset border, road-sign yellow
 * buttons with dark text, diamond markers, lane-line dividers. Headings in Overpass (OFL), body in Atkinson
 * Hyperlegible Next (OFL), both self-hosted. Mobile first. Light by default; dark with the header button (theme.js). */
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url(/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url(/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Overpass'; src: url(/fonts/overpass-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Overpass'; src: url(/fonts/overpass-latin-800-normal.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --asphalt: #22262b;
  --yellow: #f2c230;
  --yellow-2: #e0ad12;
  --green: #1b6b47;
  --green-ink: #175c3d;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #eeebe3;
  --ink: #22262b;
  --ink-2: #4b5058;
  --line: #d9d4c8;
  --link: #1b6b47;
  --ok: #1b6b47;
  --ok-bg: #e3f1e9;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --hero: #1b6b47;
  --hero-ink: #ffffff;
  --focus: #1b6b47;
  --shadow: 0 1px 0 rgba(34, 38, 43, .08), 0 6px 18px -10px rgba(34, 38, 43, .25);
  --head: 'Overpass', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  --tabh: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #16191d;
  --surface: #22262b;
  --surface-2: #2b3036;
  --ink: #eceae4;
  --ink-2: #b4b8be;
  --line: #3a4047;
  --link: #6fd3a0;
  --ok: #6fd3a0;
  --ok-bg: #1d3a2c;
  --bad: #ff8a80;
  --bad-bg: #3f2422;
  --hero: #175c3d;
  --focus: #f2c230;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--body); min-height: 100vh; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--yellow); color: var(--asphalt); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--asphalt); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; min-width: 0; }
.mark { width: 36px; height: 36px; flex: none; }
.mark .dm { fill: var(--yellow); stroke: #111417; stroke-width: 2.2; stroke-linejoin: round; }
.mark .rd { fill: var(--asphalt); }
.mark .ln { stroke: var(--yellow); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 2.4 2.2; fill: none; }
.wm { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.wm small { font: 700 11px/1.1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: #c9ccd1; }
.wm b { font: 800 21px/1.05 var(--head); letter-spacing: -.01em; color: #fff; white-space: nowrap; }
.wm .desc { font: 400 11px/1.25 var(--body); color: #c9ccd1; margin-top: 3px; max-width: 30ch; white-space: normal; }
.topactions { display: flex; align-items: center; gap: 6px; flex: none; }
.langbtn, .themebtn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1.5px solid #4b525b; background: transparent; color: #fff; font: 700 15px/1 var(--body); padding: 0 12px; cursor: pointer; text-decoration: none; }
.themebtn { padding: 0; width: 44px; }
.themebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .sun { display: none; }
[data-theme="dark"] .themebtn .sun { display: block; }
[data-theme="dark"] .themebtn .moon { display: none; }
.langbtn:hover, .themebtn:hover { border-color: var(--yellow); }

/* ---------- notice ---------- */
.notice { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.noticebtn { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 760px; margin: 0 auto; min-height: 44px; padding: 6px 14px; border: 0; background: transparent; color: var(--ink-2); font: 400 14px/1.35 var(--body); text-align: left; cursor: pointer; }
.noticebtn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.noticebtn b { color: var(--ink); font-weight: 700; }
.nt { flex: 1; min-width: 0; }
.nt .full { display: none; }
.notice.open .nt .full { display: inline; }
.notice.open .nt .short { display: none; }
.nt .short { display: inline; }
@media (min-width: 760px) { .nt .full { display: inline; } .nt .short { display: none; } .noticebtn { cursor: default; } }
.preview { margin: 0; padding: 8px 14px; background: var(--yellow); color: var(--asphalt); font-weight: 700; font-size: 14px; text-align: center; }

/* ---------- layout and tabs ---------- */
.shell { max-width: 760px; margin: 0 auto; }
main { padding: 18px 16px 24px; outline: none; }
.loading { padding: 40px 0; color: var(--ink-2); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabh); color: var(--ink-2); text-decoration: none; font: 700 13px/1.1 var(--body); position: relative; }
.tabs a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 4px; border-radius: 0 0 4px 4px; background: var(--yellow); }
@media (min-width: 760px) {
  .tabs { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px; padding: 0 12px; background: var(--bg); }
  .tabs a { flex-direction: row; gap: 8px; min-height: 52px; padding: 0 14px; font-size: 15px; }
  .tabs svg { width: 20px; height: 20px; }
  .tabs a[aria-current="page"]::before { top: auto; bottom: 0; left: 10px; right: 10px; border-radius: 4px 4px 0 0; }
  main { padding: 28px 24px 40px; }
  .top { padding: 10px 24px; }
}

/* ---------- type ---------- */
.title { font-size: 30px; margin: 4px 0 14px; }
@media (min-width: 760px) { .title { font-size: 38px; } }
.kicker { display: flex; align-items: center; gap: 8px; font: 700 13px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.lead { font-size: 18px; color: var(--ink-2); }
.meta { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }
.meta.center { text-align: center; }
.def { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.muted { color: var(--ink-2); }
.warn { background: var(--bad-bg); color: var(--ink); border-left: 4px solid var(--bad); padding: 10px 12px; border-radius: 8px; }
.h-sec { font-size: 20px; margin: 30px 0 12px; padding-bottom: 10px; background: linear-gradient(90deg, var(--yellow) 0 18px, transparent 18px 28px) 0 100% / 28px 3px repeat-x; }
.rdy { font-style: normal; font-weight: 700; color: var(--ok); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- cards: sign-like, rounded, with an inset border ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card.hero { background: var(--hero); color: var(--hero-ink); border-color: transparent; padding: 22px 20px 20px; }
.card.hero::before { content: ''; position: absolute; inset: 5px; border: 2px solid rgba(255, 255, 255, .85); border-radius: calc(var(--r) - 5px); pointer-events: none; }
.card.hero .kicker, .card.hero .meta, .card.hero .cd { color: rgba(255, 255, 255, .88); }
.card.hero .ct { color: #fff; }
.card.hero .btn2 { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.card.hero .strip .cell { background: rgba(255, 255, 255, .25); }
.card.hero .strip .cell.ok, .card.hero .strip .cell.done { background: var(--yellow); }
.card.hero .stats div { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.card.hero .stats dt { color: rgba(255, 255, 255, .85); }
.card.hero .stats dd { color: #fff; }
.card.quiet { box-shadow: none; background: transparent; }
.ct { font-size: 22px; margin: 0 0 6px; }
.cd { color: var(--ink-2); }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card.empty { text-align: center; }
.card.empty .road { margin: 0 0 14px; }

/* ---------- buttons ---------- */
.btn, .btn2 { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin: 12px 0 0; padding: 10px 18px; border-radius: 12px; font: 700 17px/1.2 var(--body); text-decoration: none; text-align: center; cursor: pointer; }
.btn { background: var(--yellow); color: var(--asphalt); border: 0; box-shadow: inset 0 -3px 0 var(--yellow-2); }
.btn:hover { filter: brightness(1.04); }
.btn[aria-disabled="true"] { opacity: .55; }
.btn2 { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn2:hover { border-color: var(--ink-2); }
.btn2:disabled { opacity: .45; cursor: default; }
.btn2.danger { color: var(--bad); border-color: currentColor; }
.btn.danger { background: var(--bad); color: #fff; box-shadow: none; }
.actions { margin: 16px 0 0; }
.actions.wrap { display: grid; grid-template-columns: 1fr; gap: 8px; }
.actions.wrap .btn2 { margin: 0; }
@media (min-width: 560px) { .actions.wrap { grid-template-columns: 1fr 1fr; } }
.ghost { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); border-radius: 10px; cursor: pointer; }
.ghost:hover { background: var(--surface-2); }
.tlink { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin: 6px 0; padding: 4px 2px; font-weight: 700; color: var(--link); text-decoration: none; }
.tlink .chev { flex: none; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- icons ---------- */
.ico, .ico-s { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico { width: 24px; height: 24px; }
.ico-s { width: 20px; height: 20px; }
.chev { color: var(--ink-2); }
.ext { width: 16px; height: 16px; vertical-align: -2px; margin-left: 4px; }

/* ---------- diamonds (one per chapter) and the road ---------- */
.dia { width: 26px; height: 26px; flex: none; }
.dia path { stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; fill: var(--surface-2); }
.dia.on path { fill: var(--yellow); }
.dia.k { width: 16px; height: 16px; }
.dia.k path { fill: var(--yellow); stroke: currentColor; }
.dias { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.road { display: block; width: 100%; height: 56px; margin: 26px 0 0; }
.road .asph { fill: var(--asphalt); }
.road .edge { stroke: #fff; stroke-width: 2; fill: none; opacity: .8; }
.road .lane { stroke: var(--yellow); stroke-width: 3; stroke-dasharray: 18 14; fill: none; }
[data-theme="dark"] .road .asph { fill: #0e1013; }
.streak b { color: var(--ink); }
.factsline { margin: 8px 0 0; }

/* ---------- strips (score cells) ---------- */
.strip { display: flex; gap: 3px; margin: 14px 0 0; align-items: center; }
.strip .cell { flex: 1; height: 10px; border-radius: 3px; background: var(--surface-2); min-width: 4px; }
.strip .cell.ok, .strip .cell.done { background: var(--ok); }
.strip .passmark { width: 3px; height: 18px; border-radius: 2px; background: var(--ink); flex: none; margin: 0 2px; }

/* ---------- lists and rows ---------- */
.list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.row, .chapter, .list .li { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.row:hover, .chapter:hover { border-color: var(--ink-2); }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rowtitle { font-weight: 700; }
.rowsub, .txt > span { font-size: 15px; color: var(--ink-2); }
.tile { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.tile.ok { background: var(--ok-bg); color: var(--ok); }
.tile.no { background: var(--bad-bg); color: var(--bad); }
/* chapter numbers sit in a yellow diamond, like a warning sign */
.tile.chn { background: transparent; position: relative; }
.tile.chn::before { content: ''; position: absolute; inset: 6px; transform: rotate(45deg); background: var(--yellow); border: 2px solid var(--asphalt); border-radius: 4px; }
.tile.chn span { position: relative; font: 800 16px/1 var(--head); color: var(--asphalt); }
.mbar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.mbar i { display: block; height: 100%; width: 0; background: var(--ink-2); border-radius: 3px; }
.mbar.done i { background: var(--ok); }

/* ---------- study ---------- */
.crumb { margin: 0 0 6px; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 20px; }
.toc summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; font-weight: 700; cursor: pointer; }
.toc ul { margin: 0; padding: 0 14px 12px 34px; }
.toc li a { display: inline-block; padding: 8px 0; min-height: 44px; }
.notes section { padding: 0 0 6px; margin: 0 0 18px; scroll-margin-top: 70px; }
.notes section + section { padding-top: 20px; background: linear-gradient(90deg, var(--line) 0 16px, transparent 16px 26px) 0 0 / 26px 2px repeat-x; }
.notes h2 { font-size: 22px; }
.secsrc a, .source a { display: inline-flex; align-items: center; min-height: 44px; }
.source { font-size: 14px; color: var(--ink-2); margin-top: 18px; }
.nextch { margin-top: 18px; }
.signgrid { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.signgrid li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 14px; }
.signgrid img { width: 88px; height: 88px; object-fit: contain; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; text-align: center; background: var(--surface); display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats dt { font-size: 13px; color: var(--ink-2); line-height: 1.25; }
.stats dd { margin: 0; font: 800 26px/1.1 var(--head); font-variant-numeric: tabular-nums; }
main > .stats { margin-bottom: 16px; }

/* ---------- details ---------- */
details.more { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
details.more > summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; font-weight: 700; cursor: pointer; }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
.rules { margin: 10px 0; padding: 0 14px 0 34px; }
.rules li { margin: 0 0 6px; }
details.more > .review { padding: 12px; }

/* ---------- question screens (focus mode) ---------- */
body.focus-mode .top, body.focus-mode .notice, body.focus-mode .tabs, body.focus-mode .foot, body.focus-mode .preview { display: none; }
body.focus-mode main { padding-top: 8px; padding-bottom: 170px; }
.qtop { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.qcount { margin: 0; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.pbar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 18px; }
.pbar i { display: block; height: 100%; width: 0; background: var(--yellow); }
.chip { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); letter-spacing: .04em; text-transform: none; font-size: 13px; }
.signfig { margin: 8px 0 14px; display: flex; justify-content: center; }
.signfig img { width: 140px; height: 140px; object-fit: contain; }
.signfig.small { justify-content: flex-start; margin: 0 0 8px; }
.signfig.small img { width: 72px; height: 72px; }
.question { font: 800 22px/1.3 var(--head); margin: 6px 0 8px; letter-spacing: 0; }
@media (min-width: 760px) { .question { font-size: 26px; } }
.hint { font-size: 14px; color: var(--ink-2); }
.options { display: grid; gap: 10px; margin: 10px 0 0; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 400 17px/1.35 var(--body); text-align: left; cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--ink-2); }
.opt .letter { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font: 800 15px/1 var(--head); }
.opt .ot { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt .tag { font-size: 13px; font-weight: 700; }
.opt.sel { border-color: var(--asphalt); background: #fff7d6; box-shadow: inset 0 0 0 1px var(--asphalt); }
.opt.sel .letter { background: var(--yellow); color: var(--asphalt); }
[data-theme="dark"] .opt.sel { border-color: var(--yellow); background: #3a331a; box-shadow: inset 0 0 0 1px var(--yellow); }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.ok .letter { background: var(--ok); color: #fff; }
[data-theme="dark"] .opt.ok .letter { color: #10241a; }
.opt.no { border-color: var(--bad); background: var(--bad-bg); }
.opt.no .letter { background: var(--bad); color: #fff; }
[data-theme="dark"] .opt.no .letter { color: #2a1110; }
.opt.dim { opacity: .65; }
.opt[disabled] { cursor: default; }
.opt.ok .tag { color: var(--ok); }
.opt.no .tag { color: var(--bad); }
.verdict { margin: 18px 0 0; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); border-left: 6px solid var(--ok); }
.verdict.bad { border-left-color: var(--bad); }
.verdict h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.verdict.ok h2 { color: var(--ok); }
.verdict.bad h2 { color: var(--bad); }
.ref { margin: 10px 0 0; font-size: 15px; }
.ref a.src { display: inline; line-height: 1.6; }
.reflinks { margin: 4px 0 0; }
.reflinks a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--bg); border-top: 1px solid var(--line); padding: 10px 16px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.dock > .btn, .dockrow { max-width: 728px; margin: 0 auto; }
.dock > .btn { margin-top: 0; }
.dockrow { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.dockrow .btn, .dockrow .btn2 { margin: 0; }
.docknote { max-width: 728px; margin: 6px auto 0; font-size: 12px; color: var(--ink-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qmap { margin-top: 20px; }
.qmaph { font: 700 15px/1.2 var(--body); color: var(--ink-2); margin: 14px 0 8px; }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (min-width: 480px) { .qgrid { grid-template-columns: repeat(10, 1fr); } }
.qgrid .cell { min-height: 44px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 15px/1 var(--body); cursor: pointer; position: relative; }
.qgrid .cell.done { background: var(--surface-2); border-color: var(--ink-2); }
.qgrid .cell.cur { border-color: var(--asphalt); box-shadow: inset 0 0 0 2px var(--yellow); }
[data-theme="dark"] .qgrid .cell.cur { border-color: var(--yellow); }

/* ---------- bottom sheet ---------- */
.sheetwrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(10, 12, 14, .5); }
.sheet { position: relative; width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; }
@media (min-width: 760px) { .sheetwrap { align-items: center; } .sheet { border-radius: 18px; } }

/* ---------- results ---------- */
.result { margin: 0 0 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; }
.result-k.ok { color: var(--ok); }
.result-k.bad { color: var(--bad); }
.parts { display: grid; gap: 12px; margin: 16px 0 0; }
@media (min-width: 640px) { .parts { grid-template-columns: 1fr 1fr; } }
.part { margin: 0; border-top: 6px solid var(--ok); }
.part.bad { border-top-color: var(--bad); }
.pscore { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 0; }
.pscore .score { font: 800 34px/1 var(--head); }
.pscore .tag { font-weight: 700; font-size: 15px; }
.part.ok .pscore .tag { color: var(--ok); }
.part.bad .pscore .tag { color: var(--bad); }
.title.score { font-variant-numeric: tabular-nums; }
.review { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.review li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; border-left: 5px solid var(--ok); }
.review li.bad { border-left-color: var(--bad); }
.rhead { display: flex; gap: 12px; align-items: flex-start; }
.rq { font-weight: 700; margin: 0; }
.rmeta { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.ra, .rc { margin: 10px 0 0; font-size: 15px; }
.rc { font-weight: 700; color: var(--ok); }
.rx { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }
.history .txt b { font-weight: 700; }
.note { margin-top: 18px; }
.confirm { margin-top: 12px; padding: 14px; border: 1.5px solid var(--bad); border-radius: 12px; background: var(--bad-bg); }
#codeBox textarea { width: 100%; margin-top: 12px; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 14px/1.4 ui-monospace, monospace; }

/* ---------- about, footer ---------- */
.links { list-style: none; padding: 0; margin: 0 0 16px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.notefull { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--yellow); border-radius: 10px; padding: 12px 14px; }
.foot { max-width: 760px; margin: 0 auto; padding: 0 16px calc(var(--tabh) + 20px); font-size: 14px; color: var(--ink-2); }
@media (min-width: 760px) { .foot { padding-bottom: 30px; } }
.foot .fdesc { margin: 0 0 4px; }
.foot .fnote, .legalnote { margin: 0 0 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.flinks { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; }
.lfi { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.lfi a { display: inline-flex; align-items: center; min-height: 44px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--asphalt); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 60; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } html { scroll-behavior: auto; } }
.noscript { padding: 20px 0; }

/* ---------- legal pages (dev/build-legal.js) ---------- */
.legalpage .top .brand { min-height: 44px; }
.legalbrand { display: flex; flex-direction: column; font: 800 20px/1.1 var(--head); }
.legaldesc { font: 400 12px/1.3 var(--body); color: #c9ccd1; }
main.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
main.legal h1 { font-size: 30px; }
main.legal h2 { font-size: 21px; margin-top: 28px; }
.tablewrap { overflow-x: auto; margin: 0 0 16px; }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: 15px; }
.tablewrap th, .tablewrap td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legalnav { margin-top: 30px; }
.legalnav a { display: inline-flex; align-items: center; min-height: 44px; }
