:root {
  --bg: #f1f2f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #151a24;
  --muted: #596173;
  --line: #d8dce3;
  --accent: #2b45a8;
  --accent-ink: #ffffff;
  --accent-soft: #e3e8f8;
  --good: #1d7a49;
  --good-soft: #dff1e7;
  --bad: #bf3a2f;
  --bad-soft: #f8e1de;
  --review: #6b3fb0;
  --review-soft: #ece3f8;
  --warn: #a8660f;
  --warn-soft: #fbeed8;
  --idle: #8b93a3;
  --shadow: 0 1px 2px rgb(20 26 36 / 6%), 0 6px 20px rgb(20 26 36 / 6%);
  --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-q: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1d222c;
    --ink: #e6e8ed;
    --muted: #9aa2b2;
    --line: #2b313d;
    --accent: #8ea3f2;
    --accent-ink: #0f1218;
    --accent-soft: #212a47;
    --good: #50c48b;
    --good-soft: #17301f;
    --bad: #f0786d;
    --bad-soft: #3a1d1b;
    --review: #b893f5;
    --review-soft: #2c2140;
    --warn: #e8a94a;
    --warn-soft: #36280f;
    --idle: #6e7686;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #171b23;
  --surface-2: #1d222c;
  --ink: #e6e8ed;
  --muted: #9aa2b2;
  --line: #2b313d;
  --accent: #8ea3f2;
  --accent-ink: #0f1218;
  --accent-soft: #212a47;
  --good: #50c48b;
  --good-soft: #17301f;
  --bad: #f0786d;
  --bad-soft: #3a1d1b;
  --review: #b893f5;
  --review-soft: #2c2140;
  --warn: #e8a94a;
  --warn-soft: #36280f;
  --idle: #6e7686;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-block: 4px 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.brand h1 { font-size: 20px; letter-spacing: -0.01em; }
.brand .tag { color: var(--muted); font-size: 13px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent);
  display: inline-grid; place-items: center; align-self: center;
}
.brand-mark::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none;
}
a.btn { color: var(--ink); }
a.btn.primary { color: var(--accent-ink); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px;
  box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px);
}

/* ---------- library ---------- */
.drop {
  display: grid; gap: 8px; justify-items: start; padding: 26px; border-radius: var(--radius);
  border: 1.5px dashed var(--line); background: var(--surface); position: relative;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { font-size: 22px; }
.drop p { margin: 0; color: var(--muted); max-width: 60ch; }
.drop input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .btn { position: relative; pointer-events: none; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; width: 100%; max-width: 420px; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }

.lib-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; gap: 12px; flex-wrap: wrap; }
.lib-head h2 { font-size: 17px; }
.quiz-list { display: grid; gap: 12px; }
.quiz-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.quiz-card h3 { font-size: 17px; margin-bottom: 6px; overflow-wrap: anywhere; }
.quiz-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.quiz-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.attempt-strip { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.attempt-strip button {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px;
}
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 640px) {
  .quiz-card { grid-template-columns: 1fr; }
  .quiz-actions { justify-content: flex-start; }
}

