/* CCRN Prep — styles. Light/dark via tokens. */
:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --ink: #12202a;
  --ink-2: #3f515d;
  --muted: #687a86;
  --line: #dbe3e8;
  --brand: #0e5a73;
  --brand-ink: #ffffff;
  --brand-soft: #e1eff4;
  --accent: #c2410c;
  --good: #15803d;
  --good-soft: #e5f4ea;
  --bad: #b42318;
  --bad-soft: #fbe9e7;
  --warn: #a15c00;
  --warn-soft: #fdf1dc;
  --focus: #2b7fff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 42, .06), 0 2px 10px rgba(16, 32, 42, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tabbar-h: 62px;
  --top-h: 52px;
  --maxw: 760px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1419; --surface: #121e25; --surface-2: #192932; --ink: #e7eef2; --ink-2: #b8c7cf; --muted: #8aa0ac;
    --line: #23363f; --brand: #5cb8d6; --brand-ink: #062631; --brand-soft: #143542; --accent: #fb923c;
    --good: #4ade80; --good-soft: #10301d; --bad: #f87171; --bad-soft: #3a1414; --warn: #fbbf24; --warn-soft: #3a2a08;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1419; --surface: #121e25; --surface-2: #192932; --ink: #e7eef2; --ink-2: #b8c7cf; --muted: #8aa0ac;
  --line: #23363f; --brand: #5cb8d6; --brand-ink: #062631; --brand-soft: #143542; --accent: #fb923c;
  --good: #4ade80; --good-soft: #10301d; --bad: #f87171; --bad-soft: #3a1414; --warn: #fbbf24; --warn-soft: #3a2a08;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ----- shell ----- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; margin: 0; font-size: 17px; font-weight: 650; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right, .icon-btn { min-width: 40px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; border: 0; background: none; color: var(--brand); border-radius: 10px; cursor: pointer; text-decoration: none; }
#backBtn[hidden] + .topbar-title { margin-left: 48px; }
.topbar-right { display: flex; justify-content: flex-end; }

.view { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); outline: none; }
body.no-tabs .view { padding-bottom: 24px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 550; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--brand); }

@media (min-width: 900px) {
  .tabbar { top: 0; bottom: 0; right: auto; width: 92px; height: auto; flex-direction: column; justify-content: flex-start; padding: 80px 0 0; border-top: 0; border-right: 1px solid var(--line); gap: 6px; }
  .tabbar a { flex: 0 0 64px; font-size: 12px; }
  .shell { padding-left: 92px; }
  body.no-tabs .shell { padding-left: 0; }
  .view { padding-bottom: 40px; }
  .topbar { padding-left: 16px; }
}

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 15px; transition: .25s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.no-tabs .toast { bottom: 90px; }

