/* Exam blue: navy chrome carries who and how long, as in the JEE test screen; white paper carries
   the work; one cobalt accent for actions. Dark mode is the Night palette. Status colours mean status. */
@font-face { font-family: "IBM Plex Sans"; src: url("/static/fonts/IBMPlexSans-Variable.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --canvas: #e9edf2;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --ink: #0f1a2b;
  --ink-soft: #2a3547;
  --muted: #5a6577;
  --line: #d8dee6;
  --line-strong: #bfc8d4;
  --on-ink: #ffffff;
  --accent: #1f5fd1;
  --accent-hover: #1a51b3;
  --on-accent: #ffffff;
  --accent-soft: #e6eefc;
  --link: #1f5fd1;
  --go: #138a4b;
  --chrome: #0f2541;
  --chrome-2: #16335a;
  --chrome-line: #24446f;
  --chrome-ink: #eef3fa;
  --chrome-muted: #9fb2cc;
  --ok: #12804a;
  --ok-bg: #e5f6ec;
  --warn: #a86400;
  --warn-bg: #fdf3e0;
  --bad: #c93a30;
  --bad-bg: #fdeceb;
  --info: #1f5fd1;
  --info-bg: #e6eefc;
  --focus: rgba(31, 95, 209, .3);
  --shadow: 0 1px 2px rgba(15, 26, 43, .05);
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-card: 14px;
  --r-input: 10px;
  --r-btn: 10px;
  --r-pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #171721; --paper: #1e1e2a; --soft: #232331; --ink: #ededf3; --ink-soft: #c9c9d6;
    --muted: #a6a6b6; --line: #2d2d3d; --line-strong: #3c3c50; --on-ink: #171721;
    --accent: #5266eb; --accent-hover: #6577f0; --accent-soft: #252a4d; --link: #9aa6ff; --go: #2a9d5e;
    --chrome: #101018; --chrome-2: #1d1d2b; --chrome-line: #2b2b3d; --chrome-ink: #ededf3; --chrome-muted: #8f8fa3;
    --ok: #3ecf7f; --ok-bg: #183427; --warn: #f0b03a; --warn-bg: #3a2f17; --bad: #f06a5f; --bad-bg: #3a1d1c;
    --info: #9aa6ff; --info-bg: #252a4d; --focus: rgba(154, 166, 255, .35); --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #171721; --paper: #1e1e2a; --soft: #232331; --ink: #ededf3; --ink-soft: #c9c9d6;
  --muted: #a6a6b6; --line: #2d2d3d; --line-strong: #3c3c50; --on-ink: #171721;
  --accent: #5266eb; --accent-hover: #6577f0; --accent-soft: #252a4d; --link: #9aa6ff; --go: #2a9d5e;
  --chrome: #101018; --chrome-2: #1d1d2b; --chrome-line: #2b2b3d; --chrome-ink: #ededf3; --chrome-muted: #8f8fa3;
  --ok: #3ecf7f; --ok-bg: #183427; --warn: #f0b03a; --warn-bg: #3a2f17; --bad: #f06a5f; --bad-bg: #3a1d1c;
  --info: #9aa6ff; --info-bg: #252a4d; --focus: rgba(154, 166, 255, .35); --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); }
a:hover { text-decoration-color: var(--link); }
code, pre, kbd, .mono { font-family: var(--mono); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

header.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--chrome); color: var(--chrome-ink); min-height: 56px;
}
header.top .brand { font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 640px) { header.top { flex-wrap: wrap; row-gap: 6px; } header.top nav { margin-left: 0; order: 5; flex-basis: 100%; } }
header.top .who { margin-left: auto; color: var(--chrome-muted); font-size: 13px; }
header.top button.plain, header.top button.ghost { background: transparent; color: var(--chrome-ink); border-color: var(--chrome-line); }
header.top button.plain:hover, header.top button.ghost:hover { background: var(--chrome-2); }
header.top form { margin: 0; }
header.top .brand + .theme-toggle { margin-left: auto; }
header.top nav { display: flex; gap: 4px; margin-left: 12px; }
header.top nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--chrome-muted); font-weight: 500; font-size: 13px; }
header.top nav a:hover, header.top nav a.on { background: var(--chrome-2); color: var(--chrome-ink); }
main { max-width: 1180px; margin: 0 auto; padding-block: 28px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; margin: 0 0 10px; text-wrap: balance; }
p { margin: 0 0 10px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }

