/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1d1c1a;
  --ink-2: #57534b;
  --muted: #8a857b;
  --line: #e7e2d8;
  --accent: #2f4fa2;          /* тхелет */
  --accent-ink: #ffffff;
  --accent-soft: #e6ebf7;
  --gold: #b7862a;
  --gold-soft: #f6ecd6;
  --good: #1f8a5b;
  --good-soft: #def3e8;
  --bad: #c2410c;
  --bad-soft: #fbe6dc;
  /* последовательная шкала тхелета — heatmap, стадии карточек */
  --seq-0: #ebe8e1;
  --seq-1: #c9d3ee;
  --seq-2: #93a8dc;
  --seq-3: #5b78c4;
  --seq-4: #2f4fa2;
  --seq-5: #1d3272;
  --shadow: 0 1px 2px rgba(29, 28, 26, .04), 0 4px 16px rgba(29, 28, 26, .05);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-he: "Noto Serif Hebrew", "Frank Ruhl Libre", "Rubik", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111215; --surface: #1a1c21; --surface-2: #202329; --ink: #eceae4; --ink-2: #bdb8ad;
    --muted: #8b877f; --line: #2c2f36; --accent: #8aa4f0; --accent-ink: #0f1424; --accent-soft: #232c45;
    --gold: #e0b55a; --gold-soft: #3a3020; --good: #4cc38a; --good-soft: #1b3328; --bad: #f08a5d; --bad-soft: #3a2219;
    --seq-0: #24272d; --seq-1: #2b3656; --seq-2: #3b4f8a; --seq-3: #5872c2; --seq-4: #8aa4f0; --seq-5: #c3d1fa;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111215; --surface: #1a1c21; --surface-2: #202329; --ink: #eceae4; --ink-2: #bdb8ad;
  --muted: #8b877f; --line: #2c2f36; --accent: #8aa4f0; --accent-ink: #0f1424; --accent-soft: #232c45;
  --gold: #e0b55a; --gold-soft: #3a3020; --good: #4cc38a; --good-soft: #1b3328; --bad: #f08a5d; --bad-soft: #3a2219;
  --seq-0: #24272d; --seq-1: #2b3656; --seq-2: #3b4f8a; --seq-3: #5872c2; --seq-4: #8aa4f0; --seq-5: #c3d1fa;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

/* ─── Base ───────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.he, [lang="he"] { font-family: var(--font-he); direction: rtl; unicode-bidi: isolate; }
.hidden { display: none !important; }

/* ─── Layout ─────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; padding: 28px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 22px; font-weight: 600; font-size: 17px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-he); font-size: 21px; line-height: 1;
}
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-size: 15px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-spacer { flex: 1; }
.main { flex: 1; min-width: 0; padding: 32px 40px 80px; }
.container { max-width: 1060px; margin: 0 auto; }
.container.narrow { max-width: 680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.mobile-top { display: none; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { padding: 12px 16px 100px; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; padding: 6px 0 14px;
  }
  .mobile-top .icons { display: flex; gap: 6px; }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: var(--surface); box-shadow: var(--shadow); border: 0;
  }
  .icon-btn svg { width: 20px; height: 20px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 50;
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--accent); }
  h1 { font-size: 23px; }
  .page-head { margin-bottom: 16px; }
}
/* в режиме урока — без навигации */
body.focus .sidebar, body.focus .tabbar, body.focus .mobile-top { display: none; }
body.focus .main { padding-top: 16px; }

