/* Next Level Academy — "Khan-clean, Philly-urban" theme.
   Clean white learning surfaces + color-coded subjects (Khan-style clarity),
   with night-city navy, electric yellow, poster type and sticker accents.
   Target WCAG 2.2 AA: every text/background pair is checked in
   test/accessibility.test.js. Fonts are self-hosted (SIL OFL). */

@font-face { font-family: "Bebas Neue"; src: url("/static/fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --ink: #101320; --ink-soft: #4a5163; --paper: #f4f5fa; --card: #ffffff; --line: #dfe2ec;
  --night: #121a33; --night-2: #1d2a55; --on-night: #ffffff; --on-night-soft: #c9cfe0;
  --accent: #ffd23f; --on-accent: #121a33;
  --brand: #1f4fe0; --brand-ink: #ffffff;
  --ok: #18794e; --bad: #b42318; --focus: #ffd23f;
  --track: #e4e7f0;
  --radius: 14px; --gap: 1.25rem;
  --display: "Bebas Neue", "Impact", "Arial Narrow Bold", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--body); font-size: 100%; line-height: 1.55; color: var(--ink); background: var(--paper);
}
/* Subject colors (white text/icons on them; also used as text on white) */
.mod-A { --mod: #c2185b; } .mod-B { --mod: #1f4fe0; } .mod-C { --mod: #18794e; }
.mod-D { --mod: #c2410c; } .mod-E { --mod: #7b2cbf; } .mod-F { --mod: #0f766e; } .mod-G { --mod: #0e7490; } .mod-H { --mod: #4338ca; } .mod-X { --mod: #4a5163; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eceef5; --ink-soft: #b8bdcc; --paper: #0d1222; --card: #171e33; --line: #2c3654;
    --brand: #8fb0ff; --brand-ink: #0d1222; --ok: #7fd49d; --bad: #ff9b92; --track: #2c3654;
  }
}
html.text-large { font-size: 125%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--brand); text-underline-offset: 3px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px #121a33; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); color: var(--ink); padding: .75rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ---------------------------------------------------------- */
.top { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; justify-content: space-between;
  padding: .75rem clamp(16px, 4vw, 40px); background: var(--night); color: var(--on-night);
  border-bottom: 4px solid var(--accent); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--on-night); }
.mark { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-family: var(--display); font-size: 1.35rem; letter-spacing: .04em;
  transform: rotate(-4deg); box-shadow: 3px 3px 0 #000; }
.wordmark { font-family: var(--display); font-size: 1.7rem; letter-spacing: .05em; line-height: 1; }
.wordmark span { color: var(--accent); }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; margin: 0; padding: 0; }
.nav a { color: var(--on-night); text-decoration: none; padding: .35rem .1rem; display: inline-block; min-height: 24px; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--on-night-soft); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.session { display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; color: var(--on-night-soft); font-size: .9rem; }
.top button.link { color: var(--on-night); }
.inline { display: inline; margin: 0; }

/* ---- layout & type ---------------------------------------------------- */
main { max-width: 1140px; margin: 0 auto; padding: 1.5rem clamp(16px, 4vw, 40px) 3rem; }
main:focus { outline: none; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: .03em; line-height: 1.02; margin: .3rem 0 .8rem; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .6rem; }
h3 { font-size: 1.08rem; font-weight: 700; margin: 0 0 .3rem; }
h4 { margin: 1rem 0 .4rem; }
.section-title { font-family: var(--display); font-weight: 400; font-size: 1.9rem; letter-spacing: .04em; margin: 0 0 .8rem; }
.eyebrow { font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--ink-soft); }
.muted, .hint { color: var(--ink-soft); }
.small { font-size: .88rem; }
.hint { font-size: .9rem; margin: -.35rem 0 .5rem; }
.crumb { margin: 0 0 .75rem; }

