:root {
  /* single source of truth — warm paper / deep green (Khan-inspired) */
  --bg: #f6f4ef;
  --surface: #fffdf9;
  --surface-2: #f3efe7;
  --ink: #26221a;
  --ink-soft: #5d5748;
  --ink-faint: #98917f;
  --line: #e6e0d4;
  --accent: #0e8a63;
  --accent-soft: #ddf2e9;
  --good: #188038;
  --good-soft: #e3f4e9;
  --bad: #c5221f;
  --bad-soft: #fbe9e7;
  --warn: #b06000;
  --warn-soft: #fdf0dc;
  --purple: #6b5cd6;
  --purple-soft: #efeafd;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(38, 34, 26, .05), 0 6px 20px rgba(38, 34, 26, .06);
  --shadow-pop: 0 18px 50px rgba(20, 16, 8, .22);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --sidebar-w: 268px;
  --topbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130e;
    --surface: #201c15;
    --surface-2: #292419;
    --ink: #efeade;
    --ink-soft: #b5ad99;
    --ink-faint: #7d7563;
    --line: #35301f;
    --accent: #2fbe8b;
    --accent-soft: #10312a;
    --good: #4cc38a;
    --good-soft: #14301f;
    --bad: #ef6a6a;
    --bad-soft: #381c1c;
    --warn: #e8a04c;
    --warn-soft: #38290f;
    --purple: #a89ae8;
    --purple-soft: #2c2442;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .3);
    --shadow-pop: 0 22px 60px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: clip;
}

canvas { max-width: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

#app { display: flex; min-height: 100vh; min-height: 100dvh; }

button { font-family: inherit; }

/* ---------- Topbar (mobile) ---------- */

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
}

.hamburger {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink);
}

.topbar .brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.topbar .brand-mini span.label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0e8a63, #14b8a6);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.topbar-xp {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 5px 11px;
  white-space: nowrap;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 20, 0.5);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ---------- Sidebar ---------- */

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 10px 14px;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 10px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover { background: var(--bg); color: var(--ink); }

.nav-link.active { background: var(--accent-soft); color: var(--accent); }