/* ─── Cards / grid ───────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head .muted { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
@media (max-width: 1000px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .span-3 { grid-column: span 2; } }
@media (max-width: 640px) {
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .grid { gap: 12px; }
  .card { padding: 16px; border-radius: 16px; }
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 20px; font-weight: 500; font-size: 15px; cursor: pointer;
  background: var(--surface-2); color: var(--ink); transition: transform .08s, background .15s, opacity .15s;
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: var(--gold); color: #fff; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.block { width: 100%; }
.btn.lg { padding: 16px 24px; font-size: 16px; border-radius: 16px; }
.btn:disabled { opacity: .45; cursor: default; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-2);
  cursor: pointer; border: 0; white-space: nowrap;
}
.chip.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ─── Inputs ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.he { font-size: 22px; text-align: right; }

/* ─── Today: hero ────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-main { display: flex; flex-direction: column; gap: 16px; }
.greet { font-size: 14px; color: var(--muted); }
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s;
}
.plan-item:hover { background: var(--accent-soft); }
.plan-item .step {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 13px; font-weight: 600; color: var(--muted);
}
.plan-item.done .step { background: var(--good); color: #fff; box-shadow: none; }
.plan-item .body { flex: 1; min-width: 0; }
.plan-item .title { font-weight: 500; }
.plan-item .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item .go { color: var(--muted); }

.rings { display: flex; align-items: center; justify-content: space-around; gap: 12px; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-label { font-size: 13px; color: var(--muted); }
.streak {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--gold-soft);
}
.streak .flame { font-size: 30px; line-height: 1; }
.streak .big { font-size: 28px; font-weight: 600; line-height: 1; }
.streak .lbl { font-size: 13px; color: var(--ink-2); }
.week-dots { display: flex; gap: 6px; margin-left: auto; }
.week-dots .d { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); }
.week-dots .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 35%, transparent); display: grid; place-items: center; font-size: 11px; }
.week-dots .dot.on { background: var(--gold); color: #fff; box-shadow: none; }
.week-dots .dot.goal::after { content: "✓"; }
@media (max-width: 520px) {
  .streak { flex-wrap: wrap; }
  .week-dots { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); }
}

/* ─── Stat tiles ─────────────────────────────────────── */
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .k { font-size: 13px; color: var(--muted); }
.tile .v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .v small { font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.tile .d { font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--seq-0); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.gold > i { background: var(--gold); }

/* ─── Charts ─────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .goal-line { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px;
  border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
  opacity: 0; transition: opacity .1s; z-index: 5; line-height: 1.35;
}
.tooltip.show { opacity: 1; }
.heatmap-wrap { overflow-x: auto; scrollbar-width: none; }
.heatmap-wrap::-webkit-scrollbar { display: none; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack > div { height: 100%; min-width: 0; }

.goals { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
@media (max-width: 640px) { .goals { grid-template-columns: 1fr; } }
.goal { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.goal .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); font-size: 18px; flex-shrink: 0; font-family: var(--font-he); }
.goal.done .ic { background: var(--gold); color: #fff; }
.goal .b { flex: 1; min-width: 0; }
.goal .t { font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; gap: 6px; }
.goal .t span { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ─── Course map ─────────────────────────────────────── */
.stage { margin-bottom: 28px; }
.stage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.stage-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-he); font-size: 22px; }
.stage-head .meter { width: 120px; margin: 0; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lesson-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; transition: transform .1s; }
.lesson-card:hover { transform: translateY(-1px); }
.lesson-card .n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; color: var(--muted); flex-shrink: 0; }
.lesson-card.done .n { background: var(--good); color: #fff; box-shadow: none; }
.lesson-card.open .n { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.lesson-card.locked { opacity: .55; }
.lesson-card .t { font-weight: 500; line-height: 1.3; }
.lesson-card .s { font-size: 13px; color: var(--muted); }
.lesson-card .acc { margin-left: auto; font-size: 12px; color: var(--good); white-space: nowrap; }

/* ─── Lesson player ──────────────────────────────────── */
.player { max-width: 640px; margin: 0 auto; min-height: calc(100vh - 60px); display: flex; flex-direction: column; }
.player-top { display: flex; align-items: center; gap: 14px; padding: 6px 0 18px; }
.progress { flex: 1; height: 10px; border-radius: 5px; background: var(--seq-0); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width .35s ease; }
.close-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.xp-pill { font-size: 13px; font-weight: 600; color: var(--gold); white-space: nowrap; }
.stage-area { flex: 1; display: flex; flex-direction: column; }
.prompt { font-size: 14px; color: var(--muted); margin-bottom: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.q-he { font-family: var(--font-he); direction: rtl; font-size: 54px; line-height: 1.35; text-align: center; margin: 12px 0 6px; }
.q-he.xl { font-size: 110px; line-height: 1.15; }
.q-he.md { font-size: 34px; }
.q-ru { font-size: 26px; font-weight: 500; text-align: center; margin: 18px 0 8px; }
.q-sub { text-align: center; color: var(--muted); font-size: 15px; }
.options { display: grid; gap: 10px; margin-top: 22px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line);
  border: 0; cursor: pointer; text-align: center; font-size: 17px; transition: transform .08s, background .15s;
}
.opt:active { transform: scale(.98); }
.opt.he { font-size: 30px; line-height: 1.4; padding: 12px; }
.opt.correct { background: var(--good-soft); box-shadow: inset 0 0 0 2px var(--good); }
.opt.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); }
.opt:disabled { cursor: default; }
.speak {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; margin: 8px auto;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow);
}
.speak svg { width: 28px; height: 28px; }
.speak.sm { width: 40px; height: 40px; margin: 0; }
.speak.sm svg { width: 18px; height: 18px; }
.speak.big { width: 96px; height: 96px; }
.speak.big svg { width: 40px; height: 40px; }
.speak-row { display: flex; gap: 12px; justify-content: center; align-items: center; }
.speak.slow { background: var(--surface); color: var(--accent); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); }

.word-card { text-align: center; padding: 28px 20px; }
.word-card .tr { color: var(--ink-2); font-size: 17px; }
.word-card .ru { font-size: 22px; font-weight: 500; margin-top: 8px; }
.word-card .root { display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 13px; }
.word-card .root b { font-family: var(--font-he); font-size: 16px; font-weight: 500; }
.word-card .note { color: var(--ink-2); font-size: 14px; margin-top: 14px; }