.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.span2 { grid-column: 1 / -1; overflow-x: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgba(16,19,32,.06); }
.narrow { max-width: 30rem; margin-inline: auto; }
.cards { list-style: none; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
ul.plain { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .55rem; }
ul.plain li { display: grid; gap: .1rem; }

/* ---- hero banner (night city) ----------------------------------------- */
.hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; justify-content: space-between;
  padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: 18px; margin-bottom: 1.75rem; color: var(--on-night);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(194,24,91,.55), transparent 60%),
    radial-gradient(50% 90% at 0% 100%, rgba(31,79,224,.55), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 10px, transparent 10px 22px),
    var(--night); }
.hero .eyebrow { color: var(--accent); }
.hero h1 { color: var(--on-night); margin-bottom: .4rem; }
.hero-sub { color: var(--on-night-soft); margin: 0 0 1rem; max-width: 40ch; }
.hero-sub strong { color: var(--on-night); }
.hero-slim { align-items: center; }
.hero-slim .hero-sub { margin: 0; }
.hero-stats { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; align-items: stretch; }
.stats-title { flex-basis: 100%; margin: 0; color: var(--on-night-soft); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.stat { margin: 0; min-width: 6.5rem; padding: .7rem .9rem; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); display: grid; }
.stat-num { font-family: var(--display); font-size: 2.3rem; line-height: 1; color: var(--accent); }
.stat-label { font-size: .8rem; font-weight: 700; color: var(--on-night-soft); text-transform: uppercase; letter-spacing: .08em; }

/* ---- dashboard -------------------------------------------------------- */
.dash { display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.dash-side { display: grid; gap: var(--gap); }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }

.course-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.course-card { display: flex; gap: 1rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-top: 6px solid var(--mod); border-radius: var(--radius); padding: 1.1rem 1.15rem; box-shadow: 0 1px 2px rgba(16,19,32,.06);
  transition: transform .15s ease, box-shadow .15s ease; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,19,32,.12); }
.course-body { min-width: 0; flex: 1; }
.course-module { margin: 0 0 .15rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mod); }
.course-card h3 a { color: var(--ink); text-decoration: none; }
.course-card h3 a:hover { text-decoration: underline; }
.next { margin: .4rem 0 0; font-size: .92rem; color: var(--ink-soft); }
.mod-icon { flex: none; display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 12px;
  background: var(--mod); color: #fff; box-shadow: 3px 3px 0 var(--night); transform: rotate(-3deg); }
.badge { display: inline-block; margin: .45rem 0 0; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; }
.badge-done { background: var(--accent); color: var(--on-accent); }
ul.plain .badge { margin: 0 .3rem 0 0; justify-self: start; }

/* ---- progress ---------------------------------------------------------- */
.progress-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; font-size: .9rem; font-weight: 600; }
progress { -webkit-appearance: none; appearance: none; width: min(100%, 16rem); height: .7rem; border: 0; border-radius: 999px; background: var(--track); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--mod, var(--ok)); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--mod, var(--ok)); border-radius: 999px; }
.done { color: var(--ok); font-weight: 700; }

/* ---- course page: learning path ---------------------------------------- */
.course-hero { display: flex; gap: 1.1rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-left: 8px solid var(--mod); border-radius: 18px; padding: 1.4rem 1.5rem; margin-bottom: 1.5rem; }
.course-hero .eyebrow { color: var(--mod); }
.course-hero h1 { margin-top: .2rem; }
.course-hero .mod-icon { width: 3.4rem; height: 3.4rem; }
.path { list-style: none; margin: 0; padding: 0 0 0 .2rem; position: relative; }
.path::before { content: ""; position: absolute; left: 1.32rem; top: .8rem; bottom: .8rem; width: 4px; border-radius: 4px; background: var(--track); }
.step { position: relative; display: grid; grid-template-columns: 2.7rem 1fr; gap: 1rem; margin-bottom: 1rem; }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%;
  background: var(--card); border: 3px solid var(--line); font-weight: 800; color: var(--ink-soft); }
