/**
 * S&P Обучение — Дизайн-система v3
 *
 * Источник: Файлы для клода/01_design_system_v3.md (утверждена 07.05.2026).
 * Все экраны платформы используют переменные отсюда.
 *
 * Темы: <body data-theme="dark|light"> — дефолт dark, переключается JS-ом.
 * Роли: <body data-role="ambassador|salesman|admin"> — определяет акцентный цвет.
 *
 * Структура:
 *   1. CSS-переменные (палитра по темам)
 *   2. Акценты по ролям
 *   3. Семантика (success/warning/danger/info/teal)
 *   4. Базовая типография (font-family + размеры)
 *   5. Базовые компоненты (button, card, badge, input, tip-box, big-number, anatomy)
 *   6. Утилиты
 */

/* ============================================================
 * 1. CSS-переменные — тёмная (дефолт)
 * ============================================================ */

:root,
[data-theme="dark"] {
  /* Backgrounds */
  --bg-base:         #0E0D0C;
  --bg-elevated:     #181614;
  --bg-overlay:      #252220;
  /* NEW-Q4: ещё ярче центр (#322B26) — Степа повторно сказал что в
   * предыдущей версии (1200×700, #2A2522) практически незаметно. */
  --bg-page:         radial-gradient(ellipse 1200px 700px at 50% -100px, #322B26 0%, #1F1A17 35%, #0E0D0C 75%);

  /* Borders */
  --border-subtle:   rgba(255, 240, 230, 0.06);
  --border-default:  rgba(255, 240, 230, 0.10);
  --border-strong:   rgba(255, 240, 230, 0.18);

  /* Text */
  --text-primary:    #F2EDE8;
  --text-secondary:  #A8A09A;
  --text-muted:      #6E6660;

  /* Neutral utility */
  --neutral-100:     rgba(255, 240, 230, 0.05);
  --neutral-200:     rgba(255, 240, 230, 0.08);
  --neutral-300:     rgba(255, 240, 230, 0.14);

  /* Semantic — общие для всех ролей и тем */
  --success:         #4ADE80;
  --success-light:   #6EE89A;
  --success-soft:    rgba(74, 222, 128, 0.12);

  --warning:         #FBBF24;
  --warning-light:   #FBCB54;
  --warning-soft:    rgba(251, 191, 36, 0.12);

  --danger:          #EF4444;
  --danger-light:    #F47171;
  --danger-soft:     rgba(239, 68, 68, 0.12);

  --info:            #60A5FA;
  --info-light:      #82B5FA;
  --info-soft:       rgba(96, 165, 250, 0.12);

  --teal:            #5EEAD4;
  --teal-light:      #7EEFD9;
  --teal-soft:       rgba(94, 234, 212, 0.10);
}

/* ============================================================
 * 1b. Светлая тема
 * ============================================================ */

[data-theme="light"] {
  --bg-base:         #F7F5F1;
  --bg-elevated:     #FFFFFF;
  --bg-overlay:      #FFFFFF;
  --bg-page:         radial-gradient(ellipse 1200px 700px at 50% -100px, #FFFFFF 0%, #FBF9F5 35%, #F7F5F1 75%);

  --border-subtle:   rgba(20, 15, 10, 0.06);
  --border-default:  rgba(20, 15, 10, 0.12);
  --border-strong:   rgba(20, 15, 10, 0.20);

  --text-primary:    #1A1614;
  --text-secondary:  #5C544D;
  /* M5 fix: было #908881 — контраст ~3.6:1 на bg-base #F7F5F1, ниже WCAG
   * AA (4.5:1) для small text. Затемнили до #7A736D — контраст ~4.7:1. */
  --text-muted:      #7A736D;

  --neutral-100:     rgba(20, 15, 10, 0.04);
  --neutral-200:     rgba(20, 15, 10, 0.08);
  --neutral-300:     rgba(20, 15, 10, 0.14);

  /* Semantic в светлой теме чуть приглушённее (контрастнее на белом) */
  --success:         #16A34A;
  --success-light:   #16A34A;
  --success-soft:    rgba(22, 163, 74, 0.10);

  --warning:         #B45309;
  --warning-light:   #B45309;
  --warning-soft:    rgba(180, 83, 9, 0.10);

  --danger:          #DC2626;
  --danger-light:    #DC2626;
  --danger-soft:     rgba(220, 38, 38, 0.10);

  --info:            #2563EB;
  --info-light:      #2563EB;
  --info-soft:       rgba(37, 99, 235, 0.10);

  --teal:            #0D9488;
  --teal-light:      #0D9488;
  --teal-soft:       rgba(13, 148, 136, 0.10);
}

/* ============================================================
 * 2. Акценты по ролям
 *
 * Система: <body data-role="ambassador|salesman|admin"> —
 *   ambassador — глубокий бордовый
 *   salesman   — серебро (текст на кнопке тёмный, не белый)
 *   admin      — золото (только в кабинете руководителя)
 *
 * Дефолт без data-role — серебро (нейтральный).
 * ============================================================ */

[data-role="ambassador"][data-theme="dark"],
[data-role="ambassador"]:not([data-theme="light"]) {
  --accent:          #8E2E3C;
  --accent-hover:    #A23F4E;
  --accent-light:    #D26A7C;
  --accent-soft:     rgba(142, 46, 60, 0.10);
  --accent-text:     #FFFFFF;
}
[data-role="ambassador"][data-theme="light"] {
  --accent:          #7A2535;
  --accent-hover:    #913040;
  --accent-light:    #B23A48;
  --accent-soft:     rgba(122, 37, 53, 0.08);
  --accent-text:     #FFFFFF;
}

[data-role="salesman"][data-theme="dark"],
[data-role="salesman"]:not([data-theme="light"]),
:root:not([data-role]):not([data-theme="light"]) {
  --accent:          #C0BFC2;
  --accent-hover:    #D8D8DC;
  --accent-light:    #D8D8DC;
  --accent-soft:     rgba(192, 191, 194, 0.14);
  --accent-text:     #1A1614;       /* тёмный текст на серебряной кнопке */
}
[data-role="salesman"][data-theme="light"] {
  --accent:          #5C5C66;
  --accent-hover:    #6F7080;
  --accent-light:    #4A4A52;
  --accent-soft:     rgba(92, 92, 102, 0.10);
  --accent-text:     #FFFFFF;
}

[data-role="admin"][data-theme="dark"],
[data-role="admin"]:not([data-theme="light"]) {
  --accent:          #C9A961;
  --accent-hover:    #D9B970;
  --accent-light:    #D4B56F;
  --accent-soft:     rgba(201, 169, 97, 0.14);
  --accent-text:     #1A1614;
}
[data-role="admin"][data-theme="light"] {
  --accent:          #A8893E;
  --accent-hover:    #BC9C4D;
  --accent-light:    #8E7639;
  --accent-soft:     rgba(168, 137, 62, 0.10);
  --accent-text:     #FFFFFF;
}

/* ============================================================
 * 3. Шрифты
 *
 * Geist Sans + Geist Mono подгружаются через CDN unpkg.
 * Fallback — system-ui, ui-monospace.
 * Подключение в HTML:
 *   <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/geist@1.5.1/font.css">
 * (или через npm @vercel/geist-font если в будущем перейдём на bundler)
 * ============================================================ */

:root {
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Menlo', 'Monaco', monospace;
}

/* ============================================================
 * 4. Базовые сбросы и body
 * ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg-base);
  background-image: var(--bg-page);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  transition: background-color 200ms ease, color 200ms ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Selection — мягкая тёплая */
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Focus ring (accessible) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
 * 5. Типография — размеры и стили
 *
 * См. 01_design_system_v3.md раздел 5.
 * ============================================================ */

.t-display { font-size: 56px; font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.t-h1      { font-size: 36px; font-weight: 500; line-height: 1.10; letter-spacing: -0.02em; }
.t-h2      { font-size: 24px; font-weight: 500; line-height: 1.20; }
.t-h3      { font-size: 18px; font-weight: 500; line-height: 1.35; }
.t-body-lg { font-size: 17px; font-weight: 400; line-height: 1.70; }
.t-body    { font-size: 15px; font-weight: 400; line-height: 1.55; }
.t-label   { font-size: 13px; font-weight: 500; line-height: 1.40; }
.t-caption { font-size: 11px; font-weight: 500; line-height: 1.40; text-transform: uppercase; letter-spacing: 0.08em; }

.t-mono-display { font-family: var(--font-mono); font-size: 88px; font-weight: 500; line-height: 1.0; letter-spacing: -0.04em; }
.t-mono-lg      { font-family: var(--font-mono); font-size: 28px; font-weight: 500; line-height: 1.2; }
.t-mono         { font-family: var(--font-mono); font-size: 14px; font-weight: 400; line-height: 1.4; }
.t-mono-sm      { font-family: var(--font-mono); font-size: 11px; font-weight: 500; }

.t-secondary    { color: var(--text-secondary); }
.t-muted        { color: var(--text-muted); }
.t-accent       { color: var(--accent-light); }

/* ============================================================
 * 6. Кнопки
 * ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms, transform 60ms;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; pointer-events: none; opacity: 0.5; }
.btn i { font-size: 16px; line-height: 1; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--neutral-200); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--neutral-100); }

.btn-sm  { padding: 7px 12px; font-size: 12px; }
.btn-lg  { padding: 13px 22px; font-size: 15px; }

/* ============================================================
 * 7. Карточки
 * ============================================================ */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 24px;
}
.card-compact { padding: 16px; }
.card-featured {
  border-radius: 16px;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-elevated));
}

