:root {
  color-scheme: dark;
  --bg: #090c0a;
  --surface: #0d120f;
  --surface-raised: #111813;
  --text: #d7dfd9;
  --text-bright: #f0f6f2;
  --muted: #7c8a80;
  --line: #273229;
  --line-strong: #3b4a3f;
  --accent: #7ee787;
  --accent-soft: #18351f;
  --warning: #e3b341;
  --danger: #ff7b72;
  --header-bg: rgba(9, 12, 10, .92);
  --placeholder: #59645c;
  --prose: #bac5bd;
  --code-bg: #071109;
  --code-text: #c9f5cf;
  --font-mono: "Cascadia Mono", "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shell: 1120px;
  --speed-fast: 140ms;
  --speed: 260ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #e9ede7;
  --surface-raised: #ffffff;
  --text: #1d2920;
  --text-bright: #071109;
  --muted: #5b695f;
  --line: #cbd3cc;
  --line-strong: #98a69c;
  --accent: #087a27;
  --accent-soft: #d9ecdc;
  --warning: #8a5a00;
  --danger: #b42318;
  --header-bg: rgba(244, 245, 241, .92);
  --placeholder: #77827a;
  --prose: #33463a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-width: 280px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { color: var(--bg); background: var(--accent); }
main {
  min-height: calc(100vh - 122px);
  transition: opacity var(--speed-fast) ease, transform var(--speed-fast) ease;
}
body.is-leaving main { opacity: 0; transform: translateY(4px); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, p, li, a, span, strong { overflow-wrap: break-word; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.shell { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }
.narrow { width: min(820px, calc(100% - 48px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.header-inner, .footer-inner {
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  min-width: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text-bright);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .03em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.brand strong { color: var(--accent); font-weight: 500; }
.nav {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  font-size: 12px;
}
.nav form { margin: 0; }
.nav-user { max-width: 240px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease, background var(--speed-fast) ease;
}
.theme-toggle [data-theme-label] { color: var(--accent); }
.theme-toggle:hover { border-color: var(--accent); color: var(--text-bright); background: var(--accent-soft); }
.nav a:not(.button), .link-button, .text-link, .back-link {
  border: 0;
  color: var(--text);
  background: none;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--speed-fast) ease;
}
.nav a:not(.button)::before, .back-link::before { color: var(--accent); content: "./"; }
.nav a:not(.button):hover, .link-button:hover, .text-link:hover, .back-link:hover { color: var(--accent); }
.text-link, .back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--bg);
  background: var(--accent);
  box-shadow: none;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--speed-fast) ease, background var(--speed-fast) ease, transform var(--speed-fast) ease;
}
.button::before { content: ">"; }
.button:hover { color: var(--accent); background: transparent; transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button-small { min-height: 36px; padding-inline: 13px; font-size: 11px; }
.button-full { width: 100%; }
.button-light { color: var(--bg); background: var(--accent); }
.button-outline { color: var(--accent); background: transparent; }
.button-outline:hover { color: var(--bg); background: var(--accent); }
.is-submitting .button[type="submit"] { color: var(--accent); background: transparent; cursor: wait; }

.eyebrow, .kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 600;
}
.eyebrow::before, .kicker::before { margin-right: 8px; color: var(--accent); content: "$"; }
.eyebrow { display: flex; align-items: center; gap: 0; }
.eyebrow span { display: none; }
.hero { padding-block: clamp(72px, 10vw, 128px) 72px; }
.hero h1, .dashboard-head h1, .auth-aside h1 {
  max-width: 980px;
  margin: 26px 0;
  color: var(--text-bright);
  font: 500 clamp(42px, 6.5vw, 76px)/1.08 var(--font-mono);
  letter-spacing: -.055em;
}
h1 em { color: var(--accent); font-style: normal; font-weight: 500; }
.hero-copy { max-width: 720px; color: var(--muted); font-size: clamp(15px, 2vw, 18px); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 34px; }
.hero-metrics {
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 72px;
  border-block: 1px solid var(--line);
}
.hero-metrics div { min-width: 0; display: grid; gap: 3px; padding: 18px 22px; border-right: 1px solid var(--line); }
.hero-metrics div:first-child { padding-left: 0; }
.hero-metrics div:last-child { border-right: 0; }
.hero-metrics strong { color: var(--text-bright); font-size: 28px; line-height: 1.2; }
.hero-metrics span { color: var(--muted); font-size: 11px; text-transform: uppercase; }

.route-section { padding-block: 76px; border-block: 1px solid var(--line); background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.section-heading h2, .cta h2 {
  margin: 10px 0 0;
  color: var(--text-bright);
  font: 500 clamp(28px, 4vw, 48px)/1.15 var(--font-mono);
  letter-spacing: -.045em;
}
.section-heading > p { max-width: 430px; margin-bottom: 0; color: var(--muted); }
.route-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.route-card {
  min-width: 0;
  min-height: 170px;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background var(--speed) ease, border-color var(--speed) ease;
}
.route-card:hover { border-color: var(--line-strong); background: var(--surface-raised); }
.route-card > span, .stage-number { color: var(--accent); font-weight: 700; font-size: 12px; }
.route-card h3 { margin: 35px 0 6px; color: var(--text-bright); font-size: 15px; }
.route-card p { margin: 0; color: var(--muted); font-size: 12px; }
.cta { margin-block: 72px; padding: clamp(28px, 6vw, 64px); border: 1px solid var(--line); background: var(--surface); }
.cta .button { margin-top: 28px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-inner { min-height: 60px; }

.flash-stack { position: fixed; z-index: 50; top: 78px; left: 50%; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.flash { padding: 12px 16px; border: 1px solid var(--accent); color: var(--text-bright); background: var(--surface-raised); animation: flash-in .35s var(--ease) both; }
.flash-warning { border-color: var(--warning); }
.flash-error { border-color: var(--danger); }

.auth-shell { min-height: calc(100vh - 122px); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 8vw; padding-block: 64px; }
.auth-aside h1 { font-size: clamp(40px, 5.5vw, 68px); }
.auth-aside p { max-width: 520px; color: var(--muted); font-size: 16px; }
.form-card, .artifact-card, .review-form, .lesson-content {
  min-width: 0;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.form-card h2 { margin-bottom: 6px; color: var(--text-bright); font: 500 30px var(--font-mono); }
label { display: grid; gap: 8px; margin-top: 20px; color: var(--text); font-size: 12px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--text-bright);
  background: var(--bg);
  transition: border-color var(--speed-fast) ease, background var(--speed-fast) ease;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 0; background: var(--surface-raised); }
textarea { resize: vertical; }
.form-card .button { margin-top: 26px; }
.muted { color: var(--muted); }
.form-error { margin: 18px 0; padding: 12px 14px; border-left: 2px solid var(--danger); color: var(--danger); background: rgba(255, 123, 114, .06); }
.form-error ul { margin: 0; padding-left: 18px; }
.privacy-note { display: block; margin-top: 16px; color: var(--muted); text-align: center; }

.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 64px 42px; }
.dashboard-head h1 { margin-bottom: 0; font-size: clamp(38px, 5.5vw, 64px); }
.progress-ring {
  width: 176px;
  flex: 0 0 auto;
  padding: 19px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(90deg, var(--accent-soft) var(--p), transparent var(--p));
}
.progress-ring::after { display: none; }
.progress-ring div { display: grid; }
.progress-ring strong { color: var(--accent); font-size: 28px; line-height: 1.2; }
.progress-ring span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric-card {
  min-width: 0;
  min-height: 128px;
  display: grid;
  align-content: space-between;
  padding: 19px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.metric-card > span, .metric-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { color: var(--text-bright); font-size: 34px; line-height: 1.2; }
.metric-card.accent { background: var(--accent-soft); }
.metric-card.accent strong { color: var(--accent); }

.learning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; padding-block: 64px; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading.compact h2 { font-size: 34px; }
.stage-list { display: grid; gap: 8px; }
.stage-row {
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color var(--speed) ease, background var(--speed) ease, transform var(--speed) var(--ease);
}
.stage-row:hover { border-color: var(--line-strong); background: var(--surface-raised); transform: translateX(3px); }
.stage-row.locked { opacity: .44; }
.stage-row.done { border-left: 2px solid var(--accent); }
.stage-main { min-width: 0; }
.stage-main h3 { margin: 3px 0; color: var(--text-bright); font-size: 15px; }
.stage-main p { margin: 0; color: var(--muted); font-size: 12px; }
.stage-competency { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.stage-meta { display: flex; align-items: center; gap: 10px; }
.arrow-link {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  transition: color var(--speed-fast) ease, background var(--speed-fast) ease, border-color var(--speed-fast) ease;
}
.arrow-link:hover { border-color: var(--accent); color: var(--bg); background: var(--accent); }
.status-pill, .score-pill, .selection { padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 0; font-size: 10px; white-space: nowrap; }
.score-pill { border-color: var(--accent); color: var(--accent); }
.lock { color: var(--muted); font-size: 20px; }
.next-card { position: sticky; top: 90px; padding: 24px; border: 1px solid var(--line); color: var(--text); background: var(--surface); }
.next-card .big-number { margin: 26px 0 8px; color: var(--accent); }
.next-card h2 { color: var(--text-bright); font: 500 25px/1.15 var(--font-mono); }
.next-card p { color: var(--muted); font-size: 12px; }
.big-number { font-size: 50px; font-weight: 700; line-height: 1; }

.lesson-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; gap: 34px; align-items: center; padding-block: 52px; }
.lesson-title { min-width: 0; }
.lesson-title h1 { margin: 14px 0; color: var(--text-bright); font: 500 clamp(38px, 6vw, 68px)/1.06 var(--font-mono); letter-spacing: -.05em; }
.lesson-title p { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.stage-badge { display: inline-block; padding: 4px 7px; border: 1px solid var(--accent); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.lesson-score { display: grid; align-content: center; justify-items: start; aspect-ratio: auto; padding: 18px; border: 1px solid var(--line); }
.lesson-score span, .lesson-score small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.lesson-score strong { color: var(--accent); font-size: 31px; line-height: 1.2; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 800px) 210px; justify-content: space-between; gap: 48px; padding-bottom: 64px; }
.prose { min-width: 0; }
.prose h2 { margin-top: 38px; color: var(--text-bright); font: 500 27px var(--font-mono); letter-spacing: -.035em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--prose); }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose code { padding: 2px 5px; color: var(--accent); background: var(--accent-soft); }
.prose pre { max-width: 100%; overflow: auto; padding: 18px; border: 1px solid var(--line); color: var(--code-text); background: var(--code-bg); }
.prose pre code { padding: 0; color: inherit; background: transparent; }
.objectives, .rubric-box { margin-top: 32px; padding: 20px; border-left: 2px solid var(--accent); background: var(--accent-soft); }
.objectives ul, .rubric-box ul { margin-bottom: 0; }
.lesson-nav { position: sticky; top: 96px; display: grid; gap: 13px; align-self: start; }
.lesson-nav a { padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 11px; transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease; }
.lesson-nav a:hover { border-color: var(--accent); color: var(--accent); }
.mini-progress, .table-progress { height: 3px; overflow: hidden; background: var(--line); }
.mini-progress span, .table-progress span { display: block; height: 100%; background: var(--accent); animation: progress-in .8s .2s var(--ease) both; }

.quiz-section { padding-block: 70px; border-block: 1px solid var(--line); background: var(--surface); }
.quiz-section h2, .practice-section h2, .review-form h2 { margin: 10px 0 28px; color: var(--text-bright); font: 500 clamp(28px, 4vw, 40px) var(--font-mono); letter-spacing: -.04em; }
.quiz-form { display: grid; gap: 12px; }
.question-card {
  min-inline-size: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.question-card:focus-within { border-color: var(--line-strong); background: var(--surface-raised); }
.question-title {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 16px;
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}
.question-number { flex: 0 0 auto; color: var(--accent); }
.question-prompt { min-width: 0; overflow-wrap: anywhere; }
.option {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: color var(--speed-fast) ease, background var(--speed-fast) ease, padding-left var(--speed-fast) ease;
}
.option:hover { padding-left: 14px; color: var(--text-bright); background: var(--surface); }
.option:has(input:checked) { color: var(--accent); background: var(--accent-soft); }
.option input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 4px 0 0;
  padding: 0;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
}
.option input[type="radio"]:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.success-panel { display: flex; align-items: center; gap: 22px; padding: 24px; border-left: 2px solid var(--accent); background: var(--accent-soft); }
.success-panel strong { color: var(--accent); font-size: 42px; }
.success-panel p { margin: 0; }
.remediation { margin-top: 22px; padding: 20px; border-left: 2px solid var(--warning); background: var(--bg); }
.remediation p { margin: 5px 0; }

.practice-section { padding-block: 72px; }
.assignment-copy { font-size: 15px; }
.rubric-box ul { margin-bottom: 0; }
.locked-panel { padding: 20px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.type-tabs label { margin: 0; }
.type-tabs input { position: absolute; opacity: 0; }
.type-tabs span { display: block; padding: 7px 13px; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; transition: color var(--speed-fast) ease, border-color var(--speed-fast) ease, background var(--speed-fast) ease; }
.type-tabs input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.submission-form .button { margin-top: 22px; }
.submission-state { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.submission-state div { display: grid; }
.submission-state span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.submission-state p { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }

.admin-head { display: flex; align-items: end; justify-content: space-between; gap: 26px; padding-block: 56px 30px; }
.admin-head h1 { margin: 8px 0; color: var(--text-bright); font: 500 clamp(38px, 5vw, 56px) var(--font-mono); letter-spacing: -.05em; }
.admin-head p { margin-bottom: 0; color: var(--muted); }
.admin-metrics { margin-bottom: 34px; }
.admin-table-section { padding-bottom: 70px; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filters input { max-width: 360px; }
.filters select { max-width: 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { padding: 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
td { font-size: 12px; }
td > small, td > strong { display: block; }
.table-progress { width: 90px; margin-bottom: 4px; }
.warn { color: var(--warning); }
.inactive { opacity: .42; }
.empty-cell { padding: 44px; color: var(--muted); text-align: center; }
.selection-shortlist { border-color: var(--accent); color: var(--accent); }
.selection-reserve { border-color: var(--warning); color: var(--warning); }
.selection-not_selected { color: var(--muted); }

.student-profile-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding-block: 48px 30px; }
.student-profile-head > .back-link { grid-column: 1 / -1; }
.profile-title { min-width: 0; display: flex; align-items: center; gap: 18px; }
.avatar { width: 62px; height: 62px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--accent); color: var(--accent); font-size: 25px; }
.profile-title h1 { margin: 4px 0; color: var(--text-bright); font: 500 40px var(--font-mono); letter-spacing: -.04em; }
.profile-title p { margin: 0; color: var(--muted); }
.profile-actions { display: grid; align-content: center; gap: 10px; }
.profile-actions form:first-child { display: flex; gap: 8px; }
.danger { color: var(--danger); }
.review-head { padding-block: 48px 28px; }
.review-head .back-link { margin-bottom: 30px; }
.review-head h1 { margin: 10px 0; color: var(--text-bright); font: 500 clamp(38px, 5vw, 54px) var(--font-mono); letter-spacing: -.05em; }
.review-head p { color: var(--muted); }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 28px; align-items: start; padding-bottom: 70px; }
.artifact-card pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; border: 1px solid var(--line); color: var(--code-text); background: var(--code-bg); }
.artifact-link { display: block; margin: 20px 0; color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.student-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.artifact-card > small { display: block; margin-top: 22px; color: var(--muted); }
.review-form { position: sticky; top: 88px; }
.criterion { grid-template-columns: minmax(0, 1fr) 96px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.criterion select { margin: 0; }
.error-page { min-height: 70vh; display: grid; place-items: center; align-content: center; text-align: center; }
.error-page .big-number { color: var(--danger); }
.error-page h1 { margin: 14px 0; color: var(--text-bright); font: 500 38px var(--font-mono); }
.error-page p { color: var(--muted); }

.reveal-item { animation: item-in .5s var(--ease) both; animation-delay: calc(var(--stagger-index, 0) * 35ms); }
.theme-changing *, .theme-changing *::before, .theme-changing *::after {
  transition-property: color, background-color, border-color, box-shadow !important;
  transition-duration: var(--speed) !important;
  transition-timing-function: ease !important;
}
@keyframes item-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes progress-in { from { transform: scaleX(0); transform-origin: left; } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: view-out var(--speed-fast) ease both; }
::view-transition-new(root) { animation: view-in var(--speed) var(--ease) both; }
@keyframes view-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 900px) {
  .header-inner { padding-block: 8px; }
  .nav { gap: 8px 14px; }
  .nav-user { display: none; }
  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-shell, .learning-layout, .review-layout { grid-template-columns: 1fr; }
  .next-card, .review-form { position: static; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-head { grid-template-columns: minmax(0, 1fr) 140px; }
  .lesson-head .back-link { grid-column: 1 / -1; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-nav { display: none; }
  .student-profile-head { grid-template-columns: 1fr; }
  .profile-actions { justify-items: start; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .shell, .narrow { width: min(100% - 28px, var(--shell)); }
  .header-inner { min-height: 57px; }
  .brand span:last-child, .nav > a:not(.button), .nav-user { display: none; }
  .nav > a.strategy-link, .nav > a.learning-link { display: inline; }
  .theme-toggle > span:first-child { display: none; }
  .nav { gap: 11px; }
  .hero { padding-block: 58px 48px; }
  .hero h1 { font-size: clamp(34px, 11vw, 48px); }
  .hero-metrics { margin-top: 52px; }
  .hero-metrics div { padding: 14px 8px; }
  .hero-metrics strong { font-size: 22px; }
  .hero-metrics span { font-size: 9px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 126px; }
  .route-card h3 { margin-top: 24px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 16px; }
  .cta { margin-block: 48px; }
  .footer-inner { min-height: 74px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
  .auth-shell { padding-block: 38px; }
  .auth-aside h1 { font-size: 36px; }
  .form-card, .artifact-card, .review-form, .lesson-content { padding: 20px; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .dashboard-head h1 { font-size: 36px; }
  .progress-ring { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 28px; }
  .stage-row { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .stage-meta { grid-column: 2; }
  .lesson-head { grid-template-columns: 1fr; }
  .lesson-score { width: 100%; }
  .question-card { padding: 14px; }
  .question-title { gap: 8px; }
  .option { padding-inline: 6px; }
  .option:hover { padding-left: 9px; }
  .admin-head { align-items: flex-start; flex-direction: column; }
  .filters { flex-direction: column; }
  .filters input, .filters select { max-width: none; }
  .profile-title { align-items: flex-start; }
  .avatar { width: 48px; height: 48px; }
  .profile-title h1 { font-size: 30px; }
  .profile-actions form:first-child { align-items: stretch; flex-direction: column; }
  .criterion { grid-template-columns: minmax(0, 1fr) 84px; }
  .submission-state { grid-template-columns: 1fr; }
  .submission-state p { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
