/* Дизайн в духе Apple: системный шрифт, светлая и тёмная тема, материалы, мгновенный отклик. */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --fill: rgba(118, 118, 128, 0.12);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.32);
  --sep: rgba(60, 60, 67, 0.18);
  --tint: #1f8a4c;
  --tint-ink: #ffffff;
  --ok: #248a3d;
  --bad: #d70015;
  --warn: #c93400;
  --ok-bg: rgba(52, 199, 89, 0.14);
  --bad-bg: rgba(255, 59, 48, 0.12);
  --warn-bg: rgba(255, 149, 0, 0.14);
  --material: rgba(242, 242, 247, 0.72);
  --material-edge: rgba(255, 255, 255, 0.6);
  --felt-1: #1d6b45;
  --felt-2: #0f4a2f;
  --card: #ffffff;
  --s: #1c1c1e; --h: #e0262f; --d: #1d6fe0; --c: #1f8a4c;
  --shadow-card: 0 1px 2px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.18);
  --radius: 14px;
  --thumb: #ffffff;
  --call-ink: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --tint: #30d158;
    --tint-ink: #00210c;
    --ok: #30d158;
    --bad: #ff453a;
    --warn: #ff9f0a;
    --ok-bg: rgba(48, 209, 88, 0.16);
    --bad-bg: rgba(255, 69, 58, 0.16);
    --warn-bg: rgba(255, 159, 10, 0.16);
    --material: rgba(22, 22, 24, 0.72);
    --material-edge: rgba(255, 255, 255, 0.08);
    --felt-1: #155a39;
    --felt-2: #0a3522;
    --thumb: #636366;
    --call-ink: #00210c;
  }
}
:root[data-theme="dark"] {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --tint: #30d158;
    --tint-ink: #00210c;
    --ok: #30d158;
    --bad: #ff453a;
    --warn: #ff9f0a;
    --ok-bg: rgba(48, 209, 88, 0.16);
    --bad-bg: rgba(255, 69, 58, 0.16);
    --warn-bg: rgba(255, 159, 10, 0.16);
    --material: rgba(22, 22, 24, 0.72);
    --material-edge: rgba(255, 255, 255, 0.08);
    --felt-1: #155a39;
    --felt-2: #0a3522;
    --thumb: #636366;
    --call-ink: #00210c;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font: 100%/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem; /* 17px, как body в iOS */
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; background: none; border: 0; padding: 0; }
p { margin: 0 0 0.6em; }

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1rem calc(env(safe-area-inset-bottom) + 1.5rem);
}