/* ============================================================
 * 8. Бренд-бейдж и точки роли
 * ============================================================ */

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  /* Бренд — НЕкликабельный статичный лейбл, не кнопка/ссылка */
  cursor: default;
  user-select: none;
  pointer-events: none;
}
.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Бейджи статусов (роли в админ-таблице, status в drilldown) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}
.status-pill[data-tone="success"] { background: var(--success-soft); color: var(--success-light); }
.status-pill[data-tone="warning"] { background: var(--warning-soft); color: var(--warning-light); }
.status-pill[data-tone="danger"]  { background: var(--danger-soft);  color: var(--danger-light); }
.status-pill[data-tone="info"]    { background: var(--info-soft);    color: var(--info-light); }
.status-pill[data-tone="teal"]    { background: var(--teal-soft);    color: var(--teal-light); }
.status-pill[data-tone="muted"]   { background: var(--neutral-200);  color: var(--text-secondary); }
.status-pill[data-tone="accent"]  { background: var(--accent-soft);  color: var(--accent-light); }

/* ============================================================
 * 9. Inputs
 * ============================================================ */

.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 120ms, background-color 120ms;
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

/* ============================================================
 * 10. Tip-box (4 типа: key/quote/warn/fact)
 *
 * Использование:
 *   <div class="tip-box" data-type="key|quote|warn|fact">
 *     <i class="ph-duotone ph-lightbulb"></i>
 *     <div class="tip-content">
 *       <div class="tip-label">Ключевая мысль</div>
 *       <div class="tip-text">...</div>
 *     </div>
 *   </div>
 *
 * Парсер для legacy-контента (без data-type) — в JS, см. ниже.
 * ============================================================ */