.step.is-done .step-dot { background: var(--mod); border-color: var(--mod); color: #fff; }
.step.is-next .step-dot { background: var(--accent); border-color: var(--night); color: var(--on-accent); box-shadow: 3px 3px 0 var(--night); }
.step.is-next .step-card { border-color: var(--night); box-shadow: 4px 4px 0 var(--accent); }
.step-kind { margin: 0 0 .25rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }

/* ---- catalog ------------------------------------------------------------ */
.subject { margin-bottom: 2rem; }
.subject-title { display: flex; align-items: center; gap: .8rem; font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: .04em; }
.subject-title .mod-icon { width: 2.4rem; height: 2.4rem; }

/* ---- sign-in ------------------------------------------------------------ */
.login-card { border-top: 6px solid var(--accent); box-shadow: 0 14px 50px rgba(16,19,32,.18); }
.login-card .eyebrow { color: var(--ink-soft); }

/* ---- forms & buttons ---------------------------------------------------- */
label { display: block; font-weight: 700; margin: .8rem 0 .3rem; }
.check label { display: inline; font-weight: 400; margin: 0 0 0 .4rem; }
.check { margin: .35rem 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: .75rem 0; padding: .5rem .9rem .75rem; }
legend { font-weight: 700; padding: 0 .3rem; }
input:not([type="checkbox"]), select, textarea { width: 100%; font: inherit; padding: .65rem .75rem; border: 2px solid #6b7285;
  border-radius: 10px; background: var(--card); color: var(--ink); min-height: 44px; }
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; vertical-align: middle; accent-color: var(--brand); }
button, .btn { display: inline-block; font: inherit; font-weight: 800; margin-top: 1rem; padding: .7rem 1.2rem; min-height: 44px; border: 0;
  border-radius: 10px; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.08); }