/* ----- common ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.center { text-align: center; }
.card.warn { background: var(--warn-soft); border-color: transparent; }
.card summary { cursor: pointer; font-weight: 600; }
.lead { color: var(--ink-2); margin: 4px 0 14px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 650; color: var(--muted); }
.section-h { scroll-margin-top: calc(var(--top-h) + env(safe-area-inset-top) + 12px); margin: 26px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.center { justify-content: center; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; font-size: .85em; background: var(--surface-2); }
.link { border: 0; background: none; color: var(--brand); padding: 0; cursor: pointer; font-weight: 600; font-size: 14px; }
.link-more { display: block; margin: 6px 2px; font-weight: 600; text-decoration: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 16px; text-decoration: none; cursor: pointer; transition: transform .05s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.big { width: 100%; min-height: 54px; font-size: 18px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.file { cursor: pointer; }

/* ----- home ----- */
.hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; }
:root[data-theme="dark"] .hero, :root:not([data-theme="light"]) .hero { }
.hero .eyebrow, .hero .muted { color: rgba(255,255,255,.8); }
.hero-text { flex: 1; min-width: 0; }
.hero-count { margin: 4px 0 6px; font-size: 24px; line-height: 1.2; font-weight: 600; }
.hero-count b { font-size: 34px; }
.hero .muted { font-size: 13px; margin: 0; }
.ring { --p: 0; flex: 0 0 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.ring > div { width: 74px; height: 74px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 82%, #000); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-size: 21px; line-height: 1; }
.ring span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; margin-top: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(135deg, #0f4a5e, #0a2c39); } :root:not([data-theme="light"]) .ring > div { background: #0c3443; } }
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #0f4a5e, #0a2c39); }
:root[data-theme="dark"] .ring > div { background: #0c3443; }

.install { background: var(--brand-soft); border: 0; font-size: 15px; }
.resume { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border-left: 4px solid var(--accent); }
.resume span { color: var(--muted); font-size: 14px; }
.resume-box p { margin: 4px 0 10px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.quick b { font-size: 16px; }
.quick small { color: var(--muted); font-size: 13px; }
.qi { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 6px; background: var(--brand-soft); position: relative; }
.qi::after { content: ""; position: absolute; inset: 8px; background: var(--brand); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.qi-practice { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11l2 2 4-4M5 4h14v16H5z' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qi-exam { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='13' r='8' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='M12 9v4l3 2M9 2h6' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.qi-audio { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2M4 14h3v6H5a1 1 0 0 1-1-1zM20 14h-3v6h2a1 1 0 0 0 1-1z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.qi-guide { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2zM4 5v16M8 7h7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.plan-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.plan-day.today { border: 2px solid var(--brand); }
.plan-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.plan-date { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); white-space: nowrap; }
.plan-title { font-weight: 650; }
.plan-tasks { list-style: none; margin: 0; padding: 0; }
.plan-tasks li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 15px; }
.plan-tasks a { color: var(--ink); text-decoration: none; }
.plan-tasks a:hover { text-decoration: underline; }
.check { position: relative; flex: 0 0 22px; height: 22px; margin-top: 1px; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span { display: block; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); }
.check input:checked + span { background: var(--good); border-color: var(--good); }
.check input:checked + span::after { content: "✓"; display: block; color: #fff; font-size: 14px; line-height: 18px; text-align: center; font-weight: 800; }
.check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ----- forms ----- */
.form fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.form legend { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 8px; padding: 0; }
.form legend .link { text-transform: none; letter-spacing: 0; }
.sys-group { margin-bottom: 10px; }
.sys-group-h { display: flex; justify-content: space-between; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 0 2px 6px; }
.sys-group-h small { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; cursor: pointer; }
.chip span em { font-style: normal; font-size: 12px; color: var(--muted); }
.chip input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip input:checked + span em { color: inherit; opacity: .8; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label, .seg a { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span, .seg a { display: inline-block; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; text-decoration: none; color: var(--ink); }
.seg input:checked + span, .seg a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.seg.small span, .seg.small a { padding: 6px 10px; font-size: 14px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; font-size: 16px; }
.switch input { position: absolute; opacity: 0; }
.switch span { flex: 0 0 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { left: 21px; }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.range, .sel, .field { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; font-size: 15px; color: var(--ink-2); }
.range { flex-direction: row; align-items: center; flex-wrap: wrap; }
.range input { flex: 1; min-width: 140px; accent-color: var(--brand); }
.sel select, .field input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }

/* ----- guide ----- */
.search input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; }
.chapters { list-style: none; padding: 0; margin: 12px 0; }
.chapter { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.ch-num { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 750; font-size: 14px; }
.ch-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-body small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.ch-body em { font-style: normal; font-size: 12px; color: var(--brand); font-weight: 600; margin-top: 2px; }
.ch-check { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.chapter.read .ch-check { background: var(--good); border-color: var(--good); }
.chapter.read .ch-check::after { content: "✓"; display: block; text-align: center; color: #fff; font-size: 13px; line-height: 18px; font-weight: 800; }
.results { list-style: none; padding: 0; }
.results a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.results small { display: block; color: var(--muted); font-size: 14px; }
mark { background: #fde68a; color: #111; border-radius: 3px; padding: 0 2px; }

.view.reading { max-width: 720px; }
.guide { font-size: 17px; line-height: 1.6; }
.guide h1 { font-size: 28px; line-height: 1.2; margin: 6px 0 6px; }
.guide .chapter-intro { color: var(--ink-2); font-size: 17px; margin: 0 0 12px; }
.guide h2 { font-size: 21px; margin: 30px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 14px); }
.guide h3 { font-size: 17px; margin: 18px 0 6px; color: var(--brand); }
.guide ul, .guide ol { padding-left: 1.3em; margin: 6px 0 12px; }
.guide li { margin: 3px 0; }
.guide p { margin: 8px 0; }
.guide table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 15px; display: block; overflow-x: auto; }
.guide th, .guide td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.guide th { background: var(--surface-2); font-weight: 650; }
.guide thead th { white-space: nowrap; }
.pearl, .alert, .tip, .new { border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 16px; }
.pearl { background: var(--brand-soft); }
.pearl::before { content: "Exam pearl"; display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); margin-bottom: 2px; }
.alert { background: var(--bad-soft); }
.alert::before { content: "Don't miss"; display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--bad); margin-bottom: 2px; }
.tip { background: var(--good-soft); }
.tip::before { content: "Test-taking tip"; display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--good); margin-bottom: 2px; }
.new { background: var(--warn-soft); }
.new::before { content: "New on the Nov 2025 test plan"; display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--warn); margin-bottom: 2px; }
.pearl > :first-child, .alert > :first-child, .tip > :first-child, .new > :first-child { margin-top: 0; }
.pearl > :last-child, .alert > :last-child, .tip > :last-child, .new > :last-child { margin-bottom: 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 12px 0; }
.toc summary { cursor: pointer; font-weight: 650; color: var(--brand); }
.toc ol { margin: 8px 0 0; }
.toc a { text-decoration: none; }
.guide-actions { display: flex; flex-direction: column; gap: 10px; margin: 28px 0 12px; }
.pager { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 15px; }
.pager a { text-decoration: none; }

/* ----- questions ----- */
.progressbar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progressbar span { display: block; height: 100%; background: var(--brand); }
.run-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin: 10px 2px; font-variant-numeric: tabular-nums; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.qcard.compact { padding: 14px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tag { font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.tag.soft { background: var(--surface-2); color: var(--ink-2); }
.star { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--line); cursor: pointer; padding: 0 4px; line-height: 1; }
.star.on { color: #f59e0b; }
.stem p { margin: 0 0 10px; }
.stem .ask { font-weight: 600; margin-top: 10px; }
.vitals { border-collapse: collapse; margin: 6px 0 10px; font-variant-numeric: tabular-nums; font-size: 16px; }
.vitals th { text-align: left; padding: 2px 16px 2px 0; color: var(--ink-2); font-weight: 650; }
.vitals td { padding: 2px 0; }
.options { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1.4; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt-let { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 750; font-size: 14px; }
.opt-txt { flex: 1; padding-top: 1px; }
.opt.chosen { border-color: var(--brand); background: var(--brand-soft); }
.opt.chosen .opt-let { background: var(--brand); color: var(--brand-ink); }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.correct .opt-let { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .opt-let { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; color: var(--ink); opacity: 1; }
.options.revealed .opt:not(.correct):not(.wrong) { opacity: .7; }
.rationale { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 16px; }
.rationale.ok { border-left: 4px solid var(--good); }
.rationale.no { border-left: 4px solid var(--bad); }
.rationale .verdict { margin: 0 0 6px; font-weight: 700; }
.rationale p { margin: 6px 0; }
.guide-link { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.run-actions { display: flex; gap: 10px; margin-top: 14px; }
.run-actions .btn.big { flex: 1; }
.big-num { font-size: 44px; margin: 6px 0; font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.bar-label small { color: var(--muted); }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; }
.bar .good { background: var(--good); }
.bar .ok { background: var(--warn); }
.bar .low { background: var(--bad); }
.group-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.group-h { font-weight: 650; margin-bottom: 6px; }
.group-h small { color: var(--muted); font-weight: 500; }
.history { list-style: none; padding: 0; margin: 0; }
.history a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.history b { font-size: 20px; min-width: 56px; font-variant-numeric: tabular-nums; }
.history span { color: var(--muted); font-size: 14px; }

/* ----- exam setup / results ----- */
.exam-kinds { display: flex; flex-direction: column; gap: 10px; }
.exam-kind { text-align: left; padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.exam-kind b { font-size: 18px; }
.exam-kind span { color: var(--muted); font-size: 15px; }
.exam-kind.featured { border-color: var(--brand); background: var(--brand-soft); }
.exam-kind[disabled] { opacity: .5; cursor: not-allowed; }
.tips ul { margin: 8px 0 0; padding-left: 1.2em; font-size: 15px; }
.tips li { margin: 6px 0; }
.result-hero { text-align: center; border-top: 6px solid var(--muted); }
.result-hero.pass { border-top-color: var(--good); }
.result-hero.fail { border-top-color: var(--bad); }
.verdict-line { font-weight: 600; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rev-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rev-item summary { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.rev-item summary::-webkit-details-marker { display: none; }
.rev-n { flex: 0 0 34px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rev-s { flex: 1; font-size: 14px; color: var(--ink-2); }
.rev-mark { font-weight: 800; }
.rev-item.ok .rev-mark { color: var(--good); }
.rev-item.no .rev-mark { color: var(--bad); }
.rev-item .qcard { border: 0; box-shadow: none; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

/* ----- exam run (testing-center style) ----- */
.view.exam-view { max-width: none; padding: 0; }
.exam-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: #1f3b4d; color: #fff; }
.exam-brand { font-weight: 650; font-size: 15px; }
.exam-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.exam-clock span { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.exam-clock b { font-size: 20px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.exam-clock.warn b { color: #fcd34d; }
.exam-clock.urgent b { color: #fca5a5; }
.exam-sub { display: flex; justify-content: space-between; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.exam-body { max-width: 860px; margin: 0 auto; padding: 20px 16px 120px; }
.exam-options .opt { border-radius: 6px; border-width: 1px; }
.exam-options .radio { flex: 0 0 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--muted); background: var(--surface); }
.exam-options .opt.chosen .radio { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--surface); background: var(--brand); }
.exam-options .opt-let { background: none; flex: 0 0 auto; font-weight: 650; height: auto; display: inline; }
.exam-options .opt.chosen .opt-let { background: none; color: inherit; }
.exam-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 8px; justify-content: space-between;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.xbtn { flex: 1; min-height: 46px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 650; font-size: 15px; cursor: pointer; color: var(--ink); max-width: 200px; }
.xbtn.primary { background: #1f3b4d; color: #fff; border-color: #1f3b4d; }
.xbtn.flag.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.xbtn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.xbtn[disabled] { opacity: .45; cursor: not-allowed; }
@media (min-width: 900px) { .exam-foot { justify-content: center; } .exam-body { font-size: 18px; } }
.review-h { margin: 0 0 4px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin: 14px 0; }
.rg { position: relative; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--ink); }
.rg.ans { background: var(--brand-soft); border-color: transparent; }
.rg.un { background: var(--surface); border: 1.5px dashed var(--muted); }
.rg.fl::after { content: "⚑"; position: absolute; top: -2px; right: 3px; font-size: 13px; color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.legend .rg { display: inline-grid; place-items: center; width: 30px; height: 26px; font-size: 12px; cursor: default; }

/* Realistic exam look: force a plain light palette */
body.exam-real { --bg: #ffffff; --surface: #ffffff; --surface-2: #f1f4f6; --ink: #111111; --ink-2: #333; --muted: #6b7280; --line: #cfd6db;
  --brand: #1f5f8b; --brand-ink: #fff; --brand-soft: #e6f0f7; --warn: #a15c00; --warn-soft: #fff4dc; --bad: #b42318; --bad-soft: #fde8e6; color-scheme: light; background: #fff; color: #111; }
body.exam-real .exam-body { font-family: Arial, Helvetica, sans-serif; }

/* ----- audio ----- */
.audio-status { margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; font-weight: 650; background: var(--surface-2); min-height: 48px; }
.audio-status.listening { background: var(--brand-soft); color: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.audio-status.right { background: var(--good-soft); color: var(--good); }
.audio-status.wrong { background: var(--bad-soft); color: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .audio-status.listening { animation: none; } }
.audio-dock { position: sticky; bottom: 0; z-index: 5; margin: 14px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.big-letters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 10px; }
.bigL { height: 72px; border-radius: 16px; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 30px; font-weight: 800; cursor: pointer; }
.bigL:active { transform: scale(.97); }
.audio-ctrl { display: flex; flex-wrap: wrap; gap: 8px; }
.audio-ctrl .btn { flex: 1; min-width: 92px; }
