/* ═══════════════════════════════════════════════════════════════════
   Guitar VK App 2.0 — глобальная обёртка и экраны вне «Дома»
   Метафора: ежедневник — книга о гитаре. Тёплый домашний вайб.
   Токены — docs/design-system.md §10, движения — docs/motion-spec.md.
   Старые v1-имена токенов замаплены на новые для совместимости.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* дерево */
  --wood-900: #16110d;
  --wood-800: #1c1612;
  --wood-700: #251d17;
  --wood-600: #2e241c;
  --wood-500: #382c22;
  --bg: var(--wood-800);
  --surface-1: var(--wood-700);
  --surface-2: var(--wood-600);
  --surface-3: var(--wood-500);
  --line-soft: #2f251e;
  --line: #4a3a2e;
  --line-strong: #8a735c;

  /* бумага */
  --paper: #ecdfc8;
  --paper-edge: #d9c8aa;
  --paper-shade: #c9b594;
  --ink: #2e2218;
  --ink-2: #6b5640;
  --ink-honey: #7f5218;
  --ink-red: #9a3b26;

  /* текст */
  --text: #f1e6d6;
  --text-2: #c4b39c;
  --text-3: #9a8773;

  /* мёд */
  --honey: #e2a24c;
  --honey-light: #f0b867;
  --honey-deep: #b87a2e;
  --honey-bg: #3a2814;
  --honey-line: #6a4a22;
  --on-honey: #1f1409;

  /* семантика */
  --good: #9cbf6e;
  --good-bg: #26301a;
  --good-line: #3e5028;
  --on-good: #1a1f0c;
  --warn: #e9c35c;
  --warn-bg: #362c12;
  --warn-line: #5e4a1a;
  --bad: #e0826a;
  --bad-bg: #3a1f18;
  --bad-line: #6a3426;

  /* типографика */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --fs-12: .75rem;
  --fs-13: .8125rem;
  --fs-15: .9375rem;
  --fs-17: 1.0625rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;

  /* пространство */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* форма */
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-20: 20px;
  --r-full: 999px;

  /* тени */
  --shadow-1: 0 1px 0 rgba(255, 236, 210, .04) inset, 0 2px 6px -2px rgba(10, 5, 0, .45);
  --shadow-2: 0 1px 0 rgba(255, 236, 210, .05) inset, 0 10px 24px -12px rgba(10, 5, 0, .65);
  --shadow-3: 0 18px 40px -18px rgba(10, 5, 0, .75);
  --shadow-press: 0 1px 2px rgba(10, 5, 0, .5) inset;

  /* motion */
  --dur-instant: 100ms;
  --dur-quick: 180ms;
  --dur-base: 320ms;
  --dur-slow: 560ms;
  --dur-story: 900ms;
  --dur-breath: 6000ms;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-settle: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-soft: cubic-bezier(.25, .1, .25, 1);
  --ease-breath: cubic-bezier(.45, .05, .55, .95);
  --move-xs: 2px;
  --move-s: 8px;
  --move-m: 16px;
  --scale-press: .98;
  --stagger: 40ms;

  /* служебное */
  --tabh: 60px;

  /* v1 aliases — сохраняют работу инлайн-стилей в app.js */
  --accent: var(--honey);
  --accent-l: var(--honey-light);
  --accent-bg: var(--honey-bg);
  --accent-line: var(--honey-line);
  --card: var(--surface-1);
  --card-2: var(--surface-2);
  --muted: var(--text-2);
  --muted-2: var(--text-3);
  --danger: var(--bad);
  --r-sm: var(--r-8);
  --r-md: var(--r-12);
  --r-lg: var(--r-16);
  --r-xl: var(--r-20);
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Base ───────────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* На десктопе (мышь) случайный «протяг» выделял тексты — с нашей медовой
     подсветкой выделения это выглядело, будто всё выделено. Интерфейс —
     как приложение: выделение выключено, поля ввода — исключение. */
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* Фон: едва заметные продольные волокна дерева + виньетка */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 2px,
      rgba(255, 236, 210, .015) 2px,
      rgba(255, 236, 210, .015) 3px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 48px,
      rgba(0, 0, 0, .025) 48px,
      rgba(0, 0, 0, .025) 49px
    );
}
body::after {
  background: radial-gradient(ellipse 85% 70% at 50% 46%, rgba(22, 17, 13, 0) 55%, rgba(22, 17, 13, .55) 100%);
}

/* На «Доме» сцена сама рисует фон */
body.is-home::before,
body.is-home::after { display: none; }

