:root {
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --ink: #12262b;
  --body: #3a4a51;
  --muted: #66777e;
  --line: #d9e3e5;
  --teal: #0e3b43;
  --teal-2: #164f59;
  --teal-3: #1f6470;
  --teal-hi: #8fd3d9;
  --on-teal: #ffffff;
  --on-teal-2: #cfe3e6;
  --focus: #1f63a8;

  --st-t: #ddf3d5; --st-s: #2f7d32;
  --kn-t: #dcebfa; --kn-s: #1f63a8;
  --gr-t: #fde6cf; --gr-s: #b85c0a;
  --ap-t: #fff3bf; --ap-s: #7d6000;
  --sc-t: #fbdcd6; --sc-s: #b23a2e;
  --rf-t: #eadff6; --rf-s: #6a45a0;

  --ok-t: #ddf3d5; --ok-s: #2f7d32;
  --mid-t: #fde6cf; --mid-s: #a0620a;
  --bad-t: #fbdcd6; --bad-s: #b23a2e;

  --code-bg: #17232a;
  --code-bg-2: #0f191e;
  --code-line: #24343c;
  --code-fg: #e6edf0;
  --code-dim: #7f9098;
  --c-kw: #d59bf6; --c-str: #a5e08a; --c-num: #ffb86c; --c-fn: #7cc4ff; --c-op: #7fe3e3; --c-bool: #ff9db0; --c-cm: #7f9098; --c-in: #ffd866; --c-err: #ff8f8f;

  --r: 12px;
  --font: "Lato", Calibri, Carlito, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1618; --surface: #122126; --surface-2: #172a30; --ink: #e9f1f2; --body: #c3d0d4; --muted: #8b9ca2; --line: #243a41;
    --teal: #0a2c32; --teal-2: #123f47; --teal-3: #1a5560; --focus: #7db3ea;
    --st-t: #1b3220; --st-s: #86d18d; --kn-t: #152a3e; --kn-s: #86b9ee; --gr-t: #38250f; --gr-s: #f2aa66; --ap-t: #302c0c; --ap-s: #e6c75c; --sc-t: #3a1d1a; --sc-s: #f39286; --rf-t: #281f3d; --rf-s: #bda1ee;
    --ok-t: #1b3220; --ok-s: #86d18d; --mid-t: #38250f; --mid-s: #f2aa66; --bad-t: #3a1d1a; --bad-s: #f39286;
    --code-bg: #0c171b; --code-bg-2: #081114; --code-line: #1c2c33;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1618; --surface: #122126; --surface-2: #172a30; --ink: #e9f1f2; --body: #c3d0d4; --muted: #8b9ca2; --line: #243a41;
  --teal: #0a2c32; --teal-2: #123f47; --teal-3: #1a5560; --focus: #7db3ea;
  --st-t: #1b3220; --st-s: #86d18d; --kn-t: #152a3e; --kn-s: #86b9ee; --gr-t: #38250f; --gr-s: #f2aa66; --ap-t: #302c0c; --ap-s: #e6c75c; --sc-t: #3a1d1a; --sc-s: #f39286; --rf-t: #281f3d; --rf-s: #bda1ee;
  --ok-t: #1b3220; --ok-s: #86d18d; --mid-t: #38250f; --mid-s: #f2aa66; --bad-t: #3a1d1a; --bad-s: #f39286;
  --code-bg: #0c171b; --code-bg-2: #081114; --code-line: #1c2c33;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--body); font-family: var(--font); font-size: 16px; line-height: 1.55; margin: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--focus); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
code, .mono { font-family: var(--mono); }
.ic { font-family: var(--mono); font-size: .9em; font-weight: 700; color: var(--ink); background: var(--surface-2); padding: .05em .35em; border-radius: 5px; white-space: pre-wrap; }
strong { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--teal); color: var(--on-teal); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-teal); text-decoration: none; font-weight: 900; letter-spacing: .01em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--teal); display: grid; place-items: center; }
.brand-mark svg { width: 17px; height: 17px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--on-teal-2); text-decoration: none; font-size: 14px; font-weight: 700; padding: 7px 11px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--teal-2); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: #0e3b43; }
.pystatus { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--on-teal-2); white-space: nowrap; }
.pystatus .dot { width: 9px; height: 9px; border-radius: 50%; background: #7f9098; }
.pystatus[data-s="loading"] .dot { background: #ffd866; animation: pulse 1s infinite alternate; }
.pystatus[data-s="ready"] .dot { background: #86d18d; }
.pystatus[data-s="failed"] .dot { background: #ff8f8f; }
@keyframes pulse { to { opacity: .35; } }

/* ---------- page frame ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 28px; }
.footer { max-width: 1180px; margin: 0 auto; padding: 18px 16px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- hero / title bars ---------- */
.hero { position: relative; overflow: hidden; background: var(--teal); color: var(--on-teal); border-radius: 18px; padding: 40px 36px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: var(--teal-2); }
.hero::before { width: 420px; height: 420px; right: -120px; top: -170px; }
.hero::after { width: 240px; height: 240px; left: -90px; bottom: -150px; background: var(--teal-3); opacity: .6; }
.hero > * { position: relative; z-index: 1; }
.hero .kicker { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-hi); }
.hero h1 { color: #fff; font-size: clamp(32px, 5vw, 52px); font-weight: 900; margin: 8px 0 10px; letter-spacing: -.01em; }
.hero .lede { color: var(--on-teal-2); font-size: 18px; max-width: 58ch; }
.hero .num { font-size: clamp(40px, 7vw, 72px); font-weight: 900; color: var(--teal-hi); line-height: 1; }
.emblem { width: 120px; height: 120px; border-radius: 50%; background: #fff; color: #0e3b43; display: grid; place-items: center; }
.emblem svg { width: 58px; height: 58px; stroke-width: 2.2; }
.hero .foot { margin-top: 22px; font-size: 13px; color: var(--on-teal-2); }
.phasekey { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.phasekey span { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; color: #14262b; }

/* ---------- phase helpers ---------- */
.ph-starter { --t: var(--st-t); --s: var(--st-s); }
.ph-knowledge { --t: var(--kn-t); --s: var(--kn-s); }
.ph-group { --t: var(--gr-t); --s: var(--gr-s); }
.ph-apply { --t: var(--ap-t); --s: var(--ap-s); }
.ph-stretch { --t: var(--sc-t); --s: var(--sc-s); }
.ph-reflect { --t: var(--rf-t); --s: var(--rf-s); }

.objectives { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.obj { border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.obj b { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.obj.can { background: var(--st-t); } .obj.can b { color: var(--st-s); }
.obj.will { background: var(--gr-t); } .obj.will b { color: var(--gr-s); }
.obj.try { background: var(--rf-t); } .obj.try b { color: var(--rf-s); }
.obj p { color: var(--ink); }

/* sticky phase legend */
.legend { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h, 56px)); z-index: 20; background: var(--bg); padding: 10px 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.legend::-webkit-scrollbar { display: none; }
.legend button { border: 0; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.legend button .pct { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.legend button.on { background: var(--s); color: #fff; }
:root[data-theme="dark"] .legend button.on { color: #0b1618; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .legend button.on { color: #0b1618; } }

/* ---------- sections ---------- */
.section { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 120px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sec-head .l { display: flex; flex-direction: column; gap: 8px; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--s); color: var(--s); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.badge svg { width: 13px; height: 13px; }
.sec-head h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 900; }
.spec { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.intro { max-width: 75ch; }
.sub-h { font-size: 18px; font-weight: 900; color: var(--s); margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.sub-h small { font-size: 13px; color: var(--muted); font-weight: 700; }

.card { background: var(--t, var(--surface)); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.plain { background: var(--surface); border: 1px solid var(--line); }
.card h3 { font-size: 17px; font-weight: 900; color: var(--s, var(--ink)); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qnum { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--s); color: #fff; font-weight: 900; font-size: 14px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .qnum { color: #0b1618; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qnum { color: #0b1618; } }
.qhead { display: flex; gap: 12px; align-items: flex-start; }
.qhead .task { flex: 1; color: var(--ink); padding-top: 3px; }
.state { margin-left: auto; flex: none; font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); display: flex; gap: 5px; align-items: center; }
.state svg { width: 13px; height: 13px; }
.state.ok { background: var(--ok-s); color: #fff; }
.state.no { background: var(--bad-s); color: #fff; }
.state.mid { background: var(--mid-s); color: #fff; }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 9px; padding: 9px 14px; font-weight: 900; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); line-height: 1.1; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--muted); }
.btn.go { background: #1f7a3a; border-color: #1f7a3a; color: #fff; }
.btn.go:hover { background: #196531; }
.btn.pri { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.phase { background: var(--s); border-color: var(--s); color: #fff; }
:root[data-theme="dark"] .btn.phase { color: #0b1618; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.phase { color: #0b1618; } }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--focus); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- code ---------- */
.code { background: var(--code-bg); color: var(--code-fg); font-family: var(--mono); font-size: 14.5px; line-height: 1.6; border-radius: 10px; padding: 14px 16px; margin: 0; overflow-x: auto; white-space: pre; tab-size: 4; }
.code.big { font-size: clamp(18px, 2.6vw, 28px); padding: 22px 24px; line-height: 1.75; }
.t-kw { color: var(--c-kw); } .t-str { color: var(--c-str); } .t-num { color: var(--c-num); } .t-fn { color: var(--c-fn); } .t-op { color: var(--c-op); } .t-bool { color: var(--c-bool); } .t-cm { color: var(--c-cm); font-style: italic; } .t-fx { color: var(--c-num); }

/* editor */
.ed-wrap { background: var(--code-bg); border-radius: 10px; overflow: hidden; }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 14px; background: var(--code-bg-2); color: var(--code-dim); font-size: 12px; font-family: var(--mono); }
.ed-bar .file { flex: 1; }
.ed { display: grid; grid-template-columns: auto 1fr; font-family: var(--mono); font-size: 14.5px; line-height: 1.6; }
.ed .gut { padding: 12px 8px 12px 12px; color: #4f636b; text-align: right; user-select: none; white-space: pre; font-variant-numeric: tabular-nums; background: var(--code-bg); }
.ed .area { position: relative; overflow-x: auto; overflow-y: hidden; }
.ed pre, .ed textarea { margin: 0; padding: 12px 16px 12px 8px; font: inherit; line-height: inherit; tab-size: 4; white-space: pre; border: 0; letter-spacing: 0; word-spacing: 0; }
.ed pre { color: var(--code-fg); pointer-events: none; min-width: 100%; width: max-content; }
.ed textarea { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; color: transparent; caret-color: #fff; resize: none; outline: none; overflow: hidden; }
.ed textarea::selection { background: rgba(124, 196, 255, .35); color: transparent; }
.ed-wrap:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.ed .hl-line { background: rgba(255, 216, 102, .16); box-shadow: inset 3px 0 0 var(--c-in); display: inline-block; min-width: 100%; }
.ed .err-line { background: rgba(255, 143, 143, .14); box-shadow: inset 3px 0 0 var(--c-err); display: inline-block; min-width: 100%; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .sp { flex: 1; }
.kbd { font-size: 12px; color: var(--muted); }

/* terminal */
.term { background: #0a1215; color: #e6edf0; border-radius: 10px; font-family: var(--mono); font-size: 14px; line-height: 1.55; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #111c21; color: #7f9098; font-size: 12px; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 6px; flex: 1; }
.term-body { padding: 12px 14px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; min-height: 52px; }
.term .echo { color: #9fb0b7; }
.term .echo .p { color: #5f737b; }
.term .in { color: var(--c-in); font-weight: 700; }
.term .err { color: var(--c-err); }
.term .note { color: #7f9098; font-style: italic; font-family: var(--font); }
.term input { background: transparent; border: 0; border-bottom: 1.5px dashed var(--c-in); color: var(--c-in); font: inherit; font-weight: 700; outline: none; min-width: 8ch; width: 30ch; max-width: 100%; }
.hintbox { border-radius: 10px; padding: 12px 14px; background: var(--bad-t); color: var(--ink); font-size: 14.5px; display: flex; gap: 10px; }
.hintbox svg { flex: none; width: 20px; height: 20px; color: var(--bad-s); margin-top: 1px; }
.hintbox.info { background: var(--kn-t); } .hintbox.info svg { color: var(--kn-s); }

/* stepper */
.stepper { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.st-code { background: var(--code-bg); border-radius: 10px; padding: 10px 0; font-family: var(--mono); font-size: 14px; line-height: 1.6; overflow-x: auto; color: var(--code-fg); }
.st-line { display: flex; white-space: pre; padding-right: 14px; min-width: max-content; }
.st-line .n { width: 44px; flex: none; text-align: right; padding-right: 12px; color: #4f636b; font-variant-numeric: tabular-nums; }
.st-line.cur { background: rgba(255, 216, 102, .16); box-shadow: inset 3px 0 0 var(--c-in); }
.st-line.cur .n { color: var(--c-in); }
.st-line.cur .n::before { content: "▶ "; font-size: 10px; }
.st-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-ctl input[type=range] { flex: 1; min-width: 120px; accent-color: var(--teal-3); }
.st-ctl .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 12ch; }
.st-msg { font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.vars { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: 10px; overflow: hidden; }
.vars th, .vars td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.vars th { font-size: 12px; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.vars td.v { font-family: var(--mono); color: var(--ink); word-break: break-all; }
.vars td.ty { color: var(--muted); font-size: 12.5px; }
.vars tr.chg td { background: color-mix(in srgb, var(--c-in) 22%, var(--surface)); }
.vars td.nm { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.tt-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); max-height: 420px; }
.tt { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.tt th, .tt td { padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tt th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 12.5px; }
.tt td { font-family: var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.tt td.dim { color: var(--muted); }
.tt tr.cur td { background: color-mix(in srgb, var(--c-in) 22%, var(--surface)); }
.tt tr { cursor: pointer; }

/* predict */
.pred { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pred.done { border-color: color-mix(in srgb, var(--s) 45%, var(--line)); }
.pred .predbox, .field { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px; resize: vertical; min-height: 44px; }
.pred .predbox:focus, .field:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.lbl { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--s, var(--muted)); }
.why { border-radius: 10px; padding: 12px 14px; background: var(--t); color: var(--ink); display: flex; gap: 10px; }
.why svg { flex: none; width: 20px; height: 20px; color: var(--s); margin-top: 2px; }
.mark { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mark .q { font-weight: 700; color: var(--ink); margin-right: 4px; }
.seg { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; color: var(--ink); }
.seg svg { width: 15px; height: 15px; }
.seg[aria-pressed="true"].y { background: var(--ok-s); border-color: var(--ok-s); color: #fff; }
.seg[aria-pressed="true"].n { background: var(--bad-s); border-color: var(--bad-s); color: #fff; }
.pred-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pred.wide { grid-column: 1 / -1; }
.stack > div:empty, .pred > div:empty { display: none; }
a.btn { text-decoration: none; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }

/* mcq */
.mcq { display: flex; flex-direction: column; gap: 10px; }
.mcq .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-size: 15px; display: flex; gap: 10px; align-items: center; }
.opt:hover:not(:disabled) { border-color: var(--s, var(--muted)); }
.opt .k { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 900; font-size: 12px; display: grid; place-items: center; }
.opt.right { border-color: var(--ok-s); background: var(--ok-t); }
.opt.right .k { background: var(--ok-s); color: #fff; }
.opt.wrong { border-color: var(--bad-s); background: var(--bad-t); }
.opt.wrong .k { background: var(--bad-s); color: #fff; }
.opt:disabled { cursor: default; }

/* anatomy */
.anat { display: flex; flex-direction: column; gap: 14px; }
.anat .code .part { position: relative; border-radius: 6px; outline: 2px solid transparent; cursor: pointer; transition: outline-color .15s, background .15s; background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline; white-space: pre; }
.anat .code .part:hover, .anat .code .part:focus-visible { outline-color: rgba(255, 255, 255, .35); }
.anat .code .part.on { outline-color: var(--pc); background: color-mix(in srgb, var(--pc) 18%, transparent); }
.anat .code .part sup { position: absolute; top: -.95em; left: 50%; transform: translateX(-50%); font-family: var(--font); font-size: 11px; font-weight: 900; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: #14262b; line-height: 1; }
.anat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.acard { border: 0; text-align: left; border-radius: 10px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; color: var(--body); font-size: 14.5px; opacity: .72; transition: opacity .15s; }
.acard.on { opacity: 1; background: color-mix(in srgb, var(--pc) 22%, var(--surface)); }
.acard .h { display: flex; gap: 8px; align-items: center; font-weight: 900; color: var(--ink); font-size: 15px; }
.acard .h i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: #14262b; font-size: 12px; flex: none; }
.anat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.anat-tabs button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; color: var(--ink); }
.anat-tabs button[aria-selected="true"] { background: var(--s); border-color: var(--s); color: #fff; }
:root[data-theme="dark"] .anat-tabs button[aria-selected="true"] { color: #0b1618; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .anat-tabs button[aria-selected="true"] { color: #0b1618; } }

/* char boxes & ranges */
.chars { display: flex; gap: 4px; flex-wrap: wrap; }
.ch { width: 46px; border: 0; border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; font-family: var(--mono); color: var(--ink); }
.ch .c { font-size: 20px; font-weight: 700; height: 28px; }
.ch .i { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ch .ni { font-size: 10px; color: var(--sc-s); font-variant-numeric: tabular-nums; }
.ch.sel { background: var(--s); color: #fff; }
.ch.sel .i, .ch.sel .ni { color: #fff; }
.ch.start { box-shadow: inset 0 0 0 2px var(--s); }
.slice-out { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 16px; color: var(--ink); }
.slice-out .eq { color: var(--muted); }
.nums { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nb { min-width: 38px; height: 38px; padding: 0 6px; border-radius: 8px; background: var(--ok-t); color: var(--ok-s); font-family: var(--mono); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.nb.stop { background: transparent; border: 2px dashed var(--bad-s); color: var(--bad-s); }
.rng-ctl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rng-ctl label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.rng-ctl input { accent-color: var(--kn-s); width: 100%; }

/* flow */
.flow svg { width: 100%; max-width: 520px; height: auto; display: block; }
.flow .box { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.flow .dia { fill: var(--ap-t); stroke: var(--ap-s); stroke-width: 2; }
.flow text { fill: var(--ink); font-family: var(--mono); font-size: 14px; }
.flow .lab { font-family: var(--font); font-size: 13px; font-weight: 700; }
.flow .edge { stroke: var(--muted); stroke-width: 2; fill: none; }
.flow .on .box { fill: var(--ok-t); stroke: var(--ok-s); }
.flow .edge.on { stroke: var(--ok-s); stroke-width: 3.5; }
.flow .lab.t { fill: var(--ok-s); } .flow .lab.f { fill: var(--bad-s); }

/* worked */
.worked .wl { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.wnote { background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; color: var(--body); min-height: 44px; }
.wnote.cur { box-shadow: inset 3px 0 0 var(--s); }
.worked .code .wline { display: block; opacity: 1; transition: opacity .2s; }
.worked .code .wline.hid { opacity: 0; }
.worked .code .wline.cur { background: rgba(255, 216, 102, .12); }

/* checks */
.checks { display: flex; flex-direction: column; gap: 6px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--ink); background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.chk svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.chk.p svg { color: var(--ok-s); } .chk.f svg { color: var(--bad-s); }
.selfcheck label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); background: var(--surface); padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.selfcheck input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ok-s); flex: none; }
.hints { display: flex; flex-direction: column; gap: 8px; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--s); }

/* bug */
.etypes { display: flex; gap: 6px; flex-wrap: wrap; }

/* confidence / reflection */
.conf { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.conf td { padding: 0; }
.conf td.topic { font-weight: 700; color: var(--ink); padding-right: 12px; }
.lvl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lvl button { border: 2px solid transparent; border-radius: 9px; padding: 9px 6px; font-weight: 900; font-size: 13.5px; }
.lvl .l0 { background: var(--bad-t); color: var(--bad-s); } .lvl .l1 { background: var(--mid-t); color: var(--mid-s); } .lvl .l2 { background: var(--ok-t); color: var(--ok-s); }
.lvl button[aria-pressed="true"] { border-color: currentColor; box-shadow: 0 0 0 2px var(--surface) inset; }
.lvl button[aria-pressed="true"]::before { content: "✓ "; }
.prompts { display: grid; gap: 10px; }
.prompt { display: grid; grid-template-columns: 220px 1fr; border-radius: 10px; overflow: hidden; background: var(--surface); }
.prompt label { background: var(--rf-t); color: var(--rf-s); font-weight: 900; padding: 12px 14px; }
.prompt textarea { border: 0; font: inherit; color: var(--ink); background: var(--surface); padding: 12px 14px; resize: vertical; min-height: 56px; }
.prompt textarea:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.stars button { border: 0; background: var(--rf-t); color: var(--rf-s); border-radius: 10px; padding: 10px 0; font-weight: 900; font-size: 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stars button small { font-size: 12px; }
.stars button svg { width: 24px; height: 24px; }
.stars button.on svg { fill: currentColor; }

/* home */
.steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step4 { background: var(--kn-t); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.step4 b { color: var(--kn-s); font-size: 17px; font-weight: 900; }
.wscards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wscard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 16px; text-decoration: none; color: inherit; align-items: start; }
.wscard:hover { border-color: var(--teal-3); }
.wscard .ico { width: 54px; height: 54px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; }
.wscard .ico svg { width: 26px; height: 26px; }
.wscard h3 { font-size: 20px; font-weight: 900; }
.wscard .k { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok-s); border-radius: 999px; }
.barrow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.barrow .bar { flex: 1; }

/* results */
.gap-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); overflow: hidden; font-size: 15px; }
.gap-table th, .gap-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.gap-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 900; background: var(--surface-2); }
.gap-table td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 900; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-t); color: var(--ok-s); } .pill.mid { background: var(--mid-t); color: var(--mid-s); } .pill.bad { background: var(--bad-t); color: var(--bad-s); } .pill.none { background: var(--surface-2); color: var(--muted); }
.meter { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.meter .bar { flex: 1; }
.meter .bar i.mid { background: var(--mid-s); } .meter .bar i.bad { background: var(--bad-s); }
.mismatch { font-size: 13px; color: var(--bad-s); font-weight: 700; margin-top: 3px; }

/* reference */
.kw-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.kw { border: 0; border-radius: 10px; background: var(--code-bg); color: var(--c-kw); font-family: var(--mono); font-weight: 700; font-size: 17px; padding: 14px 10px; }
.kw.bool { color: var(--c-bool); }
.kw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--kn-s); }
.flip { perspective: 900px; border: 0; background: none; padding: 0; min-height: 120px; text-align: left; }
.flip .in { position: relative; width: 100%; height: 100%; min-height: 120px; transition: transform .45s; transform-style: preserve-3d; }
.flip.on .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; border-radius: 12px; padding: 14px; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.flip .f { background: var(--rf-t); color: var(--rf-s); font-weight: 900; font-size: 18px; }
.flip .f small { font-size: 12px; font-weight: 700; color: var(--muted); }
.flip .b { background: var(--surface); border: 1.5px solid var(--rf-s); color: var(--ink); transform: rotateY(180deg); font-size: 15px; }
.syn { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.syn td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.syn td:first-child { width: 42%; }
.syn td .code { font-size: 13.5px; padding: 8px 12px; }
.tbl-wrap { overflow-x: auto; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--teal); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 50; }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--bad-t); padding: 10px 12px; border-radius: 10px; color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pred-list, .wscards, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .steps4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: minmax(0, 1fr); }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .objectives { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; }
  .hero .emblem { display: none; }
  .mcq .opts { grid-template-columns: minmax(0, 1fr); }
  .worked .wl { grid-template-columns: minmax(0, 1fr); }
  .prompt { grid-template-columns: minmax(0, 1fr); }
  .rng-ctl { grid-template-columns: minmax(0, 1fr); }
  .pystatus .txt { display: none; }
  .topbar-in { flex-wrap: wrap; padding-block: 8px; gap: 8px 12px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; }
  .steps4 { grid-template-columns: minmax(0, 1fr); }
  .conf td.topic { display: block; padding: 8px 0 4px; }
  .conf tr { display: block; }
  .conf td { display: block; }
  .ch { width: 38px; }
}

/* ---------- Platform additions on top of the gap measure styles ---------- */

/* Course colour themes: the base colour changes per course, the phase colours never do. */
body[data-course="data"] { --teal: #13294b; --teal-2: #1c3a66; --teal-3: #274b80; --teal-hi: #9cc3f2; }
body[data-course="support"] { --teal: #3a1f4a; --teal-2: #4d2a61; --teal-3: #633a7a; --teal-hi: #d6b6ee; }
body[data-course="foundation"] { --teal: #1e3b2c; --teal-2: #2a513d; --teal-3: #376a50; --teal-hi: #a9e0bf; }
:root[data-theme="dark"] body[data-course="data"], :root[data-dark="1"] body[data-course="data"] { --teal: #0d1d36; --teal-2: #16305a; --teal-3: #1f4273; }
:root[data-dark="1"] body[data-course="support"] { --teal: #2a1636; --teal-2: #3b2150; --teal-3: #4f2d66; }
:root[data-dark="1"] body[data-course="foundation"] { --teal: #15291f; --teal-2: #1f3e2f; --teal-3: #2a553f; }

.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.mono { font-family: var(--mono); }
.strong { font-weight: 900; }
.small { font-size: 13px; }
.theme-btn { background: transparent; border-color: #2b5a63; color: #cfe3e6; }
.ghost-dark { background: transparent; color: var(--code-dim); border-color: #2b3b42; }
.warn-text { color: var(--bad-s); }
.btn.big { font-size: 18px; padding: 12px 20px; }
.btn.danger, .linkbtn.danger { color: var(--bad-s); border-color: var(--bad-s); }
.linkbtn.danger { border: 0; }
label.btn { cursor: pointer; }
.toast.bad { background: var(--bad-s); }
.card.tint { background: var(--t, var(--kn-t)); }
.section .card.tint { background: var(--t); }
.act.wide { grid-column: 1 / -1; }
.act-title { display: block; color: var(--ink); font-size: 16px; }
.q-text { color: var(--ink); font-size: 16px; }
.chipslot { margin-left: auto; flex: none; }
.chipslot .state { margin-left: 0; }
.qhead .task > div { color: var(--ink); }
.preview-banner { display: flex; gap: 10px; align-items: center; background: var(--rf-t); color: var(--rf-s); font-weight: 900; padding: 10px 14px; border-radius: 10px; }
.preview-banner svg { width: 18px; height: 18px; }

/* Home: class code */
.home-hero .lede { max-width: 52ch; }
.code-form { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.code-form .lbl { color: var(--teal-hi); }
.code-input { font-family: var(--mono); font-size: clamp(26px, 5vw, 38px); font-weight: 700; letter-spacing: .25em; text-transform: uppercase; width: 8.5em; max-width: 100%; padding: 8px 14px; border-radius: 12px; border: 2px solid transparent; background: #fff; color: #0e3b43; }
.code-input:focus { outline: none; border-color: var(--teal-hi); box-shadow: 0 0 0 4px rgba(143, 211, 217, .35); }
.code-msg { color: var(--on-teal-2); min-height: 1.4em; font-size: 15px; }
.section .code-msg { color: var(--bad-s); }
.ico.small { width: 40px; height: 40px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; }
.ico.small svg { width: 20px; height: 20px; }

/* Activities: shared */
.subq { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.act-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.diagram svg { max-width: 100%; height: auto; }
.resource { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.resource .lbl { display: flex; gap: 6px; align-items: center; }
.resource .lbl svg { width: 15px; height: 15px; }
.timer { display: flex; gap: 10px; align-items: center; align-self: flex-start; background: var(--surface-2); padding: 6px 10px; border-radius: 10px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer.low { background: var(--mid-t); color: var(--mid-s); }
.timer.end { background: var(--bad-t); color: var(--bad-s); }
.hint svg { color: var(--kn-s); }
.why.hint { background: var(--kn-t); }
.why.problem { background: var(--ap-t); }
.why.problem svg { color: var(--ap-s); }
.show-checks { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.show-checks ul { margin: 6px 0 0; padding-left: 20px; }
.pill.ok, .pill.none { white-space: nowrap; }
.score-line { font-size: 18px; color: var(--ink); }
.qf-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.qf-bar i { display: block; height: 100%; background: var(--st-s); transition: width .1s linear; }
.qf-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface); }
.qf-row svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.qf-row.ok svg { color: var(--ok-s); } .qf-row.no svg { color: var(--bad-s); }
.tf-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.tf-text { color: var(--ink); }
.tf-why { grid-column: 1 / -1; }
.num-in { max-width: 180px; font-family: var(--mono); }
.fillblanks { line-height: 2.3; color: var(--ink); font-size: 16px; }
input.blank { font: inherit; font-family: var(--mono); font-size: .95em; padding: 2px 6px; border: 0; border-bottom: 2px solid var(--muted); background: var(--surface-2); color: var(--ink); border-radius: 4px 4px 0 0; margin: 0 2px; }
pre.fillcode input.blank { background: #22343c; color: #ffd866; border-bottom-color: #ffd866; font-size: 14px; }
input.blank.right, .field.right, input.cell.right, select.right { border-color: var(--ok-s) !important; background-color: color-mix(in srgb, var(--ok-t) 70%, var(--surface)); }
input.blank.wrong, .field.wrong, input.cell.wrong, select.wrong { border-color: var(--bad-s) !important; background-color: color-mix(in srgb, var(--bad-t) 70%, var(--surface)); }
pre.fillcode input.blank.right { background: #1e3a24; color: #b5e48c; }
pre.fillcode input.blank.wrong { background: #3a1d1a; color: #ff9d8a; }
.bank { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-btn { border: 1.5px dashed var(--muted); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.chip-btn:hover { border-style: solid; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); gap: 10px; align-items: center; }
.match-row svg { width: 16px; height: 16px; color: var(--muted); }
.m-left { color: var(--ink); font-weight: 700; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-item { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; border: 2px solid transparent; }
.order-item.right { border-color: var(--ok-s); } .order-item.wrong { border-color: var(--bad-s); }
.o-num { width: 26px; height: 26px; border-radius: 50%; background: var(--s, var(--muted)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.o-text { flex: 1; color: var(--ink); }
.o-btns { display: flex; gap: 4px; flex: none; }
.o-btns .btn { padding: 4px 7px; }
.cat-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cat-col { background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.cat-col.unsorted { background: transparent; border: 1.5px dashed var(--line); }
.cat-h { font-weight: 900; color: var(--ink); font-size: 14px; }
.cat-item { background: var(--surface); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; color: var(--ink); }
.cat-item.right { border-color: var(--ok-s); } .cat-item.wrong { border-color: var(--bad-s); }
select.mini { font: inherit; font-size: 12.5px; padding: 2px 4px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
select.field { appearance: auto; }
.flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.label-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.label-wrap { position: relative; }
.label-wrap img { width: 100%; display: block; border-radius: 10px; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 13px; }
.pin.static { position: static; transform: none; flex: none; }
.pin.right { background: var(--ok-s); } .pin.wrong { background: var(--bad-s); }
table.truth { border-collapse: collapse; font-family: var(--mono); background: var(--surface); border-radius: 10px; overflow: hidden; }
table.truth th, table.truth td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; }
table.truth th { background: var(--surface-2); color: var(--ink); font-size: 13px; }
table.truth th.out { background: var(--ap-t); }
table.truth td.given { color: var(--muted); }
.bit { width: 38px; height: 34px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-weight: 700; font-size: 16px; }
.bit.right { border-color: var(--ok-s); background: var(--ok-t); } .bit.wrong { border-color: var(--bad-s); background: var(--bad-t); }
.conv-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.conv-row > svg { width: 16px; height: 16px; color: var(--muted); }
.conv-q { font-size: 20px; font-weight: 700; color: var(--ink); min-width: 7ch; }
.conv-q sub { font-size: 11px; color: var(--muted); }
.conv-in { max-width: 220px; letter-spacing: .08em; }
.places { display: flex; gap: 2px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.places span { width: 26px; text-align: center; }
.algo-data { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.algo-data .nb { position: relative; }
.algo-data .nb small { position: absolute; top: -14px; font-size: 10px; color: var(--muted); }
table.algo, table.tt.fill, table.testplan, table.sqlres, table.assess { border-collapse: collapse; background: var(--surface); }
table.algo th, table.algo td, table.tt.fill th, table.tt.fill td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; }
table.algo th, table.tt.fill th { background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.lbl-cell { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: left !important; }
input.cell { font-family: var(--mono); font-size: 14px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); min-width: 4ch; width: 9ch; text-align: center; }
table.tt.fill input.cell { width: 12ch; }
.pick-code { background: var(--code-bg); border-radius: 10px; padding: 8px 0; overflow-x: auto; display: flex; flex-direction: column; }
.pick-line { display: flex; border: 0; background: transparent; color: var(--code-fg); font-family: var(--mono); font-size: 14px; line-height: 1.6; text-align: left; padding: 0 12px 0 0; white-space: pre; min-width: max-content; }
.pick-line .n { width: 40px; flex: none; text-align: right; padding-right: 12px; color: #4f636b; }
.pick-line:hover { background: rgba(255,255,255,.05); }
.pick-line.on { background: rgba(124, 196, 255, .2); box-shadow: inset 3px 0 0 #7cc4ff; }
.pick-line.ans { background: rgba(134, 209, 141, .22); box-shadow: inset 3px 0 0 #86d18d; }
.pick-line.wrong { background: rgba(255, 143, 143, .2); box-shadow: inset 3px 0 0 #ff8f8f; }
.st-line.faded { opacity: .45; }
.parsons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
.parsons-col { background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.parsons-col.prog { background: var(--code-bg); }
.parsons-col.prog .lbl { color: #9fb0b7; }
.pline { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--code-bg); color: var(--code-fg); font-family: var(--mono); font-size: 14px; padding: 6px 10px; text-align: left; white-space: pre; overflow-x: auto; }
.pline.in { border-color: #2b3b42; background: #1f2f36; }
.pline.in .pcode { flex: 1; }
.pline.right { border-color: var(--ok-s); } .pline.wrong { border-color: var(--bad-s); }
.pline .btn { background: #2b3b42; border-color: #2b3b42; color: #e6edf0; padding: 3px 7px; }
.testplan th, .testplan td { border: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
.testplan th { background: var(--surface-2); font-size: 13px; color: var(--ink); }
.testplan tr.ok td { background: color-mix(in srgb, var(--ok-t) 55%, var(--surface)); }
.testplan tr.no td { background: color-mix(in srgb, var(--bad-t) 55%, var(--surface)); }
.testplan .field { min-width: 110px; padding: 6px 8px; }
.textblock { display: flex; flex-direction: column; gap: 8px; max-width: 80ch; }
.textblock h3 { font-size: 18px; }
.textblock.style-brief, .textblock.style-tip, .textblock.style-note, .textblock.style-warning, .textblock.style-example, .textblock.style-key { background: var(--surface); border-radius: var(--r); padding: 14px 16px; border-left: 5px solid var(--s); max-width: none; }
.textblock.style-brief { border-left-color: var(--gr-s); } .textblock.style-warning { border-left-color: var(--bad-s); } .textblock.style-key { border-left-color: var(--ap-s); }
.textblock .lbl { display: flex; gap: 6px; align-items: center; }
.textblock .lbl svg { width: 15px; height: 15px; }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
.tint-group { background: var(--gr-t) !important; border: 0 !important; }
.lbl.mode { display: flex; gap: 6px; align-items: center; color: var(--gr-s); }
.lbl.mode svg { width: 16px; height: 16px; }
.lvl-cell { width: 62%; }
.conf { width: 100%; }
table.assess th, table.assess td { border: 1px solid var(--line); padding: 8px 10px; text-align: center; }
table.assess td:first-child, table.assess th:first-child { text-align: left; color: var(--ink); }
table.assess th { background: var(--surface-2); font-size: 13px; color: var(--ink); }
.lv-btn { border: 0; background: none; font-size: 20px; color: var(--rf-s); width: 100%; }
.lv-btn[aria-pressed="true"] { color: var(--rf-s); font-weight: 900; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--body); background: var(--surface); }
.dropzone.big { padding: 26px; justify-content: center; text-align: left; }
.dropzone.over { border-color: var(--focus); background: var(--kn-t); }
.dropzone svg { width: 28px; height: 28px; color: var(--muted); }
.evidence-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.evidence-imgs figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.evidence-imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.grid2.center { align-items: center; }
.rng-ctl.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide-range { width: 100%; accent-color: var(--ap-s); }
label.strong { font-weight: 700; color: var(--ink); }

/* Workbenches */
.webwork { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.file-tabs { display: flex; gap: 4px; }
.file-tabs button { border: 0; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 6px 12px; border-radius: 8px 8px 0 0; font-weight: 700; }
.file-tabs button[aria-selected="true"] { background: var(--code-bg-2); color: #e6edf0; }
.preview-bar { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.preview-bar svg { width: 15px; height: 15px; }
iframe.preview { width: 100%; min-height: 320px; height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; resize: vertical; }
.web-console { background: #0a1215; color: #e6edf0; font-family: var(--mono); font-size: 13px; border-radius: 10px; padding: 8px 12px; max-height: 160px; overflow: auto; }
.web-console .c-error { color: var(--c-err); } .web-console .c-warn { color: var(--c-in); }
details.schema { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
details.schema summary { cursor: pointer; font-weight: 700; color: var(--ink); display: flex; gap: 6px; align-items: center; }
details.schema summary svg { width: 16px; height: 16px; }
details.schema[open] { display: flex; flex-direction: column; gap: 10px; }
table.sqlres { font-size: 14px; }
table.sqlres th, table.sqlres td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
table.sqlres th { background: var(--surface-2); font-family: var(--mono); color: var(--ink); }
table.sqlres td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sqlres td.null { color: var(--muted); font-style: italic; }

/* Results and class viewer */
.step4.rf { background: var(--rf-t); } .step4.rf b { color: var(--rf-s); }
.mismatch.good { color: var(--ok-s); }
.meter.small { min-width: 110px; font-size: 12.5px; }
.meter .n { font-size: 13px; color: var(--muted); white-space: nowrap; }
td.hm { text-align: center; font-weight: 900; font-size: 13px; }
td.hm.ok { background: var(--ok-t); color: var(--ok-s); } td.hm.mid { background: var(--mid-t); color: var(--mid-s); } td.hm.bad { background: var(--bad-t); color: var(--bad-s); } td.hm.none { color: var(--muted); }
.gap-table.class th { font-size: 11.5px; }
.danger { color: var(--bad-s); }

/* Admin */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.admin-nav a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--ink); font-weight: 700; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--line); }
.admin-nav a svg { width: 16px; height: 16px; }
.admin-nav a[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.unit-card h3 { font-size: 19px; }
.lesson-list { margin: 0; padding-left: 22px; color: var(--ink); columns: 2; }
.code-chip { display: inline-flex; flex-direction: column; text-decoration: none; background: var(--teal); color: #fff; border-radius: 10px; padding: 6px 12px; font-family: var(--mono); font-weight: 700; letter-spacing: .12em; }
.code-chip small { font-family: var(--font); letter-spacing: 0; font-weight: 400; color: var(--on-teal-2); font-size: 11.5px; }
.unit-card .row .field { max-width: 280px; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; color: var(--ink); }
.file-chip svg { width: 14px; height: 14px; }
.file-chip .x { border: 0; background: var(--line); border-radius: 50%; width: 20px; height: 20px; line-height: 1; }
.report { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rep-h { display: flex; gap: 8px; align-items: center; }
.rep-h svg { width: 18px; height: 18px; }
.rep-h.ok svg { color: var(--ok-s); } .rep-h.bad svg { color: var(--bad-s); }
.rep-h .kbd { margin-left: auto; }
.report ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.report li.e b { color: var(--bad-s); } .report li.w b { color: var(--mid-s); }
.yaml-edit { min-height: 480px; font-size: 13.5px; line-height: 1.5; white-space: pre; tab-size: 2; }

/* Board view for class codes */
body.board-mode .topbar, body.board-mode .footer { display: none; }
.board { min-height: calc(100vh - 80px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; background: var(--teal); color: #fff; border-radius: 18px; padding: 40px 20px; }
.b-top { font-size: 20px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-hi); }
.b-title { font-size: clamp(24px, 4vw, 44px); font-weight: 900; }
.b-code { display: flex; gap: clamp(6px, 1.2vw, 16px); }
.b-code span { font-family: var(--mono); font-weight: 700; font-size: clamp(56px, 12vw, 170px); background: #fff; color: #0e3b43; border-radius: 16px; width: 1.1em; line-height: 1.3; }
.b-url { font-size: clamp(18px, 2.4vw, 30px); color: var(--on-teal-2); }
.b-url strong { color: #fff; }
.b-warn { background: var(--bad-s); padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.board .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

@media (max-width: 900px) {
  .webwork, .label-grid, .parsons { grid-template-columns: minmax(0, 1fr); }
  .lesson-list { columns: 1; }
}
@media (max-width: 640px) {
  .match-row { grid-template-columns: minmax(0, 1fr); }
  .match-row svg { display: none; }
  .tf-row { grid-template-columns: minmax(0, 1fr); }
  .lvl-cell { width: auto; }
}
