/* Тренажёр речи. Цвета — токенами: светлая тема по умолчанию,
   тёмная по системе или по выбору в настройках. */
:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #eaece5;
  --surface-3: #dce3d9;
  --ink: #24332f;
  --ink-2: #56655e;
  --ink-3: #5f6d63;
  --line: #d9dfd7;
  --line-2: #b8c7b9;
  --shadow: 0 1px 2px rgba(36, 51, 47, .04), 0 8px 24px -12px rgba(36, 51, 47, .10);

  --accent: #287060;
  --accent-ink: #205b4e;
  --rec: #e5484d;
  --rec-soft: rgba(229, 72, 77, .12);
  --good: #0ca30c;
  --good-ink: #006300;
  --bad-ink: #a32424;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --filler-bg: rgba(250, 178, 25, .32);
  --hes-bg: rgba(236, 131, 90, .32);
  --chip-hes-bg: rgba(236, 131, 90, .18);
  --chip-hes-ink: #8a3b17;
  --chip-long-bg: rgba(208, 59, 59, .14);
  --chip-long-ink: #9b2222;
  --chip-hum-bg: rgba(250, 178, 25, .22);
  --chip-hum-ink: #6e4b00;
  --issue: #d03b3b;

  --series-1: #287060;
  --track: #dce8dc;
  --ord-0: #eaece5;
  --ord-1: #b8d1be;
  --ord-2: #6b9d80;
  --ord-3: #287060;

  --radius: 18px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --next-action-bg: color-mix(in srgb, var(--surface) 38%, transparent);
  --next-action-ink: var(--ink);
  --next-action-border: color-mix(in srgb, var(--line-2) 65%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151e19;
    --surface: #1e2c24;
    --surface-2: #26372d;
    --surface-3: #344b3c;
    --ink: #edf3ec;
    --ink-2: #c8d5c9;
    --ink-3: #a8bcae;
    --line: #3a5142;
    --line-2: #597462;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    --accent: #8fc9ae;
    --accent-ink: #b3e0c8;
    --rec-soft: rgba(229, 72, 77, .18);
    --good-ink: #2cc22c;
    --bad-ink: #f08a8a;
    --filler-bg: rgba(250, 178, 25, .28);
    --hes-bg: rgba(236, 131, 90, .34);
    --chip-hes-bg: rgba(236, 131, 90, .2);
    --chip-hes-ink: #f4ae8e;
    --chip-long-bg: rgba(208, 59, 59, .24);
    --chip-long-ink: #f39a9a;
    --chip-hum-bg: rgba(250, 178, 25, .18);
    --chip-hum-ink: #f6cd6a;
    --series-1: #8fc9ae;
    --track: #314b3b;
    --ord-0: #283d30;
    --ord-1: #41694f;
    --ord-2: #729d7e;
    --ord-3: #b3e0c8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151e19;
  --surface: #1e2c24;
  --surface-2: #26372d;
  --surface-3: #344b3c;
  --ink: #edf3ec;
  --ink-2: #c8d5c9;
  --ink-3: #a8bcae;
  --line: #3a5142;
  --line-2: #597462;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --accent: #8fc9ae;
  --accent-ink: #b3e0c8;
  --rec-soft: rgba(229, 72, 77, .18);
  --good-ink: #2cc22c;
  --bad-ink: #f08a8a;
  --filler-bg: rgba(250, 178, 25, .28);
  --hes-bg: rgba(236, 131, 90, .34);
  --chip-hes-bg: rgba(236, 131, 90, .2);
  --chip-hes-ink: #f4ae8e;
  --chip-long-bg: rgba(208, 59, 59, .24);
  --chip-long-ink: #f39a9a;
  --chip-hum-bg: rgba(250, 178, 25, .18);
  --chip-hum-ink: #f6cd6a;
  --series-1: #8fc9ae;
  --track: #314b3b;
  --ord-0: #283d30;
  --ord-1: #41694f;
  --ord-2: #729d7e;
  --ord-3: #b3e0c8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 680; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---- шапка ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink-2); padding: 7px 12px; border-radius: 10px; font-size: 15px; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

.banner {
  max-width: 1120px; margin: 12px auto 0; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--chip-long-bg); color: var(--chip-long-ink); font-size: 14px;
}
.banner code { font-size: 13px; }
.banner.info { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--ink); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- страница ---- */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; outline: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-title .muted { font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.5; white-space: nowrap;
}
.chip.dark { background: var(--ink); color: var(--surface); }
.chip.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.chip.warn { background: var(--chip-hum-bg); color: var(--chip-hum-ink); }
.chip.bad { background: var(--chip-long-bg); color: var(--chip-long-ink); }

