:root {
  --brand: #c8102e;
  --brand-ink: #fff;
  --bg: #f1f2f4;
  --card: #fff;
  --card-2: #f7f8fa;
  --text: #1c1d21;
  --muted: #6b7079;
  --line: #e1e3e8;
  --q-bg: #e7f4ea;
  --q-card: #fff;
  --accent: #15803d;
  --accent-ink: #fff;
  --accent-soft: #dcf2e3;
  --solid: #15803d;
  --once: #7cc61a;
  --wrong: #dc2626;
  --wrong-soft: #fde4e4;
  --new: #fff;
  --new-line: #d5d8de;
  --good: #16a34a;
  --mid: #f5b82e;
  --low: #ef6b3a;
  --tab-bg: #fff;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 2px 8px rgb(0 0 0 / .05);
  --radius: 14px;
  --inset-top: env(safe-area-inset-top, 0px);
  --inset-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #b5132c;
    --bg: #121316;
    --card: #1d1f24;
    --card-2: #25272d;
    --text: #eceef2;
    --muted: #9aa0aa;
    --line: #30333a;
    --q-bg: #14201a;
    --q-card: #1d2420;
    --accent: #22a356;
    --accent-soft: #1b3426;
    --once: #8bd42a;
    --wrong: #ef4444;
    --wrong-soft: #3a1d1f;
    --new: #2c2f36;
    --new-line: #3a3e46;
    --tab-bg: #1a1c20;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #b5132c;
  --bg: #121316;
  --card: #1d1f24;
  --card-2: #25272d;
  --text: #eceef2;
  --muted: #9aa0aa;
  --line: #30333a;
  --q-bg: #14201a;
  --q-card: #1d2420;
  --accent: #22a356;
  --accent-soft: #1b3426;
  --once: #8bd42a;
  --wrong: #ef4444;
  --wrong-soft: #3a1d1f;
  --new: #2c2f36;
  --new-line: #3a3e46;
  --tab-bg: #1a1c20;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.15rem; }
p { margin: .5em 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.bad-text { color: var(--wrong); }
[hidden] { display: none !important; }

.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.ic.big { width: 48px; height: 48px; color: var(--muted); }
.ic.ok { color: var(--accent); }

/* ---------- shell ---------- */
#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
#topbar {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  background: var(--brand); color: var(--brand-ink);
  padding: calc(var(--inset-top) + 8px) 8px 14px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 0 100%);
  min-height: calc(var(--inset-top) + 60px);
}
#tb-title { flex: 1; font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tb-right { display: flex; align-items: center; min-width: 40px; justify-content: flex-end; }
#topbar .icon-btn { color: inherit; }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.view-inner { min-height: 100%; display: flex; flex-direction: column; }
#tabbar {
  flex: none; display: flex;
  background: var(--tab-bg); border-top: 1px solid var(--line);
  padding-bottom: var(--inset-bottom);
}
#tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600;
}
#tabbar a .ic { width: 24px; height: 24px; }
#tabbar a.active { color: var(--brand); }
body.focus #tabbar { display: none; }

.boot { flex: 1; display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.error { border-left: 4px solid var(--wrong); }
.card h2 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.h { margin: 10px 2px -4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px -4px; }
.scope-note { margin: 0 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line); font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.btn.big { min-height: 52px; font-size: 1.05rem; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1 1 auto; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: transparent; border: 0; color: var(--text);
}
.icon-btn:disabled { opacity: .35; }
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn.primary { background: var(--accent); color: var(--accent-ink); }
.icon-btn.on { color: #e7a300; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; max-width: 65%;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip small { opacity: .7; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.sync-ind.spin .ic { animation: spin 1s linear infinite; }
.sync-ind.warn { color: #ffd34d; }

/* ---------- readiness + level ---------- */
.hero { display: flex; flex-direction: column; gap: 18px; }
.ready-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.1rem; }
.ready-head b { font-size: 1.9rem; }
.readybar { height: 14px; background: var(--card-2); border-radius: 7px; overflow: hidden; border: 1px solid var(--line); margin-top: 6px; }
.readybar span { display: block; height: 100%; border-radius: 7px; transition: width .4s; }
.readybar.low span { background: var(--low); }
.readybar.mid span { background: var(--mid); }
.readybar.good span { background: var(--good); }
.level-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.levelbar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--new); border: 1px solid var(--new-line); }
.levelbar .seg { display: block; min-width: 0; }
.seg.solid, .sw.solid { background: var(--solid); }
.seg.once, .sw.once { background: var(--once); }
.seg.wrong, .sw.wrong { background: var(--wrong); }
.seg.new, .sw.new { background: var(--new); }
.legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.lg { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.lg .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--new-line); }
.lg b { font-size: 1.1rem; }
.lg small { grid-column: 1 / -1; color: var(--muted); font-size: .75rem; white-space: nowrap; }