.nav-link .icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.icon.math { background: #e8edff; }
.icon.cs { background: #f3e8ff; }
.icon.data { background: #dff7ef; }
.icon.projects { background: #ffedd5; }

@media (prefers-color-scheme: dark) {
  .icon.math { background: #232b4d; }
  .icon.cs { background: #2c1f42; }
  .icon.data { background: #14352a; }
  .icon.projects { background: #3a2a0f; }
}

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
}

.user-chip:hover { background: var(--bg); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}

.user-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; }

.role-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 1px 7px;
}

.role-tag.teacher { background: var(--purple-soft); color: var(--purple); }
.role-tag.student { background: var(--accent-soft); color: var(--accent); }

.user-xp { font-size: 11.5px; color: var(--ink-faint); font-weight: 700; margin-left: 6px; }

/* ---------- Main / pages ---------- */

#main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

#main {
  flex: 1;
  min-width: 0;
  padding: clamp(18px, 4vw, 44px) clamp(16px, 4vw, 44px) 90px;
}

.loading-screen { display: grid; place-items: center; min-height: 60vh; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.page { max-width: 1020px; margin: 0 auto; animation: fadein 0.25s ease; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

h1.page-title { font-size: clamp(23px, 4vw, 30px); letter-spacing: -0.03em; margin: 0 0 6px; }

.page-sub { color: var(--ink-soft); margin: 0 0 28px; font-size: clamp(14.5px, 2vw, 16px); }

.hero {
  background: linear-gradient(120deg, #123f31, #0e8a63 60%, #14b8a6);
  border-radius: 20px;
  color: #fff;
  padding: clamp(22px, 4vw, 36px);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.hero h1 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 30px); letter-spacing: -0.03em; }
.hero p { margin: 0; opacity: 0.85; max-width: 600px; font-size: clamp(14px, 2vw, 16px); }

.hero-stats { display: flex; gap: clamp(16px, 4vw, 28px); margin-top: 20px; flex-wrap: wrap; }

.hero-stat b { font-size: clamp(18px, 3vw, 22px); display: block; }
.hero-stat span { font-size: 12.5px; opacity: 0.75; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }

.course-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.course-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}

@media (hover: hover) {
  .course-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(28, 35, 51, 0.08), 0 16px 40px rgba(28, 35, 51, 0.11); }
}

.course-card h3 { margin: 12px 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.course-card p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 15px; font-size: 12.5px; color: var(--ink-faint);
}

.progress-track {
  height: 6px; border-radius: 99px; background: var(--line);
  overflow: hidden; margin-top: 13px;
}

.progress-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}

.badge.math { background: #e8edff; color: #4059d8; }
.badge.cs { background: #f3e8ff; color: #8b31d4; }
.badge.data { background: #dff7ef; color: #0d9268; }
.badge.projects { background: #ffedd5; color: #b45309; }
.badge.done { background: var(--good-soft); color: var(--good); }
.badge.started { background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: var(--bg); color: var(--ink-faint); border: 1px solid var(--line); }

@media (prefers-color-scheme: dark) {
  .badge.math { background: #232b4d; color: #9fb1ff; }
  .badge.cs { background: #2c1f42; color: #cf9df5; }
  .badge.data { background: #14352a; color: #5fd3a5; }
  .badge.projects { background: #3a2a0f; color: #fbbf24; }
}

.section-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: clamp(17px, 3vw, 20px); letter-spacing: -0.01em; }
.section-head .see-all { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* ---------- Lesson rows ---------- */

.lesson-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: 10px;
  text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) {
  .lesson-row:hover { transform: translateX(4px); box-shadow: var(--shadow); }
}

.lesson-num {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: var(--ink-soft); flex-shrink: 0;
}

.lesson-row.done .lesson-num { background: var(--good); border-color: var(--good); color: #fff; }
.lesson-row.current .lesson-num { border-color: var(--accent); color: var(--accent); }

.lesson-row h3 { margin: 0 0 2px; font-size: 15.5px; }
.lesson-row p { margin: 0; font-size: 13px; color: var(--ink-soft); }

.lesson-row .spacer { flex: 1; }

/* ---------- Lesson player ---------- */

.lesson-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.back-link {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
}

.back-link:hover { color: var(--ink); }

.step-dots { display: flex; gap: 6px; margin-left: auto; align-items: center; }

.dot { width: 9px; height: 9px; border-radius: 99px; background: var(--line); transition: all 0.25s ease; }
.dot.done { background: var(--accent); }
.dot.current { width: 24px; background: var(--accent); }

.step-card-wrap { position: relative; }

.step-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 38px);
  min-height: min(420px, 60vh);
  display: flex; flex-direction: column;
}

.step-kind {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}

.step-title { font-size: clamp(20px, 3.4vw, 25px); letter-spacing: -0.02em; margin: 0 0 16px; }

.step-body p { margin: 0 0 14px; font-size: clamp(15.5px, 2vw, 16.5px); }

.callout {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 16px 0; font-size: 14.5px;
}

.callout.warn { border-color: var(--warn); background: var(--warn-soft); }

code.inline {
  font-family: var(--mono); background: rgba(127, 137, 160, 0.14);
  padding: 1px 6px; border-radius: 6px; font-size: 0.88em;
}

.widget-mount { margin: 20px 0 8px; }

.step-controls {
  margin-top: auto; padding-top: 24px;
  display: flex; align-items: center; gap: 12px;
}

.btn {
  border: none; border-radius: 12px;
  padding: 13px 26px; min-height: 46px;
  font-size: 15.5px; font-weight: 700; cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-good { background: var(--good); color: #fff; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.btn-small { padding: 8px 16px; min-height: 38px; font-size: 13.5px; border-radius: 10px; }

@media (max-width: 700px) {
  .step-controls {
    position: sticky; bottom: 0;
    background: linear-gradient(to top, var(--surface) 78%, transparent);
    margin-left: calc(clamp(20px, 4vw, 38px) * -1);
    margin-right: calc(clamp(20px, 4vw, 38px) * -1);
    margin-bottom: calc(clamp(20px, 4vw, 38px) * -1);
    padding: 26px clamp(20px, 4vw, 38px) max(14px, env(safe-area-inset-bottom));
  }
  .step-controls .btn { flex: 1; }
  .step-controls .btn-ghost { flex: 0 0 auto; }
}

/* ---------- Quiz ---------- */

.quiz-prompt { font-size: clamp(16.5px, 2.4vw, 18px); font-weight: 600; margin: 4px 0 18px; line-height: 1.5; }

.options { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
  display: flex; align-items: center; gap: 13px; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 14px 16px; min-height: 50px; font-size: 15.5px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease; width: 100%;
  color: var(--ink);
}

.option-btn:hover:not(:disabled) { border-color: #c3cdf5; background: #fafbff; }
@media (prefers-color-scheme: dark) {
  .option-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
}
.option-btn:disabled { cursor: default; }

.option-key {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: var(--ink-soft); flex-shrink: 0;
}

.option-btn.correct { border-color: var(--good); background: var(--good-soft); }
.option-btn.correct .option-key { background: var(--good); border-color: var(--good); color: #fff; }
.option-btn.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option-btn.wrong .option-key { background: var(--bad); border-color: var(--bad); color: #fff; }
.option-btn.dimmed { opacity: 0.5; }

.feedback { border-radius: 12px; padding: 13px 17px; margin-top: 16px; font-size: 14.5px; animation: fadein 0.2s ease; white-space: pre-wrap; }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }

.numeric-input {
  font-size: 21px; font-weight: 700; padding: 11px 17px; min-height: 50px;
  border: 2px solid var(--line); border-radius: 12px; width: min(220px, 56vw);
  font-family: var(--font); outline: none; background: var(--surface-2); color: var(--ink);
  transition: border-color 0.15s ease;
}

.numeric-input:focus { border-color: var(--accent); }
.numeric-input.good { border-color: var(--good); background: var(--good-soft); }
.numeric-input.bad { border-color: var(--bad); background: var(--bad-soft); }

.order-list { display: flex; flex-direction: column; gap: 8px; user-select: none; }

.order-item {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px;
  background: var(--surface); cursor: grab; font-size: 14.5px; touch-action: none;
}

.order-item.dragging { opacity: 0.4; }
.order-item .drag-handle { color: var(--ink-faint); cursor: grab; font-size: 18px; }
.order-item.correct { border-color: var(--good); background: var(--good-soft); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-soft); }

.hint-box {
  background: var(--warn-soft); border-radius: 12px; padding: 12px 17px;
  margin-top: 13px; color: var(--warn); font-size: 14px; animation: fadein 0.2s ease;
}

/* ---------- Code steps ---------- */

.code-task {
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 12px; padding: 13px 17px; margin-bottom: 14px; font-size: 14.5px;
}

.code-editor {
  width: 100%; min-height: 180px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  border: 2px solid var(--line); border-radius: 12px; padding: 13px 15px;
  resize: vertical; outline: none; background: var(--surface-2); color: var(--ink);
  tab-size: 2;
}

.code-editor:focus { border-color: var(--accent); }

.console-output {
  font-family: var(--mono); font-size: 13px;
  background: #14181f; color: #d6deeb;
  border-radius: 12px; padding: 13px 16px; margin-top: 13px;
  min-height: 50px; max-height: 260px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}

.console-output .err { color: #ff8f8f; }
.console-output .sys { color: #8fa3bf; font-style: italic; }
.console-output .ok { color: #7ee2a8; }

.runner-bar { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }

.py-status { font-size: 13px; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }

/* ---------- Widgets ---------- */

.widget { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: clamp(12px, 2.5vw, 18px); overflow-x: hidden; }
.widget canvas { display: block; width: 100%; border-radius: 8px; touch-action: pan-y; }
.widget-caption { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; min-width: 0; }
.slider-row label { width: clamp(84px, 18vw, 130px); font-weight: 600; font-family: var(--mono); font-size: 13px; flex-shrink: 0; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 80px; }

.slider-val { font-family: var(--mono); font-weight: 700; min-width: 56px; text-align: right; color: var(--accent); }

.viz-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

.chip-btn {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 8px 16px; min-height: 38px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; color: var(--ink-soft); transition: all 0.15s ease;
}

.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.stat-pills { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 13px; }

.stat-pill {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 13px; font-size: 12.5px;
}

.stat-pill b { display: block; font-size: 15.5px; font-family: var(--mono); }

.bases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-top: 14px; }

.base-cell label { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.base-cell input {
  width: 100%; font-family: var(--mono); font-size: 18px; font-weight: 700;
  padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px;
  outline: none; margin-top: 4px; background: var(--surface); color: var(--ink);
}

.base-cell input:focus { border-color: var(--accent); }

.bit-lamps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.bit-lamp { width: clamp(38px, 9vw, 46px); text-align: center; cursor: pointer; }

.lamp {
  height: clamp(38px, 9vw, 46px); border-radius: 10px;
  background: var(--bg); border: 2px solid var(--line);
  display: grid; place-items: center; font-family: var(--mono);
  font-weight: 800; font-size: 18px; transition: all 0.15s ease;
}

.bit-lamp.on .lamp { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(79, 109, 245, 0.4); }

.bit-lamp small { display: block; margin-top: 4px; font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); }

.gate-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.gate-cell { flex: 1; min-width: 96px; text-align: center; }

.gate-cell .gate-name { font-family: var(--mono); font-weight: 800; font-size: 13px; color: var(--ink-faint); letter-spacing: 0.04em; }

.gate-out {
  margin-top: 6px; height: 52px; border-radius: 12px;
  background: var(--bg); border: 2px solid var(--line);
  display: grid; place-items: center; font-family: var(--mono);
  font-weight: 800; font-size: 24px; color: var(--ink-faint); transition: all 0.15s ease;
}

.gate-out.on { background: var(--good); border-color: var(--good); color: #fff; box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35); }

.truth-table { border-collapse: collapse; margin-top: 16px; font-family: var(--mono); font-size: 14px; width: 100%; }

.truth-table th, .truth-table td {
  border: 1px solid var(--line); padding: 7px 12px; text-align: center;
}

.truth-table th { background: var(--bg); color: var(--ink-soft); font-size: 12px; }
.truth-table tr.live { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }

.switch-inputs { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }

.toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 2px solid var(--line); padding: 9px 16px; border-radius: 12px;
  background: var(--surface); font-weight: 700; font-family: var(--mono);
  min-height: 46px; transition: all 0.15s ease;
}

.toggle.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- LED matrix widget ---------- */

.led-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.led-cell.on {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}

/* ---------- Roadmap v2 ---------- */

.roadmap-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.roadmap-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

.roadmap-progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; font-size: 13px; color: var(--ink-soft); }
.roadmap-progress .progress-track { flex: 1; margin-top: 0; max-width: 220px; }

.rm-stage {
  position: relative;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
  max-height: min(74vh, 780px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.rm-sizer { position: relative; }

.rm-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; padding: 30px; }

.rm-svg { display: block; }

.rm-node { cursor: pointer; }
.rm-node:focus-visible { outline: none; }
.rm-node:focus-visible rect { stroke: var(--accent); stroke-width: 3; }

.rm-node rect.body {
  fill: var(--surface); stroke: var(--line); stroke-width: 1.5;
  transition: stroke 0.15s ease, fill 0.15s ease;
}

@media (hover: hover) {
  .rm-node:hover rect.body { stroke: var(--accent); fill: var(--accent-soft); }
}

.rm-node.state-done rect.body { fill: var(--good-soft); stroke: var(--good); }
.rm-node.state-started rect.body { fill: var(--accent-soft); stroke: var(--accent); }
.rm-node.state-next rect.body { stroke: var(--purple); stroke-width: 2.5; stroke-dasharray: 7 4; }
.rm-node.state-resource rect.body { stroke-dasharray: 5 4; }

.rm-node text.n-title { fill: var(--ink); font-weight: 700; font-size: 13.5px; font-family: var(--font); }
.rm-node text.n-sub { fill: var(--ink-faint); font-size: 10.5px; font-family: var(--font); letter-spacing: 0.02em; }
.rm-node text.n-icon { font-size: 15px; }

.rm-edge { fill: none; stroke: var(--ink-faint); stroke-width: 2; opacity: 0.4; }
.rm-edge.lit { stroke: var(--good); opacity: 0.85; }

.zoom-controls { display: flex; gap: 6px; }

.rm-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 12, 20, 0.5);
  animation: fadein 0.15s ease;
}

@media (min-width: 700px) {
  .rm-overlay { align-items: center; }
}

.rm-card {
  background: var(--surface); width: min(480px, 100%);
  border-radius: 20px 20px 0 0;
  padding: 20px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.35);
  animation: slidein 0.2s ease;
  max-height: 82dvh; overflow-y: auto;
}

@media (min-width: 700px) {
  .rm-card { border-radius: 18px; padding-bottom: 22px; }
}

.rm-card h3 { margin: 0 0 2px; font-size: 19px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rm-card .n-sub { color: var(--ink-faint); font-size: 13px; margin-bottom: 10px; }
.rm-card p.blurb { margin: 0 0 16px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }

.rm-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 2px 0; font-size: 12px; color: var(--ink-soft); }
.legend span::before {
  content: ""; display: inline-block; width: 11px; height: 11px;
  border-radius: 4px; margin-right: 5px; vertical-align: -1px; background: var(--line);
}
.legend .lg-done::before { background: var(--good); }
.legend .lg-started::before { background: var(--accent); }
.legend .lg-next::before { background: var(--purple); }
.legend .lg-resource::before { background: repeating-linear-gradient(45deg, var(--line) 0 3px, transparent 3px 6px); }

/* ---------- Auth / login ---------- */

.auth-mode #sidebar, .auth-mode .topbar { display: none !important; }
.auth-mode #main { padding: 0; }

.auth-screen {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 26px 26px,
    linear-gradient(180deg, var(--bg), #efeadf);
  padding: 20px;
}

.auth-card {
  width: min(430px, 100%);
  background: var(--surface); border-radius: 22px;
  padding: 30px clamp(20px, 5vw, 34px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  animation: fadein 0.3s ease;
}

.auth-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.auth-card .auth-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }

.profile-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.profile-btn {
  display: flex; align-items: center; gap: 13px; width: 100%;
  border: 2px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 12px 15px; cursor: pointer; text-align: left;
  color: var(--ink); transition: border-color 0.15s ease;
  min-height: 62px;
}

.profile-btn:hover { border-color: var(--accent); }

.field { margin-bottom: 14px; }

.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }

.field input[type="text"], .field input[type="password"] {
  width: 100%; font-size: 16px; padding: 12px 14px; min-height: 48px;
  border: 2px solid var(--line); border-radius: 12px; outline: none;
  background: var(--surface-2); color: var(--ink); font-family: var(--font);
}

.field input:focus { border-color: var(--accent); }

.avatar-picker { display: flex; gap: 7px; flex-wrap: wrap; }

.avatar-option {
  width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); font-size: 22px; cursor: pointer; display: grid; place-items: center;
}

.avatar-option.selected { border-color: var(--accent); background: var(--accent-soft); }

.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.role-option {
  border: 2px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 13px; cursor: pointer; text-align: center; font-weight: 700; font-size: 14px;
  color: var(--ink);
}

.role-option.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.role-option small { display: block; font-weight: 500; color: var(--ink-faint); font-size: 11.5px; margin-top: 2px; }

/* Error styling only applies when a message is present — empty .form-error
   divs are reserved on every creation form and must stay invisible. */
.form-error { color: var(--bad); font-size: 13.5px; }
.form-error:not(:empty) {
  background: var(--bad-soft); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 13px; animation: fadein 0.2s ease;
}

.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-soft); margin-top: 16px; }
.auth-switch button { border: none; background: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 13.5px; }

/* ---------- Dashboard & progress ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 12px; margin-bottom: 26px; }

.stat-card { text-align: center; padding: 16px 10px; }
.stat-card b { display: block; font-size: clamp(22px, 4vw, 28px); letter-spacing: -0.02em; }
.stat-card span { font-size: 12px; color: var(--ink-soft); }

.roster-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; margin-bottom: 10px; cursor: pointer; text-align: left;
  color: inherit; transition: box-shadow 0.15s ease;
}

.roster-row:hover { box-shadow: var(--shadow); }

.roster-row .who { flex: 1; min-width: 0; }
.roster-row .who b { font-size: 15px; display: block; }
.roster-row .who span { font-size: 12.5px; color: var(--ink-soft); }

.roster-row .nums { text-align: right; font-size: 12.5px; color: var(--ink-soft); flex-shrink: 0; }
.roster-row .nums b { display: block; font-size: 15px; color: var(--ink); }

.activity-bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; margin-top: 8px; }

.activity-bars .bar {
  flex: 1; min-width: 6px; border-radius: 4px 4px 0 0;
  background: var(--accent); opacity: 0.85; min-height: 3px;
}

.activity-bars .bar.zero { background: var(--line); }

.day-labels { display: flex; gap: 4px; margin-top: 5px; }
.day-labels span { flex: 1; min-width: 6px; font-size: 9.5px; color: var(--ink-faint); text-align: center; }

.table-scroll { overflow-x: auto; }

table.records { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.records th, table.records td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.records th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }

.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }

.badge-card {
  text-align: center; padding: 18px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}

.badge-card .emoji { font-size: 34px; filter: grayscale(1); opacity: 0.35; }
.badge-card.earned .emoji { filter: none; opacity: 1; }
.badge-card b { display: block; font-size: 13.5px; margin-top: 8px; }
.badge-card span { font-size: 11.5px; color: var(--ink-faint); }
.badge-card.earned { border-color: var(--good); background: var(--good-soft); }

/* ---------- Completion ---------- */

.complete-card { text-align: center; padding: clamp(36px, 7vw, 60px) 24px; }
.complete-card .trophy { font-size: 54px; }
.complete-card h2 { font-size: clamp(22px, 4vw, 27px); margin: 12px 0 6px; letter-spacing: -0.02em; }
.complete-card p { color: var(--ink-soft); margin: 0 0 24px; }

.xp-burst {
  display: inline-block; background: var(--warn-soft); color: var(--warn);
  font-weight: 800; border-radius: 99px; padding: 7px 18px; margin-bottom: 16px; font-size: 14px;
}

/* ---------- Sandbox & panels ---------- */

.sandbox-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }

/* ---------- Toasts ---------- */

.toast-wrap { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); right: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 200; pointer-events: none; }

.toast {
  background: var(--ink); color: var(--bg); border-radius: 12px;
  padding: 13px 20px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); animation: slidein 0.25s ease;
  max-width: 100%;
}

@keyframes slidein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive breakpoints ---------- */

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }

  .topbar { display: flex; }

  #sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.25);
    height: 100dvh;
  }

  #sidebar.open,
  .app-shell.drawer-open #sidebar { transform: translateX(0); }

  .app-shell.drawer-open .scrim { opacity: 1; pointer-events: auto; }

  #main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

  .sandbox-grid { grid-template-columns: 1fr; }

  .lesson-header .page-title { order: 3; width: 100%; flex-basis: 100%; }
}

@media (min-width: 901px) {
  .scrim { display: none; }
}

@media (pointer: coarse) {
  .btn, .option-btn, .chip-btn, .profile-btn { min-height: 48px; }
}


/* ============================================================
   Games, widgets & feature styles � built on the design tokens
   (surface / surface-2 / line / accent / good / bad / warn)
   ============================================================ */

/* ---------- matcher widget (pair matching) ---------- */
.matcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.matcher-col { display: flex; flex-direction: column; gap: 8px; }
.matcher-cell {
  text-align: left; padding: 11px 14px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.matcher-cell:hover { border-color: var(--accent); }
.matcher-cell.picked { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.015); }
.matcher-cell.locked { border-color: var(--good); background: var(--good-soft); color: var(--good); cursor: default; opacity: .85; }
.matcher-cell.wrong { animation: matcher-shake .5s ease; border-color: var(--bad); }
.matcher-done .matcher-cell.locked { box-shadow: 0 2px 10px rgba(22, 163, 74, .18); }
@keyframes matcher-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---------- sudoku ---------- */
.sudoku { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; --su-strong: var(--ink-faint); }
.sudoku-toolbar { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-soft); min-height: 24px; gap: 10px; }
.sudoku-board {
  display: grid; grid-template-columns: repeat(9, 1fr);
  background: var(--surface); border: 2.5px solid var(--su-strong); border-radius: 12px;
  overflow: hidden; touch-action: manipulation;
}
.su-cell {
  aspect-ratio: 1; font-size: clamp(14px, 4.5vw, 21px); font-weight: 600;
  color: var(--accent); background: var(--surface); cursor: pointer;
  font-family: var(--mono); border: none;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.su-cell:nth-child(9n) { border-right: none; }
.su-cell:nth-child(n+73) { border-bottom: none; }
.su-cell.br-heavy { border-right: 2px solid var(--su-strong); }
.su-cell.bb-heavy { border-bottom: 2px solid var(--su-strong); }
.su-cell[data-given="1"] { color: var(--ink); font-weight: 700; background: var(--surface-2); }
.su-cell.sel { outline: 2.5px solid var(--accent); outline-offset: -2.5px; position: relative; z-index: 1; }
.su-cell.peer { background: var(--accent-soft); }
.su-cell.conflict { color: var(--bad) !important; background: var(--bad-soft); }
.su-cell.hinted { animation: hint-pop .6s ease; }
@keyframes hint-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.su-cell.note { font-size: clamp(8px, 2.4vw, 11px); color: var(--ink-faint); white-space: pre; line-height: 1.05; font-family: var(--font); }
.su-cell:focus-visible { outline: 2.5px solid var(--purple); outline-offset: -2.5px; }

.sudoku-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.su-num { min-height: 44px; font-size: 16px; font-family: var(--mono); }
.sudoku-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.chip-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sudoku-options { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }

.diff-picker { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- memory match ---------- */
.memory { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; perspective: 600px; }
.memory-card {
  aspect-ratio: 3/4; border-radius: 12px; border: 1.5px solid var(--line);
  background: linear-gradient(135deg, var(--purple), var(--accent));
  font-size: clamp(24px, 7vw, 34px); cursor: pointer; transition: transform .15s ease, background .15s;
}
.memory-card.open { background: var(--surface); transform: scale(1.04); }
.memory-card.done { background: var(--good-soft); border-color: var(--good); opacity: .92; cursor: default; }

.game-chooser { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.game-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 10px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.game-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.game-icon { font-size: 26px; }
.game-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.game-card small { color: var(--ink-faint); font-size: 11px; }

/* ---------- certificates ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.cert-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 20px 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
}
.cert-icon { font-size: 34px; }
.cert-kind { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-faint); }
.cert-title { font-weight: 800; font-size: 15px; color: var(--ink); }
.cert-card small { color: var(--ink-faint); font-size: 11.5px; }
.cert-card.earned { border: 2px solid #c9a227; background: linear-gradient(160deg, #fffaf0, #fdf3d3); cursor: pointer; transition: transform .15s; }
.cert-card.earned:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(201, 162, 39, .25); }
.cert-card.locked { opacity: .62; filter: grayscale(.35); }
.cert-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 34, .55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; overflow: auto;
}
.cert-paper { width: min(680px, 96vw); background: #fffdf6; border-radius: 6px; padding: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); color: #1c2333; }
.cert-border { border: 3px double #c9a227; border-radius: 4px; padding: 38px 30px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.cert-brand { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #a08316; }
.cert-border h2 { margin: 0; font-size: 26px; color: #2c2410; }
.cert-awarded { margin: 0; font-style: italic; color: #6b5d33; font-size: 14px; }
.cert-name { font-size: clamp(22px, 7vw, 32px); font-weight: 800; color: #1d1712; border-bottom: 2px solid #c9a227; display: inline-block; align-self: center; padding: 0 26px 6px; }
.cert-course { font-size: 21px; font-weight: 700; color: #7a5c00; }
.cert-date { font-size: 13px; color: #6b5d33; }
.cert-sig-row { display: flex; justify-content: space-between; align-items: end; margin-top: 18px; gap: 12px; }
.cert-sig { font-family: var(--mono); font-size: 11px; color: #857441; border-top: 1px solid #c9a227; padding-top: 5px; min-width: 140px; }
.cert-seal { font-size: 40px; }
.cert-actions { display: flex; gap: 10px; }

@media print {
  body * { visibility: hidden !important; }
  .cert-overlay, .cert-overlay * { visibility: visible !important; }
  .cert-overlay { position: absolute; inset: 0; background: #fff; padding: 0; }
  .no-print { display: none !important; }
}

/* ---------- mastery practice ---------- */
.practice-stage { max-width: 560px; }
.practice-progress { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin: 10px 2px; }
.practice-card { padding: 22px; }
.practice-q { font-size: clamp(22px, 6vw, 30px); font-weight: 800; text-align: center; padding: 18px 0 22px; font-family: var(--mono); }
.practice-row { display: flex; gap: 10px; }
.practice-row input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 11px; border: 1.5px solid var(--line);
  font-size: 17px; background: var(--surface); color: var(--ink); font-family: var(--mono);
}
.practice-feedback { min-height: 26px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.practice-feedback.good { color: var(--good); }
.practice-feedback.warn { color: var(--warn); }
.topic-picker { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- mastery chips (Khan-style) ---------- */
.mastery-chip {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  border-radius: 99px; padding: 3px 10px; border: 1px solid transparent;
}
.mastery-chip.none { background: var(--bg); color: var(--ink-faint); border-color: var(--line); }
.mastery-chip.attempted { background: var(--bg); color: var(--ink-soft); border-color: var(--line); }
.mastery-chip.familiar { background: var(--warn-soft); color: var(--warn); }
.mastery-chip.proficient { background: var(--accent-soft); color: var(--accent); }
.mastery-chip.mastered { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; }
.mastery-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mastery-cell b { font-size: 12.5px; line-height: 1.25; }
.mastery-line { margin-top: 6px; }

/* ---------- assignments ---------- */
.assignment-panel { margin-bottom: 20px; border-left: 4px solid var(--accent); }
.assignment-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.assignment-row:hover { border-color: var(--accent); background: var(--bg); }
.assignment-row.done { opacity: .68; }
.assign-icon { font-size: 21px; }
.assignment-row small { display: block; color: var(--ink-faint); font-size: 11.5px; }
.assignment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.assignment-form label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.assignment-form input, .assignment-form select {
  padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; width: 100%;
}
.assignment-form .btn-good { grid-column: 1 / -1; margin-top: 8px; }
.assignment-manager { width: min(560px, 94vw); max-height: 86vh; overflow-y: auto; }
.assignment-admin-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px;
}

/* ---------- collapsible sidebar rail (desktop only) ---------- */
.nav-collapse {
  position: absolute; top: 16px; right: 12px; width: 30px; height: 30px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink-soft); cursor: pointer; font-size: 13px; line-height: 1;
  transition: background .15s, color .15s; z-index: 2;
}
.nav-collapse:hover { background: var(--accent-soft); color: var(--accent); }
.brand { position: relative; padding-right: 48px; }

@media (min-width: 901px) {
  #sidebar { transition: width .18s ease; }
  body.rail #sidebar { width: 76px; padding-inline: 9px; }
  body.rail #sidebar .brand { padding-inline: 0; justify-content: center; padding-right: 0; padding-bottom: 8px; }
  body.rail .nav-collapse {
    position: static; order: -1; align-self: center; margin: 0 auto 6px; display: block;
    top: auto; right: auto; transform: none;
  }
  body.rail #sidebar .nav-text { display: none; }
  body.rail #sidebar .nav-label { font-size: 0; padding: 12px 0 4px; min-height: 0; }
  body.rail #sidebar .nav-label::before { content: ""; display: block; height: 1px; background: var(--line); }
  body.rail #sidebar .nav-link { justify-content: center; padding-inline: 0; }
  body.rail #sidebar .user-chip > div:not(.user-avatar) { display: none; }
  body.rail #sidebar .user-chip { justify-content: center; padding: 6px; }
  body.rail .search-pill { justify-content: center; padding: 8px; margin: 10px 0 6px; }
  body.rail .search-pill .sp-label { display: none; }
}
@media (max-width: 900px) {
  .nav-collapse { display: none; }
}

/* ---------- mobile polish (<=700px) ---------- */
@media (max-width: 700px) {
  .page { padding: 18px 14px 26px; }
  h1.page-title { font-size: 24px; }
  .hero { padding: 20px 16px; }
  .sudoku { max-width: 100%; }
  .sudoku-pad { gap: 4px; }
  .su-num { min-height: 40px; font-size: 15px; padding: 0; }
  .practice-row { flex-wrap: wrap; }
  .practice-row input { font-size: 17px; min-width: 0; flex: 1 1 130px; }
  .practice-row .btn { flex: 1 1 auto; }
  .matcher-cell { padding: 9px 11px; font-size: 13px; }
  .cert-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .game-chooser { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .roadmap-toolbar { flex-wrap: wrap; gap: 8px; }
  .assignment-form { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .memory-grid { gap: 7px; }
  .diff-picker, .topic-picker { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}

/* ---------- brand logo svg ---------- */
.brand-logo svg { display: block; width: 100%; height: 100%; }
.auth-logo { width: 60px; margin: 0 auto 12px; }
.auth-logo svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 16px rgba(79, 109, 245, .35)); }

/* ---------- graph walk widget ---------- */
.gw-svg { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; touch-action: manipulation; }
.gw-edge { stroke: var(--line); stroke-width: 3; transition: stroke .3s; }
.gw-edge.gw-lit { stroke: var(--accent); }
.gw-circle { fill: var(--surface-2); stroke: var(--ink-faint); stroke-width: 2.5; transition: fill .25s, stroke .25s; }
.gw-circle.gw-visited { fill: var(--good-soft); stroke: var(--good); }
.gw-circle.gw-frontier { fill: var(--accent); stroke: var(--accent); }
.gw-circle.gw-target-hit { stroke: #ffc53d; stroke-width: 5; }
.gw-node { cursor: pointer; }
.gw-label { font-size: 15px; font-weight: 700; fill: var(--ink); pointer-events: none; font-family: var(--font); }
.gw-node circle.gw-frontier ~ .gw-label { fill: #fff; }
.gw-dist { font-size: 11px; fill: var(--ink-faint); font-family: var(--mono); pointer-events: none; }
.gw-node.gw-pulse circle.gw-target-hit { animation: gw-pulse 1.1s ease infinite; transform-box: fill-box; transform-origin: center; }
@keyframes gw-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.gw-queue-text { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); }

/* ---------- practice choice mode ---------- */
.practice-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ---------- dashboard density ---------- */
@media (max-width: 700px) {
  .roster-row { padding: 10px 12px; gap: 10px; }
  .roster-row .mastery-line { display: none; }
  .roster-row .who > span { font-size: 12px; }
  .roster-row .nums b { font-size: 14px; }
}

/* ---------- flagship teacher dashboard ---------- */
.dash-hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(147, 51, 234, .14), transparent 55%),
    linear-gradient(120deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
}
.dash-hero-head h1 { font-size: clamp(24px, 3.2vw, 30px); letter-spacing: -.02em; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.dash-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.dash-kpi b { font-size: clamp(17px, 2vw, 21px); letter-spacing: -.01em; color: var(--ink); }
.dash-kpi span { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-section {
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); margin: 26px 2px 12px;
}

.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; }
.class-card {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 15px;
  padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 7px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.class-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.class-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.class-card b { font-size: 14.5px; color: var(--ink); }
.class-card small { color: var(--ink-faint); font-size: 11.5px; }
.class-card-count { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.progress-track.slim { height: 6px; border-radius: 99px; }

/* roster refinement */
.roster-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.roster-row:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.who-top { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.who-top b { font-size: 15px; }
.roster-row .who > span { font-size: 12.5px; color: var(--ink-soft); display: block; margin-top: 2px; }
.roster-row .progress-track { height: 6px; border-radius: 99px; }
.roster-row .nums b { font-size: 16px; color: var(--ink); }

@media (max-width: 700px) {
  .dash-hero { padding: 18px 16px 14px; }
  .dash-kpis { grid-template-columns: repeat(3, 1fr); }
  .dash-kpi:nth-child(n+4) { display: none; }
}

/* ============================================================
   Khan-inspired theme layer (appended last = wins)
   Warm paper neutrals � deep-green primary � serif display type
   ============================================================ */


/* friendly serif for display headings only */
.page-title,
.dash-hero h1,
.dash-section,
.auth-card h1 {
  font-family: var(--font-head);
  letter-spacing: 0;
}
.dash-section { text-transform: none; font-size: 15px; }

/* pill actions */
.btn { border-radius: 999px; padding-inline: 18px; }

/* topbar XP pill goes green */
.topbar-xp { color: var(--accent); background: var(--accent-soft); }

/* option keys & step dots pick up green */
.option-key { border-radius: 8px; }

/* ---------- Khan-style course cards ---------- */
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cc-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 24px; flex-shrink: 0;
}
.cc-math        { background: #e8effc; }
.cc-cs          { background: #ece7fb; }
.cc-data        { background: #fdf0d7; }
.cc-electronics { background: #fdeadd; }
.cc-algorithms  { background: #e4ecfd; }
.cc-projects    { background: #dcf3ea; }
@media (prefers-color-scheme: dark) {
  .cc-math        { background: #1d2740; }
  .cc-cs          { background: #262038; }
  .cc-data        { background: #383014; }
  .cc-electronics { background: #3a2517; }
  .cc-algorithms  { background: #1c2748; }
  .cc-projects    { background: #14342b; }
}

/* ---------- puzzle maze widget ---------- */
.pm-board {
  display: grid; gap: 4px; background: var(--surface-2);
  border: 2.5px solid var(--su-strong, var(--ink-faint)); border-radius: 14px;
  padding: 6px; max-width: 480px; margin: 0 auto; position: relative;
}
.pm-cell {
  aspect-ratio: 1; background: var(--surface); border-radius: 8px;
  display: grid; place-items: center; font-size: clamp(14px, 3.4vw, 20px);
}
.pm-cell.wall { background: repeating-linear-gradient(45deg, var(--line) 0 4px, var(--ink-faint) 4px 5px); opacity: .8; }
.pm-cell.goal { background: var(--warn-soft); }
.pm-hero {
  position: relative; z-index: 2; display: grid; place-items: center;
  font-size: clamp(18px, 4.4vw, 26px); transition: all .35s ease;
}
.pm-hero.crash { animation: pm-shake .45s ease; }
.pm-hero.win::after { content: "?"; position: absolute; top: -14px; right: -12px; }
@keyframes pm-shake { 0%,100%{transform:translate(0)} 25%{transform:translate(-4px,-2px)} 75%{transform:translate(4px,2px)} }

.pm-palette { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pm-caption-row { }
.pm-strip-label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 12px 0 5px;
}
.pm-program {
  display: flex; gap: 7px; flex-wrap: wrap; min-height: 44px; align-items: center;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 7px 9px; background: var(--bg);
}
.pm-empty { color: var(--ink-faint); font-size: 13px; font-style: italic; }
.pm-op {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft);
  color: var(--accent); border-radius: 10px; padding: 5px 9px; font-size: 13px; font-weight: 700;
}
.pm-times { display: inline-flex; align-items: center; gap: 3px; }
.pm-step {
  width: 19px; height: 19px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--surface); color: var(--accent); font-size: 12px; line-height: 1; font-weight: 800;
}
.pm-op em { font-style: normal; min-width: 22px; text-align: center; }
.pm-del {
  border: none; background: transparent; color: var(--bad); cursor: pointer;
  font-size: 11px; padding: 2px; opacity: .75;
}
.pm-del:hover { opacity: 1; }
.pm-actions { display: flex; gap: 9px; justify-content: center; margin-top: 12px; }
.pm-solved .pm-board { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

/* ---------- desktop sizing discipline ---------- */
#main .widget { max-width: 680px; margin-inline: auto; width: 100%; }
.lesson-header,
#main .step-card { max-width: 920px; margin-inline: auto; }

/* ---------- milestone stamps (code.org-inspired) ---------- */
.stamp-block { margin: 0 0 28px; }
.stamp-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.stamp-count {
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 999px; padding: 3px 10px;
}
.stamp-count.all { background: var(--good-soft); border-color: transparent; color: var(--good); }
.stamp-strip {
  display: flex; flex-wrap: wrap; gap: 14px 18px;
}
.stamp {
  width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none;
}
.stamp-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  background: var(--surface); color: var(--ink-faint);
  border: 2px dashed var(--line);
}
a.stamp:hover .stamp-icon { border-color: var(--accent); }
.stamp.earned .stamp-icon {
  background: var(--accent-soft); color: var(--ink);
  border: 2.5px solid var(--accent);
  animation: stamp-pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.stamp.locked .stamp-icon { opacity: .45; cursor: not-allowed; }
@keyframes stamp-pop {
  0% { transform: scale(.4) rotate(-14deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
.stamp-name {
  font-size: 10.5px; line-height: 1.25; text-align: center;
  color: var(--ink-faint); font-weight: 600; max-width: 76px;
}
.stamp.earned .stamp-name { color: var(--ink-soft); }

/* ---------- dashboard search + empty states ---------- */
.dash-search {
  position: relative; max-width: 460px; margin: 12px 0 2px;
}
.dash-search input {
  width: 100%; padding: 11px 16px 11px 44px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 14.5px; font-family: inherit;
}
.dash-search input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dash-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .7; pointer-events: none;
}
.empty-state {
  text-align: center; padding: 30px 16px 26px;
  border: 1.5px dashed var(--line); border-radius: 16px;
  background: var(--bg);
}
.empty-state.compact { padding: 14px; border: none; background: none; }
.empty-state h3 { margin: 8px 0 4px; font-size: 15.5px; }
.empty-state p { margin: 0; color: var(--ink-soft); font-size: 13.5px; max-width: 420px; margin-inline: auto; }
.illu-wrap { display: inline-block; width: min(190px, 52vw); color: var(--ink-soft); }
.illu-wrap svg.illu { width: 100%; height: auto; display: block; }

/* ---------- packetnet widget ---------- */
.packetnet { display: flex; flex-direction: column; gap: 12px; }
.pn-controls {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.pn-cut {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  user-select: none;
}
.pn-cut input { accent-color: var(--bad); width: 16px; height: 16px; cursor: pointer; }
.pn-route { font-size: 13.5px; color: var(--ink-soft); }
.pn-route b { color: var(--ink); }
.pn-reroute {
  display: inline-block; margin-left: 6px; padding: 2px 9px;
  background: #fdecec; color: #b42318; border-radius: 999px;
  font-weight: 800; font-size: 12px;
  animation: pn-flash .9s ease-in-out infinite alternate;
}
@keyframes pn-flash { from { opacity: .65; } to { opacity: 1; } }
.pn-canvas {
  width: 100%; height: auto; border: 1.5px solid var(--line);
  border-radius: 14px; background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
}
.pn-link { stroke: var(--line-strong, #b9b3a7); stroke-width: 3.5; stroke-linecap: round; transition: stroke .25s; }
.pn-link.broken {
  stroke: var(--bad); stroke-dasharray: 7 8; stroke-width: 3;
  animation: pn-blink 1s ease-in-out infinite alternate;
}
@keyframes pn-blink { from { opacity: .45; } to { opacity: .95; } }
.pn-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.pn-halo { fill: transparent; stroke: transparent; stroke-width: 3; }
.pn-node.busy .pn-halo { stroke: var(--accent); fill: var(--accent-soft); }
.pn-node.busy .pn-dot { stroke-width: 4; }
.pn-face { font-size: 19px; pointer-events: none; }
.pn-label {
  font-size: 11.5px; font-weight: 700; fill: var(--ink-soft); letter-spacing: .02em;
}
.pn-packet { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 25%)); }
.pn-log {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 13px;
  background: var(--bg);
}
.pn-log-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 6px;
}
.pn-count { color: var(--good); }
.pn-log-list {
  margin: 0; padding: 0; list-style: none;
  font-size: 12.5px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 3px;
}
.pn-log-list li.sep { color: var(--ink-faint); font-weight: 700; margin-top: 3px; }
.pn-log-list li.ok { color: var(--good); font-weight: 700; }
.pn-log-list li.reroute { color: #b42318; }

/* ============================================================
   Khan-classroom teacher dashboard shell
   ============================================================ */

.dash-shell { display: flex; flex-direction: column; gap: 16px; }

.dash-side {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.dash-side::-webkit-scrollbar { display: none; }
.dash-welcome { display: none; }
.dash-nav-item {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600; padding: 8px 15px; border-radius: 999px; cursor: pointer;
}
.dash-nav-item:hover { border-color: var(--accent); color: var(--ink); }
.dash-nav-item.active {
  background: var(--ink); border-color: var(--ink); color: var(--bg);
}
.dash-side-note { display: none; }

.dash-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-faint); margin: 2px 0 16px;
}
.dash-crumb i { font-style: normal; opacity: .55; }
.dash-crumb b { color: var(--ink-soft); font-weight: 700; }

.dash-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.btn.btn-outline {
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
}
.btn.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.dash-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--ink-faint); }

.quiet-list { display: flex; flex-direction: column; gap: 7px; }
.quiet-row {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 13.5px; color: var(--ink);
}
.quiet-row small { color: var(--ink-faint); }
.quiet-row:hover { border-color: var(--warn); }

.report-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 10px;
}
.report-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 21px;
}

@media (min-width: 1000px) {
  .dash-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 26px; align-items: start; }
  .dash-side {
    position: sticky; top: 20px;
    display: flex; flex-direction: column; gap: 4px;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
    padding: 12px; overflow: visible;
  }
  .dash-welcome {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 10px 14px; margin-bottom: 8px;
    border-bottom: 1.5px solid var(--line);
  }
  .dash-welcome .user-avatar { width: 42px; height: 42px; font-size: 22px; }
  .dash-welcome b { display: block; font-size: 14.5px; line-height: 1.25; }
  .dash-welcome small { color: var(--ink-faint); font-size: 12px; }
  .dash-nav-item {
    width: 100%; border: none; background: transparent;
    justify-content: flex-start; border-radius: 11px;
    padding: 10px 13px; font-size: 14px;
  }
  .dash-nav-item.active { background: var(--accent-soft); color: var(--accent); }
  .dn-icon { width: 22px; text-align: center; }
  .dash-side-note {
    display: block; margin: 12px 6px 2px; padding-top: 12px;
    border-top: 1.5px solid var(--line);
    font-size: 11.5px; line-height: 1.45; color: var(--ink-faint);
  }
}

/* ============================================================
   Desktop compaction — tighter type & chrome on wide screens
   ============================================================ */
@media (min-width: 1100px) {
  body { font-size: 14.5px; }
  h1.page-title { font-size: 26px !important; }
  .page-sub { font-size: 13.5px; margin-top: 4px; }
  .dash-section { font-size: 14px; }
  .panel-card { padding: 15px 17px; }
  .course-card { padding: 14px 15px; }
  .course-card h3 { font-size: 15.5px; }
  .course-card p { font-size: 12.5px; }
  .cc-icon { width: 40px; height: 40px; font-size: 21px; }
  .lesson-row { padding: 11px 14px; }
  .lesson-row h3 { font-size: 14.5px; }
  #main .widget { max-width: 640px; }
  .step-card { padding: 16px 19px; }
  .btn { padding-block: 8px; }
  .roster-row { padding: 10px 13px; }
  .stamp-icon { width: 46px; height: 46px; font-size: 21px; }
  .dash-hero { padding: 15px 16px 12px; }
  .auth-card { max-width: 400px; }
}

/* ============================================================
   Professional modal system
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow: auto;
  background: rgba(24, 20, 12, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: overlay-in .18s ease both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--surface); border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(20, 16, 8, .35), 0 2px 8px rgba(20, 16, 8, .12);
  animation: modal-in .22s cubic-bezier(.34, 1.4, .64, 1) both;
  max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
}
.modal-card.closing { animation: modal-out .16s ease both; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modal-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.97); }
}

.modal-head {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 21px;
  background: var(--accent-soft); color: var(--accent);
}
.modal-icon.danger { background: var(--bad-soft); }
.modal-icon.good { background: var(--good-soft); }
.modal-title {
  margin: 0; font-family: var(--font-head);
  font-size: 19px; font-weight: 700; letter-spacing: -.01em;
  flex: 1; min-width: 0;
}
.modal-x {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: transparent; color: var(--ink-faint);
  font-size: 15px; cursor: pointer; flex-shrink: 0;
}
.modal-x:hover { background: var(--surface-2); color: var(--ink); }

.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-body input,
.modal-body select { width: 100%; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px 18px; border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card {
    width: 100% !important; max-height: 88dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    animation: sheet-in .26s cubic-bezier(.3, 1.1, .6, 1) both;
  }
  .modal-card.closing { animation: sheet-out .18s ease both; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes sheet-out { from { transform: translateY(0); } to { transform: translateY(100%); } }
}

/* ---------- consistent form controls ---------- */
input, select, textarea {
  border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}


/* ---------- primary button lift ---------- */
.btn-primary:not(:disabled):hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn { transition: transform .12s ease, filter .12s ease, background .15s ease, border-color .15s ease; }

/* ---------- login hero layout ---------- */
.login-shell { display: grid; gap: 28px; align-items: center; justify-items: center; }
.login-art { display: none; text-align: center; }
.login-art p { font-size: 14px; color: var(--ink-soft); max-width: 300px; margin: 8px auto 0; line-height: 1.5; }
@media (min-width: 900px) {
  .login-shell { grid-template-columns: 1fr 400px; justify-items: stretch; }
  .login-art { display: block; width: 100%; }
  .login-art .illu-wrap { width: min(330px, 90%); color: var(--ink-soft); }
}

/* ---------- course checkpoint ---------- */
.cp-entry { margin: 0 0 28px; padding: 14px 16px; }
.cp-entry-main { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.cp-entry-main .cc-icon { width: 40px; height: 40px; font-size: 20px; }
.cp-entry-main h3 { font-size: 15px; }
.cp-entry-main .spacer { flex: 1; }

.dot.missed { background: var(--bad-soft); border-color: transparent; }

.cp-order-strip {
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
  min-height: 42px; margin-top: 12px;
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 6px 9px; background: var(--bg);
}
.cp-order-chip { background: var(--accent-soft); color: var(--accent); font-weight: 700; cursor: default; }

.cp-ring {
  position: relative; width: 148px; margin: 20px auto 4px;
  display: grid; place-items: center; text-align: center;
}
.cp-ring svg { width: 148px; height: 148px; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { transition: stroke-dasharray .9s cubic-bezier(.3, .8, .4, 1); }
.cp-ring.pass .ring-fg { stroke: var(--good); }
.cp-ring.fail .ring-fg { stroke: var(--warn); }
.cp-ring b { position: absolute; top: 44%; font-size: 30px; letter-spacing: -.02em; }
.cp-ring span { position: absolute; top: 64%; font-size: 12px; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.cp-result { max-width: 560px; margin-inline: auto; text-align: center; padding: 26px 22px; }
.cp-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ============================================================
   Design-system normalization (single visual language)
   ============================================================ */

/* --- SVG icons --- */
.icon-wrap { display: inline-grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; }
.icon-wrap svg.icon-svg { width: 19px; height: 19px; }
.nav-link .icon-wrap { color: var(--ink-faint); transition: color .15s; }
.nav-link:hover .icon-wrap, .nav-link.active .icon-wrap { color: var(--accent); }
.dash-nav-item .icon-wrap svg { width: 17px; height: 17px; }
.btn { gap: 8px; }
.btn .icon-wrap { width: 16px; height: 16px; }
.btn .icon-wrap svg { width: 15px; height: 15px; }
.report-icon .icon-wrap svg { width: 21px; height: 21px; }
.modal-icon .icon-wrap svg { width: 20px; height: 20px; }

/* --- type scale --- */
h1.page-title { font-size: clamp(23px, 3vw, 28px) !important; letter-spacing: -.02em; line-height: 1.2 !important; }
.page-sub { font-size: clamp(13.5px, 1.4vw, 14.5px); margin-bottom: 22px; }
.step-title { letter-spacing: -.01em; }

/* --- one card language --- */
.panel-card,
.course-card,
.class-card,
.roster-row,
.quiet-row,
.report-row,
.lesson-row,
.empty-state,
.pn-log,
.assignment-manager {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* --- button discipline --- */
.btn { min-height: 38px; }
.btn-small { min-height: 32px; padding-inline: 14px; }
.chip-btn { border-radius: 9px; }

/* --- badge restraint --- */
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* --- focus visibility everywhere --- */
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 2px;
}

/* ---------- packetnet v2 + dnsflow ---------- */
.pn-ttl {
  margin-left: auto; font-size: 12px; font-weight: 800; letter-spacing: .05em;
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px; padding: 4px 11px;
}
.pn-packet-ttl { font-size: 11px; font-weight: 800; fill: var(--accent); text-anchor: middle; }
.pn-packet.drop { fill: var(--bad); }
.pn-log-list li.drop { color: var(--bad); font-weight: 700; }

.dnsflow { display: flex; flex-direction: column; gap: 12px; }
.dns-name-input { max-width: 220px; font-family: var(--mono); }
.dns-status { font-size: 13.5px; color: var(--ink-soft); min-height: 20px; }
.dns-status b { color: var(--accent); }
.dns-steps { display: flex; flex-direction: column; gap: 7px; }
.dns-step {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); padding: 9px 13px;
  opacity: .35; transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.dns-step.active {
  opacity: 1; transform: translateY(0);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(14, 138, 99, .12);
}
.dns-step.cached.active { border-color: var(--good); box-shadow: none; }
.dns-step-icon { width: 34px; height: 34px; display: grid; place-items: center; font-size: 19px; background: var(--surface-2); border-radius: 10px; flex-shrink: 0; }
.dns-step-main { display: flex; flex-direction: column; min-width: 0; }
.dns-step-main b { font-size: 13.5px; }
.dns-step-main small { color: var(--ink-faint); font-size: 12px; line-height: 1.4; }

/* ---------- spaced-repetition cues ---------- */
.chip-btn.due {
  border-color: var(--warn); color: var(--warn);
}
.chip-btn.due.active { background: var(--warn); border-color: var(--warn); color: #fff; }
.chip-btn.due::after { content: ""; display: inline-block; }

/* ---------- class leaderboard ---------- */
.lb-card { margin-bottom: 24px; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 11px;
}
.lb-row.me { background: var(--accent-soft); }
.lb-pos { width: 34px; font-weight: 800; font-size: 13.5px; color: var(--ink-soft); flex-shrink: 0; }
.lb-row b { font-size: 14px; }
.lb-row small { color: var(--ink-faint); }
.class-card-menu {
  position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800; color: var(--ink-faint);
}
.class-card-menu:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- radioroom ---------- */
.rr-composer { display: flex; gap: 9px; }
.rr-input { flex: 1; min-width: 0; font-family: var(--mono); }
.rr-inbox { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 13px; background: var(--bg); }
.rr-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rr-msg {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 11px; padding: 8px 12px; font-size: 13.5px;
}
.rr-msg.mine { opacity: .75; border-style: dashed; }
.rr-msg:not(.mine):not(.arrived) { animation: rr-incoming .45s ease both; border-color: var(--accent); }
@keyframes rr-incoming {
  0% { transform: translateX(14px); opacity: 0; box-shadow: 0 0 0 4px var(--accent-soft); }
  100% { transform: translateX(0); opacity: 1; box-shadow: none; }
}
.rr-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); }
.rr-meta { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }
.rr-empty { color: var(--ink-faint); font-style: italic; font-size: 13px; list-style: none; }

/* ---------- illustration page heads ---------- */
.illu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 18px;
}
.illu-head .illu-wrap { width: min(150px, 30vw); flex-shrink: 0; }
@media (max-width: 700px) { .illu-head .illu-wrap { display: none; } }

/* ============================================================
   Accessibility themes
   ============================================================ */
body.a11y-contrast {
  --ink: #100d07;
  --ink-soft: #443e2d;
  --ink-faint: #5f573f;
  --line: #b7ac91;
  --surface-2: #eee7d8;
  --shadow: none;
}
body.a11y-contrast .panel-card,
body.a11y-contrast .course-card,
body.a11y-contrast .lesson-row,
body.a11y-contrast .roster-row { border-width: 1.5px; }
body.a11y-contrast .btn { font-weight: 700; }

body.a11y-dyslexia {
  font-family: Verdana, Tahoma, "Trebuchet MS", var(--font);
  letter-spacing: .03em;
  word-spacing: .13em;
}
body.a11y-dyslexia p, body.a11y-dyslexia li, body.a11y-dyslexia label {
  line-height: 1.85;
}
body.a11y-dyslexia .page-title { letter-spacing: .01em !important; }

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

/* ---------- LED matrix sizing (device-like, not billboard) ---------- */
.led-board {
  display: grid;
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
  padding: 10px;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface);
  border: 2.5px solid var(--ink-faint);
  border-radius: 16px;
}
.led-cell { aspect-ratio: 1; border-radius: 22%; }
@media (max-width: 700px) {
  .led-board { max-width: 320px; }
}

/* ---------- scroll-to-top ---------- */
.scroll-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--accent); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(14px) scale(.85);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.34,1.4,.64,1), border-color .15s;
}
.scroll-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.scroll-top:hover { border-color: var(--accent); }
.scroll-top svg { width: 21px; height: 21px; }
@media print { .scroll-top { display: none !important; } }

/* ---------- tcplab widget ---------- */
.tcp-host { font-size: 15px; font-weight: 700; fill: var(--ink); }
.tcp-lifeline { stroke: var(--line-strong, #b9b3a7); stroke-width: 2.5; stroke-dasharray: 5 6; }
.tcp-packet { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.tcp-packet.drop { fill: var(--bad-soft); stroke: var(--bad); }
.tcp-packet.ack { fill: var(--good-soft); stroke: var(--good); }
.tcp-packet-label { font-size: 10.5px; font-weight: 800; fill: var(--ink); }
.tcp-loss-select { max-width: 170px; }

/* ---------- assignment urgency chips ---------- */
.due-chip {
  display: inline-block; margin-top: 4px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  border-radius: 999px; padding: 2px 9px;
}
.due-chip.ok { background: var(--accent-soft); color: var(--accent); }
.due-chip.warn { background: var(--warn-soft); color: var(--warn); }
.due-chip.bad { background: var(--bad-soft); color: var(--bad); }
.due-chip.quiet { background: var(--surface-2); color: var(--ink-faint); }

/* ---------- quiz builder ---------- */
.qb-opt-row {
  display: flex; align-items: center; gap: 9px; margin-bottom: 7px;
}
.qb-opt-row input[type="radio"] {
  width: 17px; height: 17px; accent-color: var(--good); cursor: pointer; flex-shrink: 0;
}
.qb-opt-row input[type="text"] { flex: 1; min-width: 0; }

/* ---------- charts + ledcube ---------- */
.chart-box { position: relative; width: 100%; height: 100%; }
.chart-box canvas { position: absolute; inset: 0; }

.lc-holder {
  width: 100%; max-width: 420px; margin-inline: auto;
  aspect-ratio: 4 / 3.1;
  touch-action: none; cursor: grab; user-select: none;
}
.lc-holder:active { cursor: grabbing; }
.lc-holder canvas { display: block; border-radius: 14px; }

/* ---------- sidebar search pill ---------- */
.search-pill {
  display: flex; align-items: center; gap: 9px;
  margin: 10px 14px 6px; padding: 8px 13px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink-faint);
  cursor: pointer; font-size: 13px;
}
.search-pill:hover { border-color: var(--accent); color: var(--ink-soft); }
.search-pill .icon-wrap svg { width: 15px; height: 15px; }
.search-pill .sp-label { flex: 1; text-align: left; }
.sp-kbd {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; background: var(--surface);
}

/* ---------- command palette ---------- */
.palette-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(24,20,12,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: overlay-in .16s ease both;
}
.palette-card {
  width: min(560px, 100%);
  background: var(--surface); border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: modal-in .2s cubic-bezier(.34,1.4,.64,1) both;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.palette-head {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 17px; border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
}
.palette-head input {
  flex: 1; min-width: 0; border: none !important; background: transparent !important;
  font-size: 15.5px; box-shadow: none !important;
  padding: 3px 8px 5px 9px; line-height: 1.45;
}
.palette-kbd {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--ink-faint); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 7px;
}
.palette-list { overflow-y: auto; padding: 8px; }
.palette-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: none; background: transparent; color: var(--ink);
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  font-size: 14px; text-align: left; font-family: inherit;
}
.palette-row:hover, .palette-row.active { background: var(--accent-soft); }
.palette-row .icon-wrap { color: var(--ink-faint); }
.palette-row.active .icon-wrap { color: var(--accent); }
.palette-label { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }

@media (max-width: 600px) {
  .palette-overlay { align-items: flex-end; padding: 0; }
  .palette-card {
    max-height: 78dvh; border-radius: 22px 22px 0 0; border-bottom: none;
    animation: sheet-in .26s cubic-bezier(.3,1.1,.6,1) both;
  }
}

/* ---------- analytics row ---------- */
@media (min-width: 1000px) {
  .analytics-row { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
}


.practice-exit { margin-left: auto; }

/* ---------- roadmap panning ---------- */
.rm-stage.rm-panning { cursor: grabbing; user-select: none; }

/* ---------- sandbox breathing room ---------- */
.sandbox-grid .panel { padding: 20px 22px; }
.sandbox-grid .code-editor { min-height: 300px; font-size: 14px; line-height: 1.65; }
.sandbox-grid .console-output { max-height: 260px; overflow: auto; }
@media (min-width: 1400px) {
  #main:has(.sandbox-grid) .page { max-width: 1080px; }
}

/* ---------- collapsible curriculum groups ---------- */
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; border: none; background: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.nav-group-toggle .nav-chev {
  width: 22px; height: 22px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line);
  color: var(--ink-faint);
  transition: transform .2s ease, border-color .15s, color .15s, background .15s;
}
.nav-group-toggle .nav-chev svg { width: 13px; height: 13px; transition: transform .2s ease; }
.nav-group-toggle.collapsed .nav-chev svg { transform: rotate(-90deg); }
.nav-group-toggle:hover .nav-chev {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.nav-group-toggle:hover .ng-name { color: var(--ink); }
.nav-group { display: block; }
.nav-group.collapsed { display: none; }
body.rail #sidebar .nav-group-toggle { font-size: 0; padding: 12px 0 4px; min-height: 0; }
body.rail #sidebar .nav-group-toggle .nav-chev { display: none; }
body.rail #sidebar .nav-group-toggle::before { content: ""; display: block; height: 1px; background: var(--line); }
body.rail #sidebar .nav-group.collapsed { display: block; } /* rail shows icons only */

/* ---------- lesson-complete celebration ---------- */
.complete-card.celebrate { border-color: var(--accent); }
.complete-card.celebrate .illu-wrap { width: min(200px, 55vw); margin: 0 auto 6px; display: block; color: var(--ink-soft); }

/* ---------- flashcards ---------- */
.fc-card {
  width: 100%; max-width: 460px; margin: 0 auto; min-height: 190px;
  display: grid; place-items: center; padding: 26px 24px;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: 18px; cursor: pointer;
  box-shadow: var(--shadow); font-family: inherit;
  transition: border-color .15s ease, transform .12s ease;
}
.fc-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.fc-card.flipped { border-color: var(--good); }
.fc-face { font-size: 19px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.fc-face.fc-front { color: var(--ink); }
.fc-face.fc-back { color: var(--good); }
.fc-grades { gap: 10px; margin-top: 14px; }

/* ---------- flashcards breathing room ---------- */
.deck-edit {
  padding: 18px 20px !important;
}
.deck-edit input[type="text"],
.deck-edit textarea {
  font-size: 15px; line-height: 1.5;
}
.deck-edit textarea { min-height: 84px; resize: vertical; }
.deck-edit input[type="text"] { margin-bottom: 10px !important; }

.deck-play { display: flex; flex-direction: column; align-items: center; }
.deck-play .fc-card { max-width: 540px; min-height: 250px; padding: 34px 30px; }
.deck-play .fc-face { font-size: 22px; line-height: 1.45; }
.deck-play .step-dots { width: 100%; }
.deck-play .hint { margin-top: 14px; }
.deck-play .fc-grades { margin-top: 10px; }

/* ---------- deck builder layout v2 ---------- */
.deck-edit { padding: 20px 22px !important; }
.deck-edit .deck-field-label {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 5px;
}
.deck-edit input[type="text"] { margin-bottom: 0 !important; }
.deck-edit textarea { min-height: 104px; }
.deck-page-col { max-width: 680px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; }

.overdue-snapshot { border-left: 4px solid var(--bad); margin-top: 16px; }