/* ─── Layout ─────────────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--s4) var(--s4) calc(var(--tabh) + var(--s7));
  min-height: 100vh;
}

/* ─── Loading ────────────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wood-900);
}
#loading-screen[hidden] { display: none !important; }

.loading {
  text-align: center;
  color: var(--text-2);
  font-size: var(--fs-15);
}
.loading-lamp {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s4);
  display: grid;
  place-items: center;
  color: var(--honey);
}
.loading-lamp svg {
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 2;
}
.loading-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 162, 76, .35), rgba(226, 162, 76, .08) 55%, rgba(226, 162, 76, 0) 100%);
  opacity: 0;
  animation: lamp-on 900ms var(--ease-settle) forwards;
}
.loading p {
  margin: 0;
  opacity: 0;
  transform: translateY(var(--move-s));
  animation: rise-in 560ms var(--ease-out) 200ms forwards;
}
@keyframes lamp-on {
  to { opacity: 1; }
}

/* ─── Links ──────────────────────────────────────────────────────── */
a {
  color: var(--honey-light);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--dur-quick) var(--ease-soft);
}
a:hover { text-decoration-color: currentColor; }

/* ─── Typography ─────────────────────────────────────────────────── */
h1 {
  font-size: clamp(var(--fs-20), 5vw, var(--fs-24));
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s4);
  text-wrap: balance;
  color: var(--text);
}
h2 {
  font-size: var(--fs-17);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: var(--s5) 0 var(--s3);
  text-wrap: balance;
  color: var(--text);
}
h3 {
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--s2);
  color: var(--text);
}
p { margin: 0 0 var(--s3); }

.muted   { color: var(--text-2); }
.muted-2 { color: var(--text-3); }
.small   { font-size: var(--fs-13); }
.tiny    { font-size: var(--fs-12); }
.center  { text-align: center; }
.bold    { font-weight: 700; }

/* ─── Utilities ──────────────────────────────────────────────────── */
.row         { display: flex; align-items: center; gap: var(--s3); }
.row.between { justify-content: space-between; }
.row.wrap    { flex-wrap: wrap; }
.grow        { flex: 1; min-width: 0; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
  padding: var(--s4);
  margin: 0 0 var(--s3);
  box-shadow: var(--shadow-1);
}

/* Tappable card — active feedback без hover-only */
.card[role="button"],
.card.tap {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
}
.card[role="button"]:hover,
.card.tap:hover { background: var(--surface-2); }
.card[role="button"]:active,
.card.tap:active {
  background: var(--surface-2);
  transform: scale(var(--scale-press));
}

/* ─── Pill badges ────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--s1) var(--s2);
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  line-height: 1.4;
}
/* Статусные pill — цвет несёт смысл, не просто декорация */
.pill.accent { color: var(--honey-light); border-color: var(--honey-line); background: var(--honey-bg); }
.pill.good   { color: var(--good); border-color: var(--good-line); background: var(--good-bg); }
.pill.warn   { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.pill.new    { color: var(--honey-light); border-color: var(--honey-line); background: var(--honey-bg); }

/* ─── Progress bar ───────────────────────────────────────────────── */
.bar {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--wood-900);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--honey);
  border-radius: var(--r-full);
  transition: width var(--dur-slow) var(--ease-settle);
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  min-height: 48px;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-12);
  font-size: var(--fs-15);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background-color var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(var(--scale-press)); }
.btn:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
}

/* Варианты */
.btn.primary {
  background: var(--honey);
  border-color: var(--honey);
  color: var(--on-honey);
  font-weight: 700;
  box-shadow: var(--shadow-1);
}
.btn.primary:hover  { background: var(--honey-light); border-color: var(--honey-light); }
.btn.primary:active { background: var(--honey-deep); }

.btn.good {
  background: var(--good);
  border-color: var(--good);
  color: var(--on-good);
  font-weight: 700;
}
.btn.good:hover  { background: #aed683; border-color: #aed683; }

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
}
.btn.ghost:hover { background: var(--surface-2); }

.btn.sm {
  width: auto;
  min-height: 40px;
  padding: var(--s1) var(--s3);
  font-size: 0.875rem;
}

/* ─── Top bar (назад + заголовок) ────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s3);
  min-height: 48px;
}
.back {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text);
  border-radius: 999px;
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
}
.back:hover       { background: var(--surface-2); }
.back:active      { transform: scale(var(--scale-press)); }
.back:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
}

/* ─── List card (контейнер для списков) ──────────────────────────── */
.listcard {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
  overflow: hidden;
  margin-bottom: var(--s3);
  box-shadow: var(--shadow-1);
}

/* ─── Lesson row ─────────────────────────────────────────────────── */
.lesson {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
}
.lesson:last-child { border-bottom: none; }
.lesson:hover      { background: rgba(255, 255, 255, .03); }
.lesson:active     { background: var(--surface-2); transform: scale(.99); }