/* ---------- Типографика: трекинг и интерлиньяж зависят от размера ---------- */
.large-title { font-size: 2.125rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; margin: 0.25rem 0 0.25rem; }
.title-2 { font-size: 1.375rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.headline { font-weight: 600; }
.subhead { font-size: 0.9375rem; line-height: 1.35; letter-spacing: -0.005em; }
.footnote { font-size: 0.8125rem; line-height: 1.35; letter-spacing: 0; color: var(--label-2); }
.caption { font-size: 0.75rem; letter-spacing: 0.01em; color: var(--label-2); }
.muted { color: var(--label-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Нажатие: отклик сразу при касании ---------- */
.pressable { transition: transform 120ms ease-out, opacity 120ms ease-out, background-color 120ms ease-out; }
.pressable:active { transform: scale(0.97); }
.row.pressable:active { transform: none; background: var(--fill); }

/* ---------- Навигационная панель из материала ---------- */
.nav {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -1rem; padding: calc(env(safe-area-inset-top) + 0.5rem) 1rem 0.5rem;
  display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
.nav.scrolled { box-shadow: 0 0.5px 0 var(--sep); }
.nav .back { display: inline-flex; align-items: center; gap: 0.15rem; color: var(--tint); font-size: 1.0625rem; padding: 0.35rem 0.25rem 0.35rem 0; }
.nav .back svg { width: 0.75rem; height: 1.25rem; }
.nav .nav-title { flex: 1; text-align: center; font-weight: 600; font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .nav-side { min-width: 4.5rem; display: flex; gap: 0.25rem; }
.nav .nav-side.right { justify-content: flex-end; }
.nav .icon { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; color: var(--tint); }
.nav .icon svg { width: 1.375rem; height: 1.375rem; }
.home-head { padding-top: calc(env(safe-area-inset-top) + 1rem); }

.progress { height: 3px; background: var(--fill); border-radius: 3px; overflow: hidden; margin: 0.25rem 0 0.9rem; }
.progress > div { height: 100%; background: var(--tint); border-radius: 3px; transition: width 400ms cubic-bezier(.2,.8,.2,1); }
.counter { margin: 0.25rem 0 0.9rem; }

/* ---------- Сгруппированные списки ---------- */
.group-title { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--label-2); margin: 1.5rem 1rem 0.4rem; }
.group { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.group-note { margin: 0.4rem 1rem 0; }
.row {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  padding: 0.7rem 1rem; min-height: 2.75rem; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 3.6rem; height: 0.5px; background: var(--sep); }
.row.plain + .row.plain::before { left: 1rem; }
.row .lead {
  width: 1.9rem; height: 1.9rem; border-radius: 0.5rem; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9375rem;
  background: var(--tint); color: var(--tint-ink);
}
.row .body { flex: 1; min-width: 0; }
.row .body .t { font-weight: 600; line-height: 1.25; }
.row .body .s { font-size: 0.875rem; color: var(--label-2); line-height: 1.3; margin-top: 0.1rem; }
.row .trail { display: flex; align-items: center; gap: 0.4rem; color: var(--label-2); font-size: 0.9375rem; }
.row .chev { width: 0.5rem; height: 0.85rem; color: var(--label-3); flex: none; }
.row.danger { color: var(--bad); justify-content: center; }
.row.link { color: var(--tint); }
.pill { font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 99px; letter-spacing: 0; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.ring { width: 1.6rem; height: 1.6rem; }
.ring .bgc { stroke: var(--fill); }
.ring .fgc { stroke: var(--tint); transition: stroke-dashoffset 500ms ease; }

/* ---------- Сегментированный переключатель ---------- */
.seg { position: relative; display: flex; background: var(--fill); border-radius: 0.6rem; padding: 3px; margin: 0.75rem 1rem; }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 0.45rem;
  background: var(--thumb); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04);
}
.seg button { position: relative; flex: 1; padding: 0.4rem 0; font-size: 0.9375rem; font-weight: 600; }

/* ---------- Игровой стол ---------- */
.table {
  background: radial-gradient(120% 90% at 50% 20%, var(--felt-1), var(--felt-2));
  border-radius: 1.4rem; padding: 1rem; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 24px rgba(0,0,0,.18);
}
.zone + .zone { margin-top: 0.9rem; }
.zone .label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,.62); margin-bottom: 0.4rem; }
.cards { display: flex; gap: 0.4rem; flex-wrap: wrap; perspective: 600px; }
.card {
  width: 2.9rem; height: 4rem; border-radius: 0.45rem; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; line-height: 1; box-shadow: var(--shadow-card);
}
.card b { font-size: 1.375rem; letter-spacing: -0.03em; }
.card i { font-style: normal; font-size: 1.25rem; margin-top: 0.1rem; }
.s-s { color: var(--s); } .s-h { color: var(--h); } .s-d { color: var(--d); } .s-c { color: var(--c); }
.card.back {
  background: repeating-linear-gradient(45deg, #8e1b22 0 5px, #a8232c 5px 10px);
  border: 3px solid #fff;
}
.deal { animation: deal 420ms cubic-bezier(.2,.9,.3,1) both; }
@keyframes deal { from { opacity: 0; transform: translate3d(0, -10px, 0) scale(.92); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal 380ms cubic-bezier(.2,.8,.2,1) both; transform-origin: center; }
@keyframes reveal { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }

.money { display: flex; gap: 0.5rem; }
.chip { flex: 1; background: rgba(0,0,0,.22); border-radius: 0.85rem; padding: 0.55rem 0.75rem; }
.chip .k { font-size: 0.75rem; color: rgba(255,255,255,.7); }
.chip .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.chip.allin .k { color: #ffd60a; font-weight: 600; }
.hint {
  margin-top: 0.5rem; font-size: 0.875rem; padding: 0.45rem 0.65rem; border-radius: 0.65rem;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.92);
}

/* ---------- Вопрос и поля ---------- */
.question { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin: 1.1rem 0.25rem 0.6rem; }
.form { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.field { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 1rem; min-height: 3.4rem; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--sep); }
.field label { flex: 1; font-size: 0.9375rem; line-height: 1.25; }
.field .input { display: flex; align-items: baseline; gap: 0.3rem; }
.field input {
  width: 4.6rem; text-align: right; border: 0; background: var(--fill); border-radius: 0.55rem;
  padding: 0.45rem 0.6rem; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  transition: box-shadow 150ms ease, background-color 150ms ease;
}
.field input:focus { outline: none; box-shadow: 0 0 0 2px var(--tint); }
.field .unit { color: var(--label-2); font-size: 0.9375rem; min-width: 1.6rem; }
.field.ok input { background: var(--ok-bg); color: var(--ok); }
.field.bad input { background: var(--bad-bg); color: var(--bad); }
.field.shake { animation: shake 320ms ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Кнопки и нижняя панель действий ---------- */
.actions {
  position: sticky; bottom: 0; z-index: 4;
  margin: 1rem -1rem 0; padding: 0.75rem 1rem calc(env(safe-area-inset-bottom) + 0.75rem);
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 -0.5px 0 var(--sep);
  display: flex; gap: 0.6rem;
}
.btn {
  flex: 1; display: block; width: 100%; padding: 0.95rem 1rem; border-radius: 0.9rem;
  background: var(--tint); color: var(--tint-ink); font-weight: 600; font-size: 1.0625rem; text-align: center;
}
.btn.secondary { background: var(--fill); color: var(--tint); }
.btn.fold { background: var(--bad); color: #fff; }
.btn.call { background: var(--ok); color: var(--call-ink); }
.btn[disabled] { opacity: 0.4; }

/* ---------- Разбор ---------- */
.feedback { margin-top: 1rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.verdict { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.verdict svg { width: 1.6rem; height: 1.6rem; flex: none; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.part { padding: 0.85rem 1rem; position: relative; }
.part + .part::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--sep); }
.part .ph { display: flex; align-items: baseline; gap: 0.45rem; font-weight: 600; flex-wrap: wrap; }
.part .ph .yours { font-weight: 400; font-size: 0.875rem; color: var(--label-2); }
.mark { font-weight: 700; }
.mark.y { color: var(--ok); } .mark.n { color: var(--bad); } .mark.w { color: var(--warn); }
.formula {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; font-size: 0.875rem; letter-spacing: 0;
  background: var(--surface-2); border-radius: 0.6rem; padding: 0.55rem 0.7rem; margin: 0.5rem 0 0.3rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.note { font-size: 0.875rem; color: var(--label-2); margin-top: 0.4rem; line-height: 1.35; }
.outs-g { font-size: 0.9375rem; margin-top: 0.4rem; }
.mini {
  display: inline-flex; align-items: center; padding: 0.05rem 0.3rem; margin: 0.1rem 0.08rem;
  background: var(--card); border-radius: 0.3rem; font-weight: 700; font-size: 0.875rem; letter-spacing: -0.02em;
  box-shadow: 0 0 0 0.5px var(--sep);
}

/* ---------- Итоги ---------- */
.score { text-align: center; padding: 1.5rem 0 0.5rem; }
.score .big { font-size: 4rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score .of { color: var(--label-2); font-size: 1.375rem; font-weight: 600; }
.mistake { font-size: 0.9375rem; }

/* ---------- Справочник ---------- */
table.ref { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
table.ref th, table.ref td { padding: 0.55rem 1rem; text-align: right; position: relative; }
table.ref th:first-child, table.ref td:first-child { text-align: left; }
table.ref th { color: var(--label-2); font-weight: 600; font-size: 0.8125rem; }
table.ref tr + tr td { box-shadow: inset 0 0.5px 0 var(--sep); }
.sheet table.ref { background: var(--surface-2); border-radius: 0.75rem; overflow: hidden; margin: 0.5rem 0 1rem; }
.pad { padding: 0.85rem 1rem; }

/* ---------- Нижняя панель (sheet) ---------- */
.modal { position: fixed; inset: 0; z-index: 20; }
.modal[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 34rem; max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.25); will-change: transform;
}
.sheet-head { padding: 0.5rem 0 0.25rem; touch-action: none; cursor: grab; }
.grabber { width: 2.25rem; height: 0.3rem; border-radius: 99px; background: var(--label-3); margin: 0 auto; }
.sheet-body { overflow: auto; padding: 0.5rem 1.25rem calc(env(safe-area-inset-bottom) + 1.25rem); overscroll-behavior: contain; }
.sheet-title { touch-action: none; }
.sheet ul, .sheet ol { padding-left: 1.2rem; margin: 0.3rem 0 0.8rem; }
.sheet li { margin: 0.3rem 0; }
.sheet .btn { margin-top: 0.75rem; }

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  .pressable, .pressable:active { transition: opacity 150ms ease; transform: none !important; }
  .deal, .reveal, .field.shake { animation: none; }
  .progress > div { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .actions { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .nav, .actions { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 var(--label); }
  .group, .form, .feedback { box-shadow: 0 0 0 1px var(--label-2); }
}

/* ---------- Путь уроков ---------- */
.today { display: flex; gap: 0.6rem; margin-top: 1rem; }
.today .tile { flex: 1; background: var(--surface); border-radius: var(--radius); padding: 0.7rem 0.9rem; display: flex; align-items: center; gap: 0.6rem; }
.today .tile .v { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.today .tile .k { font-size: 0.8125rem; color: var(--label-2); line-height: 1.2; }
.today .flame { font-size: 1.6rem; line-height: 1; filter: grayscale(1); opacity: 0.45; }
.today .flame.on { filter: none; opacity: 1; }
.today .ring { width: 2.2rem; height: 2.2rem; }
.lvl-head { display: flex; justify-content: space-between; align-items: baseline; }
.lvl-head .stars-total { text-transform: none; letter-spacing: 0; }
.row .lead.lock { background: var(--fill); color: var(--label-3); }
.row .lead.done { background: var(--ok); color: var(--call-ink); }
.row.locked .t { color: var(--label-2); }
.row.current { background: linear-gradient(90deg, rgba(31,138,76,.10), transparent 70%); }
.stars { display: inline-flex; gap: 1px; font-size: 0.95rem; letter-spacing: 0; }
.stars .on { color: #ffb800; } .stars .off { color: var(--label-3); }
.pill.go { background: var(--tint); color: var(--tint-ink); }
.row .lead svg { width: 0.95rem; height: 0.95rem; }
.stars-big { display: flex; justify-content: center; gap: 0.5rem; font-size: 2.75rem; margin: 0.5rem 0 0.25rem; }
.stars-big span { display: inline-block; }
.stars-big .on { color: #ffb800; animation: pop 520ms cubic-bezier(.2,1.4,.4,1) both; }
.stars-big .off { color: var(--label-3); }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.banner { margin: 0.75rem 0 0; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 600; text-align: center; }
@media (prefers-reduced-motion: reduce) { .stars-big .on { animation: none; } }
.toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 0.75rem); left: 50%; translate: -50% 0; z-index: 30;
  padding: 0.6rem 1rem; border-radius: 99px; font-weight: 600; font-size: 0.9375rem;
  background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 6px 24px rgba(0,0,0,.18), 0 0 0 0.5px var(--sep);
}
.timer { min-width: 2.4rem; text-align: center; font-weight: 700; font-size: 1.125rem; color: var(--tint); padding: 0.2rem 0.5rem; border-radius: 99px; background: var(--fill); }
.timer.hot { color: #fff; background: var(--bad); }
.flash { margin-top: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius); font-weight: 600; text-align: center; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.bar { height: 4px; border-radius: 4px; background: var(--fill); margin-top: 0.4rem; overflow: hidden; }
.bar > div { height: 100%; background: var(--warn); border-radius: 4px; }

/* ---------- Ранг, задания, достижения, график ---------- */
.rank-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; margin-top: 1rem; padding: 0.75rem 1rem; background: var(--surface); border-radius: var(--radius); }
.rank-card .rank-badge { font-size: 1.75rem; line-height: 1; }
.rank-card .body { flex: 1; min-width: 0; }
.rank-card .t { font-weight: 700; }
.rank-card .s { font-size: 0.8125rem; color: var(--label-2); margin-top: 0.3rem; }
.rank-card .chev { width: 0.5rem; height: 0.85rem; color: var(--label-3); }
.bar.tint > div { background: var(--tint); transition: width 500ms cubic-bezier(.2,.8,.2,1); }
.quest .qcheck { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--label-3); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; flex: none; }
.quest.done .qcheck { background: var(--ok); border-color: var(--ok); color: var(--call-ink); }
.quest.done .t { color: var(--label-2); }
.quest .trail { font-size: 0.875rem; font-weight: 600; }
.quest.done .trail { color: var(--ok); }
.verdict .xp { margin-left: auto; font-size: 0.875rem; font-weight: 700; opacity: 0.8; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.badge-cell { background: var(--surface); border-radius: var(--radius); padding: 0.75rem 0.5rem; text-align: center; opacity: 0.45; filter: grayscale(1); }
.badge-cell.got { opacity: 1; filter: none; }
.badge-cell .ic { font-size: 1.75rem; line-height: 1.1; }
.badge-cell .bn { font-weight: 600; font-size: 0.8125rem; margin-top: 0.3rem; line-height: 1.2; }
.badge-cell .bh { font-size: 0.6875rem; color: var(--label-2); margin-top: 0.15rem; line-height: 1.2; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .b { fill: var(--tint); }
.chart .b0 { fill: var(--fill); }
.chart .bar-g.on .b { fill: var(--ok); opacity: 0.85; }
.chart .goal { stroke: var(--label-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .goal-t, .chart .ax { fill: var(--label-2); font-size: 9px; }
.chart-tip { text-align: center; margin-top: 0.4rem; min-height: 1.2em; }
.verdict.neutral { background: var(--fill); color: var(--label); }
.outcome { margin-top: 0.75rem; }

/* ---------- Темы: раскрываются по нажатию ---------- */
.topic + .topic { box-shadow: inset 0 0.5px 0 var(--sep); }
.topic-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms cubic-bezier(.2,.8,.2,1); }
.topic.expanded .topic-body { grid-template-rows: 1fr; }
.topic-inner { overflow: hidden; min-height: 0; background: var(--surface-2); }
.topic-inner .row { padding-left: 1.5rem; }
.topic-inner .row + .row::before { left: 4.1rem; }
.topic .disclose { display: inline-flex; transition: transform 250ms cubic-bezier(.2,.8,.2,1); }
.topic.expanded .disclose { transform: rotate(90deg); }
.topic-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0.6rem 1rem 0.8rem 1.5rem; }
.chip-btn { padding: 0.45rem 0.85rem; border-radius: 99px; background: var(--surface); color: var(--tint); font-weight: 600; font-size: 0.875rem; }
.row .lead.lock svg { width: 0.95rem; height: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .topic-body, .topic .disclose { transition: none; } }

/* Значок урока в виде карты */
.lead-card {
  position: relative; flex: none; width: 1.9rem; height: 2.55rem; border-radius: 0.3rem;
  background: var(--card); box-shadow: 0 0 0 0.5px var(--sep), 0 1px 3px rgba(0,0,0,.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.lead-card b { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; }
.lead-card i { font-style: normal; font-size: 0.85rem; margin-top: 0.05rem; }
.lead-card.back { background: repeating-linear-gradient(45deg, #8e1b22 0 3px, #a8232c 3px 6px); box-shadow: 0 0 0 2px #fff inset, 0 1px 3px rgba(0,0,0,.18); }
.lead-card .lc-lock { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: rgba(255,255,255,.92); color: #8e1b22; display: grid; place-items: center; }
.lead-card .lc-lock svg { width: 0.65rem; height: 0.65rem; }
.lead-card.done::after {
  content: "✓"; position: absolute; right: -0.35rem; bottom: -0.3rem; width: 0.95rem; height: 0.95rem; border-radius: 50%;
  background: var(--ok); color: var(--call-ink); font-size: 0.6rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface-2);
}
.topic-inner .row + .row::before { left: 4rem; }

/* Настройки: переключатель в духе iOS */
.switch-row { cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0;
  border-radius: 999px; background: var(--fill); transition: background 0.2s ease; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 0 0 0.5px rgba(0,0,0,.04); transition: transform 0.25s cubic-bezier(.3,1.3,.5,1); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