/* ---- кнопки ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--surface); font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.btn.quiet { background: var(--surface-2); color: var(--ink); }
.btn.quiet:hover { background: var(--surface-3); opacity: 1; }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: transparent; color: var(--bad-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--critical) 40%, transparent); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back svg, .dropzone svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.step-row svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.big-ico { width: 56px; height: 56px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- главная ---- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: stretch; }
.hero-text { padding: 8px 4px 0; display: flex; flex-direction: column; gap: 14px; }
.hero-text p { color: var(--ink-2); font-size: 17px; max-width: 560px; }
.skills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.today-card { display: flex; flex-direction: column; gap: 14px; }
.today-card .steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.today-card .steps span { height: 6px; border-radius: 3px; background: var(--surface-3); }
.today-card .steps span.done { background: var(--accent); }
.coach-card { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
.coach-card .q { font-size: 18px; font-weight: 560; letter-spacing: -0.01em; }
.coach-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ex-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.ex-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--line-2); }
.ex-card .icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); }
.ex-card .icon svg { width: 21px; height: 21px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ex-card h3 { font-size: 17px; }
.ex-card .meta { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 13.5px; }
.ex-card .score-badge { position: absolute; top: 16px; right: 16px; }
.note-row { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.note-row .card { box-shadow: none; padding: 16px 18px; }
.note-row h3 { margin-bottom: 4px; }

.score-pill {
  display: inline-flex; align-items: baseline; gap: 2px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); font-weight: 650; font-size: 14px;
}
.score-pill small { font-weight: 500; color: var(--ink-3); font-size: 11px; }

/* ---- упражнение ---- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 14px; margin-bottom: 10px; }
.ex-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.ex-head h1 { flex: 1 1 auto; }
.howto { margin-bottom: 16px; }
.howto summary { cursor: pointer; color: var(--ink-2); font-size: 15px; list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; }
.howto[open] summary::before { transform: rotate(90deg); }
.howto ol { margin: 10px 0 0; padding-left: 22px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.topic-card { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.topic-label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.topic-text { font-size: clamp(22px, 3.2vw, 32px); font-weight: 640; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.topic-edit { width: 100%; font-size: 20px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); }
.topic-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.hint-line { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 14.5px; }
.hint-line svg { width: 18px; height: 18px; flex: none; stroke: var(--ink-3); fill: none; stroke-width: 1.7; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.stepper .st {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px; font-size: 13.5px;
  background: var(--surface-2); color: var(--ink-3);
}
.stepper .st.current { background: var(--ink); color: var(--surface); }
.stepper .st.done { color: var(--ink); }
.stepper .st.done::before { content: "✓"; color: var(--good-ink); font-weight: 700; }
.stepper .st.err::before { content: "!"; color: var(--critical); font-weight: 700; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips .chip { background: var(--surface-2); color: var(--ink); font-size: 14px; }

.stage {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  padding: 22px 18px 18px;
}
.ring-wrap { position: relative; width: 236px; height: 236px; }
.ring-wrap svg.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-3); }
.ring-fill { stroke: var(--ink); transition: stroke .3s; }
.stage[data-mode="rec"] .ring-fill { stroke: var(--rec); }
.stage[data-mode="rec"].ending .ring-fill { stroke: var(--serious); }
.stage[data-mode="prep"] .ring-fill { stroke: var(--accent); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; }
.rec-btn {
  width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--rec); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 10px 30px -10px rgba(229, 72, 77, .7); transition: transform .15s ease, box-shadow .15s;
  font-weight: 650; font-size: 15px;
}
.rec-btn:hover { transform: scale(1.03); }
.rec-btn:active { transform: scale(.97); }
.rec-btn svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.rec-btn.stop { background: var(--ink); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); }
.rec-btn.stop .sq { width: 26px; height: 26px; border-radius: 6px; background: var(--surface); }
.rec-btn:disabled { opacity: .5; cursor: default; transform: none; }
.big-count { font-size: 88px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-time { font-size: 50px; font-weight: 660; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stage-sub { font-size: 14px; color: var(--ink-3); }
.stage-title { font-size: 16px; font-weight: 600; }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.level { width: 100%; max-width: 280px; height: 44px; }
.kbd { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 12px; line-height: 20px; color: var(--ink-2); background: var(--surface-2); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 14px; text-align: center;
  color: var(--ink-3); font-size: 14px; cursor: pointer; width: 100%;
}
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--ink); }

/* ---- разбор ---- */
.analysis { margin-top: 18px; }
.analysis-loading { display: flex; align-items: center; gap: 16px; }
.dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin-right: 4px; animation: dot 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.verdict-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; align-items: start; }
.hero-score { display: flex; flex-direction: column; gap: 2px; }
.hero-score .val { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.hero-score .val small { font-size: 22px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.verdict { font-size: 18px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.deltas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.delta { font-size: 13.5px; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.delta b { font-weight: 650; }
.delta.up b { color: var(--good-ink); }
.delta.down b { color: var(--bad-ink); }

.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 26px; margin-top: 22px; }
.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-top { display: flex; align-items: baseline; gap: 8px; }
.meter-top .name { font-weight: 600; font-size: 14.5px; }
.meter-top .v { margin-left: auto; font-weight: 650; }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--track); }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series-1); }
.meter > b { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink-2); border-radius: 1px; }
.meter-note { font-size: 13px; color: var(--ink-3); line-height: 1.4; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.list li::before { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 2px; }
.list.good li::before { content: "✓"; background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-ink); }
.list.grow li::before { content: "↑"; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); }
.callout { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.callout .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 650; }
.callout.next { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.transcript-editor { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.transcript-editor > summary { cursor: pointer; padding: 8px 0; font-weight: 560; }
.transcript-editor[open] { display: flex; flex-direction: column; gap: 12px; }
.transcript-editor textarea { width: 100%; min-height: 140px; font: inherit; line-height: 1.6; }
.skill-progress { margin: 18px 0; }
.skill-progress > p { margin-top: 10px; }
.skill-progress-item { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.skill-progress-item > p, .skill-progress-item > .row { margin-top: 12px; }
.skill-stages { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.skill-stages li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.skill-stages li.confirmed { border-left: 3px solid var(--good-ink); }
.thought-comparison.single { grid-template-columns: minmax(0, 1fr); }
.callout .q { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

/* ---- попытки ---- */
.takes { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.take-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.take-head h3 { font-size: 16px; }
.take-error { padding: 12px 14px; border-radius: 12px; background: var(--chip-long-bg); color: var(--chip-long-ink); font-size: 14.5px; }
.warn-line { padding: 8px 12px; border-radius: 10px; background: var(--chip-hum-bg); color: var(--chip-hum-ink); font-size: 13.5px; margin-bottom: 10px; }

.player { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.play {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; flex: none;
}
.play svg { width: 16px; height: 16px; fill: currentColor; }
.scrub { position: relative; flex: 1; height: 26px; cursor: pointer; touch-action: none; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.scrub i { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--ink-2); width: 0; }
.scrub b { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); left: 0; box-shadow: 0 0 0 2px var(--surface); }
.p-time { font-size: 13px; color: var(--ink-3); min-width: 86px; text-align: right; font-variant-numeric: tabular-nums; }

.transcript { font-size: 17.5px; line-height: 2.05; color: var(--ink); text-wrap: pretty; }
.transcript .w { cursor: pointer; border-radius: 4px; padding: 1px 0; transition: background .1s; }
.transcript .w:hover { background: var(--surface-3); }
.transcript .w.now { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.transcript mark.filler { background: var(--filler-bg); color: inherit; border-radius: 5px; padding: 2px 3px; }
.transcript mark.filler.hes { background: var(--hes-bg); }
.transcript .w.iss { text-decoration: underline wavy var(--issue); text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
.transcript .w.rep { text-decoration: underline dotted var(--serious); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.transcript .w.flash { background: color-mix(in srgb, var(--issue) 22%, transparent); }
.gap {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: 1px;
  padding: 0 7px; margin: 0 2px; border-radius: 7px; font-size: 12.5px; line-height: 21px; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-3); cursor: default; white-space: nowrap;
}
.gap.hes { background: var(--chip-hes-bg); color: var(--chip-hes-ink); }
.gap.long { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.gap.hum { background: var(--chip-hum-bg); color: var(--chip-hum-ink); }
.gap.start { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 4px; }
.legend i.f { background: var(--filler-bg); }
.legend i.h { background: var(--hes-bg); }
.legend i.ph { background: var(--chip-hes-bg); }
.legend i.pl { background: var(--surface-3); }
.legend i.ps { background: var(--surface-3); }
.legend i.iss { height: 3px; background: none; border-bottom: 2px solid var(--issue); border-radius: 0; }
.legend i.rep { height: 3px; background: none; border-bottom: 2px dotted var(--serious); border-radius: 0; }
.empty-transcript { color: var(--ink-3); font-style: italic; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.tile { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .t-label { font-size: 12.5px; color: var(--ink-3); }
.tile .t-val { font-size: 26px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.15; }
.tile .t-val small { font-size: 13px; font-weight: 550; color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }
.tile .t-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.tile .pre { font-size: 11px; color: var(--ink-3); }

.take-analysis { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.main-idea { font-size: 15.5px; color: var(--ink-2); }
.main-idea b { color: var(--ink); font-weight: 600; }
.structure { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.structure .s { border-radius: 12px; padding: 10px 12px; background: var(--surface-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.structure .s .k { font-weight: 650; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.structure .s.ok .k::before { content: "✓"; color: var(--good-ink); }
.structure .s.miss .k::before { content: "✗"; color: var(--critical); }
.structure .s.miss { color: var(--ink-3); }
.structure .s .q { color: var(--ink-2); overflow-wrap: anywhere; }
.issues { display: flex; flex-direction: column; gap: 10px; }
.issue { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.issue .kind { grid-row: span 2; }
.issue .kind .chip { background: var(--surface); }
.issue .quote { color: var(--ink-2); }
.issue .quote button { all: unset; cursor: pointer; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--issue) 70%, transparent); }
.issue .quote button:hover { color: var(--ink); }
.issue .fix { font-weight: 600; }
.issue .fix::before { content: "→ "; color: var(--good-ink); }
.issue .why { grid-column: 2; font-size: 13.5px; color: var(--ink-3); }
.stronger { padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--good) 7%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 20%, transparent); }
.stronger .label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--good-ink); font-weight: 650; margin-bottom: 6px; }
.stronger p { font-size: 16.5px; line-height: 1.6; white-space: pre-line; }
.stronger-explanation { min-width: 0; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.stronger-explanation h3 { margin-bottom: 6px; color: var(--ink); font-size: 16px; line-height: 1.4; letter-spacing: 0; }
.stronger-explanation p { max-width: 70ch; color: var(--ink-2); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }

.after-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.recording-details { min-width: 0; position: sticky; top: 86px; }
.recording-details > .stage { position: static; }
.recording-details > summary { display: none; }
.workspace.is-reviewed { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.workspace.is-reviewed .topic-card { padding: 18px 22px; }
.workspace.is-reviewed .topic-text { font-size: 20px; margin-bottom: 0; }
.recording-details.is-reviewed { position: static; }
.recording-details.is-reviewed > summary, .issue-details > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none;
  color: var(--ink-2); font-size: 15px; font-weight: 600;
}
.recording-details.is-reviewed > summary { width: fit-content; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.recording-details.is-reviewed > summary::before, .issue-details > summary::before { content: '›'; font-size: 22px; font-weight: 400; line-height: 1; }
.recording-details[open] > summary::before, .issue-details[open] > summary::before { transform: rotate(90deg); }
.recording-details > summary::-webkit-details-marker, .issue-details > summary::-webkit-details-marker { display: none; }
.recording-details.is-reviewed[open] > .stage { margin-top: 12px; }
.issue-details { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.issue-details > summary { padding: 8px 14px; }
.issue-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.issue-details > .issues { padding: 0 12px 12px; }
.exercise-next-dock {
  position: fixed; z-index: 35; left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(var(--trainer-mobile-nav-space, 0px), env(safe-area-inset-bottom, 0px)) + 12px);
  display: flex; justify-content: center; pointer-events: none;
}
.btn.exercise-next-link {
  min-height: 56px; height: auto; max-width: 560px; width: 100%; padding: 14px 20px; gap: 16px;
  justify-content: space-between; white-space: normal; line-height: 1.4; text-align: left; pointer-events: auto;
  background: var(--next-action-bg); color: var(--next-action-ink); border: 1px solid var(--next-action-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07); border-radius: 16px;
  text-shadow: 0 0 4px var(--surface), 0 1px 2px var(--surface);
}
.btn.exercise-next-link:hover { background: var(--next-action-bg); color: var(--next-action-ink); opacity: 1; box-shadow: 0 3px 12px rgba(0, 0, 0, .1); }
.exercise-next-link > span { overflow-wrap: anywhere; }
.exercise-next-link > svg { flex: none; }
body.has-exercise-next #app { padding-bottom: calc(var(--trainer-mobile-nav-space, 0px) + var(--exercise-next-height, 80px) + 56px); }
body.has-exercise-next .toast { bottom: calc(var(--trainer-mobile-nav-space, 0px) + var(--exercise-next-height, 80px) + 24px); }
body.trainer-mobile-keyboard-open .exercise-next-dock { display: none; }
body.trainer-mobile-keyboard-open.has-exercise-next .toast { bottom: calc(var(--trainer-mobile-keyboard-offset, 0px) + 12px); }
@media (max-width: 767px), (max-width: 1023px) and (pointer: coarse) {
  .recording-details { position: static; }
  .workspace.is-reviewed .topic-card { padding: 16px 18px; }
}

/* ---- самостоятельная переделка мысли ---- */
.thought-workshop { margin-top: 18px; scroll-margin-top: 86px; }
.thought-workshop:focus { outline: none; }
.thought-entry { display: flex; flex-direction: column; gap: 16px; border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); }
.thought-entry h2 { margin-bottom: 6px; }
.thought-entry p { max-width: 72ch; }
.thought-entry-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.thought-entry select { height: 44px; }
.thought-list { display: flex; flex-direction: column; gap: 18px; }
.thought-entry + .thought-list, .thought-workshop > div:not(:empty) + .thought-list { margin-top: 18px; }
.thought-card { scroll-margin-top: 86px; }
.thought-card h3 { font-size: 19px; }
.thought-card h4 { font-size: 15px; font-weight: 650; margin: 0 0 10px; }
.thought-card h5 { font-size: 14.5px; font-weight: 650; margin: 0; }
.thought-task { max-width: 72ch; margin-bottom: 18px; }
.thought-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.thought-version { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.thought-versions { min-width: 0; }
.thought-attempt + .thought-attempt { margin-top: 12px; }
.thought-attempt > .row { margin-bottom: 10px; }
.thought-quote { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin-bottom: 12px; }
.thought-context { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; line-height: 1.6; }
.thought-card audio { display: block; width: 100%; min-width: 0; margin: 12px 0 8px; }
.thought-card summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.thought-card summary::before { content: '›'; font-size: 20px; }
.thought-card details[open] > summary::before { transform: rotate(90deg); }
.thought-card summary::-webkit-details-marker { display: none; }
.thought-review { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.thought-next-hint { font-weight: 550; }
.thought-hints:not(:empty) { margin-bottom: 14px; }
.thought-card > .row { margin-top: 14px; }
.thought-status { padding: 12px 14px; margin-top: 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: 14.5px; }
.thought-status .btn { margin-top: 10px; }
.thought-attempt { scroll-margin-top: 86px; }
.thought-form { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.thought-modes { align-self: flex-start; }
.thought-modes button { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; font-size: 15px; }
.thought-modes svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thought-modes button:disabled { opacity: .5; cursor: default; }
.thought-input { width: 100%; min-height: 96px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); line-height: 1.6; resize: vertical; font-size: 16px; }
.thought-input:disabled { opacity: .65; }
.thought-meaning .thought-input { min-height: 76px; }
.thought-form .btn, .thought-card > .row .btn, .thought-entry .btn, .issue-practice .btn, .thought-attempt .btn { min-height: 44px; height: auto; }
.thought-form .field > .btn { align-self: flex-start; margin-top: 6px; }
.thought-voice { display: flex; flex-direction: column; gap: 12px; }
.thought-voice > .btn { align-self: flex-start; }
.thought-preview:empty { display: none; }
.thought-error { color: var(--bad-ink); font-size: 14.5px; line-height: 1.5; }
.issue-practice { grid-column: 2; margin-top: 5px; }
.pause-note { flex-basis: 100%; }

/* ---- мысль и слово ---- */
.learning-intro { max-width: 76ch; margin: 0 0 20px; }
.learning-kinds { margin-bottom: 28px; }
.learning-kinds .ex-card h2 { font-size: 19px; }
.learning-kinds .meta { flex-wrap: wrap; }
.learning-kinds .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.learning-kinds .meta svg, .section-title > a svg, .learning-citation svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-title > a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.learning-principle { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; max-width: 80ch; }
.learning-principle > svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.learning-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.learning-item { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.learning-item h2 { font-size: 19px; }
.learning-item > .btn { align-self: flex-start; margin-top: auto; }
.learning-item-actions { margin-top: auto; }
.learning-progress h2 { margin-bottom: 16px; }
.learning-progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.learning-progress-grid h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.learning-progress-grid p + p { margin-top: 5px; }
.learning-material { display: flex; flex-direction: column; gap: 18px; margin: 0 0 20px; padding: 18px; border-radius: var(--radius-sm); background: var(--surface-2); }
.learning-topic { margin: -4px 0 18px; line-height: 1.5; }
.learning-material h4 { margin-bottom: 8px; }
.learning-word h4 { font-size: 24px; letter-spacing: -.02em; }
.learning-word p + p { margin-top: 6px; }
.learning-citation { margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.learning-citation blockquote { margin: 0; font-size: 18px; line-height: 1.65; white-space: pre-wrap; }
.learning-citation figcaption { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.learning-citation a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.learning-nuances { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0 0 10px; }
.learning-nuances dt { font-weight: 650; }
.learning-nuances dd { margin: 0; color: var(--ink-2); }
.learning-examples { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.learning-usage-pairs { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.learning-usage-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; padding: 14px; border-radius: 10px; background: var(--surface); }
.learning-usage-pair > div > p { margin-top: 4px; line-height: 1.6; }
.learning-pair-note { grid-column: 1 / -1; }
.learning-transfer { margin-top: 20px; padding: 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); display: flex; flex-direction: column; gap: 12px; }
.learning-transfer .btn { align-self: flex-start; min-height: 44px; height: auto; }

/* ---- программа ---- */
.prog-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.steps-list { display: flex; flex-direction: column; gap: 8px; }
.step-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--surface-2); color: var(--ink);
}
.step-row:hover { text-decoration: none; background: var(--surface-3); }
.step-row .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); font-weight: 650; }
.step-row.done .n { background: var(--good); color: #fff; }
.step-row .t { font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cal .d {
  aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--ord-0); color: var(--ink-3); position: relative; font-variant-numeric: tabular-nums;
}
.cal .d.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.cal .d.check::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--serious); box-shadow: 0 0 0 2px var(--surface); }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---- история ---- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
select, .input {
  height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
}
.day-group { margin-bottom: 22px; }
.day-group h3 { font-size: 14px; color: var(--ink-3); font-weight: 600; margin: 0 0 8px 4px; }
.hist-list { display: flex; flex-direction: column; gap: 6px; }
.hist-row {
  display: grid; grid-template-columns: 52px 230px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.hist-row:hover { text-decoration: none; border-color: var(--line-2); }
.hist-row .time { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.hist-row .ex { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .topic { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .stats { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* ---- прогресс ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi .k-label { font-size: 13px; color: var(--ink-3); }
.kpi .k-val { font-size: 32px; font-weight: 680; letter-spacing: -0.025em; line-height: 1.1; }
.kpi .k-sub { font-size: 13px; color: var(--ink-2); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-card { padding: 16px 18px 10px; }
.chart-card .c-title { font-weight: 650; font-size: 15px; }
.chart-card .c-sub { font-size: 13px; color: var(--ink-3); }
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis line { stroke: var(--line-2); stroke-width: 1; }
.chart text { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart text.end-label { fill: var(--ink); font-weight: 650; font-size: 12.5px; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .1; }
.chart .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart .hot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 120px; max-width: 260px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 8px 11px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.4;
}
.tooltip .tv { font-size: 16px; font-weight: 700; }
.tooltip .tl { color: var(--ink-3); }
.tooltip .key { display: inline-block; width: 12px; height: 2px; background: var(--series-1); vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.data-table td.n, .data-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---- настройки ---- */
.dialog {
  border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35);
}
.dialog::backdrop { background: rgba(10, 10, 9, .35); backdrop-filter: blur(2px); }
.dialog-in { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: 14.5px; }
.field .help { font-size: 13px; color: var(--ink-3); }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); font-weight: 600; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.switch input { width: 18px; height: 18px; accent-color: var(--ink); }
.mic-test { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.mic-test i { display: block; height: 100%; width: 0; background: var(--good); transition: width .06s linear; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 14.5px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ---- узкие экраны ---- */
@media (max-width: 920px) {
  .workspace, .prog-grid, .hero { grid-template-columns: minmax(0, 1fr); }
  .verdict-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .note-row { grid-template-columns: minmax(0, 1fr); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .learning-items, .learning-progress-grid { grid-template-columns: minmax(0, 1fr); }
  .learning-usage-pair { grid-template-columns: minmax(0, 1fr); }
  .learning-nuances { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .learning-nuances dd { margin-bottom: 8px; }
  .learning-transfer .btn { white-space: normal; }
  .thought-comparison { grid-template-columns: minmax(0, 1fr); }
  .thought-entry-actions { align-items: stretch; flex-direction: column; }
  .thought-entry-actions > .btn { width: 100%; }
  .thought-card .card-head { align-items: flex-start; }
  .issue-practice { grid-column: 1; }
  .page { padding: 18px 16px 70px; }
  .topbar-in { padding: 8px 16px; gap: 10px; }
  .brand span { display: none; }
  .nav a { padding: 7px 9px; font-size: 14px; }
}
@media (max-width: 520px) {
  .topbar-in { padding: 8px 10px 8px 16px; gap: 4px; }
  .brand { display: none; }
  .nav { margin-left: 0; flex: 1; justify-content: space-between; gap: 0; }
  .nav a { padding: 7px 7px; font-size: 13.5px; }
}
@media (max-width: 640px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .structure { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue { grid-template-columns: minmax(0, 1fr); }
  .issue .kind { grid-row: auto; }
  .issue .why { grid-column: 1; }
  .hist-row { grid-template-columns: 44px minmax(0, 1fr); }
  .hist-row .topic { grid-column: 2; }
  .hist-row .stats { grid-column: 1 / -1; justify-content: flex-start; }
  .transcript { font-size: 16.5px; }
  .coach-card { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.learning-answer-format { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.6; }
.learning-answer-format h4 { margin-bottom: 8px; }
.learning-answer-format ol { padding-left: 22px; margin: 0 0 8px; }

/* ---- короткие обучающие примеры: только пространство guide-* ---- */
.guide-entry {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px;
  padding: 18px 20px; margin: 0 0 20px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--surface);
}
.guide-entry-text { flex: 1 1 280px; min-width: 0; }
.guide-entry-title { font-weight: 650; margin-bottom: 3px; }
.guide-entry-description { color: var(--ink-2); font-size: 14px; max-width: 62ch; }
.guide-open { flex: none; min-height: 44px; }
.guide-entry-status { flex: 1 1 100%; color: var(--bad-ink); font-size: 14px; }
.guide-entry-status:empty { display: none; }
.guide-dialog {
  --guide-paper: var(--surface); --guide-board: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 0;
  width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  background: var(--guide-paper); color: var(--ink); overflow: auto;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .5);
}
.guide-dialog::backdrop { background: rgba(12, 12, 11, .58); backdrop-filter: blur(3px); }
.guide-shell { display: flex; flex-direction: column; }
.guide-header { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 22px 24px 18px; position: sticky; top: 0; z-index: 5; background: var(--guide-paper); border-bottom: 1px solid var(--line); }
.guide-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.guide-title { font-size: 20px; line-height: 1.3; }
.guide-icon-button {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--line-2); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; background: transparent;
  color: var(--ink); cursor: pointer; transition: background .18s ease;
}
.guide-icon-button:hover { background: var(--surface-2); }
.guide-icon-button:active { background: var(--surface-3); }
.guide-icon-button:disabled { opacity: .35; cursor: default; }
.guide-icon-button svg, .guide-intro-cue > svg, .guide-feedback svg {
  width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.guide-stage {
  position: relative; display: grid; grid-template-columns: 158px minmax(0, 1fr);
  min-height: 356px; padding: 24px 28px 26px 16px; gap: 16px;
  background-color: var(--guide-board);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) .65px, transparent .65px);
  background-size: 9px 9px; border-block: 1px solid var(--line);
}
.guide-actors { display: flex; align-items: center; justify-content: center; position: relative; min-width: 0; align-self: stretch; }
.guide-character { position: relative; display: flex; flex-direction: column; align-items: center; }
.guide-character-coach { width: 144px; z-index: 1; }
.guide-character-learner { position: absolute; right: -5px; bottom: -6px; width: 78px; transform: rotate(4deg); }
.guide-character-name { font-size: 12px; color: var(--ink-2); font-weight: 650; margin-top: -6px; }
.guide-person { display: block; width: 100%; height: auto; overflow: visible; }
.guide-person-body { transform-origin: 92px 220px; }
.guide-person-shadow { fill: var(--ink); opacity: .08; }
.guide-person-ink { fill: var(--ink); }
.guide-person-shirt { fill: var(--ink); stroke: var(--guide-board); stroke-width: 1.6; }
.guide-person-face { fill: var(--guide-paper); stroke: var(--ink); stroke-width: 2.6; }
.guide-person-feature, .guide-person-mouth { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.guide-person-mouth { transform-origin: 92px 88px; }
.guide-person-accent { fill: var(--accent); }
.guide-learner .guide-person-accent { fill: var(--warn); }
.guide-playing .guide-coach .guide-person-mouth { animation: guide-speak .45s ease-in-out infinite alternate; }
.guide-playing .guide-coach .guide-person-body { animation: guide-emphasise 3.8s ease-in-out infinite; }
.guide-stage[data-visual="answer"] .guide-coach .guide-person-mouth { animation: none; }
.guide-playing .guide-stage[data-visual="answer"] .guide-learner .guide-person-mouth { animation: guide-speak .45s ease-in-out infinite alternate; }
.guide-board { min-width: 0; align-self: center; }
.guide-scene-kicker { color: var(--accent-ink); font-size: 12px; font-weight: 650; letter-spacing: .03em; margin-bottom: 5px; }
.guide-scene-title { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.2; max-width: 30ch; margin-bottom: 18px; }
.guide-example { border: 1px solid var(--line-2); background: var(--guide-paper); padding: 14px 16px; border-radius: 12px; margin-top: 12px; animation: guide-enter .26s ease-out both; }
.guide-example-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.guide-example-text { font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-source .guide-example-text { font-size: 19px; font-weight: 600; }
.guide-answer { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 6%, transparent); }
.guide-written { animation: guide-write .18s ease-out both; animation-delay: calc(var(--guide-order) * 36ms); }
.guide-caret { color: var(--accent-ink); margin-left: 2px; animation: guide-blink 1s steps(2, end) infinite; }
.guide-options { display: grid; gap: 9px; margin-top: 12px; }
.guide-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--guide-paper); border-radius: 12px; animation: guide-enter .28s ease-out both; animation-delay: calc(var(--guide-order) * 160ms); }
.guide-option-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--surface-3); font-size: 13px; font-weight: 650; }
.guide-option-copy { min-width: 0; }
.guide-option-copy strong { display: block; font-size: 18px; line-height: 1.35; }
.guide-option-copy p { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin-top: 2px; }
.guide-feedback { border-left: 3px solid var(--accent); }
.guide-feedback .guide-example-label { color: var(--accent-ink); display: flex; align-items: center; gap: 5px; }
.guide-feedback svg { width: 16px; height: 16px; }
.guide-new-topic { border-style: dashed; border-width: 2px; }
.guide-new-topic .guide-example-label { color: var(--accent-ink); }
.guide-intro-cue { display: flex; align-items: center; gap: 20px; margin: 24px 0 20px; }
.guide-intro-mark { display: grid; place-items: center; width: 78px; height: 78px; border: 2px solid var(--ink); border-radius: 20px; background: var(--guide-paper); font-weight: 700; font-size: 35px; transform: rotate(-5deg); }
.guide-intro-mark-after { border-color: var(--accent-ink); color: var(--accent-ink); transform: rotate(4deg); }
.guide-intro-caption { font-size: 19px; line-height: 1.5; max-width: 37ch; color: var(--ink-2); }
.guide-subtitles { padding: 18px 26px; min-height: 100px; display: flex; align-items: center; }
.guide-caption { font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 76ch; }
.guide-progress { height: 4px; background: var(--surface-3); overflow: hidden; }
.guide-progress-fill { height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--accent); transition: transform .14s linear; }
.guide-controls { display: flex; align-items: center; gap: 10px; padding: 16px 24px 8px; }
.guide-controls .btn { min-height: 44px; height: auto; white-space: normal; }
.guide-toggle { min-width: 132px; }
.guide-toggle svg { flex: none; }
.guide-next svg { order: 2; flex: none; }
.guide-step { margin-left: auto; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.guide-chapters { display: flex; align-items: center; gap: 6px; padding: 0 24px 0; flex-wrap: wrap; }
.guide-chapter { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink-2); border-radius: 11px; cursor: pointer; font-size: 13px; }
.guide-chapter:hover { background: var(--surface-2); }
.guide-chapter-current { color: var(--accent-ink); font-weight: 700; background: color-mix(in srgb, var(--accent) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.guide-chapter-done { color: var(--ink); }
.guide-note { font-size: 12px; color: var(--ink-2); padding: 8px 26px 18px; }
.guide-status { font-size: 13px; line-height: 1.5; color: var(--ink-2); padding: 6px 26px 0; }
.guide-status:empty { display: none; }
@keyframes guide-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes guide-write { from { opacity: 0; } to { opacity: 1; } }
@keyframes guide-blink { to { opacity: 0; } }
@keyframes guide-speak { from { transform: scaleY(.75); } to { transform: scaleY(1.4); } }
@keyframes guide-emphasise { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(1deg); } }
@media (max-width: 600px) {
  .guide-entry { padding: 16px; align-items: flex-start; gap: 12px; }
  .guide-entry-text { flex-basis: 100%; }
  .guide-open { width: 100%; }
  .guide-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .guide-header { padding: 18px 16px 14px; gap: 12px; }
  .guide-title { font-size: 18px; }
  .guide-eyebrow { font-size: 11px; }
  .guide-stage { grid-template-columns: minmax(0, 1fr); min-height: 300px; padding: 18px 16px; gap: 0; }
  .guide-actors { position: absolute; top: 15px; right: 8px; width: 78px; height: 92px; opacity: .9; align-self: auto; }
  .guide-character-coach { width: 64px; }
  .guide-character-learner { right: -2px; bottom: -7px; width: 35px; }
  .guide-character-name { display: none; }
  .guide-scene-title { padding-right: 68px; margin-bottom: 20px; font-size: 23px; min-height: 76px; }
  .guide-example { padding: 12px; }
  .guide-example-text { font-size: 16px; }
  .guide-source .guide-example-text { font-size: 18px; }
  .guide-option-copy strong { font-size: 17px; }
  .guide-subtitles { padding: 16px; min-height: 124px; }
  .guide-caption { font-size: 15px; }
  .guide-controls { gap: 8px; padding: 14px 14px 6px; flex-wrap: wrap; }
  .guide-toggle { min-width: 122px; }
  .guide-next { flex: 1; padding: 0 12px; }
  .guide-step { margin-left: 0; margin-right: auto; padding-left: 3px; }
  .guide-sound { margin-left: auto; }
  .guide-chapters { padding: 0 12px; gap: 2px; }
  .guide-chapter { flex: 1; max-width: 44px; }
  .guide-note, .guide-status { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-dialog *, .guide-dialog *::before, .guide-dialog *::after { animation: none !important; transition: none !important; }
  .guide-written { opacity: 1; }
  .guide-caret { display: none; }
}
.guide-demo-submit { position: relative; width: fit-content; padding: 8px 12px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 600; margin-top: 14px; }
.guide-demo-pointer { position: absolute; width: 23px; height: 30px; right: 0; top: 20px; fill: var(--guide-paper); stroke: var(--ink); stroke-width: 1.7; animation: guide-point 2.8s ease-in-out .8s both; }
@keyframes guide-point { 0% { opacity: 0; transform: translate(18px, 14px); } 30%, 65% { opacity: 1; transform: translate(0, 0); } 75% { transform: translate(-2px, -2px) scale(.93); opacity: 1; } 100% { transform: translate(0, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .guide-demo-pointer { animation: none; } }
.guide-dialog:not(.guide-playing) .guide-written, .guide-dialog:not(.guide-playing) .guide-demo-pointer { animation: none; }
.guide-dialog:not(.guide-playing) .guide-caret { animation: none; opacity: 0; }

/* Разные речевые действия в заданиях на синонимы. */
.learning-recommendation {
  display: flex; align-items: center; flex-wrap: wrap; gap: 18px 24px;
  padding: 20px 22px; margin-bottom: 24px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.learning-recommendation > div { flex: 1 1 320px; min-width: 0; }
.learning-recommendation h2 { font-size: 20px; margin-bottom: 8px; }
.learning-recommendation p { color: var(--ink-2); max-width: 66ch; line-height: 1.6; }
.learning-recommendation > .btn { min-height: 48px; height: auto; white-space: normal; flex: none; }
.learning-format-label { align-self: flex-start; max-width: 100%; white-space: normal; }
.learning-task-preview { line-height: 1.6; color: var(--ink-2); }
.learning-legacy-notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; margin-bottom: 20px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface);
}
.learning-legacy-notice > svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke: var(--accent-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.learning-legacy-notice h2 { font-size: 17px; line-height: 1.5; margin-bottom: 6px; }
.learning-legacy-notice p { color: var(--ink-2); max-width: 74ch; line-height: 1.6; }
.learning-legacy-notice .btn { margin-top: 14px; min-height: 44px; height: auto; white-space: normal; }
.learning-answer-format > p + p { margin-top: 6px; }
@media (max-width: 600px) {
  .learning-recommendation { padding: 18px; gap: 16px; }
  .learning-recommendation > .btn { width: 100%; }
  .learning-legacy-notice { padding: 16px; gap: 10px; }
  .learning-legacy-notice .btn { width: 100%; }
  .learning-item-actions > .btn { min-height: 44px; height: auto; white-space: normal; }
}
/* Сохранённые на устройстве записи не перекрывают рабочий экран. */
.trainer-recovery { padding-bottom: 0; }
.trainer-recovery[hidden] { display: none; }
.trainer-recovery .card { margin-bottom: 16px; }
.trainer-recovery audio { display: block; width: 100%; max-width: 560px; margin: 12px 0; }
.trainer-recovery .row { flex-wrap: wrap; gap: 8px; }