label { display: block; font-weight: 500; font-size: 13px; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-input);
  background: var(--paper); color: var(--ink); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--accent); border-radius: var(--r-btn);
  background: var(--accent); color: var(--on-accent); font: 500 14px/1.2 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.plain, .button.plain { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
button.plain:hover, .button.plain:hover { background: var(--soft); border-color: var(--line-strong); }
button.ghost { background: transparent; color: var(--ink); border-color: transparent; }
button.ghost:hover { background: var(--soft); border-color: transparent; }
button.go { background: var(--go); border-color: var(--go); color: #fff; }
button.go:hover { filter: brightness(1.08); background: var(--go); border-color: var(--go); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.small, .button.small { padding: 5px 12px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; }

.error { color: var(--bad); font-weight: 500; white-space: pre-wrap; }
.note { color: var(--muted); }
.notice { border: 1px solid var(--line); border-radius: var(--r-input); padding: 10px 14px; background: var(--soft); }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; border: 1px solid var(--line); color: var(--muted); background: var(--paper); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.info { background: var(--info-bg); color: var(--info); border-color: transparent; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-input); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
pre.code { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-input); padding: 12px; overflow-x: auto; font-size: 13px; }
.theme-toggle { font-size: 13px; }

/* classroom maps */
.room-map { width: max-content; min-width: 100%; }
.room-map .board { text-align: center; background: var(--chrome); color: var(--chrome-ink); border-radius: 6px; padding: 4px; margin-bottom: 10px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.map-row { display: flex; gap: 4px; margin-bottom: 4px; }
.map-row .cell { flex: 0 0 auto; width: 58px; min-height: 32px; padding: 3px; border-radius: 8px; font-size: 11px; text-align: center; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.room-map.compact .cell { width: 38px; min-height: 28px; font-size: 10px; padding: 0; }
.map-row .cell.floor { background: transparent; border: 1px dashed var(--line); color: transparent; }
.map-row .cell.seat { background: var(--soft); border: 1px solid var(--line-strong); color: var(--muted); }
.map-row .cell.taken { background: var(--paper); color: var(--ink); border-color: var(--accent); }
.map-row .cell.empty { opacity: .5; }
.map-row button.cell { display: block; color: var(--ink); }

/* check-in desk */
.checkin-result { text-align: center; }
.checkin-result p { margin: 4px 0; }
.checkin-name { font-size: 20px; font-weight: 600; }
.checkin-seat { font: 600 84px/1.05 var(--mono); color: var(--accent); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.checkin-result form { margin-top: 12px; }

/* exam screen: LeetCode-style split, problem left, editor and console right */
body.exam { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--canvas); }
.xbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 9px max(14px, env(safe-area-inset-right, 0px)) 9px max(14px, env(safe-area-inset-left, 0px)); background: var(--chrome); color: var(--chrome-ink); }
.xbar button.plain { background: transparent; color: var(--chrome-ink); border-color: var(--chrome-line); }
.xbar button.plain:hover { background: var(--chrome-2); }
.xbar #submit { background: var(--go); border-color: var(--go); color: #fff; }
.xbar #submit:hover { filter: brightness(1.08); }
.xbar-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.xbar-side.end { justify-content: flex-end; }
.xbar-mid { display: flex; gap: 8px; }
.xbrand { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.qtabs { display: flex; gap: 4px; overflow-x: auto; }
.qtabs button { background: transparent; color: var(--chrome-muted); border: 1px solid transparent; padding: 5px 11px; font-size: 13px; }
.qtabs button:hover { background: var(--chrome-2); color: var(--chrome-ink); }
.qtabs button.on { background: var(--chrome-2); color: var(--chrome-ink); border-color: var(--chrome-line); }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.xbar .who { color: var(--chrome-muted); font-family: var(--mono); }
.timer { font: 500 22px/1 var(--mono); font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 8px; background: var(--chrome-2); color: var(--chrome-ink); letter-spacing: .02em; }
.timer.warn { color: #ffc35c; }
.timer.low { color: #ff8a7f; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--line-strong); vertical-align: 0; }
.dot.draft { background: var(--muted); }
.dot.submitted, .dot.changed { background: var(--warn); }
.dot.passed { background: var(--ok); }
.dot.failed { background: var(--bad); }
.banner { padding: 8px 16px; font-weight: 500; border-bottom: 1px solid var(--line); background: var(--info-bg); color: var(--info); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner button { margin-left: 8px; }

.xwrap { --left: 42%; flex: 1; min-height: 0; display: grid; grid-template-columns: var(--left) 6px 1fr; padding: 8px; gap: 0; }
.pane { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#right { --console: 230px; display: grid; grid-template-rows: auto 1fr 6px var(--console); }
/* the editor side is a dark code panel in both themes */
#right {
  --paper: #0e1a2c; --soft: #13223a; --canvas: #0a1424; --ink: #e4ebf5; --ink-soft: #c3cfdf; --muted: #7d8fa8;
  --line: #1d2e48; --line-strong: #2b4163; --ok: #4fd18b; --ok-bg: #143226; --bad: #ff7d70; --bad-bg: #3b1d22;
  --warn: #f3b544; --warn-bg: #3a2c14; --focus: rgba(124, 199, 255, .35); --link: #7cc7ff;
  --syn-key: #c4a6ff; --syn-str: #8fe3a8; --syn-num: #ffcf7a; --syn-com: #6f8299; --syn-def: #7cc7ff; --syn-builtin: #7cc7ff;
  color-scheme: dark; border-color: #0e1a2c; color: var(--ink);
}
.gutter { background: transparent; position: relative; }
.gutter.v { cursor: col-resize; }
.gutter.h { cursor: row-resize; }
.gutter::after { content: ""; position: absolute; border-radius: 2px; background: var(--line-strong); opacity: 0; transition: opacity .15s; }
.gutter.v::after { left: 2px; top: 45%; width: 2px; height: 10%; }
.gutter.h::after { top: 2px; left: 45%; height: 2px; width: 10%; }
.gutter:hover::after { opacity: 1; }
.ptabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--soft); }
.ptabs button { background: transparent; color: var(--muted); border: 0; border-radius: 8px 8px 0 0; padding: 7px 12px; font-size: 13px; border-bottom: 2px solid transparent; }
.ptabs button:hover { color: var(--ink); background: transparent; }
.ptabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
#right .ptabs button.on { border-bottom-color: var(--ink); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.pbody { padding: 16px 20px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.pbody h1 { font-size: 20px; margin-bottom: 10px; }
.pbody .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.pbody .text { white-space: pre-wrap; line-height: 1.65; max-width: 72ch; margin-bottom: 16px; }
.example { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--soft); }
.io-label { font-size: 12px; color: var(--muted); font-weight: 500; margin: 8px 0 4px; }
.pbody pre, .cbody pre, .check pre { margin: 0; padding: 8px 10px; background: var(--canvas); border-radius: 8px; white-space: pre-wrap; word-break: break-word; font: 13px/1.5 var(--mono); }
.example pre { background: var(--paper); border: 1px solid var(--line); }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.msg.mine { background: var(--soft); }
.msg p { margin: 0; white-space: pre-wrap; }
.msg-head { font-size: 12px; color: var(--muted); margin-bottom: 2px !important; }
.ask { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.ask select, .ask textarea { margin-bottom: 8px; }

.edbar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 13px; }
.edbar .lang { font-weight: 500; padding: 2px 8px; }
.edbar .spacer { flex: 1; }
.syntax { font-size: 12px; }
.syntax.ok { color: var(--muted); }
.syntax.bad { color: var(--bad); font-weight: 500; }
.saved { color: var(--muted); font-size: 12px; margin-right: 6px; }
.edwrap { min-height: 0; position: relative; }
.edwrap .CodeMirror { position: absolute; inset: 0; height: auto; }
.console { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.cbody { padding: 10px 14px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.cbody textarea { font: 13px/1.5 var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--canvas); color: var(--muted); border: 1px solid transparent; padding: 4px 12px; font-size: 13px; }
.chip:hover { background: var(--line); color: var(--ink); }
.chip.on { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.result-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.verdict { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
pre.diff span { display: block; }
pre.diff span.bad { background: var(--bad-bg); color: var(--bad); }
pre.stderr { color: var(--bad); }

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: grid; place-items: center; z-index: 20; padding: 16px; }
.dialog { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* editor colours from the theme tokens */
:root { --ed-size: 14px; --syn-key: #7c3aed; --syn-str: #15803d; --syn-num: #b45309; --syn-com: #8a8a8a; --syn-def: #1d4ed8; --syn-builtin: #0e7490; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --syn-key: #c4b5fd; --syn-str: #86efac; --syn-num: #fcd34d; --syn-com: #737373; --syn-def: #93c5fd; --syn-builtin: #67e8f9; } }
:root[data-theme="dark"] { --syn-key: #c4b5fd; --syn-str: #86efac; --syn-num: #fcd34d; --syn-com: #737373; --syn-def: #93c5fd; --syn-builtin: #67e8f9; }
.CodeMirror { font: var(--ed-size)/1.55 var(--mono); background: var(--paper); color: var(--ink); }
.CodeMirror-gutters { background: var(--paper); border-right: 1px solid var(--line); }
.CodeMirror-linenumber { color: var(--muted); }
.CodeMirror-cursor { border-left-color: var(--ink); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: var(--line) !important; }
.CodeMirror-activeline-background { background: var(--soft); }
.CodeMirror-matchingbracket { color: var(--ink) !important; background: var(--line); }
.cm-s-default .cm-keyword { color: var(--syn-key); }
.cm-s-default .cm-string { color: var(--syn-str); }
.cm-s-default .cm-number { color: var(--syn-num); }
.cm-s-default .cm-comment { color: var(--syn-com); font-style: italic; }
.cm-s-default .cm-def { color: var(--syn-def); }
.cm-s-default .cm-builtin { color: var(--syn-builtin); }
.cm-s-default .cm-variable, .cm-s-default .cm-variable-2, .cm-s-default .cm-property, .cm-s-default .cm-operator { color: var(--ink); }
.cm-syntax-error { background: var(--bad-bg); }

@media (max-width: 900px) {
  body.exam { height: auto; overflow: auto; }
  .xbar { grid-template-columns: 1fr; }
  .xbar-side.end { justify-content: flex-start; }
  .xwrap { grid-template-columns: 1fr; }
  .gutter { display: none; }
  #right { grid-template-rows: auto 420px 0 260px; margin-top: 8px; }
}

@media print {
  header.top, .no-print { display: none; }
  body { background: #fff; }
  .card, .plan { break-inside: avoid; border: 0; box-shadow: none; }
  .table-wrap { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* live room */
.map-row a.cell { text-decoration: none; color: var(--ink); }
.map-row .cell.st-seated { background: var(--info-bg); border-color: var(--info); color: var(--info); }
.map-row .cell.st-working { background: var(--ok-bg); border-color: var(--ok); }
.map-row .cell.st-idle { background: var(--warn-bg); border-color: var(--warn); }
.map-row .cell.st-offline { background: var(--bad-bg); border-color: var(--bad); }
.map-row .cell.st-finished { background: var(--canvas); border-color: var(--line-strong); color: var(--muted); }
.map-row .cell.flag { box-shadow: 0 0 0 2px var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.legend i.st-seated { background: var(--info-bg); border-color: var(--info); }
.legend i.st-working { background: var(--ok-bg); border-color: var(--ok); }
.legend i.st-idle { background: var(--warn-bg); border-color: var(--warn); }
.legend i.st-offline { background: var(--bad-bg); border-color: var(--bad); }
.legend i.st-finished { background: var(--canvas); }
.legend i.flag { box-shadow: 0 0 0 2px var(--bad); }
tr:target td { background: var(--warn-bg); }

/* code playback */
pre.playback { counter-reset: line; line-height: 1.55; }
pre.playback span { display: block; padding-right: 8px; }
pre.playback span.add { background: var(--ok-bg); }
pre.playback i { display: inline-block; width: 3ch; margin-right: 12px; color: var(--muted); font-style: normal; text-align: right; user-select: none; }
.jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.jumps button.pill { cursor: pointer; font: 500 12px/1.6 var(--sans); }

/* analytics */
.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; align-items: end; height: 180px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bar-fill { width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-n { font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-x { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { height: 8px; background: var(--canvas); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter div { height: 100%; background: var(--accent); }

/* Student home */
.dash { display: grid; gap: 14px; }
.dash > * { margin: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dash-head h2 { margin: 2px 0 0; font-size: 18px; }
.dash-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.dash-facts span { display: block; font-size: 12px; color: var(--muted); }
.dash-facts b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Laptop check */
.checks { display: grid; gap: 0; }
.check { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; padding-top: 0; }
.check h3 { margin: 0; font-size: 14px; font-weight: 600; }
.check .detail { grid-column: 1 / -1; color: var(--muted); margin: 0; }
.typing-target { font: 15px/1.6 var(--mono); background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-input); padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.typing-target mark { background: var(--bad-bg); color: var(--bad); border-radius: 3px; }
.practice-ed { border: 1px solid var(--line); border-radius: var(--r-input); overflow: hidden; margin: 10px 0; }
.practice-ed .CodeMirror { height: 180px; }
input.mono { font-family: var(--mono); }

/* Question bank editor */
.qedit .practice-ed .CodeMirror { height: 220px; }
.qedit details { margin-top: 12px; }
.qedit summary { cursor: pointer; font-weight: 500; }
.test-row { border-top: 1px solid var(--line); padding: 14px 0; }
.test-row:first-child { border-top: 0; }
.test-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.test-head button { margin-left: auto; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--muted); }
label.inline input[type=number] { padding: 4px 8px; }
.test-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.test-io textarea { font: 13px/1.5 var(--mono); }
.test-result { margin: 8px 0 0; overflow-wrap: anywhere; }
.ok-text { color: var(--ok); font-weight: 500; }
