/* ===== Плавающая навигация ===== */
.topbar { position: fixed; top: 12px; left: 0; right: 0; z-index: 50; padding: 0 12px; pointer-events: none; }
.topbar-inner {
  pointer-events: auto; max-width: 1100px; margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 10px 0 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--ink-text); }
.brand-name em { color: var(--accent); font-style: italic; }
.topnav { display: flex; gap: 2px; }
.topnav a, .bottomnav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  color: var(--text-2); font-weight: 600; font-size: 0.92rem; transition: background .15s, color .15s;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.active, .bottomnav a.active { color: var(--ink-text); background: var(--ink); }
.nav-ico { display: inline-flex; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.xp-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--money-soft); border: 1px solid transparent; font-size: 0.8rem; color: var(--text); white-space: nowrap;
}
.xp-level { color: var(--text); font-weight: 700; }
.xp-bar { width: 64px; height: 6px; border-radius: 3px; background: rgba(0,0,0,0.08); overflow: hidden; }
:root[data-theme="dark"] .xp-bar { background: rgba(255,255,255,0.12); }
.xp-fill { display: block; height: 100%; width: 0; background: var(--money); transition: width .6s ease; }
.xp-num { color: var(--text-2); font-weight: 600; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

.main { padding: calc(var(--topbar-h) + 36px) 20px 56px; }
.container { max-width: var(--maxw); margin: 0 auto; }
.bottomnav { display: none; }

@media (max-width: 860px) {
  .topnav { display: none; }
  .topbar { top: 8px; padding: 0 8px; }
  .topbar-inner { height: 56px; padding: 0 6px 0 14px; }
  .brand-name { display: none; }
  .xp-num { display: none; }
  .main { padding: calc(56px + 28px) 16px calc(var(--bottomnav-h) + 32px); }
  .bottomnav {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50;
    height: var(--bottomnav-h); padding: 6px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .bottomnav a { flex: 1; flex-direction: column; gap: 2px; padding: 4px; font-size: 0.68rem; justify-content: center; min-height: 44px; border-radius: 999px; }
}

/* ===== Общие компоненты ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: var(--gap); }
.card.glow { border-color: var(--accent); box-shadow: var(--accent-glow), var(--shadow); }
.card.beige { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card.clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; min-height: 46px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; font-size: 0.95rem;
  transition: background .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.9; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { filter: brightness(1.05); }
.btn.money { background: var(--money); color: #1a1200; border-color: var(--money); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 8px 14px; min-height: 36px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-row.between { justify-content: space-between; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.money { background: var(--money-soft); color: #8a5f00; }
:root[data-theme="dark"] .pill.money { color: var(--money); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.lav { background: var(--accent-2-soft); color: var(--accent-2); }
.muted { color: var(--text-2); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .5s ease; border-radius: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.kpi { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); }
.kpi .kpi-label { font-size: 0.78rem; color: var(--text-2); font-weight: 600; }
.kpi .kpi-value { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.kpi .kpi-value.accent { color: var(--accent); }
.kpi .kpi-value.good { color: var(--good); }
.kpi .kpi-value.bad { color: var(--bad); }
.kpi .kpi-value.money { color: #b57f00; }
:root[data-theme="dark"] .kpi .kpi-value.money { color: var(--money); }
.kpi .kpi-sub { font-size: 0.75rem; color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 22px 0; }

#toast-root { position: fixed; top: calc(var(--topbar-h) + 22px); right: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-lg); font-size: 0.9rem; font-weight: 600; max-width: 320px; animation: toastIn .35s ease; }
.toast b { color: var(--money); }
.toast.xp { background: var(--money); color: #1a1200; } .toast.xp b { color: #1a1200; }
.toast.badge { background: var(--accent); color: #fff; } .toast.badge b { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Главная ===== */
.hero { padding: 48px 32px 36px; text-align: center; background: var(--surface); }
.hero h1 { margin: 10px auto 12px; max-width: 640px; font-size: clamp(2.1rem, 3.4vw + 1rem, 3.4rem); }
.hero .hero-sub { color: var(--text-2); max-width: 560px; margin: 0 auto; font-size: 1.05rem; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.hero .btn-row { justify-content: center; margin-top: 24px; }
.case-banner { display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: center; background: var(--surface-2); border: none; box-shadow: none; }
.case-banner .case-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--money-soft); color: #8a5f00; display: grid; place-items: center; }
:root[data-theme="dark"] .case-banner .case-ico { color: var(--money); }
.module-list { display: grid; gap: 12px; margin-top: 18px; }
.module-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 18px 20px; }
.module-num {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--text);
  background: var(--tile, var(--surface-2));
}
.module-card.done .module-num { background: var(--accent); color: #fff; }
.module-card.locked { opacity: 0.6; }
.module-card.locked .module-num { background: var(--surface-2); color: var(--text-3); }
.module-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.module-meta { font-size: 0.8rem; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; }
.module-card .progress { margin-top: 10px; max-width: 320px; }
.module-arrow { color: var(--text-3); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
@media (max-width: 520px) { .module-card { grid-template-columns: 48px 1fr; gap: 12px; } .module-arrow { display: none; } .module-num { width: 48px; height: 48px; border-radius: 14px; } }

/* ===== Модуль ===== */
.lesson-list { display: grid; gap: 10px; margin-top: 16px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-sm); }
.lesson-status { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: var(--text-3); flex: 0 0 auto; }
.lesson-row.done .lesson-status { border-color: var(--accent); color: #fff; background: var(--accent); }
.lesson-row .lesson-title { flex: 1; font-weight: 600; color: var(--text); }
.lesson-row .lesson-min { font-size: 0.78rem; color: var(--text-3); white-space: nowrap; display: flex; align-items: center; gap: 4px; }

/* ===== Урок ===== */
.lesson { max-width: 760px; margin: 0 auto; }
.lesson-head { margin-bottom: 24px; }
.lesson-body > * + * { margin-top: 20px; }
.lesson-body p { font-size: 1.04rem; }
.lesson-body ul, .lesson-body ol { padding-left: 1.3em; margin: 0 0 1em; }
.lesson-body li { margin-bottom: 0.4em; }
.callout { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface-2); }
.callout.idea { background: var(--accent-soft); }
.callout.warn { background: var(--money-soft); }
.callout.money { background: var(--money-soft); }
.callout.case { background: var(--accent-2-soft); }
.callout.good { background: var(--good-soft); }
.callout-title { font-weight: 800; font-family: var(--font-body); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.callout.idea .callout-title, .callout.good .callout-title { color: var(--accent); }
.callout.warn .callout-title, .callout.money .callout-title { color: #8a5f00; }
:root[data-theme="dark"] .callout.warn .callout-title, :root[data-theme="dark"] .callout.money .callout-title { color: var(--money); }
.callout.case .callout-title { color: var(--accent-2); }
.callout p:last-child { margin-bottom: 0; }
.example { border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.example-title { padding: 12px 18px; background: var(--surface-2); font-weight: 700; font-size: 0.95rem; }
.example table { width: 100%; border-collapse: collapse; }
.example td { padding: 10px 18px; border-top: 1px solid var(--border); }
.example td:last-child { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.example tr.total td { font-weight: 700; background: var(--accent-soft); }
.example tr.sub td { color: var(--text-2); }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.tbl th { text-align: left; padding: 11px 14px; background: var(--surface-2); font-weight: 700; white-space: nowrap; }
table.tbl td { padding: 10px 14px; border-top: 1px solid var(--border); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
table.tbl tr.total td { font-weight: 700; background: var(--accent-soft); }
.formula { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--ink); color: var(--ink-text); }
.formula-main { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; text-align: center; overflow-x: auto; }
.formula-note { margin-top: 8px; font-size: 0.86rem; opacity: 0.75; text-align: center; }
.formula-note strong { color: inherit; }
.steps { counter-reset: step; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.step::before { counter-increment: step; content: counter(step); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ink-text); font-weight: 700; font-family: var(--font-head); }
.step-title { font-weight: 700; }
.step-text { color: var(--text-2); font-size: 0.95rem; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.compare > div { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); }
.compare h4 { margin: 0 0 8px; color: var(--accent); font-family: var(--font-body); font-weight: 800; }
.compare ul { margin: 0; padding-left: 1.1em; font-size: 0.94rem; }
.case { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.case-head { padding: 16px 20px; background: var(--surface-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.case-head h3 { margin: 0; font-size: 1.15rem; }
.case-body { padding: 18px 20px; }
.case-section { margin-top: 12px; }
.case-section .case-label { font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); font-weight: 800; }
.case-solution { margin-top: 12px; }
.case-solution summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.case-solution summary .ico { transition: transform .2s; }
.case-solution[open] summary .ico { transform: rotate(90deg); }
.case-lesson { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-xs); background: var(--money-soft); }
.term { border-bottom: 1.5px dotted var(--accent); cursor: help; color: var(--text); }
.diagram { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram-caption { font-size: 0.84rem; color: var(--text-2); text-align: center; margin-top: 10px; }
.diagram .anim { animation: diagIn .5s ease both; animation-delay: calc(var(--d, 0) * 0.18s); }
@keyframes diagIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.check { padding: 18px 20px; border-radius: var(--radius-sm); border: 1.5px dashed var(--border-strong); background: var(--surface); }
.check .check-q { font-weight: 700; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 36px; flex-wrap: wrap; }

/* ===== Симуляторы ===== */
.sim { border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.sim-head { padding: 14px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--surface-3); }
.sim-head h3 { margin: 0; font-size: 1.05rem; font-family: var(--font-body); font-weight: 800; }
.sim-head .ico { color: var(--accent); }
.sim-body { display: grid; grid-template-columns: 280px 1fr; }
.sim-controls { padding: 18px 20px; border-right: 1px solid var(--surface-3); display: grid; gap: 14px; align-content: start; }
.sim-view { padding: 18px 20px; min-width: 0; }
.sim-outputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.sim-outputs .kpi { background: var(--surface); }
.sim-outputs .kpi-value { font-size: 1.1rem; font-family: var(--font-body); font-weight: 800; white-space: nowrap; }
.sim-note { font-size: 0.88rem; color: var(--text-2); margin-top: 12px; }
.sim-note strong { color: var(--text); }
.sim-view svg { width: 100%; height: auto; display: block; }
.sim-view .callout { background: var(--surface); }
@media (max-width: 700px) { .sim-body { grid-template-columns: 1fr; } .sim-controls { border-right: none; border-bottom: 1px solid var(--surface-3); } }
.ctrl label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.ctrl label b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.ctrl input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; cursor: pointer; }
.ctrl select, .ctrl input[type=number], .ctrl input[type=text] { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.ctrl .toggle { display: flex; align-items: center; justify-content: flex-start; gap: 8px; cursor: pointer; min-height: 32px; color: var(--text); }
.ctrl .toggle input { accent-color: var(--accent); width: 18px; height: 18px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text); min-height: 36px; }
.chip.active { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }

/* ===== Квиз ===== */
.quiz { max-width: 720px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 0.85rem; color: var(--text-2); font-weight: 600; }
.quiz-q { font-size: 1.2rem; font-weight: 600; margin-bottom: 18px; font-family: var(--font-head); line-height: 1.35; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; min-height: 50px;
  border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; color: var(--text); font-weight: 500; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.option:hover { border-color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow); }
.option .opt-mark { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: 0 0 auto; display: grid; place-items: center; font-size: 0.74rem; font-weight: 700; color: var(--text-2); }
.option.multi { border-radius: var(--radius-sm); }
.option.multi .opt-mark { border-radius: 7px; }
.option.selected { border-color: var(--text); background: var(--surface-2); }
.option.selected .opt-mark { border-color: var(--text); background: var(--text); color: var(--bg); }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.correct .opt-mark { border-color: var(--good); background: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .opt-mark { border-color: var(--bad); background: var(--bad); color: #fff; }
.option:disabled { cursor: default; transform: none; box-shadow: none; }
.numeric-input { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.numeric-input input { flex: 1; min-width: 160px; padding: 13px 16px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-family: var(--font-mono); font-size: 1.05rem; }
.numeric-input .unit { color: var(--text-2); font-weight: 600; }
.feedback { margin-top: 16px; padding: 16px 18px; border-radius: var(--radius-sm); animation: fadeIn .3s ease; }
.feedback.ok { background: var(--good-soft); }
.feedback.no { background: var(--bad-soft); }
.feedback-title { font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.feedback.ok .feedback-title { color: var(--good); }
.feedback.no .feedback-title { color: var(--bad); }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: grid; gap: 8px; align-content: start; }
.match-item { padding: 11px 14px; min-height: 46px; border-radius: var(--radius-xs); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; color: var(--text); font-size: 0.92rem; font-weight: 500; position: relative; }
.match-item.picked { border-color: var(--text); background: var(--surface-2); }
.match-item.paired { border-color: var(--accent-2); }
.match-item.paired::after { content: attr(data-pair); position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-2); color: #fff; font-size: 0.72rem; display: grid; place-items: center; font-weight: 700; }
.match-item.correct { border-color: var(--good); background: var(--good-soft); }
.match-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 480px) { .match-grid { gap: 6px; } .match-item { font-size: 0.84rem; padding: 8px 10px; } }
.order-list { display: grid; gap: 8px; }
.order-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-xs); border: 1.5px solid var(--border); background: var(--surface); }
.order-item .order-num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--ink-text); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; flex: 0 0 auto; }
.order-item .order-text { flex: 1; font-size: 0.94rem; font-weight: 500; }
.order-item .order-btns { display: flex; gap: 4px; }
.order-item .order-btns button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.order-item.correct { border-color: var(--good); background: var(--good-soft); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
.fill-sentence { font-size: 1.05rem; line-height: 2.3; }
.fill-sentence select { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--text); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; margin: 0 4px; }
.fill-sentence select.correct { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.fill-sentence select.wrong { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.quiz-result { text-align: center; padding: 36px 24px; }
.score-ring { width: 150px; height: 150px; margin: 0 auto 16px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .score-text { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 2.1rem; font-weight: 700; }
.review-list { text-align: left; margin-top: 22px; display: grid; gap: 8px; }
.review-item { padding: 10px 14px; border-radius: var(--radius-xs); background: var(--surface-2); font-size: 0.9rem; display: flex; gap: 10px; align-items: flex-start; }
.review-item .ico { margin-top: 2px; }
.review-item.ok .ico { color: var(--good); }
.review-item.no .ico { color: var(--bad); }
.timer { font-family: var(--font-mono); color: var(--text); font-weight: 600; }

/* ===== Профиль ===== */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { padding: 16px 10px; text-align: center; border-radius: var(--radius-sm); background: var(--surface-2); }
.badge .badge-ico { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: var(--surface); color: var(--text-3); }
.badge.earned .badge-ico { background: var(--tile, var(--accent-soft)); color: var(--tile-fg, var(--accent)); }
.badge .badge-name { font-weight: 700; font-size: 0.86rem; }
.badge .badge-desc { font-size: 0.74rem; color: var(--text-3); }
.badge.locked { opacity: 0.55; }
.level-track { display: grid; gap: 8px; }
.level-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: var(--radius-xs); background: var(--surface-2); font-size: 0.92rem; }
.level-item span:first-child { display: flex; align-items: center; gap: 8px; }
.level-item.current { background: var(--ink); color: var(--ink-text); font-weight: 700; }
.level-item.passed { color: var(--good); }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--text-2); font-weight: 600; }
.field input, .field textarea { padding: 12px 16px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.field input:focus { outline: none; border-color: var(--text); }
.settings-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; cursor: pointer; }
.settings-row input { accent-color: var(--accent); width: 20px; height: 20px; flex: 0 0 auto; }

/* ===== Словарь ===== */
.glossary-search { width: 100%; padding: 13px 18px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; margin-bottom: 18px; }
.glossary-search:focus { outline: none; border-color: var(--text); }
.gl-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.gl-term { font-weight: 700; font-family: var(--font-head); font-size: 1.1rem; color: var(--text); }
.gl-def { color: var(--text-2); font-size: 0.95rem; }

/* ===== Сертификат ===== */
.cert-wrap { background: #fff; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.cert-wrap svg { width: 100%; height: auto; display: block; }

/* ===== Подсказка термина ===== */
.tooltip { position: fixed; z-index: 200; max-width: 300px; padding: 12px 16px; border-radius: var(--radius-xs); background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-lg); font-size: 0.86rem; pointer-events: none; }
.tooltip b { color: var(--money); display: block; margin-bottom: 2px; }

@media print {
  .topbar, .bottomnav, .btn, #toast-root { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; }
}