.lesson .l-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-13);
  font-weight: 700;
  color: var(--text-2);
}
.lesson.done .l-num {
  background: var(--good-bg);
  border-color: var(--good-line);
  color: var(--good);
}

.lesson .l-meta     { flex: 1; min-width: 0; }
.lesson .l-title    { font-weight: 600; font-size: var(--fs-15); }
.lesson .l-sub {
  color: var(--text-2);
  font-size: var(--fs-12);
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}
.lesson .l-chev { color: var(--text-3); flex: none; font-size: 1.125rem; }
.lesson .hand-ico { width: 16px; height: 16px; }

/* ─── Step row ───────────────────────────────────────────────────── */
.step {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
}
.step:last-child { border-bottom: none; }
.step:hover      { background: rgba(255, 255, 255, .03); }
.step:active     { background: var(--surface-2); transform: scale(.99); }

.step .check {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.875rem;
  transition: background var(--dur-quick), border-color var(--dur-quick);
}
.step.done .check {
  background: var(--good);
  border-color: var(--good);
  color: var(--on-good);
}
.step.learning .check {
  background: var(--honey-bg);
  border-color: var(--honey-line);
  color: var(--honey);
}

/* ─── Video box ──────────────────────────────────────────────────── */
.videobox {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--wood-900);
  border-radius: var(--r-12);
  overflow: hidden;
  margin-bottom: var(--s3);
  box-shadow: var(--shadow-2);
}
.videobox iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.videobox .no-video {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  text-align: center;
  padding: var(--s4);
  gap: var(--s2);
  font-size: 0.875rem;
}

/* ─── Instructions checklist ─────────────────────────────────────── */
.inst {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s3);
}
.inst li {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s3) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  margin-bottom: var(--s2);
  background: var(--surface-1);
  cursor: pointer;
  transition: background var(--dur-instant), border-color var(--dur-instant);
  min-height: 48px;
}
.inst li:active { background: var(--surface-2); }
.inst li .box {
  flex: none;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-8);
  border: 2px solid var(--line-strong);
  transition: background var(--dur-instant), border-color var(--dur-instant);
}
.inst li.on .box { background: var(--honey); border-color: var(--honey); }
.inst li.on { opacity: 0.65; }

/* ─── Timer block ────────────────────────────────────────────────── */
.timer {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s3);
}
.timer .clock {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  color: var(--text);
}

/* ─── Retrieval practice question ────────────────────────────────── */
.retrieval-card {
  background: var(--honey-bg);
  border: 1px solid var(--honey-line);
  border-radius: var(--r-16);
  padding: var(--s4);
  margin: 0 0 var(--s3);
}
.retrieval-card .rq-label {
  font-size: var(--fs-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--honey);
  margin-bottom: var(--s2);
}
.retrieval-card .rq-text {
  font-size: var(--fs-15);
  line-height: 1.5;
  color: var(--text);
}
.retrieval-card .rq-reveal {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid var(--honey-line);
  color: var(--text-2);
  font-size: 0.875rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 320ms var(--ease-settle), opacity 240ms var(--ease-out), margin-top 320ms var(--ease-settle), padding-top 320ms var(--ease-settle);
}
.retrieval-card.revealed .rq-reveal {
  margin-top: var(--s3);
  padding-top: var(--s3);
  max-height: 400px;
  opacity: 1;
}

/* ─── SM2 next-review badge ──────────────────────────────────────── */
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-full);
  padding: var(--s1) var(--s2);
}

/* Тёплая подпись к шагу на повторение (вместо «просрочено») */
.sm2-warm {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: var(--s1) var(--s2);
}
/* ─── Tags strip ─────────────────────────────────────────────────── */
.tags {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  margin: var(--s2) 0 var(--s3);
}

/* ─── Timecodes ──────────────────────────────────────────────────── */
.timecodes {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timecodes li {
  display: flex;
  gap: var(--s3);
  align-items: center;
  min-height: 44px;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-soft), transform var(--dur-instant) var(--ease-out);
}
.timecodes li:last-child { border-bottom: none; }
.timecodes li:hover { background: rgba(255, 255, 255, .03); border-radius: var(--r-8); }
.timecodes li:active { transform: scale(.99); }
.timecodes .tc-time {
  color: var(--honey-light);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.875rem;
  flex: none;
  min-width: 44px;
}

/* ─── Bullets ────────────────────────────────────────────────────── */
.bullets {
  margin: 0;
  padding-left: var(--s5);
}
.bullets li { margin-bottom: var(--s2); line-height: 1.5; }