.theory h3 { margin: 18px 0 6px; font-size: 17px; }
.theory h3:first-child { margin-top: 0; }
.theory p { margin: 0; color: var(--ink-2); line-height: 1.65; }
.theory .he { font-size: 1.3em; color: var(--ink); }

.tiles-answer {
  min-height: 72px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line);
  padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; direction: rtl; align-content: flex-start; margin-top: 18px;
}
.tiles-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: rtl; margin-top: 16px; }
.tile-btn {
  font-family: var(--font-he); font-size: 26px; padding: 6px 14px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); min-width: 48px;
}
.tile-btn.word { font-size: 22px; }
.tile-btn.used { visibility: hidden; }

.feedback {
  position: sticky; bottom: 0; margin: 20px -16px 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; display: none;
}
.feedback.show { display: block; }
.feedback.ok { background: var(--good-soft); }
.feedback.no { background: var(--bad-soft); }
.feedback .fb-title { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.feedback.ok .fb-title { color: var(--good); }
.feedback.no .fb-title { color: var(--bad); }
.feedback .fb-body { color: var(--ink-2); margin-bottom: 12px; }
.feedback .fb-body .he { font-size: 22px; color: var(--ink); }
.actions { margin-top: auto; padding-top: 20px; }

/* ─── Hebrew keyboard ────────────────────────────────── */
.kbd { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; direction: rtl; user-select: none; }
.kbd-row { display: flex; gap: 5px; justify-content: center; }
.kbd button {
  flex: 1; max-width: 46px; height: 46px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--surface); box-shadow: 0 1px 0 var(--line), inset 0 0 0 1px var(--line);
  font-family: var(--font-he); font-size: 21px;
}
.kbd button.wide { max-width: 90px; font-family: var(--font); font-size: 14px; }
.kbd button:active { background: var(--accent-soft); }

/* ─── Review / flashcards ────────────────────────────── */
.flash { perspective: 1200px; margin: 8px 0 18px; }
.flash-inner { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 20px; cursor: pointer; }
.flash .back { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 18px; width: 100%; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate button { padding: 12px 4px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 500; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rate button small { font-weight: 400; font-size: 11px; opacity: .75; }
.rate .r1 { background: var(--bad-soft); color: var(--bad); }
.rate .r2 { background: var(--gold-soft); color: var(--gold); }
.rate .r3 { background: var(--good-soft); color: var(--good); }
.rate .r4 { background: var(--accent-soft); color: var(--accent); }
.kbd-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 860px) { .kbd-hint { display: none; } }
.nikud-tap { cursor: pointer; border-bottom: 1px dotted var(--muted); }

/* ─── Listening ──────────────────────────────────────── */
.dlg-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dlg-line:last-child { border-bottom: 0; }
.dlg-line.playing .dlg-he { color: var(--accent); }
.dlg-who { font-size: 12px; color: var(--muted); width: 64px; flex-shrink: 0; padding-top: 8px; }
.dlg-body { flex: 1; min-width: 0; }
.dlg-he { font-family: var(--font-he); direction: rtl; text-align: right; font-size: 24px; line-height: 1.5; transition: filter .2s; }
.dlg-tr { font-size: 13px; color: var(--muted); }
.dlg-ru { font-size: 14px; color: var(--ink-2); }
.blur .dlg-he, .blur .dlg-tr { filter: blur(7px); }
.blur .dlg-line:hover .dlg-he, .blur .dlg-line:hover .dlg-tr { filter: none; }
.hide-ru .dlg-ru { display: none; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* ─── Dictionary ─────────────────────────────────────── */
.dict-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.dict-row:last-child { border-bottom: 0; }
.dict-he { font-family: var(--font-he); font-size: 24px; direction: rtl; min-width: 120px; text-align: right; }
.dict-main { flex: 1; min-width: 0; }
.dict-main .ru { font-weight: 500; }
.dict-main .meta { font-size: 12px; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.st-none { background: var(--seq-0); box-shadow: inset 0 0 0 1px var(--line); }
.st-new { background: var(--seq-1); }
.st-learning { background: var(--seq-2); }
.st-young { background: var(--seq-3); }
.st-mature { background: var(--seq-5); }
.root-group { margin-bottom: 14px; }
.root-title { font-family: var(--font-he); font-size: 20px; color: var(--gold); }

/* ─── Misc ───────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.result { text-align: center; padding: 20px 0; }
.result .big-num { font-size: 56px; font-weight: 700; color: var(--gold); line-height: 1; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.result-stats .card { padding: 14px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brand { justify-content: center; padding: 0 0 8px; font-size: 20px; }
.error { color: var(--bad); font-size: 14px; margin-bottom: 12px; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.94); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.simple th { color: var(--muted); font-weight: 400; font-size: 12px; }
details.table-view summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 10px; }