/* ---------- mode tiles ---------- */
.modes { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode, .cta, .resume {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid transparent; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); text-decoration: none;
}
.mode:active, .cta:active, .resume:active, .row:active { transform: scale(.99); }
.mode.disabled { opacity: .5; }
.mode-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; color: #fff; }
.mode-ic .ic { width: 22px; height: 22px; }
.m-random { background: #2563eb; }
.m-wrong { background: var(--wrong); }
.m-oldest { background: #9333ea; }
.m-unsure { background: #ea8a0c; }
.m-new { background: #0d9488; }
.m-exam { background: var(--brand); }
.m-list { background: #475569; }
.mode-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mode-txt small { color: var(--muted); font-size: .82rem; }
.badge { min-width: 32px; padding: 2px 8px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); text-align: center; font-weight: 700; font-size: .85rem; }
.cta { border-color: var(--brand); }
.cta > .ic, .resume > .ic { color: var(--muted); }
.resume { border-color: var(--accent); background: var(--accent-soft); }
.resume-card { border: 2px solid var(--accent); }

/* ---------- question screens ---------- */
.qscreen { flex: 1; display: flex; flex-direction: column; background: var(--q-bg); }
.q-page { flex: 1; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; color: var(--muted); }
.qid, .qnum { font-weight: 700; color: var(--text); }
.qnum { font-size: .95rem; }
.sec { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qstat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: .72rem; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.qstat .ic { width: 12px; height: 12px; }
.st-solid { background: var(--solid); border-color: var(--solid); color: #fff; }
.st-once { background: var(--once); border-color: var(--once); color: #10310a; }
.st-wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.st-flag { color: #b37a00; border-color: #e7a300; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; }
.dots i.ok { background: var(--solid); }
.dots i.bad { background: var(--wrong); }
.stem { font-size: 1.12rem; font-weight: 650; line-height: 1.45; }
.stem p { margin: 0 0 .5em; }
.stem p:last-child { margin-bottom: 0; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: var(--q-card); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .15s, background .15s, opacity .15s;
}
.opt:not(:disabled):hover { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.letter {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  border: 2px solid var(--text); font-weight: 800; font-size: .85rem;
}
.otext { flex: 1; padding-top: 2px; }
.otext p { margin: 0; }
.opt.correct { border-color: var(--solid); background: var(--accent-soft); }
.opt.correct .letter { background: var(--solid); border-color: var(--solid); color: #fff; }
.opt.wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.opt.wrong .letter { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.opt.dim { opacity: .55; }
.opt.selected { border-color: var(--text); background: var(--card-2); }
.opt.selected .letter { background: var(--text); color: var(--bg); }
.feedback { display: flex; flex-direction: column; gap: 10px; }
.verdict { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; }
.verdict.ok { color: var(--solid); }
.verdict.bad { color: var(--wrong); }
.expl { background: var(--q-card); border-radius: 12px; padding: 12px 14px; border-left: 4px solid var(--accent); }
.expl h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.expl p { margin: 0 0 .5em; }
.expl p:last-child { margin: 0; }

.actionbar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + var(--inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.actionbar .sess { flex: 1; font-size: .85rem; color: var(--muted); }
.actionbar .sess b { color: var(--text); }
.actionbar > .btn { min-width: 140px; }
.exam-bar { justify-content: space-between; }
.exam-bar .btn { min-width: 0; flex: 1; max-width: 200px; }
.exam-progress { height: 4px; background: var(--line); }
.exam-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; padding: 4px 10px; border-radius: 8px; background: rgb(0 0 0 / .18); }
.timer.low { background: #ffd34d; color: #3a2a00; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .7; } }

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 45vh; overflow-y: auto; padding: 2px; margin-top: 8px; }
.qgrid button { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .85rem; position: relative; }
.qgrid button.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.qgrid button.flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #e7a300; }
.qgrid button.cur { outline: 3px solid var(--text); outline-offset: 1px; }

/* ---------- lists, kpis ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
}
.list.plain { gap: 0; margin: -6px 0 10px; }
.list.plain .row { box-shadow: none; padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-main small { color: var(--muted); }
.row > .ic { color: var(--muted); }
.score { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff; flex: none; }
.score small { font-size: .65rem; }
.score { display: flex; align-items: baseline; justify-content: center; padding-top: 14px; }
.score.good, .b-exam.good { background: var(--good); }
.score.mid, .b-exam.mid { background: var(--mid); color: #3a2a00; }
.score.low, .b-exam.low { background: var(--low); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi b { font-size: 1.3rem; }
.kpi small { color: var(--muted); font-size: .78rem; line-height: 1.25; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bar-stack { width: 100%; max-width: 28px; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; background: var(--line); }
.bar-stack span { display: block; min-height: 0; }
.b-right { background: var(--solid); }
.b-wrong { background: var(--wrong); }
.b-exam { flex: 1; }
.bar small { font-size: .68rem; color: var(--muted); }

.ch-block + .ch-block { margin-top: 16px; }
.ch-title { display: flex; justify-content: space-between; margin-bottom: 8px; }
.sec-row { margin-bottom: 10px; }
.sec-name { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; margin-bottom: 3px; }
.sec-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-name small { color: var(--muted); flex: none; }
.sec-row .levelbar { height: 8px; }

.hard { padding: 0; }
.hard summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.hard summary::-webkit-details-marker { display: none; }
.hard-n { font-weight: 800; color: var(--wrong); flex: none; width: 32px; }
.hard-q { flex: 1; font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hard[open] .hard-q { display: block; }
.hard > p { margin: 0 14px 12px; }
.answer { display: flex; gap: 8px; color: var(--solid); font-weight: 600; }
.answer p { margin: 0; }
.danger-zone { border: 1px solid var(--line); box-shadow: none; background: transparent; }

/* ---------- exam review ---------- */
.result { display: flex; gap: 16px; align-items: center; }
.result-score { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; padding-top: 22px; color: #fff; flex: none; }
.result-score b { font-size: 2.2rem; line-height: 1; }
.result-score.good { background: var(--good); }
.result-score.mid { background: var(--mid); color: #3a2a00; }
.result-score.low { background: var(--low); }
.result-txt { display: flex; flex-direction: column; gap: 2px; }
.result-txt b { font-size: 1.15rem; }
.result-txt small { color: var(--muted); }
.result-txt .tag { align-self: flex-start; margin-top: 4px; }
.rv { border-left: 4px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.rv-right { border-left-color: var(--solid); }
.rv-wrong { border-left-color: var(--wrong); }
.rv-open { border-left-color: var(--mid); }
.rv-head { display: flex; align-items: center; gap: 8px; }
.rv-num { font-weight: 800; }
.rv-right .rv-ic { color: var(--solid); }
.rv-wrong .rv-ic { color: var(--wrong); }
.rv-open .rv-ic { color: var(--mid); }
.rv-flag { color: #e7a300; margin-left: auto; }
.rv .stem { font-size: 1rem; }
.rv-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-opts li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; font-size: .93rem; }
.rv-opts li p { margin: 0; }
.rv-opts li .ic { width: 18px; height: 18px; margin-top: 2px; }
.rv-opts li.correct { background: var(--accent-soft); color: var(--text); }
.rv-opts li.correct .ic { color: var(--solid); }
.rv-opts li.wrong { background: var(--wrong-soft); }
.rv-opts li.wrong .ic { color: var(--wrong); }
.rv-opts li.picked { font-weight: 700; }
.rv-expl summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: .9rem; }
.rv-expl p { font-size: .93rem; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form input[type="number"], .form input[type="url"], .form input[type="password"], .form input[type="text"] {
  min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); font-weight: 400; font-size: 1rem;
}
.form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
label.check span { flex: 1; }
details.custom { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.custom summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-ctl { display: flex; background: var(--card-2); border-radius: 10px; padding: 3px; border: 1px solid var(--line); }
.seg-ctl button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg-ctl button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.sync-state.ok { color: var(--solid); font-weight: 600; }
.sync-state.error { color: var(--wrong); font-weight: 600; }

.scope-list { display: flex; flex-direction: column; gap: 12px; max-height: 55vh; overflow-y: auto; margin: 10px 0; }
.scope-ch { display: flex; flex-direction: column; gap: 4px; }
.scope-ch label.check { padding: 6px 0; }
.scope-ch label.check:not(.strong) { padding-left: 26px; font-size: .92rem; }
.scope-ch label small { color: var(--muted); }

.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(18px + var(--inset-bottom));
  transform: translateY(100%); transition: transform .22s ease-out;
}
.overlay.open .backdrop { opacity: 1; }
.overlay.open .sheet { transform: none; }
.sheet h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
@media (min-width: 640px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 18px; padding-bottom: 18px; transform: translateY(20px); opacity: 0; transition: transform .2s, opacity .2s; }
  .overlay.open .sheet { opacity: 1; }
}

#toasts { position: fixed; left: 0; right: 0; bottom: calc(80px + var(--inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #24262b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; max-width: 520px; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; box-shadow: 0 4px 16px rgb(0 0 0 / .25); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: var(--solid); }
.toast.bad { background: var(--wrong); }

@media (max-width: 380px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis.three { grid-template-columns: repeat(3, 1fr); }
  .legend { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  #tabbar { justify-content: center; }
  #tabbar a { flex: 0 1 160px; }
}