/* ─── Tab bar ────────────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabh) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--wood-900);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(10, 5, 0, .35);
  display: flex;
  z-index: 20;
}
.tabbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 236, 210, .05);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 600;
  text-decoration: none;
  min-height: 48px;
  transition: color var(--dur-quick) var(--ease-soft);
}
.tabbar a .tab-icon {
  width: 24px;
  height: 24px;
}
.tabbar a::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 6px rgba(226, 162, 76, .55);
  transform: scale(0);
  opacity: 0;
  transition: transform 320ms var(--ease-settle), opacity 240ms var(--ease-out);
}
.tabbar a.active { color: var(--honey); }
.tabbar a.active::after { transform: scale(1); opacity: 1; }

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabh) + var(--s4));
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-12);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 40;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-3);
  transition: opacity 200ms var(--ease-in), transform 200ms var(--ease-in);
}
.toast[hidden] {
  display: block !important;
  opacity: 0;
  transform: translateX(-50%) translateY(var(--move-s));
  pointer-events: none;
}

/* ─── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --move-xs: 0px;
    --move-s: 0px;
    --move-m: 0px;
    --scale-press: 1;
    --stagger: 0ms;
    --dur-base: 150ms;
    --dur-slow: 150ms;
    --dur-story: 150ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Focus visible (keyboard nav) ──────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 3px;
  border-radius: var(--r-8);
}

/* ─── Selection ──────────────────────────────────────────────────── */
::selection {
  background: var(--honey-bg);
  color: var(--text);
}

/* ─── Paywall (продолжение курса по подписке) ───────────────────── */
.paywall {
  background: var(--surface-1);
  border: 1px solid var(--honey-line);
  border-radius: var(--r-16);
  padding: var(--s5) var(--s4);
  margin: 0 0 var(--s3);
  text-align: center;
  box-shadow: var(--shadow-2);
}
.paywall .pw-badge {
  display: inline-block;
  font-size: var(--fs-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--honey-light);
  background: var(--honey-bg);
  border: 1px solid var(--honey-line);
  border-radius: var(--r-full);
  padding: var(--s1) var(--s3);
  margin-bottom: var(--s3);
}
.paywall .pw-title {
  font-size: var(--fs-20);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}
.paywall .pw-text {
  color: var(--text-2);
  font-size: var(--fs-15);
  line-height: 1.5;
  max-width: 44ch;
  margin: 0 auto var(--s4);
}
.paywall .pw-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.paywall .pw-price b {
  font-size: var(--fs-24);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.paywall .pw-price span {
  color: var(--text-2);
  font-size: var(--fs-15);
}
.paywall .pw-note {
  color: var(--text-3);
  font-size: var(--fs-13);
  line-height: 1.5;
  margin: var(--s3) 0 var(--s2);
}
.paywall .pw-group {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--honey-light);
  text-decoration: none;
}
.paywall .pw-group:hover { text-decoration: underline; }

/* Пейволл внутри шага уже обёрнут в .st-paywall (бумажный лист) */
.st-paywall .paywall {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* Урок по подписке */
.lesson.locked .l-title { color: var(--text-2); }
.lesson.locked .l-num {
  background: var(--honey-bg);
  border-color: var(--honey-line);
  color: var(--honey);
  font-size: 0.875rem;
}

/* ─── Scrollbar (Chrome/Safari) ──────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* ─── Skip link (a11y) ───────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s4);
  background: var(--honey);
  color: var(--on-honey);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-12);
  font-weight: 700;
  font-size: var(--fs-15);
  text-decoration: none;
  z-index: 100;
  transition: top 0.12s;
}
.skip-link:focus { top: var(--s2); }

/* ─── Onboarding inputs ──────────────────────────────────────────── */
.ob-input {
  width: 100%;
  min-height: 48px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-15);
  padding: var(--s2) var(--s3);
  margin-top: var(--s2);
  outline: none;
  transition: border-color 0.15s;
}
.ob-input::placeholder { color: var(--text-3); }
.ob-input:focus {
  border-color: var(--honey);
  box-shadow: 0 0 0 2px var(--honey-bg);
}

/* ─── Timecode button ────────────────────────────────────────────── */
.tc-btn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: 44px;
  padding: var(--s2) 0;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur-instant) var(--ease-out);
}
.tc-btn:active { transform: scale(.99); }
.tc-btn:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
  border-radius: var(--r-8);
}
.tc-time {
  color: var(--honey-light);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  flex: none;
  min-width: 42px;
}

/* ─── Blockquote ─────────────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--line);
  margin: 0 0 var(--s3);
  padding: var(--s2) var(--s4);
  color: var(--text-2);
  font-style: italic;
}

/* ─── Fieldset в шаге ────────────────────────────────────────────── */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
fieldset legend {
  display: block;
  font-size: var(--fs-13);
  color: var(--text-2);
  margin-bottom: var(--s2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(var(--move-s)); }
  to { opacity: 1; transform: none; }
}
