/* Uzolingo — палитра риштанской керамики: кобальт, бирюза, шафран, гранат.
   Светлая и тёмная тема; в Telegram тема берётся из colorScheme клиента. */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #e8eef8;
  --line: #d5deec;
  --text: #0f1b3d;
  --muted: #5d6b88;
  --cobalt: #1f45b5;
  --cobalt-deep: #142f82;
  --firuza: #14a39a;
  --firuza-deep: #0c7d76;
  --saffron: #e9a21b;
  --anor: #c7303f;
  --anor-deep: #9a1f2d;
  --on-accent: #ffffff;
  --tile-idle: #c9d4e8;
  --ok-bg: #dff5f2;
  --ok-text: #0a5f59;
  --no-bg: #fbe4e6;
  --no-text: #8e1c29;
  --shadow: 0 1px 2px rgba(15, 27, 61, .06), 0 6px 20px rgba(15, 27, 61, .06);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --tap: 56px;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --star: polygon(50% 0, 64.9% 14%, 85.4% 14.6%, 86% 35.1%, 100% 50%, 86% 64.9%, 85.4% 85.4%,
    64.9% 86%, 50% 100%, 35.1% 86%, 14.6% 85.4%, 14% 64.9%, 0 50%, 14% 35.1%, 14.6% 14.6%, 35.1% 14%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1530; --surface: #16204a; --surface-2: #1d2a5c; --line: #2a3a73;
    --text: #edf1fb; --muted: #97a4c6; --cobalt: #5b82f0; --cobalt-deep: #3457c4;
    --firuza: #2fc4b9; --firuza-deep: #1a948b; --tile-idle: #2a3a73;
    --ok-bg: rgba(47, 196, 185, .14); --ok-text: #8fe6de;
    --no-bg: rgba(199, 48, 63, .18); --no-text: #ffb3ba;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1530; --surface: #16204a; --surface-2: #1d2a5c; --line: #2a3a73;
  --text: #edf1fb; --muted: #97a4c6; --cobalt: #5b82f0; --cobalt-deep: #3457c4;
  --firuza: #2fc4b9; --firuza-deep: #1a948b; --tile-idle: #2a3a73;
  --ok-bg: rgba(47, 196, 185, .14); --ok-text: #8fe6de;
  --no-bg: rgba(199, 48, 63, .18); --no-text: #ffb3ba;
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px env(safe-area-inset-bottom, 0);
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--firuza); outline-offset: 2px; }

/* ---------- кнопки ---------- */
.btn {
  width: 100%;
  min-height: var(--tap);
  border: none;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 17px;
  transition: transform .08s ease, box-shadow .08s ease, opacity .15s ease;
}
.btn + .btn { margin-top: 10px; }
.btn[disabled] { opacity: .4; cursor: default; }
.btn-primary { background: var(--cobalt); color: var(--on-accent); box-shadow: 0 4px 0 var(--cobalt-deep); }
.btn-ok { background: var(--firuza); color: var(--on-accent); box-shadow: 0 4px 0 var(--firuza-deep); }
.btn-wrong { background: var(--anor); color: #fff; box-shadow: 0 4px 0 var(--anor-deep); }
.btn-primary:not([disabled]):active, .btn-ok:active, .btn-wrong:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); min-height: 50px; font-weight: 600; }

/* ---------- главный экран ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 16px; }
.hello { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.chips { display: flex; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 99px; font-size: 14px;
}
.chip b { font-size: 16px; }
.chip span:last-child:not(.chip-ico) { color: var(--muted); }
.chip-streak.lit { border-color: var(--saffron); }
.chip-ico { font-size: 16px; line-height: 1; }

.home-main { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }

.hero {
  position: relative; overflow: hidden;
  background: var(--cobalt); color: var(--on-accent);
  border-radius: var(--r-lg); padding: 22px 20px 20px;
}
.hero::after {  /* кусок изразца в углу */
  content: ""; position: absolute; right: -46px; top: -46px; width: 170px; height: 170px;
  background: rgba(255, 255, 255, .09); clip-path: var(--star);
}
.hero::before {
  content: ""; position: absolute; right: 2px; top: 2px; width: 78px; height: 78px;
  background: rgba(255, 255, 255, .1); clip-path: var(--star);
}
.hero-kicker { font-size: 14px; opacity: .8; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.2;
  margin: 6px 0 4px; max-width: 16ch; position: relative; }