/* Fix-2: вертикальный layout — заголовок (иконка + label inline) сверху, текст снизу.
 * Степа: «все подобные блоки в формате заголовок, под ним текст».
 * Parser в chapter.js теперь оборачивает icon+label в .tip-header. */
.tip-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  margin: 28px 0;
  border-left: 3px solid var(--tip-color, var(--accent));
  background: var(--tip-soft, var(--accent-soft));
  border-radius: 0 6px 6px 0;
}
.tip-box > i {
  font-size: 18px;
  color: var(--tip-color, var(--accent));
  flex-shrink: 0;
}
.tip-box .tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tip-box .tip-header > i {
  font-size: 18px;
  color: var(--tip-color, var(--accent));
  flex-shrink: 0;
}
.tip-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tip-color, var(--accent));
  margin: 0;
}
.tip-content { min-width: 0; }  /* legacy fallback если где-то остался */
.tip-text { font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.tip-text > :first-child { margin-top: 0; }
.tip-text > :last-child  { margin-bottom: 0; }

.tip-box[data-type="key"]   { --tip-color: var(--accent);  --tip-soft: var(--accent-soft); background: var(--tip-soft); }
.tip-box[data-type="quote"] { --tip-color: var(--info);    --tip-soft: var(--info-soft);   background: var(--tip-soft); }
.tip-box[data-type="warn"]  { --tip-color: var(--warning); --tip-soft: var(--warning-soft);background: var(--tip-soft); }
.tip-box[data-type="fact"]  { --tip-color: var(--teal);    --tip-soft: var(--teal-soft);  background: var(--tip-soft); }

/* Дефолт для legacy tip-box без data-type — заметный фон + border-left
 * (accent-soft на менеджере полупрозрачно-серебряный, почти невидимый
 * на тёмном — поэтому усиливаем neutral-100). */
.tip-box:not([data-type]) {
  background: var(--neutral-100);
  border-left-color: var(--accent);
  --tip-color: var(--accent);
}
/* Legacy .tip-title — старый аналог .tip-label */
.tip-box .tip-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tip-color, var(--accent));
  margin-bottom: 6px;
  display: block;
}

