:root {
  color-scheme: dark;
  --bg: #141518;
  --bg-2: #18191d;
  --surface: #1c1e22;
  --raised: #23262b;
  --hover: #292c32;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #ecebe8;
  --dim: #a4a7ad;
  --faint: #6f737a;
  --accent: #f2b880;
  --accent-ink: #2a1a0c;
  --accent-soft: rgba(242, 184, 128, 0.12);
  --ok: #8bd3a0;
  --ok-soft: rgba(139, 211, 160, 0.1);
  --bad: #f08a84;
  --bad-soft: rgba(240, 138, 132, 0.1);
  --code-bg: #111215;
  --r: 14px;
  --r-sm: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, #1d1e23 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
::selection { background: rgba(242, 184, 128, 0.3); }
* { scrollbar-width: thin; scrollbar-color: #33363c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2f3238; border-radius: 10px; border: 3px solid var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 20px;
  background: rgba(20, 21, 24, 0.92);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; }
.top .spacer { flex: 1; }
.runner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 4px; transition: background 0.3s; }
.runner-dot.on { background: var(--ok); }

main { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }
main.wide { max-width: 1400px; }

.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--r-sm); color: var(--dim);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 17px; height: 17px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--raised); color: var(--text);
  cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #f6c595; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.big { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.danger { color: var(--bad); }

h1 { font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 13px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin: 36px 0 12px; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* library */
.lib-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.search {
  flex: 1; height: 44px; padding: 0 16px 0 42px; border-radius: 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236f737a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
  border: 1px solid var(--line); outline: none;
}
.search:focus { border-color: var(--line-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px; min-height: 150px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; text-align: left; color: inherit; text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}
.card:hover { background: var(--raised); border-color: var(--line-2); transform: translateY(-2px); }
.card-title { font-weight: 600; font-size: 16px; line-height: 1.35; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--faint); }
.card.add { align-items: center; justify-content: center; color: var(--dim); border-style: dashed; background: transparent; }
.card.add:hover { color: var(--text); }
.card.add svg { width: 28px; height: 28px; }
.mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  font-weight: 650; font-size: 15px; letter-spacing: -0.02em;
}
.mark.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; transition: transform 0.5s var(--ease); }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: rgba(255, 255, 255, 0.05); color: var(--dim); }
.empty { padding: 60px 20px; text-align: center; color: var(--faint); }
.drop-hint { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(20, 21, 24, 0.9); border: 2px dashed var(--accent); font-size: 18px; color: var(--accent); }
body.dragging .drop-hint { display: grid; }

/* course page */
.course-head { display: flex; gap: 20px; align-items: flex-start; }
.course-head .about { margin: 8px 0 0; color: var(--dim); max-width: 60ch; }
.course-actions { display: flex; gap: 2px; margin-left: auto; }
.hero { display: flex; align-items: center; gap: 24px; margin-top: 28px; padding: 22px 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--faint); }
.hero .btn { margin-left: auto; }
.tasks { display: flex; flex-direction: column; gap: 6px; }
.task-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.task-row:hover { background: var(--raised); border-color: var(--line); }
.task-row .t-title { flex: 1; min-width: 0; }
.task-row .t-kind { width: 22px; color: var(--faint); display: grid; place-items: center; }
.task-row .t-kind svg { width: 16px; height: 16px; }
.task-row .t-acc { width: 48px; text-align: right; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.dots i.on { background: var(--accent); }
.dots.done i { background: var(--ok); }
.lessons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--text);
}
.chip:hover { background: var(--raised); }
.chip svg { width: 16px; height: 16px; color: var(--faint); }