.hero p { margin: 0 0 18px; opacity: .8; font-size: 15px; }
.hero .btn { background: #fff; color: var(--cobalt-deep); box-shadow: 0 4px 0 rgba(0, 0, 0, .22); position: relative; }
.hero .btn:active { transform: translateY(4px); box-shadow: none; }
.hero .resume { display: block; margin-top: 12px; background: none; border: none; color: #fff;
  opacity: .85; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; position: relative; }
.hero.done { background: var(--firuza-deep); }

.review-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.review-strip .dot { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  background: var(--firuza); color: #fff; clip-path: var(--star); font-weight: 700; font-size: 14px; }
.review-strip b { display: block; font-size: 16px; }
.review-strip small { color: var(--muted); font-size: 14px; }
.review-strip[disabled] { cursor: default; }
.review-strip[disabled] .dot { background: var(--tile-idle); color: var(--muted); }

.path-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.path-head h2 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0; }
.path-head span { color: var(--muted); font-size: 14px; }

/* путь из восьмиконечных звёзд — сердце главного экрана */
.path { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 0; }
.node {
  --x: 0px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: 4px; transform: translateX(var(--x));
  width: 150px; text-align: center;
}
.tile {
  position: relative; width: 74px; height: 74px; display: grid; place-items: center;
  background: var(--tile-idle); clip-path: var(--star);
  font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted);
  transition: transform .12s ease;
}
.tile::before { content: ""; position: absolute; inset: 9px; clip-path: var(--star);
  background: var(--surface); opacity: .55; }