/* ---------- question content ---------- */
.q-body { font-family: var(--font-q); font-size: 17px; line-height: 1.55; }
.q-body p { margin: 0 0 8px; max-width: 72ch; }
.q-body .q-table-wrap { overflow-x: auto; margin: 4px 0 10px; }
.q-body table { border-collapse: collapse; font-size: 16px; }
.q-body td { padding: 4px 18px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.q-body tr:first-child td { font-weight: 600; }
.q-body tr:last-child td { border-bottom: 0; }

.snippet { display: grid; gap: 6px; }
.snippet-img {
  width: 100%; max-width: 560px; height: auto; background: #fff; border-radius: 6px; border: 1px solid var(--line);
}
.snippet-missing { font-size: 13px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--line); border-radius: 6px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- editor ---------- */
.editor-head { display: grid; gap: 14px; margin-bottom: 18px; }
.title-input {
  font-size: 24px; font-weight: 600; border: 1px solid transparent; background: transparent; padding: 4px 6px; margin-left: -6px;
  border-radius: 6px; width: 100%;
}
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--surface); }
.summary-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.key-panel { display: grid; gap: 10px; }
.key-panel textarea {
  width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; background: var(--surface-2); font-family: var(--font-mono); font-size: 13px;
}
.meter { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.meter .progress { max-width: 220px; }
.meter .progress > i { background: var(--good); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 22px 0 12px; }
.filters .seg button { padding: 6px 12px; }

.qcards { display: grid; gap: 12px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; }
.qcard.flag { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.qcard-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qno { font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--accent); }
.warnings { font-size: 13px; color: var(--warn); display: grid; gap: 2px; }

.opts { display: grid; gap: 6px; }
.opt {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%;
  font-family: var(--font-q); font-size: 16px; line-height: 1.45; cursor: pointer;
}
.opt:hover { border-color: var(--muted); }
.bubble {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center;
  font: 600 13px var(--font-mono); color: var(--muted); background: var(--surface);
}
.opt.key { border-color: var(--good); background: var(--good-soft); }
.opt.key .bubble { background: var(--good); border-color: var(--good); color: #fff; }
.opt-note { font-family: var(--font-ui); font-size: 12px; font-weight: 600; margin-left: 8px; }

.edit-form { display: grid; gap: 8px; }
.edit-form label { font-size: 12px; font-weight: 600; color: var(--muted); }
.edit-form textarea, .edit-form input {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface-2);
}
.edit-form textarea { min-height: 120px; font-family: var(--font-q); font-size: 15px; }

/* ---------- setup ---------- */
.setup { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); }
.field input[type='number'] {
  width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface);
}
.field-row { display: flex; gap: 18px; flex-wrap: wrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; }

