:root, [data-theme="dark"] {
  --bg: #0e131f;
  --panel: #161d2c;
  --panel-2: #1c2538;
  --line: #28324a;
  --text: #e6ebf5;
  --muted: #8d98b3;
  --accent: #2dd4bf;
  --accent-ink: #062a26;
  --xp: #fbbf24;
  --ok: #4ade80;
  --bad: #f87171;
  --code-bg: #0a0f19;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
[data-theme="light"] {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #eef1f8;
  --line: #dde2ee;
  --text: #172033;
  --muted: #5f6b85;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --xp: #b7791f;
  --ok: #15803d;
  --bad: #dc2626;
  --code-bg: #0f1624;
  --shadow: 0 8px 24px rgba(20, 30, 60, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
:not(pre) > code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: .88em;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 800 14px ui-monospace, Menlo, monospace;
}
.top-stats { margin-left: auto; display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip.xp { color: var(--xp); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
}

main { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-weight: 600; font-size: 14px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

/* Dashboard */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
  padding: 28px; border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.eyebrow { margin: 0; color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 6px 0 4px; font-size: 32px; letter-spacing: -.03em; }
.hero p { color: var(--muted); margin: 0 0 18px; }
.edit-name { background: none; border: 0; color: var(--muted); font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.level-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.level-bar i { display: block; height: 100%; background: var(--xp); }

.layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.side { display: grid; gap: 16px; position: sticky; top: 76px; }

.lab { margin-bottom: 20px; }
.lab-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 8px; }
.lab-head small { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.lab-head h2 { margin: 2px 0; font-size: 20px; }
.lab-head p { margin: 0; color: var(--muted); font-size: 13px; }
.lab-pct { font-weight: 700; color: var(--muted); font-size: 13px; white-space: nowrap; }
.nodes { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0 8px; }
.node {
  display: flex; align-items: center; gap: 14px; width: 260px;
  transform: translateX(calc(var(--o) * 56px));
}
.bubble {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--line);
  font-size: 20px; font-weight: 800;
  box-shadow: 0 5px 0 var(--line);
  transition: transform .12s;
}
.node:hover .bubble { transform: translateY(-2px); }
.node.done .bubble { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.node.current .bubble { border-color: var(--xp); color: var(--xp); box-shadow: 0 5px 0 color-mix(in srgb, var(--xp) 45%, #000); animation: pulse 2s infinite; }
.node.locked { opacity: .45; pointer-events: none; }
.node-label b { display: block; font-size: 14px; }
.node-label span { color: var(--muted); font-size: 12px; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.goal-bar { height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 8px 0 6px; }
.goal-bar i { display: block; height: 100%; background: var(--ok); transition: width .4s; }
.muted { color: var(--muted); font-size: 13px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge {
  text-align: center; padding: 10px 4px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--muted);
  filter: grayscale(1); opacity: .55;
}
.badge i { display: block; font-style: normal; font-size: 22px; margin-bottom: 2px; }
.badge.earned { filter: none; opacity: 1; color: var(--text); border-color: color-mix(in srgb, var(--xp) 50%, var(--line)); }
.streak-num { font-size: 34px; font-weight: 800; line-height: 1; }
.footer-links { margin-top: 8px; text-align: center; }
.linklike { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }

/* Quest page */
.quest-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.quest-top h1 { font-size: 20px; margin: 0; }
.quest-top .crumb { color: var(--muted); font-size: 13px; }
.quest-top .spacer { flex: 1; }
.cleared-tag { color: var(--ok); font-weight: 700; font-size: 13px; }

.quest-grid { display: grid; grid-template-columns: minmax(320px, 1fr) 1.35fr; gap: 20px; align-items: start; }
.brief { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: none; padding: 7px; border-radius: 7px; font-weight: 600; color: var(--muted); }
.tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.brief p { margin: 0 0 12px; }
.brief pre, .expected {
  background: var(--code-bg); color: #dbe4f5;
  border-radius: 10px; padding: 12px 14px; margin: 0 0 12px;
  font-size: 13px; overflow-x: auto; line-height: 1.5;
}
.brief ol { padding-left: 20px; margin: 0 0 16px; }
.brief li { margin-bottom: 6px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 16px 0 6px; }
.expected { counter-reset: ln; padding-left: 0; }
.expected div { counter-increment: ln; white-space: pre; padding-right: 12px; }
.expected div::before { content: counter(ln); display: inline-block; width: 32px; text-align: right; margin-right: 12px; color: #56607a; }
.ws { color: #4b5673; }
.stdin-tag { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hint { background: color-mix(in srgb, var(--xp) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--xp) 35%, var(--line)); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }

.workbench { display: grid; gap: 12px; }
.editor-card { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.file-tab { font: 600 13px ui-monospace, Menlo, monospace; padding: 4px 10px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); }
.kbd-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
#editor .CodeMirror, #editor textarea { height: 380px; font: 14px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }
#editor textarea { width: 100%; border: 0; padding: 12px; background: var(--code-bg); color: #dbe4f5; resize: vertical; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }

.terminal { background: var(--code-bg); color: #dbe4f5; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.term-head { display: flex; justify-content: space-between; padding: 8px 14px; font: 600 12px ui-monospace, Menlo, monospace; color: #8d98b3; border-bottom: 1px solid #1e2740; }
#term { padding: 14px; min-height: 120px; max-height: 420px; overflow: auto; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, monospace; }
#term pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.t-muted { color: #6b7693; }
.t-ok { color: #4ade80; font-weight: 700; }
.t-bad { color: #f87171; font-weight: 700; }
.t-warn { color: #fbbf24; }
.check { border-top: 1px dashed #26304a; padding-top: 10px; margin-top: 10px; }
.check:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.diff { margin-top: 6px; color: #fca5a5; }
.success-banner {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--ok) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line));
  font-weight: 600;
}
.error-line { background: rgba(248, 113, 113, .16); }

/* CodeMirror theme */
.cm-s-bytetrail.CodeMirror { background: var(--code-bg); color: #dbe4f5; }
.cm-s-bytetrail .CodeMirror-gutters { background: var(--code-bg); border-right: 1px solid #1e2740; }
.cm-s-bytetrail .CodeMirror-linenumber { color: #4b5673; }
.cm-s-bytetrail .CodeMirror-cursor { border-left: 2px solid var(--accent); }
.cm-s-bytetrail .CodeMirror-selected, .cm-s-bytetrail .CodeMirror-focused .CodeMirror-selected { background: #25324d; }
.cm-s-bytetrail .CodeMirror-activeline-background { background: #121a2a; }
.cm-s-bytetrail .cm-keyword { color: #c792ea; }
.cm-s-bytetrail .cm-type, .cm-s-bytetrail .cm-variable-3 { color: #7dd3fc; }
.cm-s-bytetrail .cm-string { color: #a5e3a0; }
.cm-s-bytetrail .cm-string-2 { color: #f0c674; }
.cm-s-bytetrail .cm-number { color: #fdba74; }
.cm-s-bytetrail .cm-comment { color: #5f6b85; font-style: italic; }
.cm-s-bytetrail .cm-meta { color: #f472b6; }
.cm-s-bytetrail .cm-def, .cm-s-bytetrail .cm-builtin { color: #82aaff; }
.cm-s-bytetrail .cm-operator { color: #89ddff; }
.cm-s-bytetrail .CodeMirror-matchingbracket { color: #fff !important; background: #2a3a5c; }

/* Toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--xp);
  border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow);
  font-weight: 600; animation: slidein .25s ease-out;
}
.toast small { display: block; color: var(--muted); font-weight: 500; }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 900px) {
  .hero, .layout, .quest-grid { grid-template-columns: 1fr; }
  .side, .brief { position: static; max-height: none; }
  .top-stats .chip.hide-sm { display: none; }
  main { padding: 16px; }
}
@media (max-width: 480px) {
  .node { transform: none; width: 100%; }
  .topbar { padding: 10px 16px; }
}

/* ---------- Navigation ---------- */
.nav { display: flex; gap: 4px; margin-left: 16px; }
.nav a { padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel); border: 1px solid var(--line); }

/* ---------- Output comparison & match % ---------- */
.compare { margin-top: 8px; }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.out-pane { min-width: 0; }
.out-title { font: 700 11px ui-sans-serif, -apple-system, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8d98b3; margin-bottom: 4px; }
.compare .expected { margin: 0; border: 1px solid #1e2740; }
.diff-line { background: rgba(248, 113, 113, .16); }
.empty-out { color: #6b7693; padding-left: 12px; font-style: italic; }
.diff-note { margin-top: 8px; color: #fca5a5; }
.match { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px; min-width: 150px; margin-left: auto; }
.match b { font-size: 22px; }
.match span { color: #8d98b3; font-size: 12px; }
.match-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: #1e2740; overflow: hidden; margin-top: 4px; }
.match-bar i { display: block; height: 100%; }
.match.ok b { color: #4ade80; } .match.ok .match-bar i { background: #4ade80; }
.match.mid b { color: #fbbf24; } .match.mid .match-bar i { background: #fbbf24; }
.match.low b { color: #f87171; } .match.low .match-bar i { background: #f87171; }
.q-card .match span, .q-card .out-title { color: var(--muted); }
.q-card .match-bar { background: var(--line); }

.partial-banner {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--xp) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--xp) 45%, var(--line));
}
.partial-banner .muted { margin-top: 2px; }
.no-penalty {
  padding: 10px 14px; border-radius: 12px; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
}
.partial-tag, .bad-tag { font-weight: 700; font-size: 13px; }
.partial-tag { color: var(--xp); }
.bad-tag { color: var(--bad); }
.node.partial .bubble { background: color-mix(in srgb, var(--xp) 18%, var(--panel-2)); border-color: var(--xp); color: var(--xp); font-size: 14px; box-shadow: 0 5px 0 color-mix(in srgb, var(--xp) 40%, #000); }

/* ---------- Lab Practice: overview ---------- */
.xp-scale { display: flex; gap: 8px; flex-wrap: wrap; }
.diff-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.diff-dot.easy { background: var(--ok); }
.diff-dot.medium { background: var(--xp); }
.diff-dot.hard { background: var(--bad); }
.goal-bar.easy i { background: var(--ok); }
.goal-bar.medium i { background: var(--xp); }
.goal-bar.hard i { background: var(--bad); }

.lab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lab-card { display: flex; flex-direction: column; gap: 6px; transition: transform .12s, border-color .12s; }
a.lab-card:hover, a.diff-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lab-card small { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.lab-card h2 { margin: 0 0 4px; font-size: 18px; }
.lab-card .btn { align-self: flex-start; margin-top: 8px; }
.lab-card.soon { opacity: .6; border-style: dashed; }
.mini-rows { display: grid; gap: 4px; margin-top: 4px; }
.mini-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mini-row .muted { margin-left: auto; }

.lab-progress { margin-bottom: 16px; }
.lab-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.diff-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.diff-card { display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--line); transition: transform .12s, border-color .12s; }
.diff-card.easy { border-top-color: var(--ok); }
.diff-card.medium { border-top-color: var(--xp); }
.diff-card.hard { border-top-color: var(--bad); }
.diff-head { display: flex; align-items: center; gap: 8px; }
.diff-head h2 { margin: 0; font-size: 20px; }
.diff-head .chip { margin-left: auto; }
.diff-card p { margin: 0; }
.diff-count b { font-size: 22px; }
.diff-card .btn { align-self: flex-start; margin-top: 6px; }

.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.q-tile {
  display: grid; gap: 2px; padding: 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line);
  transition: transform .12s;
}
.q-tile:hover { transform: translateY(-2px); }
.q-num { font-size: 22px; font-weight: 800; }
.q-type { font-size: 13px; font-weight: 600; }
.q-status { font-size: 12px; color: var(--muted); }
.q-tile.correct { border-left-color: var(--ok); }
.q-tile.correct .q-status { color: var(--ok); font-weight: 700; }
.q-tile.incorrect { border-left-color: var(--bad); }
.q-tile.incorrect .q-status { color: var(--bad); font-weight: 700; }
.q-tile.pending { border-left-color: var(--xp); }
.q-tile.pending .q-status { color: var(--xp); }

/* ---------- Lab Practice: question page ---------- */
.type-pill { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent); }
.q-single { max-width: 820px; margin: 0 auto; }
.q-prompt { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.code-view { background: var(--code-bg); color: #dbe4f5; border-radius: 10px; padding: 12px 14px 12px 0; margin: 0 0 12px; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; }
.code-view div { white-space: pre; }
.code-view .ln { display: inline-block; width: 36px; text-align: right; margin-right: 14px; color: #4b5673; user-select: none; }
.inline-code { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: none; border: 0; padding: 0; white-space: pre; }
.out-view { margin: 0; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre; tab-size: 8; }
.legend { margin-top: -4px; }
.options { display: grid; gap: 8px; margin: 12px 0; }
.option {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 2px solid var(--line);
}
.option:hover:not([disabled]) { border-color: var(--muted); }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel-2)); }
.option.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--panel-2)); }
.option.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel-2)); }
.option.dim { opacity: .55; }
.option[disabled] { cursor: default; }
.opt-letter { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 13px; }
.option.selected .opt-letter { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.option.correct .opt-letter { background: var(--ok); color: #fff; border-color: transparent; }
.option.wrong .opt-letter { background: var(--bad); color: #fff; border-color: transparent; }
.opt-body { min-width: 0; overflow-x: auto; padding-top: 2px; }
.option .out-view, .option .inline-code { color: var(--text); }
.answer-box {
  width: 100%; padding: 12px; border-radius: 10px; resize: vertical;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font: inherit;
}
.answer-box.mono { font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.answer-box:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.q-actions { margin-top: 12px; display: flex; gap: 8px; }
.result { margin: 14px 0 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.result p { margin: 8px 0 0; }
.result-head { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.result-head span:not(.muted) { font-weight: 800; color: var(--xp); }
.result.correct { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.result.correct b { color: var(--ok); }
.result.incorrect { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.result.incorrect b { color: var(--bad); }
.result.incorrect .result-head span:not(.muted) { color: var(--muted); }
.result .compare .expected { background: var(--code-bg); }
.model-answer { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.error-msg { background: #1a0f14; color: #fca5a5; border: 1px solid #4a1f28; border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; white-space: pre; }
.part { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.part-head { display: flex; align-items: baseline; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.part-num { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.part-result { margin-top: 10px; font-weight: 700; }
.part-result.ok { color: var(--ok); }
.part-result.bad { color: var(--bad); }
.part-result .model-answer { color: var(--text); font-weight: 400; }
.part-lines { display: grid; gap: 4px; margin-top: 6px; font-weight: 600; }
.locked-editor { min-height: 200px; display: flex; flex-direction: column; justify-content: center; border-style: dashed; }
.part2-intro .expected { margin-bottom: 8px; }
.solution summary { cursor: pointer; font-weight: 700; }
.solution .code-view { margin-top: 12px; }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.q-nav .muted { text-decoration: underline; }

@media (max-width: 900px) {
  .diff-cards, .compare-grid { grid-template-columns: 1fr; }
  .nav { margin-left: 4px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 560px) {
  .brand { font-size: 0; gap: 0; }
  .top-stats .chip.xp { display: none; }
}