/* example-box — legacy quote-плашка */
.example-box {
  padding: 14px 18px;
  margin: 24px 0;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

/* client-reply — реплика клиента (используется и в главе, и в тесте).
 * Стиль дублирован в quiz.css, оставляем здесь как общий компонент. */
.client-reply {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin: 20px 0;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  border-radius: 0 6px 6px 0;
}
.client-reply > i {
  font-size: 16px;
  color: var(--info-light);
  flex-shrink: 0;
  padding-top: 2px;
}
.client-reply::before {
  /* Если иконки не было в legacy-контенте — рисуем «»» через ::before */
  content: '\201D';
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
  color: var(--info-light);
  font-weight: 600;
}
.client-reply > i + ::before,
.client-reply:has(> i)::before { display: none; }
.client-reply-content { flex: 1; min-width: 0; }
.client-reply-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--info-light);
  margin-bottom: 4px;
}
.client-reply-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Footnote sup — legacy маркеры [1], [2] в тексте */
.chapter-prose sup {
  font-size: 0.75em;
  color: var(--accent-light);
  font-weight: 500;
  vertical-align: super;
  line-height: 0;
}

/* ============================================================
 * 11. Term — слова с тултипом
 * ============================================================ */

.term {
  color: var(--accent-light);
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  font-weight: 500;
  text-decoration: none;
}

/* ============================================================
 * 12. Big-number — крупные цифры в инфографике
 * ============================================================ */

.big-number {
  position: relative;
  margin: 36px 0;
  padding: 36px 24px;
  border-radius: 16px;
  border: 1px solid var(--bn-border, var(--teal-soft));
  background: linear-gradient(135deg, var(--bn-bg, var(--teal-soft)) 0%, transparent 100%);
  text-align: center;
  overflow: hidden;
}
.big-number-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, var(--bn-glow, rgba(94, 234, 212, 0.10)) 0%, transparent 70%);
  pointer-events: none;
}
.big-number-value {
  position: relative;
  font-family: var(--font-mono);
  font-size: 88px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.big-number-value .accent { color: var(--bn-text, var(--teal-light)); }
.big-number-label {
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto;
}
.big-number-source {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.big-number[data-color="teal"] {
  --bn-bg:     var(--teal-soft);
  --bn-border: rgba(94, 234, 212, 0.18);
  --bn-glow:   rgba(94, 234, 212, 0.10);
  --bn-text:   var(--teal-light);
}
.big-number[data-color="accent"] {
  --bn-bg:     var(--accent-soft);
  --bn-border: var(--border-strong);
  --bn-glow:   rgba(142, 46, 60, 0.15);
  --bn-text:   var(--accent-light);
}

@media (max-width: 720px) {
  .big-number-value { font-size: 64px; }
}

/* ============================================================
 * 13. Anatomy diagram — слои выдачи
 * ============================================================ */

.anatomy-diagram { margin: 36px 0; }
.anatomy-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}
.anatomy-frame {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}
.anatomy-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  border-left: 3px solid var(--border-default);
  background: var(--neutral-100);
  font-size: 13px;
}
.anatomy-bar:last-child { margin-bottom: 0; }
.anatomy-bar[data-highlight="true"] {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-left-color: var(--accent);
}
.anatomy-position {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--neutral-200);
  color: var(--text-secondary);
}
.anatomy-bar[data-highlight="true"] .anatomy-position {
  background: var(--accent);
  color: var(--accent-text);
}
.anatomy-name { flex: 1; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anatomy-share {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.anatomy-bar[data-highlight="true"] .anatomy-share {
  color: var(--accent-light);
  font-weight: 500;
}

/* ============================================================
 * 14. Good-bad — двухколонник «правильно/неправильно»
 * ============================================================ */

.good-bad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0;
}
.good-bad > .bad-box,
.good-bad > .good-box {
  padding: 16px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
}
.bad-box {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.good-box {
  background: var(--success-soft);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.box-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.bad-box .box-label  { color: var(--danger-light); }
.good-box .box-label { color: var(--success-light); }

@media (max-width: 720px) {
  .good-bad { grid-template-columns: 1fr; }
}

/* ============================================================
 * 15. Stat-grid — карточки с цифрами (тарифы, доходы)
 * ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
@media (max-width: 480px) {
  /* На мобиле — 1 колонка чтобы featured-карточка и две обычные не
     ломались асимметрично (3 шт на узком экране → 2+1 уродливо) */
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 18px 16px; }
}
.stat-card {
  position: relative;
  padding: 16px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  text-align: center;
}
.stat-card h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.stat-card--featured {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-elevated));
}
.stat-card--featured .stat-value { color: var(--accent-light); }
.featured-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ============================================================
 * 16. Theme switcher — кнопка sun/moon в шапке
 * ============================================================ */

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.theme-switcher:hover { color: var(--text-primary); border-color: var(--border-strong); }
.theme-switcher i { font-size: 14px; }

