/* Стиль сайта по шпаргалке: громко на главной, средне на страницах букв, тихо в тренажёрах.
   Все цвета и размеры только через переменные ниже: их же потом возьмёт приложение. */
:root {
  --paper: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #EFECE4;
  --ink: #15161A;
  --muted: #6B6A66;
  --line: #15161A;
  --accent: #FF5A1F;
  --on-accent: #15161A;
  --ok: #7BE0A8;
  --ok-soft: #C9F0D8;
  --bad: #FF9A8F;
  --bad-soft: #FFD9D4;
  --ok-text: #1F8A5B;
  --bad-text: #C8372D;
  --faded-line: #E4E1D9;
  --hairline: #E4E1D9;
  --accent-text: #D9420D;
  --footer-bg: #15161A;
  --footer-ink: #F6F4EF;
  --footer-muted: #A3A097;
  --footer-line: #34353C;
  --mid: #FFD23F;
  --mid-text: #8A5E00;
  --high: #F0465A;
  --high-text: #B3192C;
  --low: #6FB6FF;
  --low-text: #1F5FAE;
  --tile-yellow: #FFD23F;
  --tile-blue: #CDEBFF;
  --radius: 24px;
  --radius-sm: 16px;
  --border: 1.5px;
  --font-head: "Unbounded", system-ui, sans-serif;
  --font-text: "Manrope", "Noto Sans Thai Looped", system-ui, sans-serif;
  --font-thai: "Noto Sans Thai Looped", "Manrope", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161A;
    --surface: #1F2026;
    --surface-2: #2A2B31;
    --ink: #F2F0EA;
    --muted: #A3A097;
    --line: #3A3B42;
    --mid-text: #FFD23F;
    --high-text: #FF8A97;
    --low-text: #8CC6FF;
    --ok-soft: #1E3B2C;
    --bad-soft: #43201C;
    --ok-text: #7BE0A8;
    --bad-text: #FF9A8F;
    --faded-line: #2A2B31;
    --hairline: #2A2B31;
    --accent-text: #FF7A45;
    --footer-bg: #0D0E11;
    --tile-yellow: #3A3216;
    --tile-blue: #1C2E3D;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.5 var(--font-text);
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.thai { font-family: var(--font-thai); line-height: 1.5; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 760px; }

/* Шапка: одна ширина на всех страницах, разделы видны сразу, на телефоне меню */
.site-header { position: relative; z-index: 20; border-bottom: var(--border) solid var(--hairline); background: var(--paper); }
.top { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { font: 800 18px/1 var(--font-head); letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.logo span { color: var(--accent); }
.nav { display: none; }
.nav a { text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink); }
.top-cta { margin-left: auto; }
.btn.btn-sm { min-height: 40px; padding: 0 16px; border-radius: 14px; font-size: 15px; box-shadow: 2px 2px 0 #15161A; }
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -8px;
  border: 0; background: none; color: var(--ink); cursor: pointer;
}
.menu-btn .menu-close { display: none; }
.menu-btn[aria-expanded="true"] .menu-open { display: none; }
.menu-btn[aria-expanded="true"] .menu-close { display: inline; }
.nav.open {
  display: grid; position: absolute; left: 0; right: 0; top: 100%; padding: 8px 16px 16px;
  background: var(--paper); border-bottom: var(--border) solid var(--line);
}
.nav.open a { display: flex; align-items: center; min-height: 52px; font-size: 18px; border-bottom: var(--border) solid var(--hairline); }
.nav.open a:last-child { border-bottom: 0; }
.nav a[aria-current="page"] { color: var(--accent-text); }
@media (min-width: 860px) {
  .nav, .nav.open { display: flex; position: static; padding: 0; border: 0; background: none; gap: 28px; margin-left: 40px; }
  .nav.open a, .nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: 15px; border: 0; }
  .nav a:hover { color: var(--accent-text); }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav .nav-bot { display: none; }
  .menu-btn { display: none; }
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(26px, 7vw, 40px); }
h2 { font-size: 20px; margin: 32px 0 12px; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--muted); font-weight: 600; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 20px;
  border: var(--border) solid var(--line); border-radius: 18px; font: 800 17px/1.2 var(--font-text);
  text-decoration: none; cursor: pointer; color: var(--ink); background: var(--surface);
}
.btn-main {
  background: var(--accent); color: var(--on-accent); border-color: #15161A; box-shadow: 3px 3px 0 #15161A;
  transition: transform .08s, box-shadow .08s;
}
.btn-main:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #15161A; }
.btn-ink { background: #15161A; color: #FFFFFF; border-color: #15161A; }

/* Плитки главной */
.bento {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px;
  grid-template-areas: "hero hero" "word heroes" "train train" "course course" "abc abc";
}
.area-hero { grid-area: hero; } .area-word { grid-area: word; } .area-heroes { grid-area: heroes; }
.area-train { grid-area: train; } .area-course { grid-area: course; } .area-abc { grid-area: abc; }
.tile {
  position: relative; overflow: hidden; display: block; min-height: 150px; padding: 14px;
  border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; color: var(--ink);
}
.hero {
  min-height: 300px; padding: 18px 18px 84px; background: var(--accent); color: #FFFFFF; border-color: #15161A;
  box-shadow: 3px 3px 0 #15161A;
}
.hero h1 { color: #FFFFFF; font-size: clamp(24px, 6.6vw, 34px); max-width: 220px; margin-top: 12px; }
.hero .badge { display: inline-block; background: #FFFFFF; color: #15161A; border: var(--border) solid #15161A; border-radius: 10px; padding: 3px 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hero .sign { display: inline-block; position: relative; margin-top: 12px; background: #FFFFFF; color: #15161A; border: var(--border) solid #15161A; border-radius: 14px; padding: 0 12px; font-size: 36px; transform: rotate(-3deg); }
.hero .hero-art { position: absolute; right: -4px; top: 48px; height: 168px; width: auto; animation: bob 2.6s ease-in-out infinite; }
.hero .go { position: absolute; left: 18px; right: 18px; bottom: 16px; min-height: 48px; border-radius: 16px; background: #15161A; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.tile-yellow { background: var(--tile-yellow); }
.tile-blue { background: var(--tile-blue); }
.tile-ink { background: #15161A; color: #F6F4EF; border-color: #15161A; }
.tile .big-thai { font-size: 40px; font-weight: 700; margin-top: 2px; }
.tile .art { position: absolute; right: -2px; bottom: -4px; height: 84px; width: auto; }
.tile-ink .kicker { color: #F6F4EF; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

.play {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none;
  border-radius: 26px; border: var(--border) solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.play svg { width: 22px; height: 22px; }
.play.playing { background: var(--accent); }

/* Класс буквы: цвет + форма */
.cls { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.cls::before { content: ""; width: 12px; height: 12px; border: var(--border) solid #15161A; flex: none; }
.cls-mid::before { background: var(--mid); border-radius: 50%; }
.cls-low::before { background: var(--low); border-radius: 3px; }
.cls-high::before { background: var(--high); border: 0; width: 14px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.chip { min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); border: var(--border) solid var(--line); }

/* Алфавит */
.grid-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.letter-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 112px;
  border: var(--border) solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; padding: 8px 4px;
}
.letter-cell .thai { font-size: 40px; font-weight: 700; line-height: 1.3; }
.letter-cell small { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; }
.letter-cell .cls { font-size: 0; }

/* Страница буквы */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 800; text-decoration: none; }
.letter-head { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.letter-big {
  font-family: var(--font-thai); font-weight: 700; font-size: 120px; line-height: 1.3; width: 150px; height: 160px; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--surface);
  border: var(--border) solid var(--line); border-radius: var(--radius);
}
.letter-big.mid { color: var(--mid-text); }
.letter-big.high { color: var(--high-text); }
.letter-big.low { color: var(--low-text); }
.letter-name { font-size: 24px; font-weight: 700; line-height: 1.35; }
/* Аватарка буквы: рисунок мнемоники без подписей (рамка 518×518 из картинки 800×800 вокруг круга с рисунком). */
.letter-avatar { position: relative; width: 132px; height: 132px; flex: none; overflow: hidden; border: var(--border) solid var(--line); border-radius: var(--radius); background: #FFFFFF; }
.letter-avatar img { position: absolute; width: 154.44%; max-width: none; height: auto; left: -27.22%; top: -9.27%; }
.letter-name-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.letter-name-row .play { flex: none; }
.letter-aside h1 { font-size: 22px; font-weight: 700; line-height: 1.2; }
.reading { font-weight: 700; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fact { padding: 8px 12px; border: var(--border) solid var(--line); border-radius: 16px; background: var(--surface); }
.fact .kicker { text-transform: none; letter-spacing: 0; font-size: 13px; }
.fact b { display: block; font: 700 20px/1.3 var(--font-head); }
.hint { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-weight: 600; }
.twins { display: flex; flex-wrap: wrap; gap: 8px; }
.twin { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: var(--border) solid var(--line); border-radius: 22px; background: var(--surface); text-decoration: none; font-weight: 700; }
.twin .thai { font-size: 22px; }
.words { display: grid; gap: 8px; }
.word { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border: var(--border) solid var(--line); border-radius: 18px; background: var(--surface); }
.word .thai { font-size: 24px; font-weight: 700; line-height: 1.35; }
.word div { flex: 1; min-width: 0; }
.word small { display: block; font-weight: 700; color: var(--muted); font-size: 14px; }
.word .play { width: 44px; height: 44px; }

/* Мини-проверка: тихо, как тренажёр */
.quiz { margin-top: 12px; padding: 16px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); }
.quiz-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.quiz-top b { font: 800 17px/1.25 var(--font-head); }
.quiz-top span { font-weight: 800; font-size: 13px; color: var(--muted); white-space: nowrap; }
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.option {
  min-height: 60px; border-radius: 16px; border: var(--border) solid var(--line); background: var(--surface);
  color: var(--ink); font: 800 20px/1.2 var(--font-text); cursor: pointer; padding: 4px;
}
.option.thai { font-family: var(--font-thai); font-size: 32px; line-height: 1.3; }
.option.right { background: var(--ok-soft); border-width: 2.5px; }
.option.wrong { background: var(--bad-soft); border-width: 2.5px; text-decoration: line-through; }
.option:disabled { cursor: default; opacity: 1; color: var(--ink); }
.why { margin: 12px 0 0; font-weight: 600; min-height: 24px; }
.quiz-next { margin-top: 12px; }
.quiz-done { font-weight: 700; }
.noscript-note { color: var(--muted); font-size: 14px; }

.cta { margin-top: 28px; padding: 18px; border-radius: var(--radius); background: #15161A; color: #F6F4EF; }
.cta h2 { margin: 0 0 6px; color: #F6F4EF; }
.cta p { color: #C9C6BD; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.pager a { flex: 1; }
.pager .thai { font-size: 22px; }

/* Подвал: тёмная полоса во всю ширину, в обеих темах */
.site-footer { margin-top: 64px; background: var(--footer-bg); color: var(--footer-ink); }
.site-footer .logo { color: var(--footer-ink); }
.footer-grid { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; display: grid; gap: 14px; justify-items: start; }
.footer-brand p { margin: 0; color: var(--footer-muted); font-weight: 600; max-width: 420px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--footer-muted); margin-bottom: 4px; }
.footer-col a { color: var(--footer-ink); text-decoration: none; font-weight: 700; }
.footer-col a:hover { color: var(--accent); }
.footer-letters { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-letters a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: var(--border) solid var(--footer-line); border-radius: 12px; font-size: 22px; }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; padding-bottom: 28px; color: var(--footer-muted); font-size: 14px; font-weight: 600; }
.footer-bottom::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; border-top: var(--border) solid var(--footer-line); }
.footer-bottom a { color: var(--footer-muted); }
@media (min-width: 860px) {
  .footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); padding-top: 56px; }
  .footer-brand { grid-column: auto; }
}
.seo-text { margin-top: 28px; }
.seo-text p { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* Тренажёр на главной */
.tile-train .tile-title { font: 800 22px/1.15 var(--font-head); letter-spacing: -0.02em; margin-top: 6px; }
.train-demo { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.train-demo .thai { font-size: 44px; font-weight: 700; line-height: 1.3; }
.train-demo .picks { display: grid; gap: 6px; }
.train-demo .picks span { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 112px; min-height: 32px; padding: 0 10px; border: var(--border) solid var(--line); border-radius: 10px; font-weight: 800; font-size: 15px; background: var(--surface); }
.train-demo .picks .ok { background: var(--ok-soft); }

/* Тренажёр «Как читается?»: тихий стиль */
.wrap-trainer { max-width: 600px; }
.trainer { padding-bottom: 32px; }
.tr-top { display: flex; align-items: center; gap: 12px; height: 64px; }
.tr-close { width: 44px; height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: var(--ink); flex: none; }
.tr-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--surface); border: var(--border) solid var(--line); overflow: hidden; }
.tr-bar div { width: 0; height: 100%; background: var(--accent); transition: width .3s; }
.tr-count { font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; min-width: 52px; text-align: right; }
.tr-prompt { font-weight: 700; font-size: 15px; color: var(--muted); margin-top: 4px; }
.tr-card {
  position: relative; margin-top: 10px; min-height: 196px; padding: 16px 16px 52px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  border-radius: 28px; background: var(--surface); border: var(--border) solid var(--line);
}
.tr-word { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.tr-xl { font-size: 100px; } .tr-l { font-size: 76px; } .tr-m { font-size: 54px; } .tr-s { font-size: 36px; }
.tr-first.mid { color: var(--mid-text); } .tr-first.high { color: var(--high-text); } .tr-first.low { color: var(--low-text); }
@media (max-width: 719px) {
  /* После ответа на телефоне слово меньше, а лишние варианты прячутся: рядом помещаются ответ и «почему». */
  .tr-card.small { min-height: 0; padding: 8px 16px 48px; }
  .has-sheet .tr-opt.faded, .has-sheet .tr-legend { display: none; }
  .tr-card.small .tr-xl { font-size: 64px; } .tr-card.small .tr-l { font-size: 52px; }
  .tr-card.small .tr-m { font-size: 40px; } .tr-card.small .tr-s { font-size: 30px; }
}
.tr-chip { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 15px; background: var(--surface-2); }
.tr-play { position: absolute; right: 12px; top: 12px; }
.tr-options { display: grid; gap: 10px; margin-top: 16px; }
.tr-opt {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 18px; text-align: left; cursor: pointer;
  border-radius: 18px; border: var(--border) solid var(--line); background: var(--surface); color: var(--ink);
  font: 800 22px/1.2 var(--font-text); transition: background .15s, border-color .15s;
}
.tr-opt:active { transform: scale(.98); }
.tr-opt kbd { display: none; }
.tr-long .tr-opt { font-size: 18px; }
.tr-label { flex: 1; }
.tr-mark { font-size: 18px; }
.tr-opt.right { background: var(--ok-soft); border-width: 2.5px; }
.tr-opt.wrong { background: var(--bad-soft); border-width: 2.5px; }
.tr-opt.faded { background: transparent; border-color: var(--faded-line); color: var(--muted); }
.tr-opt:disabled { cursor: default; transform: none; }
.tr-legend { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.tr-sheet {
  margin-top: 16px; padding: 16px; border: var(--border) solid var(--line); border-radius: 28px; background: var(--surface);
  animation: rise .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.tr-sheet-head { display: flex; gap: 12px; align-items: center; }
.tr-hero { flex: none; }
.tr-hero img { width: 64px; height: 64px; border-radius: 14px; border: var(--border) solid var(--line); background: #FFFFFF; }
.tr-verdict { font: 800 20px/1.2 var(--font-head); }
.tr-verdict.ok { color: var(--ok-text); }
.tr-verdict.bad { color: var(--bad-text); }
.tr-meaning { font-weight: 700; margin-top: 2px; }
.tr-why { margin-top: 10px; font-size: 15px; line-height: 1.45; font-weight: 600; }
.tr-why p { margin: 0 0 4px; }
.tr-why a { font-family: var(--font-thai); font-weight: 700; }
.cls-dot { gap: 0; margin: 0 4px 0 1px; vertical-align: -1px; }
.tr-next { width: 100%; margin-top: 14px; }
.tr-done h1 { margin-top: 6px; }
.tr-done .lead { margin-top: 10px; }
.tr-actions { display: grid; gap: 10px; margin-top: 16px; }
.tr-mistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-mistakes li { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; border: var(--border) solid var(--line); border-radius: 16px; background: var(--surface); }
.tr-mistakes .thai { font-size: 26px; font-weight: 700; }
.tr-mistakes small { font-weight: 700; color: var(--muted); font-size: 14px; }

/* Начало тренажёра: выбор урока и тоны */
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.level { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; border: var(--border) solid var(--line); border-radius: 20px; background: var(--surface); text-decoration: none; }
.level-num { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font: 800 16px/1 var(--font-head); transition: background .15s; }
.level:hover .level-num, .level:focus-visible .level-num { background: var(--accent); color: var(--on-accent); }
.level-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.level-text .thai { color: var(--muted); font-weight: 600; font-size: 15px; line-height: 1.5; }
.tones { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tones li { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.tone-line { width: 48px; height: 24px; flex: none; color: var(--accent); }

@media (min-width: 720px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "hero hero hero hero" "word heroes train train" "course course abc abc";
  }
  .tr-card { min-height: 250px; }
  .tr-xl { font-size: 124px; } .tr-l { font-size: 92px; } .tr-m { font-size: 64px; } .tr-s { font-size: 40px; }
  .tr-options:not(.tr-long) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-actions { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .tr-opt kbd {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none;
    border: var(--border) solid var(--faded-line); border-radius: 7px; font: 700 12px/1 var(--font-text); color: var(--muted);
  }
  .tr-opt:not(:disabled):hover { background: var(--surface-2); }
}
@media (min-width: 960px) {
  .wrap-wide { max-width: 1080px; }
  .bento { grid-template-areas: "hero hero word heroes" "hero hero train train" "course course abc abc"; }
  .hero { min-height: 360px; }
  .hero h1 { max-width: 320px; font-size: 40px; }
  .hero .hero-art { height: 220px; top: 56px; right: 8px; }
  .trainer-start { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .trainer-start aside { position: sticky; top: 16px; }
  .letter-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 8px; }
  .letter-aside h1 { font-size: 26px; }
  .letter-avatar { width: 168px; height: 168px; }
  .letter-main > .facts:first-child { margin-top: 0; }
}

/* Разделы главной и страниц курса и тренажёров */
.wrap > main { padding-top: 12px; }
.home-section { margin-top: 64px; }
.section-head { display: grid; gap: 6px; margin-bottom: 20px; max-width: 680px; }
.section-head h2, .page-head h1 { margin: 0; text-wrap: balance; }
.section-head h2 { font-size: clamp(24px, 5vw, 34px); }
.section-head .lead { margin: 6px 0 0; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; max-width: none; }
.btn.btn-sm-plain { min-height: 44px; font-size: 15px; padding: 0 16px; border-radius: 14px; }
.text-link { font-weight: 800; color: var(--accent-text); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 24px; border-top: var(--border) solid var(--line); border-bottom: var(--border) solid var(--line); }
.stats div { display: grid; gap: 2px; padding: 16px 12px 16px 0; }
.stats div:nth-child(n+3) { border-top: var(--border) solid var(--hairline); }
.stats b { font: 800 34px/1.1 var(--font-head); letter-spacing: -0.02em; }
.stats span { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.35; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { position: relative; padding: 18px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.steps h3 { font-size: 19px; }
.steps p { margin: 0; color: var(--muted); font-weight: 600; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: var(--border) solid #15161A; font: 800 16px/1 var(--font-head); }
.step-letters { display: flex; flex-wrap: wrap; gap: 6px; }
.step-letters a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); text-decoration: none; font-size: 24px; font-weight: 700; }
.step-letters .mid, .trainer-glyphs .mid { color: var(--mid-text); }
.step-letters .high, .trainer-glyphs .high { color: var(--high-text); }
.step-letters .low, .trainer-glyphs .low { color: var(--low-text); }

.heroes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-card { display: grid; border: var(--border) solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); text-decoration: none; transition: transform .15s; }
.hero-card:hover { transform: translateY(-2px); }
@media (max-width: 719px) { .hero-card:nth-child(n+7) { display: none; } }
.hero-card img { width: 100%; height: auto; aspect-ratio: 1; background: #FFFFFF; border-bottom: var(--border) solid var(--line); }
.hero-card-text { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-weight: 800; line-height: 1.2; }
.hero-card-text .thai { font-size: 30px; }
.hero-card-text small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }

.tone-cards { display: grid; gap: 10px; }
.tone-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "line line" "thai thai" "read read" "mean mean" "foot foot"; gap: 2px; padding: 16px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tone-card .tone-line { grid-area: line; width: 72px; height: 36px; }
.tone-card .thai { grid-area: thai; font-size: 48px; font-weight: 700; line-height: 1.4; }
.tone-card b { grid-area: read; font-size: 20px; }
.tone-meaning { grid-area: mean; font-weight: 600; color: var(--muted); }
.tone-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tone-foot small { font-weight: 800; color: var(--accent-text); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.tone-how { display: grid; gap: 12px; margin-top: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface-2); }
.tone-how p { margin: 0; font-weight: 600; }
.tone-how .btn { justify-self: start; }

.course-band { padding: 24px 18px; border-radius: 28px; border: var(--border) solid var(--footer-line); background: var(--footer-bg); color: var(--footer-ink); display: grid; gap: 24px; }
.course-band h2 { color: var(--footer-ink); font-size: clamp(24px, 5vw, 34px); margin: 6px 0 12px; text-wrap: balance; }
.course-band .kicker { color: var(--accent); }
.course-band p { color: var(--footer-muted); font-weight: 600; }
.course-band-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-ghost { background: transparent; color: var(--footer-ink); border-color: var(--footer-line); }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.lesson-list a { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--footer-ink); text-decoration: none; font-weight: 700; border-bottom: var(--border) solid var(--footer-line); }
.lesson-list a:hover { color: var(--accent); }
.lesson-list span { display: inline-flex; width: 28px; font: 800 14px/1 var(--font-head); color: var(--footer-muted); }

.faq-list { display: grid; gap: 0; border-top: var(--border) solid var(--line); }
.faq-list details { border-bottom: var(--border) solid var(--line); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 12px 0; cursor: pointer; font-weight: 800; font-size: 17px; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font: 700 24px/1 var(--font-text); color: var(--accent-text); flex: none; transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin: 0 0 16px; max-width: 680px; font-weight: 600; color: var(--muted); }

.page-head { display: grid; gap: 10px; margin-top: 16px; max-width: 760px; }
.page-head .lead { margin: 0; }
.facts-row { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts-row li { padding: 6px 12px; border: var(--border) solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.course-lessons { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.course-lesson { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 18px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 16px; }
.course-lesson:target { box-shadow: 3px 3px 0 var(--accent); }
.course-lesson-num { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font: 800 18px/1 var(--font-head); }
.course-lesson h2 { margin: 6px 0 6px; font-size: 21px; }
.course-lesson-body > p { margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.course-letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.course-letters .twin { min-height: 40px; padding: 0 10px; gap: 6px; }
.course-letters .cls::before { width: 10px; height: 10px; }
.course-letters .cls-high::before { width: 12px; }
.course-rule summary { cursor: pointer; font-weight: 800; color: var(--accent-text); min-height: 32px; }
.rule-text { white-space: pre-line; margin: 8px 0; font-weight: 600; }
.syllables { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.syllables small { font-family: var(--font-text); font-size: 14px; color: var(--muted); }
.course-lesson-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: var(--border) solid var(--hairline); }
.course-lesson-foot small { color: var(--muted); font-weight: 700; font-size: 14px; }

.group-title { margin-top: 36px; }
.trainer-cards { display: grid; gap: 12px; }
.trainer-card { display: grid; gap: 8px; align-content: start; padding: 18px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.trainer-card h3 { font-size: 20px; }
.trainer-card p { margin: 0; color: var(--muted); font-weight: 600; }
.trainer-card-main { box-shadow: 3px 3px 0 var(--line); }
.trainer-glyphs { display: flex; gap: 12px; font-size: 44px; font-weight: 700; line-height: 1.3; }
.trainer-cards-bot .trainer-card { background: var(--surface-2); }
.trainer-tones { display: flex; gap: 6px; height: 60px; align-items: center; }
.trainer-tones .tone-line { width: 40px; height: 20px; }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats div:nth-child(n+3) { border-top: 0; }
  .stats div + div { padding-left: 16px; border-left: var(--border) solid var(--hairline); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .heroes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tone-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tone-how { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .trainer-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trainer-cards-bot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .heroes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .course-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding: 40px; align-items: center; }
  .course-lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trainer-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Четвёртая карточка на всю ширину: картинка слева, текст справа, без пустой клетки. */
  .trainer-card-wide { grid-column: 1 / -1; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; align-items: center; }
  .trainer-card-wide > .trainer-glyphs { grid-row: 1 / span 3; }
}

/* Тренажёр «Тоны на слух» */
.tn-card { flex-direction: column; gap: 4px; padding-bottom: 16px; }
.tn-listen {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 132px; height: 132px; border-radius: 50%; cursor: pointer;
  border: var(--border) solid #15161A; background: var(--accent); color: var(--on-accent);
  font: 800 15px/1 var(--font-text); box-shadow: 0 4px 0 #15161A;
}
.tn-listen svg { width: 44px; height: 44px; }
.tn-listen:active { transform: translateY(3px); box-shadow: 0 1px 0 #15161A; }
.tn-listen:not(.heard) { animation: tn-pulse 1.8s ease-in-out infinite; }
.tn-listen.playing { animation: none; }
@keyframes tn-pulse { 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .tn-listen:not(.heard) { animation: none; } }
.tn-word { font-size: 64px; }
.tn-reading { font: 800 22px/1.2 var(--font-text); color: var(--muted); }
.tn-card.small { min-height: 0; padding: 12px 16px 16px; }
.tn-opt .tone-line { width: 44px; height: 22px; }
.tn-opt.faded .tone-line { color: var(--muted); }
.tn-sign { font-size: 22px; color: var(--muted); min-width: 14px; }
.tone-example { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.tone-example .thai { font-size: 20px; font-weight: 700; }
.tone-example .play { width: 36px; height: 36px; }
.tr-mistakes li .play { margin-left: auto; width: 36px; height: 36px; align-self: center; }

/* «Продолжить»: прогресс из этого браузера */
.resume { display: grid; gap: 12px; margin: 4px 0 20px; padding: 18px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 3px 3px 0 var(--line); }
.resume[hidden] { display: none; }
.resume-main h2 { margin-top: 4px; font-size: 24px; }
.resume-main p { margin: 4px 0 12px; color: var(--muted); font-weight: 600; }
.resume-main .btn { width: 100%; }
.resume-more { display: grid; gap: 8px; }
.resume-link { display: grid; gap: 2px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); text-decoration: none; }
.resume-link small { color: var(--muted); font-weight: 600; }
.resume-days { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.level-best { flex: none; padding: 4px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 800; font-size: 14px; color: var(--muted); }
.level-best.pass { background: var(--ok-soft); color: var(--ok-text); }
.letter-cell { position: relative; }
.letter-cell.seen::after { content: "✓"; position: absolute; top: 6px; right: 10px; font-weight: 800; font-size: 14px; color: var(--ok-text); }
@media (min-width: 720px) {
  .resume { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 12px 32px; padding: 24px; }
  .resume-main .btn { width: auto; min-width: 220px; }
  .resume-days { grid-column: 1 / -1; }
}

/* Вход через Telegram и кабинет */
.top-login { display: none; }
@media (min-width: 860px) {
  .top-login {
    display: inline-flex; align-items: center; min-height: 44px; margin-left: auto;
    font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink);
  }
  .top-login:hover { color: var(--accent-text); }
  .top-login + .top-cta { margin-left: 0; }
}
.account { display: grid; gap: 14px; margin: 24px 0 48px; max-width: 560px; }
.account h1 { margin-top: -6px; }
.account .lead { margin: 0; }
.account form { margin: 0; }
.account-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: var(--border) solid var(--hairline); }
.account-card h2 { margin: 4px 0 6px; }
.account-card p { margin: 0; color: var(--muted); font-weight: 600; }
.account-grid { display: grid; gap: 10px; }
@media (min-width: 600px) { .account-grid { grid-template-columns: 1fr 1fr; } }
.account-error { margin: 0; padding: 14px 16px; border-radius: 20px; background: var(--surface-2); border-left: 4px solid var(--accent); font-weight: 700; }
.account-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 17px; }
.account-wait { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); font-weight: 700; }
.account-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: account-pulse 1.4s ease-in-out infinite; }
@keyframes account-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .account-dot { animation: none; } }
.account-note { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.account-logout { justify-self: start; }
.btn-link {
  min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 700 15px/1.2 var(--font-text); color: var(--muted); text-decoration: underline;
}
.account-number { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--radius); border: var(--border) solid var(--line); background: var(--surface); }
.account-number span { font-weight: 700; color: var(--muted); }
.account-number b { font: 800 44px/1 var(--font-head); letter-spacing: 0.04em; }
.account-wide { max-width: 640px; }
.course-card h2 { font-size: 26px; }
.course-meter { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 12px 0; }
.course-meter span { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--hairline); }
.course-meter span.on { background: var(--accent); border-color: #15161A; }
.course-card p + p { margin-top: 8px; }
.course-next { color: var(--ink) !important; }
.course-next .thai { font-size: 18px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: var(--border) solid var(--hairline); }
.stat dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat dd { margin: 4px 0 0; font: 800 26px/1.1 var(--font-head); }
.stat dd small { font: 700 14px/1 var(--font-text); color: var(--muted); }
.account-plan h2 { font-size: 18px; }
.site-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.site-results li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; border-bottom: var(--border) solid var(--hairline); }
.site-results li:last-child { border-bottom: 0; }
.site-results a { font-weight: 800; color: var(--ink); }
.site-results span { color: var(--muted); font-weight: 600; font-size: 15px; text-align: right; }
.site-results b { color: var(--ink); }
.site-card p { margin-top: 8px !important; }

/* Урок курса по шагам: страница урока и сам урок */
.back-link { display: inline-block; margin-bottom: 10px; }
.lesson-intro { max-width: 680px; font-weight: 600; color: var(--muted); }
.lesson-intro p { margin: 0 0 10px; }
.lesson-parts { margin-top: 24px; }
.lesson-parts .hint { margin: 6px 0 14px; }
.lesson-parts .level-text > span { color: var(--muted); font-weight: 600; font-size: 14px; }
.level.done .level-num { background: var(--ok); color: #15161A; }
.lesson-parts .page-actions { margin-top: 16px; }
.lesson-saved { font-size: 14px; }
.course-progress { color: var(--ok-text); }
.course-progress:not(:empty)::before { content: "· "; color: var(--muted); }
.course-links { display: flex; gap: 16px; }
/* Урок по шагам: плитки как на главной. Нажимаемое с жёсткой тенью, тайское крупно, тон линией. */
.lesson-player { --press: #15161A; --tile-line: var(--ink); }
@media (prefers-color-scheme: dark) { .lesson-player { --press: #8A2E0C; } }
.lp-bar { flex: 1; display: flex; gap: 4px; }
.lp-bar i { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); transition: background .25s; }
.lp-bar i.on { background: var(--accent); }
.lesson-player .tr-count { min-width: 40px; font-family: var(--font-head); font-size: 13px; font-weight: 800; }
.lp-step { margin-top: 4px; }
.lp-kicker { font: 800 12px/1.3 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.lp-title { font: 800 28px/1.12 var(--font-head); letter-spacing: -.01em; margin: 0 0 14px; }
.lp-text { font-size: 17px; line-height: 1.5; font-weight: 500; }
.lp-text p { margin: 0 0 14px; }
.lp-text .thai { font-size: 1.15em; font-weight: 700; }
.lp-examples { display: grid; gap: 12px; margin: 0 0 18px; }
.lp-examples p { margin: 0; }
.lp-ex {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head play" "about play"; align-items: center; gap: 0 12px;
  width: 100%; padding: 10px 12px 12px 16px; text-align: left; cursor: pointer; color: var(--ink); font: inherit;
  border: 2px solid var(--tile-line); border-radius: 20px; background: var(--surface); box-shadow: 4px 4px 0 var(--tile-line);
  transition: transform .08s, box-shadow .08s, border-color .15s;
}
.lp-ex:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--tile-line); }
.lp-ex.playing { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }
.lp-ex:disabled { cursor: default; }
.lp-ex-head { grid-area: head; display: flex; align-items: center; gap: 12px; }
.lp-ex-head .cls-dot { margin: 0; }
.lp-text .lp-ex-thai { font-size: 38px; font-weight: 700; line-height: 1.35; }
.lp-ex .tone-line { width: 60px; height: 30px; color: var(--accent); }
.lp-ex-about { grid-area: about; font-size: 15px; font-weight: 700; color: var(--muted); }
.lp-ex-about .thai { font-size: 1em; }
.lp-ex-play { grid-area: play; width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center; background: var(--accent); color: #15161A; }
.lp-ex-play svg { width: 22px; height: 22px; }
.lp-rows { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.lp-rows li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: var(--border) solid var(--hairline); font-size: 16px; font-weight: 600; line-height: 1.4; }
.lp-rows .tone-line { width: 44px; height: 22px; color: var(--accent); }
.lp-note { margin: 0 0 16px; padding: 14px 16px; border-radius: 18px; background: var(--tile-yellow); }
.lp-note b { display: block; font: 800 12px var(--font-head); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.lp-note p { margin: 0; font-weight: 600; }
.lp-rule .lp-text { padding: 16px 18px 2px; border: 2px solid var(--tile-line); border-radius: 22px; background: var(--surface); box-shadow: 4px 4px 0 var(--accent); }
.lp-listens { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.play.lp-listen { width: auto; padding: 0 18px 0 14px; gap: 8px; border: 2px solid var(--tile-line); box-shadow: 3px 3px 0 var(--tile-line); background: var(--surface); }
.lp-listen .thai { font-size: 22px; font-weight: 700; }
/* Карточка буквы: картинка, снизу полоса цвета класса с названием класса и звуком */
.lp-card { overflow: hidden; margin-bottom: 14px; border: 2px solid var(--tile-line); border-radius: 28px; background: #FFFFFF; box-shadow: 5px 5px 0 var(--tile-line); }
.lp-card-pic { display: flex; align-items: center; justify-content: center; min-height: 160px; background: #FFFFFF; }
.lp-card-pic img { width: 100%; height: auto; }
.lp-glyph { font-size: 96px; font-weight: 700; color: #15161A; }
.lp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-top: 2px solid var(--tile-line); background: var(--surface-2); color: var(--ink); }
.lp-card-mid .lp-card-foot { background: var(--mid); color: #15161A; }
.lp-card-high .lp-card-foot { background: var(--high); color: #15161A; }
.lp-card-low .lp-card-foot { background: var(--low); color: #15161A; }
.lp-card-cls { display: flex; align-items: center; gap: 8px; font: 800 13px var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.lp-card-cls .thai { font-size: 26px; text-transform: none; letter-spacing: 0; }
.lp-card-cls .cls-dot { margin: 0; }
.lp-card-foot .play { width: 46px; height: 46px; background: #15161A; color: #FFFFFF; border-color: #15161A; }
.lp-card-foot .play.playing { background: var(--accent); color: #15161A; }
.lp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.lp-fact { padding: 10px 14px 12px; border-radius: 16px; background: var(--surface); border: var(--border) solid var(--hairline); min-width: 0; }
.lp-fact.wide { grid-column: span 2; }
.lp-fact small { display: block; font: 800 11px/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.lp-fact b { font-size: 17px; line-height: 1.4; }
.lp-fact .thai { font-size: 1.15em; }
/* Вопрос: тайское отдельной крупной строкой, варианты как клавиши */
.lp-question { font: 800 22px/1.3 var(--font-head); margin: 0 0 18px; }
.lp-question .thai { font-family: var(--font-thai); font-size: 1.2em; }
.lp-question .lp-question-thai { display: block; font-size: 64px; line-height: 1.3; margin-top: 4px; }
.lesson-player .lp-lone { font-size: 1.8em; line-height: 1; vertical-align: -0.15em; }
.lp-question-pre { font: 700 16px/1.3 var(--font-text); color: var(--muted); margin-bottom: 10px; }
.lp-question-pre .thai { display: block; font-size: 48px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.lp-step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 10px; border-radius: 16px; background: var(--accent); color: #15161A; font-size: 16px; vertical-align: 2px; }
.lp-big-play { width: 76px; height: 76px; border-radius: 38px; margin: 0 auto 8px; display: flex; border: 2px solid var(--tile-line); box-shadow: 4px 4px 0 var(--tile-line); background: var(--accent); color: #15161A; }
.lp-big-play svg { width: 32px; height: 32px; }
.lp-options { gap: 12px; }
.lp-options.lp-two { grid-template-columns: 1fr 1fr; }
.lp-options .tr-opt { min-height: 68px; border: 2px solid var(--tile-line); box-shadow: 0 4px 0 var(--tile-line); transition: transform .08s, box-shadow .08s, background .15s; }
.lp-options.lp-two .tr-opt { justify-content: center; text-align: center; padding: 0 12px; }
.lp-options.lp-two .tr-label { flex: none; }
.lp-options.lp-two .tr-mark { display: none; }
.lp-options .tr-opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--tile-line); }
.lp-options .tr-opt.right { background: var(--ok); color: #15161A; border-color: #15161A; box-shadow: 0 4px 0 #1F8A5B; }
.lp-options .tr-opt.wrong { background: var(--bad); color: #15161A; border-color: #15161A; box-shadow: 0 4px 0 #C8372D; }
.lp-options .tr-opt.faded { border-color: var(--faded-line); box-shadow: 0 4px 0 var(--faded-line); }
.lp-tone-opt { display: flex; align-items: center; gap: 14px; }
.lp-tone-opt .tone-line { width: 44px; height: 22px; color: var(--accent); }
.tr-opt.right .lp-tone-opt .tone-line, .tr-opt.wrong .lp-tone-opt .tone-line { color: #15161A; }
.lp-thai-options .tr-label.thai { font-size: 32px; font-weight: 700; }
.lp-sheet { margin-top: 20px; border-width: 2px; }
.lp-sheet.ok { background: var(--ok-soft); border-color: var(--ok); }
.lp-sheet.bad { background: var(--bad-soft); border-color: var(--bad); }
.lp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lp-sheet .tr-verdict { font-size: 24px; }
.lp-sheet .lp-after { width: 46px; height: 46px; background: #15161A; color: #FFFFFF; border-color: #15161A; }
.lp-right { margin: 6px 0 0; font-weight: 700; }
.lp-right .thai { font-size: 1.2em; }
.lp-sheet .lp-text { font-size: 16px; }
.lp-sheet .lp-text p:last-child { margin-bottom: 0; }
.lp-streak { margin: 8px 0 0; font: 800 13px var(--font-head); color: var(--ok-text); }
.lp-sheet.ok .btn-main { background: var(--ok); --press: #1F8A5B; }
/* Кнопки «Дальше»: на длинном шаге остаются у пальца внизу экрана */
.lp-nav { display: flex; gap: 10px; margin-top: 18px; }
.lp-step > .lp-nav { position: sticky; bottom: 0; z-index: 2; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--paper) 30%); }
.lp-nav .lp-next { flex: 1; }
.lesson-player .btn-main { border: 2px solid #15161A; box-shadow: 0 5px 0 var(--press); font-family: var(--font-head); font-size: 17px; }
.lesson-player .btn-main:active { transform: translateY(5px); box-shadow: 0 0 0 var(--press); }
.lp-nav .lp-back { width: 56px; padding: 0; flex: none; }
.lp-score { display: inline-flex; flex-direction: column; margin: 4px 0 14px; padding: 14px 20px; border-radius: 22px; background: var(--ok); color: #15161A; border: 2px solid #15161A; box-shadow: 4px 4px 0 var(--tile-line); }
.lp-score.weak { background: var(--tile-yellow); color: var(--ink); }
.lp-score b { font: 800 34px/1.1 var(--font-head); }
.lp-score span { font-weight: 700; font-size: 14px; }
.lp-done p { margin: 10px 0 0; }
.lp-done .cta { margin-top: 24px; }
.lp-done .cta .btn + .btn { margin-top: 10px; }

/* «Повторение» букв и слогов (/povtorenie/): после ответа короткая карточка, как в боте. */
.review-player .rv-card { margin-top: 16px; }
.review-player .rv-card .lp-card-pic img { display: block; max-width: 280px; margin: 0 auto; }
.rv-again { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.rv-from { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.rv-more { display: inline-block; margin-bottom: 6px; font-weight: 800; color: var(--ink); }
.review-player .lp-sheet + .lp-facts { margin-top: 16px; }


/* «Учиться» (/uchitsya/): слова на сегодня по плану дня бота. */
.daily-player.dl-busy .tr-stage { opacity: .6; pointer-events: none; transition: opacity .2s .15s; }
.dl-blocks li { justify-content: space-between; }
.dl-blocks li span { color: var(--muted); font-weight: 700; font-size: 15px; }
.dl-blocks li.done span { color: var(--ok-text); }
.dl-blocks .dl-letters { background: transparent; border-style: dashed; }
.dl-about, .dl-hint { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--muted); }
.dl-hint .thai { font-size: 1.2em; font-weight: 700; color: var(--ink); }
.dl-card { position: relative; display: grid; gap: 4px; padding: 18px 70px 18px 20px; margin-bottom: 14px; border: 2px solid var(--tile-line); border-radius: 22px; background: var(--surface); box-shadow: 4px 4px 0 var(--tile-line); }
.dl-card-thai { font-size: 56px; font-weight: 700; line-height: 1.3; }
.dl-card .dl-ru { font-size: 20px; font-weight: 700; }
.dl-card-play { position: absolute; right: 12px; top: 12px; }
.dl-answer { margin-top: 4px; }
.dl-reading { font-weight: 700; color: var(--muted); }
.dl-question-ru { display: block; margin-top: 8px; font-size: 28px; }
.dl-sentence { display: block; margin-top: 8px; font-size: 32px; line-height: 1.45; }
.dl-sentence-ru { display: block; margin-top: 6px; font: 600 16px/1.4 var(--font-text); color: var(--muted); }
.dl-listen { margin: -6px 0 6px; }
.dl-tone-ru { margin: -8px 0 10px; font-weight: 700; }
.dl-word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 0; font-weight: 700; }
.dl-word .thai { font-size: 28px; }
.dl-word .dl-ru { font-weight: 600; }
.dl-example .thai { font-size: 22px; }
.dl-tone { display: flex; align-items: center; gap: 10px; }
.dl-tone .tone-line { width: 44px; height: 22px; color: var(--ink); }
.tr-why > b { display: block; font: 800 12px/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.dl-counts .lp-fact b { font: 800 26px/1.2 var(--font-head); }
.dl-stack { flex-direction: column; }
.dl-nav .btn { flex: 1; }

/* Словарь (/slovar/): список с поиском и страница слова, разбор как на карточке слова в боте */
.dict-search { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; padding: 0 16px; min-height: 56px; border: var(--border) solid var(--line); border-radius: 18px; background: var(--surface); }
.dict-search svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.dict-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 600 17px/1.3 var(--font-text); outline: none; }
.dict-search:focus-within { box-shadow: 3px 3px 0 var(--line); }
.dict-empty { margin-top: 16px; font-weight: 600; color: var(--muted); }
.dict-count { font: 700 15px/1 var(--font-text); color: var(--muted); margin-left: 4px; }
.dict-list { display: grid; gap: 0; border-top: var(--border) solid var(--hairline); }
.dict-row { display: flex; align-items: center; gap: 12px; border-bottom: var(--border) solid var(--hairline); }
.dict-row a { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; align-items: baseline; padding: 10px 0; text-decoration: none; }
.dict-row .thai { font-size: 22px; font-weight: 700; line-height: 1.4; }
.dict-row small { grid-row: 2; font-weight: 700; color: var(--muted); font-size: 14px; }
.dict-meaning { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 600; }
.dict-row .play { width: 40px; height: 40px; }
.dict-row .play svg { width: 18px; height: 18px; }
.dict-row a:hover .thai { color: var(--accent-text); }
.word-card { margin-top: 8px; padding: 20px; border: var(--border) solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 4px 4px 0 var(--line); }
.word-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.word-thai { font-size: clamp(40px, 12vw, 64px); font-weight: 700; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere; }
.word-reading { font: 700 22px/1.3 var(--font-text); }
.word-meaning { margin-top: 2px; font-weight: 700; font-size: 18px; color: var(--muted); }
.word-card .play { background: var(--accent); color: var(--on-accent); border-color: #15161A; }
.word-photo { width: 100%; margin-top: 16px; border-radius: var(--radius-sm); aspect-ratio: 3 / 2; object-fit: cover; }
.word-h { margin: 28px 0 10px; font-family: var(--font-text); }
.word-parts { display: flex; align-items: center; gap: 8px; }
.word-part { flex: 1; min-width: 0; padding: 10px 14px; border: var(--border) solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; }
.word-part .thai { display: block; font-size: 28px; font-weight: 700; line-height: 1.4; }
.word-part small { font-weight: 700; color: var(--muted); font-size: 14px; }
.word-plus { font: 800 22px/1 var(--font-head); }
.word-syllables { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.syllable { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: var(--border) solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.syllable .thai { font-size: 30px; font-weight: 700; line-height: 1.4; }
.syllable b { font-size: 17px; }
.syllable small { font-weight: 700; color: var(--muted); font-size: 13px; }
.word-why { padding: 6px 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.word-why p { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: baseline; margin: 0; padding: 10px 0; font-weight: 600; }
.word-why p + p { border-top: var(--border) solid var(--hairline); }
.word-why .thai { font-size: 22px; font-weight: 700; }
.word-lesson { margin-top: 24px; padding: 18px; border-radius: var(--radius); background: var(--tile-yellow); }
.word-lesson p { font-weight: 700; font-size: 17px; }
.word-lesson .btn { display: inline-flex; min-height: 48px; }
a.word { text-decoration: none; }
.word-actions { display: grid; gap: 10px; margin-top: 28px; }
@media (min-width: 720px) {
  .dict-row a { grid-template-columns: 180px 160px minmax(0, 1fr); }
  .dict-row small { grid-row: 1; grid-column: 2; }
  .dict-meaning { grid-row: 1; grid-column: 3; }
}
.dict-row[hidden], [data-dict-section][hidden] { display: none; }
.dict-searching .dict-count { display: none; }
/* «Мои слова» (/slovar/moi/, только для вошедших) */
.dict-mine { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border: var(--border) solid var(--line); border-radius: 18px; background: var(--surface); text-decoration: none; }
.dict-mine b { display: block; font: 800 17px/1.3 var(--font-head); }
.dict-mine small { font-weight: 700; color: var(--muted); font-size: 14px; }
.dict-row a.is-mine .thai::after { content: "✓"; margin-left: 8px; font: 800 15px/1 var(--font-text); color: var(--ok-text); vertical-align: middle; }
.dict-own { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; align-items: baseline; padding: 10px 0; }
.my-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.word-mine { color: var(--ok-text); }
.word-note { margin: 0; font-weight: 600; color: var(--muted); font-size: 14px; }
.word-lesson-done { background: var(--ok-soft); }
.word-lesson-done p { margin: 0; }
@media (min-width: 720px) {
  .dict-own { grid-template-columns: 180px 160px minmax(0, 1fr); }
  .dict-own small { grid-row: 1; grid-column: 2; }
}
