/*
DIRECTION: Classroom Route Map
WORLD: A vocational classroom timetable rendered as a clear transit route; every activity is a station and every submission is a stamped stop.
FIRST VIEWPORT: The current task and route dominate immediately; teacher control and student action remain visible without dashboard clutter.
SIGNATURE INTERACTION: Advancing the lesson moves the live orange stop across one preparation stop and nine interaction stops in both views.
RAISE — Teletext discipline: terse labels, high legibility, explicit states.
RAISE — Tensegrity discipline: progress and control share one visible state spine.
RISK: Route language can feel abstract if task copy is vague, so every station carries a concrete verb and output.
FINISH: unreviewed and undocumented is unfinished; this build ends with the finish review, the verdict, and DESIGN.md
*/
:root {
  --paper: #f3efe4;
  --paper-deep: #e6dfce;
  --ink: #102a43;
  --ink-soft: #486581;
  --line: #b8c2c8;
  --orange: #e66a2c;
  --orange-dark: #a63d12;
  --green: #23856d;
  --red: #ba3b46;
  --blue: #2364aa;
  --white: #fffdf7;
  --shadow: 0 12px 32px rgba(16, 42, 67, 0.12);
  --radius: 14px;
  --font-body: "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  --font-display: "STZhongsong", "SimSun", serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(90deg, transparent 0 5%, rgba(16, 42, 67, 0.035) 5% 5.15%, transparent 5.15% 100%),
    var(--paper);
}

::selection { background: #ffd0b8; color: var(--ink); }

button, input, select, textarea { font: inherit; color: inherit; }

button, a, input, select, textarea { outline: none; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: 0.45; }

a { color: inherit; text-underline-offset: 4px; }

.topbar {
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--white);
  background: var(--ink);
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 50%;
  font-weight: 800;
}

.brand strong { display: block; font-size: 16px; }
.brand small { color: #d4e2ef; }

.status-strip { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 9px;
  color: #fff;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .12); }
.theme-toggle--page { color: var(--ink); border-color: var(--line); }
.theme-toggle--page:hover { background: var(--paper-deep); }

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f0b429; }
.status-dot.running { background: #44d19d; box-shadow: 0 0 0 5px rgba(68, 209, 157, .14); }
.status-dot.paused { background: #ffd166; }

.app-shell { width: min(1500px, 100%); margin: 0 auto; padding: 28px clamp(16px, 3vw, 44px) 56px; }

.route-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  max-width: 900px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.3vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 { margin-bottom: 10px; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.25; }
h3 { margin-bottom: 8px; font-size: 18px; }
p { line-height: 1.72; }

.lede { max-width: 72ch; margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }

.ticket {
  min-width: 178px;
  padding: 15px 18px;
  position: relative;
  background: var(--orange);
  color: #fff;
  box-shadow: 5px 7px 0 rgba(16, 42, 67, .18);
}

.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
}

.ticket::before { top: 14px; }
.ticket::after { bottom: 14px; }
.ticket small { display: block; opacity: .86; }
.ticket strong { display: block; margin-top: 3px; font-size: 25px; font-variant-numeric: tabular-nums; }

.route-status-card {
  min-width: 250px;
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-left: 6px solid var(--green);
  background: var(--white);
  box-shadow: var(--shadow);
}
.route-status-card small { color: var(--ink-soft); }
.route-status-card strong { font-size: 21px; }

.teacher-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 24px; }
.student-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr); gap: 24px; }
.stack { display: grid; gap: 20px; align-content: start; }

.mode-panel { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; margin-bottom: 24px; }
.control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, .5fr) minmax(260px, .7fr); gap: 24px; align-items: center; margin-bottom: 24px; }
.compact-field { margin: 0; }
.switch-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}
.switch-card input { width: 22px; min-height: 22px; margin: 2px 0 0; accent-color: var(--green); }
.switch-card strong, .switch-card small { display: block; }
.switch-card small { margin-top: 5px; color: var(--ink-soft); line-height: 1.45; }
.address-list { display: grid; gap: 8px; }
.address-list a { overflow-wrap: anywhere; color: var(--blue); font-weight: 700; }
.answer-grid { display: grid; gap: 12px; }
.answer-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(210px, .7fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #d8d2c4; }
.answer-row:last-child { border-bottom: 0; }
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }

.panel {
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, .86);
  box-shadow: var(--shadow);
}