/* По умолчанию показываем иконку противоположной темы (то на что переключим) */
[data-theme="dark"] .theme-switcher .ph-sun { display: inline-block; }
[data-theme="dark"] .theme-switcher .ph-moon { display: none; }
[data-theme="light"] .theme-switcher .ph-sun { display: none; }
[data-theme="light"] .theme-switcher .ph-moon { display: inline-block; }

/* ============================================================
 * 17. Phosphor Duotone — кастомизация
 * ============================================================ */

i.ph-duotone {
  display: inline-block;
  --ph-secondary-color: currentColor;
  --ph-secondary-opacity: 0.4;
}

/* ============================================================
 * 18. Reading layout — длинный prose (главы)
 * ============================================================ */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
}
.prose p { margin: 0 0 20px; }
.prose h2 { font-size: 24px; font-weight: 500; margin: 36px 0 16px; line-height: 1.2; }
.prose h3 { font-size: 18px; font-weight: 500; margin: 28px 0 12px; }
.prose h4 { font-size: 15px; font-weight: 500; margin: 24px 0 10px; }

.prose ul, .prose ol {
  padding: 0 0 0 4px;
  margin: 0 0 24px;
  list-style: none;
}
.prose ul li, .prose ol li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.65;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.prose ol { counter-reset: ol; }
.prose ol li {
  counter-increment: ol;
  padding-left: 28px;
}
.prose ol li::before {
  content: counter(ol) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Жирное слово получает highlighter-маркер под текстом */
.prose strong {
  font-weight: 500;
  color: var(--text-primary);
  background: linear-gradient(180deg, transparent 65%, var(--accent-soft) 65%);
  padding: 0 2px;
}

.prose img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
  cursor: zoom-in;
}

@media (max-width: 720px) {
  .prose { padding: 0 16px; font-size: 16px; }
}

/* ============================================================
 * 19. Reading progress bar (sticky под header)
 * ============================================================ */

.reading-progress {
  position: sticky;
  top: 60px;             /* высота header */
  height: 2px;
  background: var(--neutral-100);
  z-index: 5;
}
.reading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  width: 0;
  transition: width 60ms linear;
}

/* ============================================================
 * 20. Утилиты
 * ============================================================ */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-light); }

.hide-on-mobile { display: initial; }
@media (max-width: 720px) {
  .hide-on-mobile { display: none; }
}

/* ============================================================
 * Кастомный курсор — стрелка в палитре роли (default).
 *
 * SVG-стрелка генерируется в styles/cursor.js при загрузке + при
 * themechange/rolechange и выставляется как CSS-переменная
 * --cursor-default на body.
 *
 * На кликабельных элементах оставляем СИСТЕМНЫЙ pointer — кастомная
 * рука Степе не понравилась («кринж»), а покрасить нативный системный
 * pointer браузерным API нельзя. Каждый компонент сам ставит cursor:
 * pointer в своих стилях (header.css, quiz.css, и т.д.) — мы не
 * перебиваем.
 *
 * Обводка стрелки — контрастная теме (белая на тёмной, тёмная на светлой).
 * ============================================================ */

