/* Nova dev preview — Clear Road inspired, text-first. No network fonts. */
:root {
  --navy: #1b2f4b;
  --navy-dark: #122338;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --paper: #f4f6f8;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #475569;
  --line: #cbd5e1;
  --good: #166534;
  --bad: #991b1b;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
  font-size: 17px;
}
.sample-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  text-align: center;
  font-weight: 700;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}
.real-banner {
  background: #dcfce7;
  color: var(--good);
  text-align: center;
  font-weight: 700;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}
.review-banner {
  background: var(--navy-dark);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}
pre.fact {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
}
header.site {
  background: var(--navy);
  color: #fff;
}
header.site .wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
}
.brand { font-weight: 700; font-size: 1.1rem; }
nav.main { display: flex; flex-wrap: wrap; gap: 0.25rem; }
nav.main a {
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
nav.main a[aria-current="page"] { background: var(--teal); }
nav.main a[hidden] { display: none; } /* state-scoped links hide on the state picker */
nav.main a:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
main.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 1rem 0;
}
h1 { font-size: 1.6rem; margin: 0.4rem 0 0.8rem; color: var(--navy); }
h2 { font-size: 1.25rem; color: var(--navy); margin: 1.2rem 0 0.5rem; }
p.muted, .muted { color: var(--muted); }
button, .btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin: 0.25rem 0.25rem 0.25rem 0;
}
button:hover, .btn:hover { background: var(--teal-dark); }
button.secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
}
ol.choices, ul.choices { list-style: none; padding: 0; margin: 0.75rem 0; }
ol.choices li, ul.choices li { margin: 0.5rem 0; }
.option {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.option.picked-correct { border-color: var(--good); background: #f0fdf4; }
.option.picked-wrong { border-color: var(--bad); background: #fef2f2; }
.option.dim { opacity: 0.75; }
.result-good { color: var(--good); font-weight: 700; }
.result-bad { color: var(--bad); font-weight: 700; }
table.checks {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  margin: 0.75rem 0;
}
table.checks th, table.checks td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
table.checks th { background: var(--navy); color: #fff; }
.pass { color: var(--good); font-weight: 700; }
.fail { color: var(--bad); font-weight: 700; }
.hold { color: var(--warn-ink); font-weight: 700; }
footer.site {
  border-top: 2px solid var(--line);
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.9rem;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1rem; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; }
.totals-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.totals-strip .stat {
  background: var(--navy-dark);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}
.totals-strip .stat b { display: block; font-size: 1.15rem; }
code { font-size: 0.88em; word-break: break-all; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none; transition: none; }
}
/* Pre-generated narration (dev preview). */
button[data-slide-audio], button[data-card-audio], button[data-recap-audio] { margin-left: 0.25rem; }

/* ---- Study flow (2026-10-31): lesson video frame + module step bar ---- */
.lesson-player { background: var(--card, #fff); border: 1px solid var(--line, #cbd5e1); border-radius: var(--radius, 14px); overflow: hidden; margin: 12px 0 18px; }
.lesson-player .lp-stage { position: relative; background: #0b1220; aspect-ratio: 16 / 9; }
.lesson-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0b1220; }
.lesson-player .lp-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; justify-content: space-between; padding: 12px 14px 0; }
.lesson-player .lp-head .lp-title { font-weight: 700; margin: 0; font-size: 1.02rem; }
.lesson-player .lp-head .lp-meta { color: var(--muted, #475569); font-size: .9rem; }
.lesson-player .lp-bar { padding: 10px 14px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line, #cbd5e1); }
.lesson-player .lp-bar button { min-height: 40px; }
.lesson-player .lp-bar .lp-spacer { flex: 1; }
.lesson-player .lp-chapters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.lesson-player .lp-chapters button { font-size: .86rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line, #cbd5e1); background: var(--paper, #f4f6f8); color: var(--ink, #1e293b); cursor: pointer; min-height: 36px; }
.lesson-player .lp-chapters button[aria-current="true"] { background: var(--teal, #0f766e); border-color: var(--teal, #0f766e); color: #fff; }
.lesson-player .lp-progress { height: 4px; background: var(--line, #cbd5e1); position: relative; }
.lesson-player .lp-progress .lp-fill { height: 100%; width: 0; background: var(--teal, #0f766e); transition: width .15s linear; }
.lesson-player .lp-progress .lp-tick { position: absolute; top: -2px; width: 2px; height: 8px; background: var(--card, #fff); opacity: .9; }
.lesson-player .lp-done { padding: 10px 14px; background: #ecfdf5; color: var(--good, #166534); font-weight: 600; border-top: 1px solid #bbf7d0; }
.lesson-player select { min-height: 40px; border-radius: 8px; border: 1px solid var(--line, #cbd5e1); padding: 0 8px; font: inherit; }
.lp-follow-active { outline: 3px solid var(--teal, #0f766e); outline-offset: 2px; border-radius: 10px; }

.step-bar { position: sticky; bottom: 0; z-index: 20; margin: 22px -4px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--card, #fff); border-top: 1px solid var(--line, #cbd5e1); box-shadow: 0 -6px 18px rgba(15, 23, 42, .08); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-bar .sb-steps { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 180px; }
.step-bar .sb-step { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted, #475569); padding: 4px 8px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; }
.step-bar .sb-step .sb-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--paper, #f4f6f8); border: 1px solid var(--line, #cbd5e1); color: var(--ink, #1e293b); }
.step-bar .sb-step[data-state="done"] .sb-dot { background: var(--good, #166534); border-color: var(--good, #166534); color: #fff; }
.step-bar .sb-step[data-state="current"] { border-color: var(--teal, #0f766e); color: var(--ink, #1e293b); font-weight: 600; }
.step-bar .sb-step[data-state="current"] .sb-dot { background: var(--teal, #0f766e); border-color: var(--teal, #0f766e); color: #fff; }
.step-bar .sb-sep { width: 18px; height: 1px; background: var(--line, #cbd5e1); }
.step-bar .sb-actions { display: flex; gap: 8px; align-items: center; }
.step-bar .btn, .step-bar button.btn { min-height: 44px; }
.step-bar .btn.secondary { background: var(--paper, #f4f6f8); color: var(--ink, #1e293b); border: 1px solid var(--line, #cbd5e1); }
.step-bar .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
@media (max-width: 640px) {
  .step-bar { gap: 8px; }
  .step-bar .sb-step span.sb-label { display: none; }
  .step-bar .sb-step[data-state="current"] span.sb-label { display: inline; }
  .step-bar .sb-actions { width: 100%; justify-content: space-between; }
  .step-bar .sb-actions .btn { flex: 1; text-align: center; }
  .lesson-player .lp-head .lp-meta { width: 100%; }
}

/* ---- Reading session (2026-10-31): book-style lesson pages ---- */
.reader { background: var(--card, #fff); border: 1px solid var(--line, #cbd5e1); border-radius: var(--radius, 14px); overflow: hidden; margin: 14px 0 18px; }
.reader .rd-progress { height: 4px; background: var(--line, #cbd5e1); }
.reader .rd-progress .rd-fill { height: 100%; width: 0; background: var(--teal, #0f766e); transition: width .2s ease; }
.reader .rd-page { padding: 22px 24px 8px; min-height: 42vh; font-size: 1.08rem; line-height: 1.65; }
.reader .rd-eyebrow { margin: 0 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #475569); font-weight: 700; }
.reader .rd-title { margin: 0 0 14px; font-size: 1.45rem; line-height: 1.25; }
.reader .rd-lines { margin: 0 0 14px; padding: 0 0 0 1.1em; }
.reader .rd-lines li { margin: 4px 0; font-weight: 600; }
.reader .rd-body p { margin: 0 0 12px; }
.reader .rd-prompt { font-weight: 600; font-size: 1.12rem; }
.reader .rd-answer { background: var(--paper, #f4f6f8); border-radius: 10px; padding: 12px 14px; }
.reader .rd-listen { margin: 6px 0 0; }
.reader .rd-listen button { min-height: 40px; }
.reader figure { margin: 14px 0 0; }
.reader .rd-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--line, #cbd5e1); background: var(--paper, #f4f6f8); }
.reader .rd-nav .btn { min-height: 46px; min-width: 136px; }
.reader .rd-nav .rd-status { color: var(--muted, #475569); font-size: .92rem; }
@media (max-width: 640px) {
  .reader .rd-page { padding: 18px 16px 6px; font-size: 1.04rem; min-height: 36vh; }
  .reader .rd-nav .btn { min-width: 0; flex: 1; }
  .reader .rd-nav .rd-status { order: -1; width: 100%; text-align: center; }
  .reader .rd-nav { flex-wrap: wrap; }
}

/* ---- Road signs module (hub, flashcards, sign test) ---- */
.sign-yield-icon { vertical-align: -4px; margin-right: 4px; flex-shrink: 0; }
.sign-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; margin-top: 12px; }
.sign-hub-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 12px 10px; border: 1px solid var(--line, #cbd5e1); border-radius: 12px; background: var(--card, #fff); color: var(--ink, #1e293b); text-decoration: none; }
.sign-hub-tile:hover { border-color: var(--teal, #0f766e); }
.sign-hub-img { width: 100%; height: 112px; display: grid; place-items: center; background: #fff; border-radius: 8px; }
.sign-hub-img img { max-width: 104px; max-height: 104px; width: auto; height: auto; object-fit: contain; }
.sign-hub-name { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.sign-hub-tile.is-text-sign { align-items: flex-start; text-align: left; background: var(--paper, #f8fafc); }
.sign-pic-coming { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.sign-hub-spec { font-size: .82rem; color: var(--muted, #475569); line-height: 1.35; }
.sign-hub-meaning { font-size: .82rem; color: var(--ink, #1e293b); line-height: 1.35; }
.sign-q-media { display: flex; justify-content: center; align-items: center; background: #fff; border: 1px solid var(--line, #cbd5e1); border-radius: 12px; padding: 12px; margin: 8px 0 10px; max-width: 240px; }
.sign-q-media img { max-width: 176px; max-height: 176px; width: auto; height: auto; object-fit: contain; display: block; }
.sign-text-box { background: var(--paper, #f8fafc); border: 1px dashed var(--line, #94a3b8); border-radius: 12px; padding: 14px; margin: 8px 0 10px; }
.sign-spec-line { margin: 8px 0 0; font-weight: 600; }
.card.is-target-sign { outline: 2px solid var(--teal, #0f766e); }
@media (max-width: 480px) {
  .sign-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sign-q-media { max-width: 100%; padding: 10px; }
  .sign-q-media img { max-width: 152px; max-height: 152px; }
}