/* practice */
.play { max-width: 760px; margin: 0 auto; }
.play.code { max-width: 1100px; }
.play-top { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; color: var(--faint); font-size: 14px; }
.play-top .counter { display: flex; gap: 16px; margin-left: auto; font-variant-numeric: tabular-nums; }
.play-top .counter span { display: inline-flex; align-items: center; gap: 6px; }
.play-top .counter svg { width: 15px; height: 15px; }
.play-task-name { color: var(--dim); }
.q { font-size: 21px; line-height: 1.55; }
.q.big { font-size: 40px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.q p { margin: 0 0 14px; }
.q pre.code { font-size: 15px; }
.answer-zone { margin-top: 26px; }
.answer {
  width: 100%; height: 60px; padding: 0 20px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--line-2); outline: none;
  font-size: 20px; transition: border-color 0.15s, background 0.15s;
}
.answer:focus { border-color: var(--accent); }
.answer.ok { border-color: var(--ok); background: var(--ok-soft); }
.answer.bad { border-color: var(--bad); background: var(--bad-soft); }
.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 12px 18px;
  border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer;
  text-align: left; font-size: 17px; transition: background 0.15s, border-color 0.15s;
}
.opt:hover { background: var(--raised); }
.opt kbd { font: 12px var(--mono); color: var(--faint); width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.missed { border-color: var(--ok); border-style: dashed; }
.play-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.play-actions .grow { flex: 1; }
.verdict { margin-top: 22px; padding: 16px 18px; border-radius: 14px; animation: rise 0.25s var(--ease); }
.verdict.ok { background: var(--ok-soft); }
.verdict.bad { background: var(--bad-soft); }
.verdict .v-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.verdict.ok .v-head { color: var(--ok); }
.verdict.bad .v-head { color: var(--bad); }
.verdict .v-head svg { width: 20px; height: 20px; }
.verdict .v-body { margin-top: 8px; color: var(--dim); }
.verdict .v-body p { margin: 0 0 6px; }
.hint { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--text); animation: rise 0.2s var(--ease); }
.hint p { margin: 0; }
.kbd-hint { font-size: 12px; color: var(--faint); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.code-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.code-layout .q { font-size: 17px; }
@media (max-width: 900px) { .code-layout { grid-template-columns: 1fr; } }

/* code editor */
.editor {
  position: relative; display: flex; border-radius: 12px; overflow: hidden;
  background: var(--code-bg); border: 1px solid var(--line);
}
.editor:focus-within { border-color: var(--line-2); }
.editor .gutter {
  flex: none; padding: 14px 10px 14px 14px; text-align: right; color: #464a51; user-select: none;
  font: 13.5px/1.6 var(--mono); white-space: pre; overflow: hidden;
}
.editor textarea {
  flex: 1; min-height: 320px; padding: 14px 14px 14px 4px; border: 0; outline: none; resize: vertical;
  background: transparent; color: #dcdde0; font: 13.5px/1.6 var(--mono); tab-size: 4; white-space: pre; overflow: auto;
}
.out { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.test {
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; font-size: 13px;
}
.test-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
.test-h svg { width: 16px; height: 16px; }
.test.pass .test-h { color: var(--ok); }
.test.fail .test-h { color: var(--bad); }
.test-b { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.test-b > div { background: var(--code-bg); padding: 8px 12px; min-width: 0; }
.test-b label { display: block; font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.test-b pre { margin: 0; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; }
.console { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); border: 1px solid var(--line); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; max-height: 300px; overflow: auto; color: var(--dim); }
.console.err { color: var(--bad); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--dim); font-size: 14px; }
.notice code { color: var(--text); }

/* markdown */
.md p { margin: 0 0 12px; }
.md h2, .md h3, .md h4, .md h5 { color: var(--text); text-transform: none; letter-spacing: -0.01em; font-size: 18px; margin: 22px 0 10px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md table { border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.md th, .md td { padding: 6px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.md th { color: var(--faint); font-weight: 500; }
code { font-family: var(--mono); font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
pre.code, .editor textarea, .editor .gutter, code { font-variant-ligatures: none; }
pre.code { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--line); overflow: auto; font: 13.5px/1.6 var(--mono); }
pre.code code { padding: 0; background: none; font-size: inherit; }
.hl-k { color: #f2b880; }
.hl-s { color: #a8d8a0; }
.hl-n { color: #c6a6f5; }
.hl-c { color: #5c616a; font-style: italic; }
.hl-r { color: #8cc8f0; }

/* course editor */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; height: calc(100vh - 60px - 64px - 72px); min-height: 480px; }
.ed .editor { height: 100%; }
.ed .editor textarea { height: 100%; min-height: 0; resize: none; }
.ed-side { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.ed-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ed-title { font-weight: 600; font-size: 17px; }
.issue {
  display: flex; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  background: var(--bad-soft); color: #f4b3ae;
}
.issue.warn { background: var(--accent-soft); color: #f0cfa8; }
.issue b { font-family: var(--mono); font-weight: 500; opacity: 0.7; flex: none; }
.preview {
  padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.preview-h { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); margin-bottom: 8px; }
.preview-h svg { width: 15px; height: 15px; flex: none; }
.preview .md { font-size: 14.5px; }
.preview .ans { font-size: 13px; color: var(--ok); font-family: var(--mono); word-break: break-all; }
.preview .err { color: var(--bad); font-size: 13px; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--ok); font-size: 14px; padding: 4px 2px; }
.ok-line svg { width: 16px; height: 16px; }
@media (max-width: 900px) { .ed { grid-template-columns: 1fr; height: auto; } .ed .editor textarea { min-height: 420px; } }

/* dialogs */
dialog {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
dialog.wide { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 9, 11, 0.7); }
dialog[open] { animation: rise 0.22s var(--ease); }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.dlg-h h3 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.dlg-b { padding: 10px 20px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow: auto; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--dim); }
.field input, .field select, .field textarea, textarea.plain {
  width: 100%; padding: 10px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, textarea.plain:focus { border-color: var(--accent); }
.field textarea, textarea.plain { min-height: 110px; resize: vertical; line-height: 1.5; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; color: var(--dim); cursor: pointer; }
.seg button.on { background: var(--raised); color: var(--text); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.status { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.langs { display: flex; flex-wrap: wrap; gap: 6px; }
.langs span { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--bg-2); color: var(--faint); }
.langs span.on { color: var(--ok); background: var(--ok-soft); }

.menu { position: absolute; z-index: 30; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); animation: rise 0.15s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 17px; height: 17px; color: var(--dim); }
.menu button.danger, .menu button.danger svg { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: rise 0.2s var(--ease); font-size: 14px; }
.toast.bad { color: var(--bad); }

.lesson-body { font-size: 16px; line-height: 1.7; }

@media (max-width: 640px) {
  main { padding: 20px 14px 60px; }
  .hero { flex-wrap: wrap; gap: 18px; }
  .hero .btn { width: 100%; margin-left: 0; }
  .course-head { flex-wrap: wrap; }
  .q { font-size: 19px; }
  .split { grid-template-columns: 1fr; }
  .test-b { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* memory and register diagrams */
.mem { display: flex; flex-wrap: wrap; gap: 10px 6px; margin: 4px 0 16px; }
.mem-group { display: flex; flex-direction: column; gap: 6px; }
.mem-label { font: 12px var(--mono); color: var(--accent); padding: 0 2px 4px; border-bottom: 1.5px solid rgba(242, 184, 128, 0.35); }
.mem-cells { display: flex; gap: 3px; }
.mem-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 42px; height: 52px; padding: 0 4px; border-radius: 8px;
  background: var(--code-bg); border: 1px solid var(--line-2); font-family: var(--mono);
}
.mem-cell b { font-weight: 500; font-size: 14px; color: var(--text); }
.mem-cell i { font-style: normal; font-size: 11px; color: #a8d8a0; line-height: 1; }
.mem-cell span { font-size: 10px; color: var(--faint); line-height: 1; }
.mem-cell.hot { border-color: var(--accent); background: var(--accent-soft); }
.reg { margin: 4px 0 18px; max-width: 520px; }
.reg-cells, .reg-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.reg-bars { grid-auto-flow: row dense; margin-top: 6px; gap: 4px 3px; }
.reg-cell { height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--code-bg); border: 1px solid var(--line-2); font: 13px var(--mono); }
.reg-cell.hot { border-color: var(--accent); background: var(--accent-soft); }
.reg-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); font: 11.5px var(--mono); color: var(--dim); overflow: hidden; }
.reg-bar span { color: var(--text); }
.reg-bar em { font-style: normal; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-bar.hot { background: var(--accent-soft); }
.reg-bar.hot span { color: var(--accent); }
@container (max-width: 400px) { .reg-bar em { display: none; } }

/* slides */
.play.theory { max-width: 860px; }
.deck { display: flex; flex-direction: column; min-height: calc(100vh - 60px - 32px - 70px - 24px); }
.deck-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--faint); font-size: 13px; }
.deck-top .deck-title { color: var(--dim); }
.deck-progress { display: flex; gap: 4px; margin-left: auto; }
.deck-progress i { width: 18px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); transition: background 0.2s; cursor: pointer; }
.deck-progress i.on { background: var(--accent); }
.slide { flex: 1; font-size: 17px; line-height: 1.7; animation: rise 0.25s var(--ease); container-type: inline-size; }
.slide h2, .slide h3 { font-size: 24px; margin-top: 0; }
.deck-nav {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 18px 0 22px;
  background: linear-gradient(to bottom, rgba(20, 21, 24, 0), var(--bg) 35%);
}
.deck-nav .grow { flex: 1; }
.lesson-chip-n { font-size: 12px; color: var(--faint); }
.chip.seen svg { color: var(--ok); }

.trace { display: flex; flex-direction: column; margin: 4px 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.tr { display: grid; grid-template-columns: minmax(170px, 0.8fr) 1.6fr; align-items: center; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); }
.tr:first-child { border-top: 0; }
.ti { padding: 0; background: none; font-size: 13.5px; white-space: pre; }
.ts { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tv { display: inline-flex; align-items: center; gap: 3px; font: 13px var(--mono); }
.tn { color: var(--faint); margin-right: 5px; }
.tb { padding: 1px 3px; border-radius: 4px; color: var(--dim); }
.tb.hot { color: var(--accent-ink); background: var(--accent); }
@media (max-width: 640px) { .tr { grid-template-columns: 1fr; gap: 6px; } }
.lang-add { font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px dashed var(--line-2); background: transparent; color: var(--accent); cursor: pointer; }
.lang-add:hover { background: var(--accent-soft); }
.lang-add:disabled { opacity: 0.6; cursor: default; }