.panel--dark { color: var(--white); background: var(--ink); border-color: var(--ink); }
.panel--dark .muted { color: #c8d8e6; }
.panel--flat { box-shadow: none; }

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading p { margin-bottom: 0; }

.muted { color: var(--ink-soft); }
.fine { font-size: 13px; color: var(--ink-soft); }
.eyeline { margin-bottom: 6px; color: var(--orange-dark); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.timer {
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.timer-label { margin-top: 9px; color: #c8d8e6; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  font-weight: 750;
  transition: transform .18s ease-out, box-shadow .18s ease-out, background .18s ease-out;
}

.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16, 42, 67, .13); }
.button--primary { color: #fff; background: var(--orange); border-color: var(--orange-dark); }
.button--ink { color: #fff; background: var(--ink); }
.button--ghost { background: transparent; }
.button--danger { color: var(--red); border-color: #dba4a8; background: #fff6f5; }
.button--wide { width: 100%; justify-content: center; }

.stage-map {
  display: grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap: 0;
  overflow-x: auto;
  padding: 12px 2px 18px;
}

.stage-stop {
  min-width: 78px;
  padding: 0 8px;
  position: relative;
  border: 0;
  background: transparent;
  text-align: center;
}

.stage-stop::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line);
}

.stage-stop:first-child::before { left: 50%; }
.stage-stop:last-child::before { right: 50%; }

.stop-dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  margin: 0 auto 9px;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.stage-stop.done::before, .stage-stop.active::before { background: var(--green); }
.stage-stop.done .stop-dot { border-color: var(--green); color: #fff; background: var(--green); }
.stage-stop.active .stop-dot { border-color: var(--orange); color: #fff; background: var(--orange); transform: scale(1.12); }
.stage-stop.live .stop-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 30%, transparent); }
.stage-stop.locked { color: var(--ink-soft); }
.stage-stop.locked .stop-dot { border-style: dashed; }
.stage-stop span:last-child { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; }

.current-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  border-top: 8px solid var(--orange);
}

.current-task .big-number { font-size: clamp(34px, 5vw, 64px); font-weight: 850; color: var(--orange-dark); }
.stage-state-stack { min-width: 145px; display: grid; justify-items: end; gap: 8px; }

.browse-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; }

.progress-track { height: 9px; overflow: hidden; border-radius: 6px; background: var(--paper-deep); }
.progress-track > span { display: block; height: 100%; width: 0; background: var(--green); }

.metric-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 12px 0; }
.metric-line strong { font-variant-numeric: tabular-nums; }