.tile span { position: relative; }
.node:active .tile { transform: scale(.94); }
.node.done .tile { background: var(--firuza); color: #fff; }
.node.done .tile::before { background: #fff; opacity: .16; }
.node.current .tile { width: 96px; height: 96px; background: var(--cobalt); color: #fff; font-size: 26px; }
.node.current .tile::before { background: #fff; opacity: .15; }
.node-title { font-size: 14px; line-height: 1.25; color: var(--muted); }
.node.current .node-title { color: var(--text); font-weight: 600; }
.node.done .node-title { color: var(--text); }
.tile-wrap { position: relative; display: grid; place-items: center; }
.node.current .tile-wrap::before {   /* единственная «живая» анимация на экране */
  content: ""; position: absolute; width: 118px; height: 118px; clip-path: var(--star);
  background: var(--cobalt); opacity: .18; animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(.88) rotate(22.5deg); opacity: .08; } }

/* ---------- шапка урока ---------- */
.run { display: flex; flex-direction: column; flex: 1; min-height: 100vh; min-height: 100dvh; }
.run-head { display: flex; align-items: center; gap: 12px; padding: 14px 0 8px; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.bar { flex: 1; height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--firuza); border-radius: 99px;
  transition: width .35s cubic-bezier(.3, .8, .3, 1); min-width: 14px;
  background-image: linear-gradient(180deg, rgba(255,255,255,.28) 0 40%, transparent 40%); }
.counter { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.stage { flex: 1; display: flex; flex-direction: column; padding-top: 10px; }
.q-title { color: var(--muted); font-size: 15px; font-weight: 600; margin: 4px 0 14px; }

/* ---------- карточка слова ---------- */
.word-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 20px 22px; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.word-card::before { content: ""; position: absolute; left: 50%; top: -30px; width: 60px; height: 60px;
  margin-left: -30px; background: var(--firuza); opacity: .16; clip-path: var(--star); }
.word-uz { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -.01em;
  line-height: 1.15; overflow-wrap: anywhere; }
.word-ru { font-size: 19px; color: var(--cobalt); margin-top: 8px; font-weight: 600; }
.word-ex { margin-top: 20px; padding-top: 16px; border-top: 1.5px dashed var(--line); color: var(--muted);
  font-size: 15px; text-align: left; }
.word-ex b { display: block; color: var(--text); font-weight: 600; font-size: 17px; margin-bottom: 2px; }
.registers { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.registers span { background: var(--surface-2); border-radius: var(--r-sm); padding: 6px 12px; font-size: 15px; }
.registers b { color: var(--muted); font-weight: 600; margin-right: 6px; font-size: 13px; }

.grammar-card { background: var(--surface); border: 1.5px solid var(--saffron); border-radius: var(--r-lg);
  padding: 22px 20px; box-shadow: var(--shadow); }
.grammar-card h2 { font-family: var(--display); margin: 0 0 10px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.grammar-card p { margin: 0 0 16px; }
.grammar-ex { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.grammar-ex b { display: block; font-size: 18px; }
.grammar-ex span { color: var(--muted); font-size: 15px; }
.tag { display: inline-block; background: rgba(233, 162, 27, .16); color: #a86f00;
  border-radius: 99px; padding: 3px 11px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
:root[data-theme="dark"] .tag { color: var(--saffron); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: var(--saffron); } }

/* ---------- вопросы ---------- */
.prompt { font-family: var(--display); font-size: 27px; font-weight: 700; line-height: 1.2;
  margin: 0 0 22px; overflow-wrap: anywhere; }
.prompt.ru { font-family: var(--font); font-size: 26px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  min-height: var(--tap); background: var(--surface); border: 1.5px solid var(--line);
  border-bottom-width: 4px; border-radius: var(--r-md); padding: 12px 16px; text-align: left; font-size: 17px;
  display: flex; align-items: center; gap: 12px; transition: border-color .12s ease, background .12s ease;
}
.option kbd { font: 600 12px var(--font); color: var(--muted); border: 1.5px solid var(--line);
  border-radius: 7px; width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; }
.option.selected { border-color: var(--cobalt); background: var(--surface-2); }
.option.selected kbd { border-color: var(--cobalt); color: var(--cobalt); }
.option.correct { border-color: var(--firuza); background: var(--ok-bg); }
.option.wrong { border-color: var(--anor); background: var(--no-bg); }
.option[disabled] { cursor: default; }

.tokens { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 108px;
  background-image: linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line));
  background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 50px, 0 100%;
  padding-bottom: 12px; margin-bottom: 20px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.token { background: var(--surface); border: 1.5px solid var(--line); border-bottom-width: 4px;
  border-radius: 12px; padding: 8px 14px; font-size: 17px; animation: pop .14s ease; }
.token.used { background: var(--surface-2); color: transparent; border-color: var(--surface-2);
  pointer-events: none; animation: none; }
@keyframes pop { from { transform: scale(.85); opacity: .4; } }

.fill-line { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.3; margin-bottom: 18px; }
.fill-line .gap { color: var(--saffron); }
.fill-input {
  width: 100%; min-height: var(--tap); background: var(--surface); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; font: 500 20px var(--font);
}
.fill-input:focus { outline: none; border-color: var(--cobalt); }
.fill-input.ok { border-color: var(--firuza); background: var(--ok-bg); }
.fill-input.no { border-color: var(--anor); background: var(--no-bg); }
.hint { color: var(--muted); font-size: 14px; margin-top: 8px; }
.hint-top { margin: -12px 0 18px; }

.shake { animation: shake .32s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- футер и фидбек ---------- */
.foot { position: sticky; bottom: 0; padding: 14px 0 calc(16px + env(safe-area-inset-bottom, 0));
  margin: auto -16px 0; padding-left: 16px; padding-right: 16px;
  background: linear-gradient(180deg, transparent, var(--bg) 18px); }
.foot.ok { background: var(--ok-bg); border-radius: var(--r-lg) var(--r-lg) 0 0; animation: rise .22s ease; }
.foot.no { background: var(--no-bg); border-radius: var(--r-lg) var(--r-lg) 0 0; animation: rise .22s ease; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.feedback { padding: 4px 2px 14px; font-size: 15px; }
.foot.ok .feedback { color: var(--ok-text); }
.foot.no .feedback { color: var(--no-text); }
.feedback b { display: block; font-family: var(--display); font-size: 19px; margin-bottom: 4px; }
.feedback .answer { font-weight: 700; font-size: 17px; }
.feedback .typed { display: block; margin-top: 4px; font-size: 14px; opacity: .8; }

/* ---------- экраны разделов и итог ---------- */
.section-screen { text-align: center; padding: 56px 0 24px; margin: auto 0; }
.section-screen .emblem { width: 110px; height: 110px; margin: 0 auto; display: grid; place-items: center;
  background: var(--cobalt); clip-path: var(--star); font-size: 44px; }
.section-screen.retry .emblem { background: var(--saffron); }
.section-screen.review .emblem, .section-screen.final_mix .emblem { background: var(--firuza); }
.section-screen h2 { font-family: var(--display); font-size: 24px; margin: 22px 0 6px; font-weight: 700; }
.section-screen p { color: var(--muted); margin: 0; }

.summary { padding: 36px 0 20px; text-align: center; }
.summary .emblem { width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center;
  background: var(--firuza); clip-path: var(--star); font-family: var(--display); font-weight: 700;
  font-size: 30px; color: #fff; animation: spin-in .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes spin-in { from { transform: scale(.4) rotate(-90deg); opacity: 0; } }
.summary h1 { font-family: var(--display); font-size: 26px; margin: 20px 0 4px; font-weight: 700; }
.summary > p { color: var(--muted); margin: 0; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0 14px; text-align: left; }
.stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.wave-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.wave-row { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.wave-row span { color: var(--muted); }
.wave-row .mini { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.wave-row .mini i { display: block; height: 100%; background: var(--firuza); border-radius: 99px; }
.wave-row b { text-align: right; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px;
  max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 20; }
.toast.show { opacity: 1; }

.center-msg { margin: auto; text-align: center; color: var(--muted); padding: 40px 12px; max-width: 34ch; }
.center-msg h2 { font-family: var(--display); color: var(--text); font-size: 22px; margin: 18px 0 8px; }
.center-msg p { margin: 0 0 20px; }
.center-msg .emblem { width: 84px; height: 84px; margin: 0 auto; background: var(--cobalt); clip-path: var(--star); }
.loader { width: 54px; height: 54px; margin: auto; background: var(--firuza); clip-path: var(--star);
  animation: turn 1.2s linear infinite; }
@keyframes turn { to { transform: rotate(90deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 420px) {
  .word-uz { font-size: 40px; }
  .prompt { font-size: 30px; }
}

/* ---------- статистика ---------- */
:root { --viz-strong: #14a39a; --viz-learning: #1f45b5; --viz-weak: #e9a21b; }
:root[data-theme="dark"] { --viz-strong: #1fa89e; --viz-learning: #5b82f0; --viz-weak: #bd7d0e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viz-strong: #1fa89e; --viz-learning: #5b82f0; --viz-weak: #bd7d0e; }
}
.review-strip .stats-dot { background: var(--cobalt); display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 13px; }
.stats-dot i { width: 3px; background: #fff; border-radius: 2px; }
.stats-dot i:nth-child(1) { height: 7px; } .stats-dot i:nth-child(2) { height: 12px; } .stats-dot i:nth-child(3) { height: 9px; }

.stats { padding-bottom: 32px; }
.stats-head { display: flex; align-items: center; gap: 8px; padding: 14px 0 12px; margin-left: -8px; }
.stats-head h1 { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.tile-stat b { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-stat b small { font-size: 15px; color: var(--muted); font-weight: 500; }
.tile-stat span { color: var(--muted); font-size: 14px; }

.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 16px; margin-top: 14px; }
.panel h2 { font-family: var(--display); font-size: 17px; font-weight: 700; margin: 0; }
.panel-sub { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }

.stack { display: flex; gap: 2px; height: 18px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.seg { display: block; height: 100%; min-width: 4px; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg.strong, .sw.strong { background: var(--viz-strong); }
.seg.learning, .sw.learning { background: var(--viz-learning); }
.seg.weak, .sw.weak { background: var(--viz-weak); }
.sw.rest { background: var(--surface-2); border: 1.5px solid var(--line); }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 12px; }

.week-head, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week-head { margin-bottom: 5px; }
.week-head span { text-align: center; color: var(--muted); font-size: 12px; }
.day { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); }
.day.l1 { background: color-mix(in srgb, var(--firuza) 40%, var(--surface-2)); }
.day.l2 { background: color-mix(in srgb, var(--firuza) 70%, var(--surface-2)); }
.day.l3 { background: var(--firuza); }
.day.future { background: transparent; border: 1.5px dashed var(--line); }
.day.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--cobalt); }
.scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.scale .day { width: 12px; height: 12px; border-radius: 3px; }

.lstats { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.lstat { display: flex; gap: 12px; align-items: center; background: none; border: none; padding: 8px 0;
  text-align: left; width: 100%; border-radius: var(--r-sm); }
.lstat + .lstat { border-top: 1.5px solid var(--line); border-radius: 0; }
.lstat-tile { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; background: var(--firuza);
  color: #fff; clip-path: var(--star); font-family: var(--display); font-weight: 700; font-size: 14px; }
.lstat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.lstat-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.lstat-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lstat-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.lstat small { color: var(--muted); font-size: 13px; }
.mini { display: block; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--firuza); border-radius: 99px; }

/* ---- все слова ---- */
.review-strip .words-dot { background: var(--saffron); font-family: var(--display); font-size: 12px; }
.practice-btns .btn-ghost { margin-top: 10px; }
.search { width: 100%; margin-top: 14px; padding: 13px 16px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); outline: none; }
.search:focus { border-color: var(--cobalt); }
.wlesson { padding: 12px 16px; }
.wlesson > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.wlesson > summary::-webkit-details-marker { display: none; }
.wlesson > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.wlesson:not([open]) > summary::after { transform: rotate(-90deg); }
.lstat-tile.idle { background: var(--tile-idle); color: var(--muted); }
.wl-title { display: flex; flex-direction: column; min-width: 0; }
.wl-title b { font-weight: 600; font-size: 15px; }
.wl-title small { color: var(--muted); font-size: 13px; }
.wl-train { margin: 12px 0 4px; padding: 9px 14px; border-radius: 99px; border: 1.5px solid var(--cobalt);
  background: none; color: var(--cobalt); font: inherit; font-weight: 600; font-size: 14px; }
.wlist { margin-top: 8px; }
.wrow { border-top: 1.5px solid var(--line); }
.wrow > summary { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; min-height: 44px; }
.wrow > summary::-webkit-details-marker { display: none; }
.wrow b { font-family: var(--display); font-weight: 500; font-size: 14px; }
.wru { margin-left: auto; color: var(--muted); font-size: 14px; text-align: right; }
.wex { display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px 22px; font-size: 14px; }
.wex span, .wex small { color: var(--muted); }
.wex .wty { color: var(--text); }

/* ---- звук и грамматика ---- */
.speak { background: none; border: none; padding: 2px 4px; font-size: 20px; cursor: pointer; vertical-align: middle; line-height: 1; }
.speak.sm { font-size: 16px; }
.chip-sound { font-size: 16px; cursor: pointer; min-width: 40px; justify-content: center; }
.listen { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 18px; }
.play-big { width: 96px; height: 96px; border: none; background: var(--cobalt); color: #fff; font-size: 36px;
  clip-path: var(--star); cursor: pointer; }
.play-big:active { transform: scale(.95); }
.play-slow { background: none; border: 1.5px solid var(--line); color: var(--muted); border-radius: 99px;
  padding: 6px 14px; font: inherit; font-size: 14px; }
.fill-area { resize: none; min-height: 72px; line-height: 1.4; }
.review-strip .gram-dot { background: var(--anor); font-family: var(--display); font-size: 11px; }
.grule .gexpl { font-size: 15px; margin: 12px 0 10px; line-height: 1.5; }
.grule[data-locked] .gexpl, .grule[data-locked] .grammar-ex { opacity: .75; }
.sw.inline { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: 0; }
.speak-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.speak-row.center { justify-content: center; }
.speak-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: 99px; border: 1.5px solid var(--cobalt); background: var(--surface); color: var(--cobalt);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.speak-pill:active { transform: scale(.97); }
.feedback .speak-row { margin-top: 10px; }
.listen .speak-row { margin-top: 0; }
.wrow .speak { font-size: 16px; padding: 4px 6px; }
.grammar-ex .speak-pill { margin-top: 10px; align-self: flex-start; }

/* ---- диалоги ---- */
.review-strip .dlg-dot { background: var(--cobalt); font-size: 17px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.chat.compact { margin-bottom: 18px; }
.bubble { position: relative; max-width: 86%; padding: 10px 40px 10px 14px; border-radius: 18px;
  background: var(--surface); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: box-shadow .15s; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--ok-bg); border-color: transparent; }
.bubble b { font-family: var(--display); font-weight: 500; font-size: 15px; line-height: 1.35; }
.bubble .tr { display: none; color: var(--muted); font-size: 14px; }
.bubble.open .tr { display: block; }
.bubble .speak { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 17px; }
.bubble.live { box-shadow: 0 0 0 2.5px var(--cobalt); }
.bubble.me.hidden { border: 1.5px dashed var(--firuza); background: none; padding-right: 14px; }
.bubble.me.hidden b { display: none; }
.bubble .say-ru { color: var(--muted); font-size: 14px; }
.bubble.me.hidden .say-ru { color: var(--text); font-size: 15px; }
.roleplay-done { align-self: center; margin-top: 8px; color: var(--muted); font-weight: 600; }
.prompt.small { font-size: 18px; margin-bottom: 10px; }
.dlg-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit;
  color: var(--text); cursor: pointer; padding: 12px 16px; }
.dlg-row[disabled] { cursor: default; opacity: .7; }

/* ---- модули ---- */
.review-strip .mod-dot { font-family: var(--display); font-size: 11px; font-weight: 700; }
.review-strip .mod-dot.slang { background: var(--firuza); }
.review-strip .mod-dot.mat { background: var(--anor); }
.panel.warn { border-color: var(--anor); }

/* ---------- шпаргалка правила ---------- */
.gmemo { background: rgba(233, 162, 27, .12); border-left: 4px solid var(--saffron); border-radius: var(--r-md);
  padding: 10px 12px; margin: 0 0 12px; font-weight: 600; line-height: 1.35; }
.gmemo span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  font-weight: 600; margin-bottom: 2px; }
.gforms { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 15px; }
.gforms td { padding: 7px 8px; border-bottom: 1px solid var(--line, rgba(127,127,127,.18)); vertical-align: top; }
.gforms td:first-child { padding-left: 0; white-space: nowrap; }
.gforms td b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.gforms td:last-child { color: var(--muted); }
.gmore { margin: 0 0 12px; color: var(--muted); }
.gmore summary { cursor: pointer; font-weight: 600; }
.gmore p { margin: 8px 0 0; }
.q-rule { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.grule .grule-drill { margin-top: 12px; width: 100%; }
.path-note { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 16px 20px; }