[data-theme="dark"]  body { --cursor-stroke: rgba(255, 245, 235, 0.95); }
[data-theme="light"] body { --cursor-stroke: rgba(20, 15, 10, 0.85); }

body { cursor: var(--cursor-default, default); }

/* === Тени для bg-elevated карточек ===
 * В тёмной теме границы достаточно. В светлой нужна subtle тень — иначе
 * карточки сливаются с белым фоном. */
[data-theme="light"] .dashboard-module,
[data-theme="light"] .dashboard-sheet,
[data-theme="light"] .dashboard-hero,
[data-theme="light"] .admin-metric,
[data-theme="light"] .admin-table-wrap,
[data-theme="light"] .video-card,
[data-theme="light"] .admin-video-card,
[data-theme="light"] .token-card,
[data-theme="light"] .nav-btn,
[data-theme="light"] .option {
  box-shadow: 0 1px 3px rgba(20, 15, 10, 0.04), 0 1px 2px rgba(20, 15, 10, 0.06);
}
[data-theme="light"] .dashboard-hero {
  box-shadow: 0 4px 14px rgba(20, 15, 10, 0.06), 0 1px 3px rgba(20, 15, 10, 0.04);
}

/* === Smooth scroll + page transitions ===
 * Мягкий скролл (не желейный — короткий) и fade-in для смены экранов. */
html { scroll-behavior: smooth; }

@keyframes sp-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dashboard-page,
.chapter-content,
.quiz-content,
.admin-content,
.login-page,
.videos-page {
  animation: sp-fade-in 180ms ease-out;
}

/* Плавность hover-переходов на интерактивных карточках */
.dashboard-module,
.dashboard-sheet,
.option,
.nav-btn,
.admin-metric,
.cycle-block,
.funnel-step,
.factor-card,
.token-card,
.video-card,
.admin-video-card {
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.dashboard-module:not([data-state="locked"]):hover,
.dashboard-sheet:not([data-locked="true"]):hover,
.option:not(.option-disabled):hover,
.nav-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

/* ============================================================
 * Login page (Phase 3)
 *
 * Открывается по корпоративной токен-ссылке (/m-{token} для менеджера,
 * /a-{token} для амбассадора). На корне sp-agency.pro/ — нейтральная
 * заглушка «доступ по приглашению». Слово роли в подзаголовке окрашено
 * в --accent. TG primary в акценте роли, VK secondary outline.
 * Хедер использует mountHeader(..., {guest: true}) — только бренд +
 * переключатель темы, без profile-pill.
 * ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* В светлой теме открытый layout сливается с белым фоном → текст еле виден.
 * Добавляем subtle карточку с тенью только в light, dark остаётся open. */
[data-theme="light"] .login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 4px 16px rgba(20, 15, 10, 0.06), 0 1px 3px rgba(20, 15, 10, 0.04);
}

.login-card .brand-badge {
  margin-bottom: 32px;
}

.login-title {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.1;
}

.login-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 32px;
  line-height: 1.5;
}

.login-subtitle .login-role {
  color: var(--accent);
  font-weight: 500;
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 28px;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.login-btn i,
.login-btn svg {
  font-size: 18px;
  flex-shrink: 0;
}

.login-btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.login-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.login-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.login-btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--neutral-100);
}

/* Fix-4: убрать визуальный мусор —
 *   abbr с dotted underline внутри глав (Степа: «работает криво»)
 *   <i> без класса (просто курсив текста — некрасиво)
 * Phosphor-иконки `<i class="ph-duotone ph-...">` НЕ затрагиваются:
 *   ph-* класс перебивает font-style: normal от font-family. */
.chapter-prose abbr,
.chapter-prose abbr[title] {
  text-decoration: none;
  border-bottom: none;
  cursor: default;
}
.chapter-prose i:not([class]),
.chapter-prose em:not([class]) {
  font-style: normal;
  color: var(--text-secondary);
  font-size: 0.92em;
}

/* Fix-1: контейнер для оф. TG-виджета — центрируем iframe который Telegram
 * инжектит. Кнопка виджета приходит в синем стиле (cross-origin iframe не
 * стилизуется), но это работающий one-click TG-логин до получения numeric
 * bot_id с бэкенда. */