.group-list { display: grid; gap: 10px; }
.group-row { display: grid; grid-template-columns: 1fr minmax(100px, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #d8d2c4; }
.group-row:last-child { border-bottom: 0; }
.group-name strong, .group-name small { display: block; }
.group-name small { color: var(--ink-soft); margin-top: 2px; }
.participant-list { display: grid; gap: 4px; }
.participant-row { grid-template-columns: 1fr auto; }
.participant-row .button { min-height: 36px; padding: 7px 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge--green { color: #095f4a; background: #d7f3e9; }
.badge--orange { color: #8e340e; background: #ffe0cc; }
.badge--neutral { color: var(--ink); background: #e7edf2; }
.badge--red { color: #8c2530; background: #f8d9dc; }

.note-list { margin: 0; padding-left: 20px; }
.note-list li { margin: 9px 0; line-height: 1.55; }

.empty { padding: 26px 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--ink-soft); }

.identity {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 12px;
  align-items: end;
}

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label, .field legend { font-weight: 750; }
.field small { color: var(--ink-soft); line-height: 1.5; }

input, select, textarea {
  width: 100%;
  border: 1px solid #8fa1ad;
  border-radius: 10px;
  background: #fffefa;
}

input, select { min-height: 46px; padding: 9px 12px; }
textarea { min-height: 98px; padding: 12px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: #758797; }

fieldset { margin: 0; padding: 0; border: 0; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.choice {
  min-height: 106px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  align-items: start;
  padding: 17px;
  border: 1px solid #98a8b3;
  border-radius: 12px;
  background: #fffefa;
  cursor: pointer;
}

.choice:has(input:checked) { border: 2px solid var(--orange); background: #fff4eb; }
.choice input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--orange); }
.choice strong, .choice small { display: block; }
.choice small { margin-top: 5px; color: var(--ink-soft); line-height: 1.5; }

.scenario { padding: 20px; margin-bottom: 20px; border-radius: 12px; color: #fff; background: var(--ink); }
.scenario p { margin-bottom: 0; font-size: 17px; }

.static-choice { cursor: default; }
.option-letter { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--orange); font-weight: 850; }
.content-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.content-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.content-card p { margin: 7px 0 0; }

.guidance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.answer-panel { border-top: 6px solid var(--orange); }
.submission-detail { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.response-list { display: grid; gap: 0; margin: 0 0 14px; }
.response-list > div { display: grid; grid-template-columns: minmax(110px, .35fr) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--paper-deep); }
.response-list dt { font-weight: 800; }
.response-list dd { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }

.completion-stat { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px; align-items: baseline; padding: 20px; border-radius: 12px; background: var(--paper-deep); }
.completion-stat strong { color: var(--orange-dark); font-size: 30px; }
.stat-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat-group summary { cursor: pointer; font-weight: 800; line-height: 1.5; }
.stat-items { display: grid; gap: 10px; padding: 14px 0 4px; }
.stat-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(120px, 1fr) auto; gap: 12px; align-items: center; }
.stat-row strong { min-width: 86px; text-align: right; font-size: 13px; }

.score-panel { overflow: hidden; }
.score-total { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 2px; }
.score-total strong { font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-total span { color: #c8d8e6; }
.ranking-list { display: grid; gap: 8px; }
.ranking-row { display: grid; grid-template-columns: 68px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--paper-deep); }
.ranking-row span:nth-child(2) strong, .ranking-row span:nth-child(2) small { display: block; }
.ranking-row span:nth-child(2) small { margin-top: 2px; color: var(--ink-soft); }
.ranking-row.is-self { outline: 2px solid var(--orange); background: #fff1e7; }
.ranking-row.is-separated { margin-top: 12px; }
.rank-number { color: var(--orange-dark); font-weight: 850; }

.issue-list { display: grid; gap: 8px; margin: 14px 0; }
.issue { padding: 11px 13px; border-radius: 10px; background: #fff0ef; color: #8d2630; }
.success { padding: 12px 14px; border-radius: 10px; color: #075e49; background: #dcf5eb; }

.dimension-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dimension { padding: 20px 16px 16px; background: #edf4f8; box-shadow: inset 0 5px var(--blue); }
.dimension:nth-child(2) { background: #fff2e8; box-shadow: inset 0 5px var(--orange); }
.dimension:nth-child(3) { background: #eaf6f1; box-shadow: inset 0 5px var(--green); }
.dimension .field { margin-bottom: 11px; }

.task-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.save-state { color: var(--ink-soft); font-size: 13px; }

.step-note { padding: 14px 16px; margin-bottom: 18px; border: 1px solid #e7b493; border-radius: 12px; background: #fff5ed; line-height: 1.6; }

.framework-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.framework-column { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; }
.framework-column ul { margin: 9px 0 0; padding-left: 20px; }
.framework-column li { margin: 6px 0; }

.index-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--ink); }
.index-board { width: min(980px, 100%); padding: clamp(28px, 5vw, 64px); position: relative; background: var(--paper); box-shadow: 0 25px 70px rgba(0,0,0,.35); }
.index-tools { display: flex; justify-content: flex-end; margin-bottom: 22px; }
.index-board::before { content: ''; position: absolute; top: -1px; left: clamp(28px, 5vw, 64px); width: 72px; height: 12px; background: var(--orange); }
.index-title { max-width: 760px; margin-bottom: 18px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 34px; }
.entry-link { display: block; min-height: 230px; padding: 26px; border: 2px solid var(--ink); border-radius: 14px; text-decoration: none; background: var(--white); transition: transform .2s ease-out, box-shadow .2s ease-out; }
.entry-link:hover { transform: translateY(-4px); box-shadow: 8px 10px 0 rgba(230, 106, 44, .38); }
.entry-link strong { display: block; margin: 24px 0 10px; font-family: var(--font-display); font-size: 30px; }
.entry-link p { color: var(--ink-soft); }
.entry-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--orange); font-size: 22px; font-weight: 850; }

.modal-open { overflow: hidden; }
.modal-layer[hidden] { display: none; }
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(10, 24, 36, .68);
  cursor: default;
}
.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  position: relative;
  z-index: 1;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .32);
}
.modal-card h2 { font-size: clamp(24px, 3vw, 32px); }
.modal-card p { margin-bottom: 18px; }
.modal-actions { justify-content: flex-end; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 360px; padding: 14px 18px; border-radius: 10px; color: #fff; background: var(--ink); box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: transform .25s ease-out, opacity .25s ease-out; }
.toast.show { transform: translateY(0); opacity: 1; }

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101820;
  --paper-deep: #243341;
  --ink: #edf4f8;
  --ink-soft: #b7c8d6;
  --line: #526579;
  --orange: #f18749;
  --orange-dark: #ffad78;
  --green: #58c5a7;
  --red: #ff8791;
  --blue: #82bdff;
  --white: #192631;
  --shadow: 0 12px 32px rgba(0, 0, 0, .32);
}

[data-theme="dark"] body {
  background:
    linear-gradient(90deg, transparent 0 5%, rgba(255, 255, 255, .025) 5% 5.15%, transparent 5.15% 100%),
    var(--paper);
}
[data-theme="dark"] ::selection { color: #141b22; background: #ffb78c; }
[data-theme="dark"] .topbar,
[data-theme="dark"] .panel--dark,
[data-theme="dark"] .scenario { color: #f7fbff; background: #0a1118; border-color: #304354; }
[data-theme="dark"] .panel { background: rgba(25, 38, 49, .92); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .choice,
[data-theme="dark"] .framework-column,
[data-theme="dark"] .entry-link { color: var(--ink); background: #14212b; border-color: #63798c; }
[data-theme="dark"] .choice:has(input:checked) { background: #3a261b; border-color: var(--orange); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #91a6b6; }
[data-theme="dark"] .dimension { background: #172a38; }
[data-theme="dark"] .dimension:nth-child(2) { background: #30241d; }
[data-theme="dark"] .dimension:nth-child(3) { background: #172c28; }
[data-theme="dark"] .issue { color: #ffb7bd; background: #3c2026; }
[data-theme="dark"] .success { color: #9ee6d1; background: #17362f; }
[data-theme="dark"] .step-note { color: #ffd0b3; background: #34251e; border-color: #8d6045; }
[data-theme="dark"] .badge--green { color: #a2edd7; background: #19453a; }
[data-theme="dark"] .badge--orange { color: #ffd0b4; background: #4b2c1c; }
[data-theme="dark"] .badge--neutral { color: #e8f2f9; background: #34495a; }
[data-theme="dark"] .badge--red { color: #ffc0c5; background: #4a242a; }
[data-theme="dark"] .button { color: var(--ink); background: #1a2a36; border-color: #6b8193; }
[data-theme="dark"] .button--primary { color: #fff; background: #bd5525; border-color: #f18749; }
[data-theme="dark"] .button--ink { color: #fff; background: #0a1118; }
[data-theme="dark"] .button--ghost { background: transparent; }
[data-theme="dark"] .button--danger { color: #ffafb6; background: #351f24; border-color: #9d5960; }
[data-theme="dark"] .route-status-card,
[data-theme="dark"] .switch-card,
[data-theme="dark"] .content-card { background: #14212b; }
[data-theme="dark"] .ranking-row.is-self { background: #3a261b; }
[data-theme="dark"] .progress-track { background: #2c3d4c; }
[data-theme="dark"] .group-row,
[data-theme="dark"] .answer-row { border-bottom-color: #425565; }
[data-theme="dark"] .stop-dot { color: var(--ink); background: #182630; }
[data-theme="dark"] .ticket { box-shadow: 5px 7px 0 rgba(0, 0, 0, .32); }
[data-theme="dark"] .index-page { background: #070d12; }
[data-theme="dark"] .index-board { background: var(--paper); }
[data-theme="dark"] .theme-toggle--page { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .toast { color: #f7fbff; background: #071017; }
[data-theme="dark"] .modal-card { color: var(--ink); background: #192631; border-color: #526579; }

@media (max-width: 960px) {
  .teacher-grid, .student-grid { grid-template-columns: 1fr; }
  .dimension-grid, .framework-preview { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr 1fr; }
  .control-grid > :first-child { grid-column: 1 / -1; }
  .route-banner { align-items: start; }
  .teacher-grid > aside, .student-grid > aside { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .status-strip small { display: none; }
  .app-shell { padding-top: 18px; }
  .route-banner { grid-template-columns: 1fr; }
  .ticket { width: 100%; }
  .identity, .choice-grid, .entry-grid, .mode-panel, .control-grid, .answer-row, .guidance-grid, .content-card-grid { grid-template-columns: 1fr; }
  .control-grid > :first-child { grid-column: auto; }
  .teacher-grid > aside, .student-grid > aside { grid-template-columns: 1fr; }
  .current-task { grid-template-columns: 1fr; }
  .current-task .big-number { font-size: 38px; }
  .group-row { grid-template-columns: 1fr auto; }
  .group-row .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .task-actions { align-items: stretch; flex-direction: column; }
  .task-actions .button { width: 100%; }
  .route-status-card { width: 100%; min-width: 0; }
  .stage-state-stack { justify-items: start; }
  .stat-row { grid-template-columns: 1fr auto; }
  .stat-row .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .response-list > div { grid-template-columns: 1fr; gap: 4px; }
  .modal-layer { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

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

@media print {
  .topbar, .button-row, .task-actions { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; break-inside: avoid; }
}