/* ---------- exam ---------- */
.exam { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.exam-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.exam-bar h1 { font-size: 15px; font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.timer {
  font: 600 20px var(--font-mono); font-variant-numeric: tabular-nums; padding: 4px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); letter-spacing: 0.02em;
}
.timer.low { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.timer.critical { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.exam-main { display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.q-pane { overflow-y: auto; padding: 22px 16px 28px; }
.q-inner { max-width: 820px; margin: 0 auto; display: grid; gap: 16px; }
.q-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.q-top h2 { font-size: 16px; margin-right: auto; }
.exam .opt { padding: 11px 12px; }
.exam .opt[aria-checked='true'] { border-color: var(--accent); background: var(--accent-soft); }
.exam .opt[aria-checked='true'] .bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kbd-hint { font-size: 12px; color: var(--muted); }
.kbd-hint kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }

.palette {
  border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 16px; display: grid;
  align-content: start; gap: 14px;
}
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-size: 12px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-family: var(--font-mono); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.pbtn {
  position: relative; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2);
  font: 600 12px var(--font-mono); cursor: pointer; color: var(--ink);
}
.st-idle { background: var(--surface-2); color: var(--ink); }
.st-seen { background: var(--bad); border-color: var(--bad); color: #fff; }
.st-done { background: var(--good); border-color: var(--good); color: #fff; }
.st-mark { background: var(--review); border-color: var(--review); color: #fff; border-radius: 50%; }
.st-markdone { background: var(--review); border-color: var(--review); color: #fff; border-radius: 50%; }
.st-markdone::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--good); border: 2px solid var(--surface);
}
.pbtn.current { outline: 2px solid var(--ink); outline-offset: 1px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; position: relative; border: 1px solid var(--line); flex: none; }

.exam-actions {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.palette-toggle { display: none; }
@media (max-width: 860px) {
  .exam-main { grid-template-columns: 1fr; }
  .palette {
    position: fixed; inset: auto 0 0 0; max-height: 70%; border-left: 0; border-top: 1px solid var(--line);
    box-shadow: var(--shadow); z-index: 20; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .palette:not(.open) { display: none; }
  .palette-toggle { display: inline-flex; }
  .exam-actions .btn { flex: 1 1 auto; }
}

/* ---------- modal ---------- */
.scrim { position: fixed; inset: 0; background: rgb(10 12 18 / 50%); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { background: var(--surface); border-radius: 12px; padding: 22px; width: min(460px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); }
.modal h2 { font-size: 19px; }
.modal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.modal td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.modal td:last-child { text-align: right; font-family: var(--font-mono); font-weight: 600; }

/* ---------- results ---------- */
.score-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.score-big { font: 600 52px/1.05 var(--font-ui); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.score-big small { font-size: 20px; color: var(--muted); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.stat b { display: block; font: 600 20px var(--font-mono); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.good b { color: var(--good); }
.stat.bad b { color: var(--bad); }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.bar i { display: block; height: 100%; }
@media (max-width: 560px) { .score-head { grid-template-columns: 1fr; } }

.review-list { display: grid; gap: 12px; }
.opt.r-correct { border-color: var(--good); background: var(--good-soft); }
.opt.r-correct .bubble { background: var(--good); border-color: var(--good); color: #fff; }
.opt.r-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.r-wrong .bubble { background: var(--bad); border-color: var(--bad); color: #fff; }
.review-list .opt { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

#app { min-height: 100%; }
body.in-exam { overflow: hidden; }
body.in-exam #app { height: 100%; }
.q-body table.no-head tr:first-child td, .q-body tr.plain td { font-weight: 400; }
.field-row { align-items: start; }
.field .seg { justify-self: start; }
@media (max-width: 520px) {
  .exam-bar h1 { display: none; }
  .exam-bar { justify-content: flex-end; }
  .timer { margin-right: auto; }
}

/* ---------- status fills (shared by report bars and charts) ---------- */
.s-correct { background: var(--good); }
.s-wrong { background: var(--bad); }
.s-skipped { background: var(--idle); }
.s-unscored { background: var(--warn); }
.chip.review { background: var(--review-soft); color: var(--review); border-color: transparent; }
.bar { gap: 2px; background: var(--surface); border-radius: 4px; }

/* ---------- test tab: instructions ---------- */
.lobby { max-width: 760px; display: grid; gap: 18px; padding-block: 36px 48px; }
.lobby-title { font-size: 30px; letter-spacing: -0.015em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; }
.facts span { font-size: 12px; color: var(--muted); }
.facts b { font: 600 22px var(--font-ui); font-variant-numeric: tabular-nums; }
.countdown { display: grid; gap: 4px; justify-items: start; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); }
.countdown b { font: 600 40px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent); }
.instructions h2 { font-size: 17px; margin-bottom: 8px; }
.instructions ol { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; max-width: 68ch; }
.instructions kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
.lobby-legend { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 10px; }
.btn.big { min-height: 46px; padding: 0 22px; font-size: 16px; }

/* ---------- performance report ---------- */
.report { display: grid; gap: 16px; }
.report .topbar { margin-bottom: 6px; }
.report .filters { margin: 10px 0 0; }
.h-sec { font-size: 16px; }
.note { font-size: 13px; margin: 0; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.kv { margin: 0; display: grid; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv .sum dt { color: var(--ink); font-weight: 600; }
.good-t { color: var(--good); }
.bad-t { color: var(--bad); }

.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tchart { display: grid; gap: 8px; }
.tchart-body { display: grid; grid-template-columns: 44px 1fr; gap: 6px; height: 190px; }
.tchart-y { display: flex; flex-direction: column; justify-content: space-between; font: 11px var(--font-mono); color: var(--muted); text-align: right; transform: translateY(-6px); height: calc(100% + 12px); }
.tchart-plot { position: relative; height: 100%; }
.tchart-plot .grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.tbars { position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: space-around; gap: 2px; }
.tbar { flex: 1 1 0; max-width: 24px; min-width: 0; border: 0; padding: 0; background: transparent; display: flex; align-items: flex-end; cursor: pointer; }
.tbar i { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.tbar i:not([style*='height:0%']) { min-height: 2px; }
.tbar:hover i, .tbar:focus-visible i { filter: brightness(1.15); }
.tbar:hover, .tbar:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.tip {
  position: absolute; top: 6px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 2;
}
.tchart-x { display: flex; justify-content: space-around; gap: 2px; margin-left: 50px; font: 11px var(--font-mono); color: var(--muted); }
.tchart-x span { flex: 1 1 0; max-width: 24px; min-width: 0; overflow: visible; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data .n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.current td { background: var(--accent-soft); }
.stackcell { min-width: 140px; width: 30%; }
.stack-bar { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; }
.stack-bar i { display: block; height: 100%; }
.rev-sum { font-size: 13px; }
@media (max-width: 560px) {
  .tchart-body { height: 150px; }
  .score-big { font-size: 44px; }
}
.report-grid .panel { align-content: start; }
.tchart-body { margin-top: 8px; }

.offer {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); font-size: 14px;
}
.offer span { flex: 1 1 280px; }
.select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); max-width: 100%; font-size: 13px; }
.catalog { display: grid; gap: 10px; }
.catalog .quiz-card { background: var(--surface-2); }