.login-tg-widget {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.login-tg-widget iframe { border-radius: 12px !important; }

.login-foot {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
}
.login-foot a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: color 120ms;
}
.login-foot a:hover {
  color: var(--text-primary);
}

/* На login-странице хедер прозрачный — только переключатель темы справа.
 * data-role на корне страницы определяет --accent для бейджа и слова роли. */
.app-header.app-header-guest {
  border-bottom: 1px solid transparent;
  background: transparent;
}
@media (max-width: 480px) {
  .login-title { font-size: 26px; }
  .login-subtitle { font-size: 14px; }
}

/* ============================================================
 * VISUAL PACK v1 — скрины в главах + STAT-блоки
 * (Marc, visual_pack_v1.md секции 1-2)
 * ============================================================ */

/* === Скрины в главах === */
.chapter-image {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chapter-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  cursor: pointer; /* lightbox */
  transition: transform 200ms, border-color 200ms;
}
.chapter-image img:hover {
  transform: scale(1.005);
  border-color: var(--border-strong);
}
.chapter-image figcaption {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 0 4px;
}
.chapter-image figcaption strong {
  color: var(--text-primary);
  font-weight: 500;
  background: linear-gradient(180deg, transparent 65%, var(--accent-soft) 65%);
}

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
.image-pair .chapter-image { margin: 0; }
.image-pair-bad img  { border-color: rgba(239, 68, 68, 0.20); }
.image-pair-good img { border-color: rgba(74, 222, 128, 0.20); }

@media (max-width: 720px) {
  .image-pair { grid-template-columns: 1fr; }
}