.btn-accent, button.btn-accent { background: var(--accent); color: var(--on-accent); border: 2px solid var(--night); box-shadow: 4px 4px 0 var(--night); }
.btn-accent:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--night); filter: none; }
.hero .btn-accent { margin-top: 0; }
button.link { background: none; color: var(--brand); padding: .2rem; margin: 0; min-height: 24px; text-decoration: underline; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.alert { border-left: 5px solid var(--bad); padding: .6rem .9rem; background: var(--card); color: var(--bad); font-weight: 700; border-radius: 6px; }
.notice { border-left: 5px solid var(--ok); padding: .6rem .9rem; background: var(--card); color: var(--ok); font-weight: 700; border-radius: 6px; }
details { margin: .75rem 0; border-top: 1px solid var(--line); padding-top: .6rem; }
summary { cursor: pointer; font-weight: 700; min-height: 24px; }
.setup-key code { font-size: 1.3rem; letter-spacing: .08em; background: var(--paper); padding: .3rem .5rem; border-radius: 6px; display: inline-block; }
.stack label { font-size: .85rem; margin: .3rem 0 .15rem; }
.stack button { margin-top: .4rem; }
.foot { text-align: center; color: var(--ink-soft); font-size: .85rem; padding: 1rem 16px 2rem; }

/* ---- Philadelphia photo backgrounds (only when photos are installed) ----
   Text never sits directly on a photo: content is on a solid panel. */
body.has-bg { background-color: #0a1020; background-size: cover; background-position: center; background-attachment: fixed; min-height: 100vh; }
body.has-bg main { background: var(--paper); border-radius: 18px; margin-top: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
body.has-bg .foot { color: #f1efe8; }

@media (max-width: 640px) { body.has-bg { background-attachment: scroll; } body.has-bg main { margin: .75rem; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .course-card:hover, .btn-accent:hover { transform: none; } }

/* ---- sign-in landing (poster style) ------------------------------------
   Works over a photo (has-bg) or, with no photos installed, over the
   night-city gradient. Copy sits on a dark translucent panel so contrast
   holds whatever the photo looks like. */
body.signed-out { min-height: 100vh;
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(194,24,91,.45), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(31,79,224,.45), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 10px, transparent 10px 22px),
    #121a33; }
body.signed-out.has-bg { background-size: cover; background-position: center; }
body.signed-out main { max-width: 1180px; background: transparent; box-shadow: none; padding-top: clamp(1.5rem, 7vh, 5rem); }
body.signed-out .foot { color: #e7e9f2; }
.landing { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 400px); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 880px) { .landing { grid-template-columns: 1fr; } }
.landing-copy { color: #fff; padding: clamp(1.2rem, 3vw, 2rem); border-radius: 20px;
  background: rgba(10,14,28,.72); border: 1px solid rgba(255,255,255,.14); }
.landing-copy .eyebrow { color: var(--accent); }
.poster { font-family: var(--display); font-size: clamp(3.6rem, 10vw, 7.5rem); line-height: .88; letter-spacing: .02em; margin: .5rem 0 1rem; color: #fff;
  text-shadow: 4px 4px 0 rgba(0,0,0,.45); }
.poster span { display: block; }
.poster .hl { color: var(--accent); }
.landing-sub { font-size: 1.12rem; color: #e1e5f0; max-width: 46ch; margin: 0 0 1.4rem; }
.lanes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.lane { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem .35rem .35rem; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); font-weight: 700; font-size: .92rem; color: #fff; }
.lane .mod-icon { width: 2rem; height: 2rem; border-radius: 50%; box-shadow: none; transform: none; }
.lane .mod-icon svg { width: 18px; height: 18px; }
.login-card { padding: 1.6rem 1.6rem 1.2rem; transform: rotate(.6deg); box-shadow: 10px 10px 0 var(--accent), 0 20px 60px rgba(0,0,0,.45); border: 2px solid var(--night); border-top: 2px solid var(--night); }
.login-card h1 { font-size: 2.6rem; }
.btn-block { width: 100%; margin-top: 1.25rem; font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .login-card { transform: none; } }

/* ---- lesson page --------------------------------------------------------- */
.lead { font-size: 1.08rem; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 1.5rem; align-items: start; }
.lesson-main { display: grid; gap: var(--gap); }
.lesson-help { display: grid; gap: var(--gap); position: sticky; top: 1rem; }
.lesson-help .section-title { margin: 0; }
.lesson-help h3 { margin-bottom: .5rem; }
@media (max-width: 900px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-help { position: static; } }
.video-card { border-left: 6px solid var(--night); }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .5rem; }
.complete-form button { margin-top: 0; }

.hint-box { border: 2px dashed var(--line); border-radius: 10px; padding: .55rem .8rem; margin: .5rem 0; background: var(--paper); }
.hint-box[open] { border-style: solid; border-color: var(--accent); background: #fffbea; }
.hint-box summary { color: var(--ink); }
.hint-box p { margin: .5rem 0 .2rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hint-box[open] { background: #2a2610; } }

dl.terms { margin: 0; display: grid; gap: .55rem; }
dl.terms dt { font-weight: 800; }
dl.terms dd { margin: 0 0 .2rem; color: var(--ink-soft); font-size: .95rem; }

.ask textarea { resize: vertical; }
.ask button { margin-top: .6rem; }
ul.qa { margin-top: .5rem; }
ul.qa li { border-top: 1px solid var(--line); padding-top: .55rem; }
.qa .q, .question-item .q { margin: 0; font-weight: 700; }
.qa .a, .question-item .a { margin: .3rem 0 0; padding: .45rem .6rem; border-left: 4px solid var(--brand); background: var(--paper); border-radius: 0 8px 8px 0; }

/* ---- practice quiz ------------------------------------------------------- */
.quiz { border-top: 6px solid var(--mod, var(--brand)); }
.question { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem 1rem; margin: 1rem 0; }
.question legend { font-weight: 700; font-size: 1.02rem; padding: 0 .35rem; display: flex; gap: .55rem; align-items: baseline; }
.qnum { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--night); color: #fff; font-size: .85rem; }
.choice { display: flex; gap: .65rem; align-items: center; padding: .55rem .7rem; margin: .35rem 0; border: 2px solid var(--line); border-radius: 10px; min-height: 44px; }
.choice:hover { border-color: #9aa1b5; }
.choice:has(input:checked) { border-color: var(--brand); background: #eef2ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .choice:has(input:checked) { background: #1b2650; } }
.choice input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand); flex: none; }
.choice label { margin: 0; font-weight: 600; flex: 1; cursor: pointer; }
.results { border-top: 6px solid var(--ok); }
.results.is-retry { border-top-color: var(--accent); }
.results h2 { font-family: var(--display); font-weight: 400; font-size: 2rem; letter-spacing: .03em; margin: .2rem 0 .4rem; }
ol.review { padding-left: 1.2rem; display: grid; gap: .7rem; }
ol.review .q { font-weight: 700; margin: 0; }
ol.review p { margin: .2rem 0; }
ol.review .right > p:nth-child(2) { color: var(--ok); font-weight: 700; }
ol.review .wrong > p:nth-child(2) { color: var(--bad); font-weight: 700; }

/* ---- mastery ------------------------------------------------------------- */
.mastery { margin-top: .6rem; }
.mastery-label { margin: 0 0 .35rem; font-size: .92rem; }
.mastery-steps { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0; flex-wrap: wrap; }
.mastery-steps li { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .55rem; border-radius: 6px;
  background: var(--track); color: var(--ink-soft); }
.mastery-steps li.on { background: var(--mod, var(--brand)); color: #fff; }
.mastery-mastered .mastery-steps li.on:last-child { background: var(--accent); color: var(--on-accent); box-shadow: 2px 2px 0 var(--night); }
.chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; background: var(--track); color: var(--ink); }
.chip-familiar, .chip-proficient { background: var(--mod, var(--brand)); color: #fff; }
.chip-mastered { background: var(--accent); color: var(--on-accent); }
.step-card h2 a { color: var(--ink); text-decoration: none; }
.step-card h2 a:hover { text-decoration: underline; }
.step-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .4rem; }
.step-actions .btn { margin-top: 0; padding: .5rem 1rem; }

/* ---- instructor inbox ---------------------------------------------------- */
.question-list { gap: 1rem; }
.question-item.is-open { border-left: 6px solid var(--accent); }
.question-item textarea { margin-bottom: .2rem; }

/* ---- getting-started tour ------------------------------------------------ */
.tour { max-width: 44rem; margin: 2rem auto; padding: clamp(1.4rem, 4vw, 2.4rem); border: 2px solid var(--night); box-shadow: 10px 10px 0 var(--accent); }
.tour-dots { list-style: none; display: flex; gap: .4rem; padding: 0; margin: .6rem 0 1.2rem; }
.tour-dots li { width: 2.2rem; height: .4rem; border-radius: 4px; background: var(--track); }
.tour-dots li.on { background: var(--mod); }
.tour-body { display: flex; gap: 1.2rem; align-items: flex-start; }
.tour-body .mod-icon { width: 3.6rem; height: 3.6rem; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.tour-actions .btn, .tour-actions button { margin-top: 0; }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.skip-tour { text-align: center; margin-top: 1rem; }

/* ---- pathways ------------------------------------------------------------ */
.dash-main { display: grid; gap: 1.75rem; align-content: start; }
.pathway-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem;
  border-left: 8px solid var(--mod); box-shadow: 4px 4px 0 var(--night); }
.pathway-top { display: flex; gap: .9rem; align-items: center; }
.pathway-card h3 a { color: var(--ink); text-decoration: none; }
.pathway-card h3 a:hover { text-decoration: underline; }
ol.chain { list-style: none; display: flex; gap: .35rem; padding: 0; margin: .9rem 0 .4rem; }
ol.chain li { flex: 1; height: .55rem; border-radius: 4px; background: var(--track); }
ol.chain li.link-done { background: var(--mod); }
ol.chain li.link-active { background: repeating-linear-gradient(90deg, var(--mod) 0 8px, var(--track) 8px 14px); }
ol.chain li.link-soon { background: transparent; border: 2px dashed var(--line); }
.step.is-locked .step-card { opacity: .78; }
.step.is-locked .step-dot { font-size: .9rem; }
.objectives { margin-bottom: 1.5rem; }
ul.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
ul.checks li { padding-left: 1.6rem; position: relative; }
ul.checks li::before { content: "✓"; position: absolute; left: 0; font-weight: 800; color: var(--ok); }
.admin-extra { margin-top: var(--gap); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; white-space: nowrap; }

/* ---- certificate ------------------------------------------------------------ */
.certificate { max-width: 52rem; margin: 1rem auto; text-align: center; background: #fff; color: #101320;
  border: 3px solid #121a33; outline: 10px solid #ffd23f; outline-offset: -22px; border-radius: 6px;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.2rem, 5vw, 3.5rem); }
.certificate .eyebrow { color: #4a5163; }
.cert-brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-size: 1.6rem; letter-spacing: .05em; margin: 0 0 1rem; }
.cert-presented, .cert-for { margin: 1.2rem 0 .2rem; color: #4a5163; }
.cert-name { font-family: var(--display); font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1; margin: 0; letter-spacing: .03em; }
.cert-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: .2rem 0 1.4rem; }
.cert-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem 2rem; border-top: 2px solid #dfe2ec; padding-top: 1rem; }
.cert-meta p { margin: 0; display: grid; }
.cert-meta span { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #4a5163; }
.cert-verify { margin-top: 1rem; color: #4a5163; }
.certificate.is-revoked { opacity: .55; }
@media print {
  .top, .foot, .no-print, .skip { display: none !important; }
  body, body.has-bg { background: #fff !important; }
  body.has-bg main, main { box-shadow: none !important; background: #fff !important; margin: 0 !important; padding: 0 !important; max-width: none; }
  .certificate { margin: 0 auto; page-break-inside: avoid; }
}

/* ---- verification --------------------------------------------------------- */
.verify-card { margin-top: 1rem; }
.verify-result { margin-top: 1rem; border-radius: 10px; padding: .8rem 1rem; border-left: 6px solid var(--ok); background: var(--paper); }
.verify-result.is-revoked { border-left-color: var(--bad); }
.verify-status { font-weight: 800; margin: 0 0 .3rem; }
.is-valid .verify-status { color: var(--ok); }
.is-revoked .verify-status { color: var(--bad); }

/* Outcomes Phases B–C: instructor cohort workspace */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.tabs a { padding: .4rem .85rem; border: 2px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; min-height: 24px; }
.tabs a[aria-current="page"] { background: var(--night); border-color: var(--night); color: var(--on-night); }
.table-scroll { overflow-x: auto; }
.table-scroll select { min-width: 11rem; }
.radio-row { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.radio-row .check { margin: .1rem 0; }
.levels { margin: .25rem 0 1rem; padding-left: 1.2rem; }
details.card > summary { cursor: pointer; font-weight: 800; }

/* Outcomes Phases D–F: dashboard, grants, funder report */
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1rem 0 1.25rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 0; }
.tile dt { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.tile dd { margin: .2rem 0 0; font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.tile dd.tile-note { font-family: inherit; font-size: .85rem; color: var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.tag-warn { background: #fff4d6; border-color: #b45309; color: #7a3a00; }
.tag-ok { background: #e3f6ec; border-color: #18794e; color: #0f5132; }
.supp { text-decoration: none; font-weight: 700; color: var(--ink-soft); cursor: help; }
.chart { margin: .5rem 0 1rem; }
.chart-svg { display: block; max-width: 720px; }
.ch-grid { stroke: #d5d9e3; stroke-width: 1; }
.ch-tick { font-size: 11px; fill: #4a5163; }
.ch-label { font-size: 13px; fill: #1b1f2e; font-weight: 600; }
.ch-val { font-size: 12px; fill: #1b1f2e; font-weight: 700; }
.ch-null { font-size: 12px; fill: #4a5163; font-style: italic; }
.ch-a { fill: #6b7285; }
.ch-b { fill: #1f4fe0; }
.defs dt { font-weight: 800; margin-top: .6rem; }
.defs dd { margin: .15rem 0 0; }
.report { max-width: 52rem; margin: 0 auto; background: var(--card); padding: 1.5rem 1.75rem; border-radius: var(--radius); border: 1px solid var(--line); }
.report section { margin-top: 1.4rem; page-break-inside: avoid; }
.report-head { border-bottom: 4px solid var(--night); padding-bottom: .8rem; }
.report-foot { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: .8rem; color: var(--ink-soft); }
.indent { padding-left: 1.4rem; font-weight: 400; }
@media print { .report { border: 0; padding: 0; } .ch-b { fill: #1f4fe0 !important; } }
.cost-card { display: grid; gap: 0 2rem; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); align-items: start; }
.cost-card h2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .cost-card { grid-template-columns: 1fr; } }

/* Phase G: disclosure registry and internal preview */
.alert-box { border-left: 5px solid #b45309; background: #fff8e6; padding: .7rem 1rem; border-radius: 6px; margin: 0 0 1rem; }
.alert-box p { margin: .25rem 0; }
.disclosure-preview { position: relative; background: var(--card); border: 3px dashed #b42318; border-radius: var(--radius); padding: 1.25rem 1.5rem;
  background-image: repeating-linear-gradient(-30deg, transparent 0 140px, rgba(180,35,24,.06) 140px 175px); }
.watermark-bar { margin: 0 0 .8rem; padding: .45rem .7rem; background: #b42318; color: #fff; font-weight: 800; letter-spacing: .04em; font-size: .85rem; border-radius: 4px; }
.disclosure-preview section { margin-top: 1rem; }
.print-blocked { display: none; }
@media print { .disclosure-preview { display: none !important; } .print-blocked { display: block; font-weight: 800; padding: 2rem; } }

/* Read-aloud */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin: .4rem 0 .8rem; padding: .45rem .7rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.listen-label { font-weight: 800; font-size: .9rem; }
.listen audio { height: 36px; max-width: 100%; }
fieldset.question .listen { margin-top: .2rem; }
.placement { margin: .8rem 0 1rem; padding: .7rem 1rem; border-left: 5px solid var(--mod, #4338ca); background: var(--paper); border-radius: 8px; }
.placement p { margin: .2rem 0; }

/* Animated lesson diagrams (src/animations.js) */
.anim { margin: .25rem 0 1rem; padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.anim-svg { display: block; max-width: 640px; margin: 0 auto; }
.anim-cap { margin-top: .4rem; font-weight: 700; text-align: center; }
.a-tile { fill: #eef2ff; stroke: #4338ca; stroke-width: 2.5; }
.a-hl .a-tile, g.a-hl rect.a-tile { fill: #fde68a; stroke: #92400e; }
.a-ghost .a-tile { fill: #ffffff; stroke-dasharray: 6 4; }
.a-big { font: 800 44px var(--display, system-ui); fill: #1b1f2e; }
.a-huge { font: 800 56px var(--display, system-ui); fill: #1b1f2e; letter-spacing: .02em; }
.a-mid { font: 700 24px system-ui, sans-serif; fill: #1b1f2e; }
.a-label { font: 600 17px system-ui, sans-serif; fill: #1b1f2e; }
.a-small { font: 500 14px system-ui, sans-serif; fill: #4a5163; }
.a-strong { font-weight: 800; fill: #3730a3; }
.a-c1 { fill: #b42318; } .a-c2 { fill: #1f4fe0; } .a-c3 { fill: #0f766e; }
.a-ring { fill: none; stroke: #b42318; stroke-width: 4; }
.a-col { fill: #f4f6fb; stroke: #9aa3b8; stroke-width: 2; }
.a-line { stroke: #4a5163; stroke-width: 3; }
.a-dot { fill: #4338ca; } .a-dot-lg { fill: #4338ca; }
.a-arc { fill: none; stroke: #1f4fe0; stroke-width: 3; stroke-dasharray: 8 6; }
.a-slice { fill: #fde68a; stroke: #92400e; stroke-width: 2; }
.a-slice-on { fill: #f59e0b; }
.a-slice-on2 { fill: #b42318; }
.a-bar { fill: #1f4fe0; } .a-onbar { fill: #ffffff; }
.a-bar2 { fill: #f59e0b; }

.anim .s1, .anim .s2, .anim .s3, .anim .s4 { transform-box: fill-box; transform-origin: center; }
.anim .s1 { animation: a-s1 8s ease-out infinite; }
.anim .s2 { animation: a-s2 8s ease-out infinite; }
.anim .s3 { animation: a-s3 8s ease-out infinite; }
.anim .s4 { animation: a-s4 8s ease-out infinite; }
.anim .s2.a-slide { animation-name: a-s2-slide; }
.anim .s2.a-drop { animation-name: a-s2-drop; }
@keyframes a-s1 { 0% { opacity: 0; } 6%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes a-s2 { 0%, 18% { opacity: 0; } 25%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes a-s3 { 0%, 38% { opacity: 0; } 45%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes a-s4 { 0%, 58% { opacity: 0; } 65%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes a-s2-slide { 0%, 18% { opacity: 0; transform: translateX(90px); } 27%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes a-s2-drop { 0%, 18% { opacity: 0; transform: translateY(-40px); } 27%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .anim .s1, .anim .s2, .anim .s3, .anim .s4 { animation: none !important; opacity: 1 !important; transform: none !important; }
}
@media print { .anim .s1, .anim .s2, .anim .s3, .anim .s4 { animation: none !important; opacity: 1 !important; transform: none !important; } }

/* Lesson videos */
.lesson-video { width: 100%; max-width: 720px; border-radius: 10px; background: #000; display: block; }
.a-meter-g { fill: #18794e; } .a-meter-y { fill: #d97706; } .a-meter-r { fill: #b42318; }
.a-bar3 { fill: #3730a3; } .a-bar4 { fill: #0f766e; }

/* Public website */
.pub-hero { max-width: 60rem; margin: 1.5rem auto 2rem; padding: 2rem 1.75rem; background: var(--night); color: var(--on-night); border-radius: var(--radius); }
.pub-hero .eyebrow { color: #ffd24a; }
.pub-hero h1 { margin: .3rem 0 .8rem; }
.pub-hero a:not(.btn) { color: #ffd24a; }
.narrow-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pub-lead { font-size: 1.2rem; line-height: 1.55; max-width: 44rem; }
.pub-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 .5rem; }
.btn-ghost { background: transparent; border: 2px solid currentColor; color: inherit; }
.pub-band { max-width: 60rem; margin: 0 auto 1.75rem; padding: 1.5rem 1.75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pub-lanes { margin: .75rem 0 1rem; }
.pub-grid { max-width: 60rem; margin: 0 auto 1.75rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pub-grid .card ul, .prose ul { padding-left: 1.2rem; }
.pub-grid .card li, .prose li { margin: .35rem 0; }
.pub-who { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.pub-who li { padding: .35rem .8rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 700; }
.pub-signin { margin-top: .75rem; }
.prose { max-width: 48rem; margin: 1rem auto 2rem; }
.prose h2 { margin-top: 1.4rem; }
.nav-signin { font-weight: 800; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pub-lanes .lane { color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.pub-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
body.signed-out .foot a { color: #ffd24a; }