/* === STAT-1 — До / После === */
.stat-before-after {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin: 36px 0;
  padding: 32px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.stat-ba-side {
  text-align: center;
  padding: 16px;
}
.stat-ba-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: 'Geist Mono', ui-monospace, monospace;
  margin-bottom: 14px;
}
.stat-ba-before .stat-ba-label { color: var(--text-muted); }
.stat-ba-after  .stat-ba-label { color: var(--accent-light); }
.stat-ba-value {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 72px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.stat-ba-before .stat-ba-value { color: var(--text-muted); }
.stat-ba-after  .stat-ba-value {
  color: var(--accent-light);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-ba-unit {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.stat-ba-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.stat-ba-arrow i { font-size: 32px; }
.stat-ba-period {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 640px) {
  .stat-before-after { grid-template-columns: 1fr; gap: 12px; }
  .stat-ba-arrow { transform: rotate(90deg); }
  .stat-ba-value { font-size: 56px; }
}

/* === STAT-2 — Сетка регалий === */
.stat-credentials {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stat-cred-group { padding: 0; }
.stat-cred-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-family: 'Geist Mono', ui-monospace, monospace;
  color: var(--accent-light);
  margin-bottom: 12px;
}
.stat-cred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stat-cred-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-cred-card {
  padding: 16px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-align: center;
}
.stat-cred-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-cred-icon i { font-size: 18px; color: var(--accent-light); }
.stat-cred-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.stat-cred-desc {
  font-size: 11px;
  color: var(--text-secondary);
}
.stat-cred-large {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-cred-large-value {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent-light);
  margin-bottom: 6px;
}
.stat-cred-large-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
@media (max-width: 640px) {
  .stat-cred-grid   { grid-template-columns: repeat(2, 1fr); }
  .stat-cred-grid-2 { grid-template-columns: 1fr; }
}

/* === STAT-3 — Воронка чисел === */
.stat-funnel {
  margin: 36px 0;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-funnel-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding: 14px 18px;
  border-radius: 10px;
  overflow: hidden;
}
.stat-funnel-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  border-radius: 10px;
  z-index: 0;
}
.stat-funnel-step[data-tone="info"] .stat-funnel-bar {
  background: linear-gradient(90deg, var(--info-soft), transparent);
  border-left: 3px solid var(--info);
}
.stat-funnel-step[data-tone="warning"] .stat-funnel-bar {
  background: linear-gradient(90deg, var(--warning-soft), transparent);
  border-left: 3px solid var(--warning);
}
.stat-funnel-step[data-tone="success"] .stat-funnel-bar {
  background: linear-gradient(90deg, var(--success-soft), transparent);
  border-left: 3px solid var(--success);
}
.stat-funnel-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}
.stat-funnel-num {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
  min-width: 60px;
}
.stat-funnel-name {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
.stat-funnel-summary {
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.5;
}
.stat-funnel-summary strong {
  color: var(--accent-light);
  font-weight: 500;
  background: linear-gradient(180deg, transparent 65%, var(--accent-soft) 65%);
}

/* === STAT-4 — Хронология рынка === */
.stat-timeline-market {
  margin: 36px 0;
  padding: 32px 32px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}
/* Fix-3: переписан с CSS grid вместо absolute positioning — 5 равных столбцов
 * гарантированно без overlap. inline left% теперь игнорируется. */
.stat-tlm-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  min-height: 120px;
}
.stat-tlm-line {
  position: absolute;
  top: 36px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--text-muted) 0%, var(--accent) 100%);
}
.stat-tlm-point {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* inline left% переопределяется через CSS specificity */
  left: 0 !important;
  transform: none !important;
  padding: 0 4px;
}
.stat-tlm-year {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.stat-tlm-current .stat-tlm-year { color: var(--accent-light); }
.stat-tlm-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 3px solid var(--bg-elevated);
  margin-bottom: 10px;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.stat-tlm-current .stat-tlm-dot {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--accent-soft);
}
.stat-tlm-label {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
}
.stat-tlm-cost {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.stat-tlm-current .stat-tlm-cost { color: var(--accent-light); }
@media (max-width: 720px) {
  .stat-timeline-market { padding: 24px 16px; overflow-x: auto; }
  .stat-tlm-track { width: 700px; }
}

/* ============================================================
 * Final Sprint F-9 — цветовые акценты для статистик
 * F-10 — унификация callout-заголовков (icon + text inline-flex)
 * ============================================================ */
:root {
  --color-positive: #5FAD56;
  --color-negative: #D9534F;
}

/* F-9 stat-before-after — value до/после */
.stat-ba-before .stat-ba-value { color: var(--color-negative); }
.stat-ba-after .stat-ba-value {
  color: var(--color-positive);
  background: none;
  -webkit-text-fill-color: var(--color-positive);
  background-clip: unset;
}

/* F-9 stat-card--featured — value подсветка зелёным */
.stat-card--featured .stat-value { color: var(--color-positive); }

/* F-9 lead-cost-compare — expensive/cheap value */
.lead-cost-card[data-type="expensive"] .lead-cost-value { color: var(--color-negative); }
.lead-cost-card[data-type="cheap"]     .lead-cost-value { color: var(--color-positive); }

/* F-9 factors-note — предупреждение коралл */
.factors-note { color: var(--color-negative); }

/* F-10 — единое выравнивание иконки и текста в callout-заголовках */
.tip-title,
.example-box h4,
.cheat-callout-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.tip-title i,
.example-box h4 i,
.cheat-callout-title i,
.featured-badge i {
  font-size: 1.1em;
  line-height: 1;
  flex-shrink: 0;
}

/* featured-badge — иконка inline */
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Hotfix-5 H-3: визуальная компенсация baseline-сдвига Phosphor Duotone
 * иконок в callout-заголовках. align-items:center выравнивает bounding box,
 * но визуальный центр иконки чуть выше визуального центра текста. */
.tip-title i.ph-duotone,
.example-box h4 i.ph-duotone,
.cheat-callout-title i.ph-duotone {
  transform: translateY(1px);
  display: inline-block;
}

/* Hotfix-5 H-4: обрезка верхней части (статус-бар телефона) на скрине
 * мобильной выдачи Яндекса. Применяется через class на figure. */
.chapter-image--cropped-top {
  overflow: hidden;
  border-radius: 12px;
}
.chapter-image--cropped-top img {
  margin-top: -60px;
  border-radius: 0; /* radius на figure */
}

/* ============================================================
 * Staging banner (setup_staging.md Блок D.3)
 * Sticky 30px полоска вверху, тёплый жёлтый, не пугающий.
 * ============================================================ */
#sp-staging-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%);
  color: #1A1614;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  z-index: 99999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
#sp-staging-banner b { font-weight: 700; margin-right: 4px; }
.sp-staging-icon { margin-right: 6px; }
body.sp-has-staging-banner { padding-top: 30px; }
