/* Шрифты бренда Constanta: лежат рядом (fonts/), сеть не нужна. */
@font-face{font-family:"Geologica";font-weight:100 900;font-display:swap;src:url(fonts/geologica-400-500-cyrillic.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Geologica";font-weight:100 900;font-display:swap;src:url(fonts/geologica-400-500-cyrillic-ext.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Geologica";font-weight:100 900;font-display:swap;src:url(fonts/geologica-400-500-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+2000-206F,U+2212}
@font-face{font-family:"Golos Text";font-weight:400 900;font-display:swap;src:url(fonts/golos-text-400-600-cyrillic.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Golos Text";font-weight:400 900;font-display:swap;src:url(fonts/golos-text-400-600-cyrillic-ext.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Golos Text";font-weight:400 900;font-display:swap;src:url(fonts/golos-text-400-600-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+2000-206F,U+2212}

/* ==========================================================================
   Constanta Academy — интерфейс под телефон. Один экран = один шаг.
   Светлая и тёмная темы; тёмную включает либо система, либо Telegram
   атрибутом data-theme на <html>.
   ========================================================================== */

/* Палитра (2026-08, «тёплая бумага»): возврат к спокойной гамме продукта после
   короткого лайм-эксперимента. Основание — тёплая бумага, а не белое и не
   near-black; акцент — приглушённая терракота, а не сигнальный красный и не
   кислотный лайм. Принцип тот же, что был у прежней системы: один тёплый
   акцент, одна зелёная «зачётная» и одно золото; всё остальное — нейтрали.

   Каждая пара «текст на своей подложке» проверена на контраст: минимум 4.5:1
   (подписи бывают 11–12px и жирные, ниже нормы читаться перестают). Если
   меняете значение — пересчитайте пару, а не подбирайте на глаз. */

:root {
    --bg:        #F7F8FC;
    --bg-sunk:   #EEF0F6;
    --card:      #FFFFFF;
    --ink:       #0B1026;
    --muted:     #454C6E;
    --faint:     #5A6286;
    --line:      #D6DAEE;
    --line-soft: #E6E9F6;

    /* Бренд Constanta (синий #2F46FF). До 2026-10-08 здесь была терракота вместо прежнего сигнального #c1272d: тот же тёплый красный
       угол круга, но снятая насыщенность — акцент перестаёт кричать и начинает
       работать фоном для длинного чтения. 4.89:1 на бумаге, 4.60:1 на своей
       подложке. --accent-d — затемнённый торец для 3D-нажатия кнопок. */
    --accent:    #2F46FF;
    --accent-s:  #ECEFFE;
    --accent-d:  #1F30C7;
    --on-accent: #FFFFFF;

    --gold:      #7d6018;
    --gold-s:    #f3ecd9;
    --ok:        #3f7150;
    --ok-s:      #e6efe4;
    --ok-d:      #325b40;
    --on-ok:     #ffffff;

    /* Шесть направлений, шесть приглушённых тонов одного семейства: ни один не
       ярче акцента, иначе строка чипов перетягивает внимание с героя. */
    --dir-text:     var(--accent);
    --dir-text-s:   var(--accent-s);
    --dir-bots:     #825e13;
    --dir-bots-s:   #f2e9d9;
    --dir-visual:   #655283;
    --dir-visual-s: #ece8f2;
    --dir-web:      #2f7069;
    --dir-web-s:    #e2eeeb;
    --dir-voice:    #456185;
    --dir-voice-s:  #e6ebf2;
    --dir-agency:   #546737;
    --dir-agency-s: #e9eddd;
    --dir-pentest:   #8a3a3a;
    --dir-pentest-s: #f4e8e8;

    --shadow-1: 0 1px 2px rgba(11,16,38,.05);
    --shadow-2: 0 1px 2px rgba(11,16,38,.06), 0 6px 20px -6px rgba(11,16,38,.12);
    --shadow-3: 0 2px 4px rgba(11,16,38,.07), 0 14px 32px -10px rgba(11,16,38,.18);

    --r-lg: 20px;
    --r-md: 15px;
    --r-sm: 11px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
    --bg:        #0B1026;
    --bg-sunk:   #070A1A;
    --card:      #131938;
    --ink:       #F2F4FF;
    --muted:     #AAB2D6;
    --faint:     #8F98C2;
    --line:      #262E5A;
    --line-soft: #1B2248;

    --accent:    #8B9AFF;
    --accent-s:  #1B2366;
    --accent-d:  #6B7CF0;
    --on-accent: #0B1026;

    --gold:      #d3ac5e;
    --gold-s:    #2e2512;
    --ok:        #86b58e;
    --ok-s:      #16281a;
    --ok-d:      #5d8a66;
    --on-ok:     #0e1a10;

    --dir-text:     var(--accent);
    --dir-text-s:   var(--accent-s);
    --dir-bots:     #d9a45c;
    --dir-bots-s:   #2f2411;
    --dir-visual:   #b0a0d8;
    --dir-visual-s: #252038;
    --dir-web:      #74bdb3;
    --dir-web-s:    #16302c;
    --dir-voice:    #96b0d4;
    --dir-voice-s:  #1c2436;
    --dir-agency:   #adc188;
    --dir-agency-s: #242c16;
    --dir-pentest:   #d87d7d;
    --dir-pentest-s: #301818;

    --shadow-1: none;
    --shadow-2: 0 1px 2px rgba(0,0,0,.5);
    --shadow-3: 0 8px 28px -10px rgba(0,0,0,.7);
}

/* Тот же тёмный набор третьим блоком — обязательно. app.js при теме «Как в
   Telegram» снимает data-theme с <html>, и токен, заведённый только в двух
   блоках, молча падает на светлое значение (см. CLAUDE.md, «НЕ ЛОМАТЬ»). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:        #0B1026;
        --bg-sunk:   #070A1A;
        --card:      #131938;
        --ink:       #F2F4FF;
        --muted:     #AAB2D6;
        --faint:     #8F98C2;
        --line:      #262E5A;
        --line-soft: #1B2248;

        --accent:    #8B9AFF;
        --accent-s:  #1B2366;
        --accent-d:  #6B7CF0;
        --on-accent: #0B1026;

        --gold:      #d3ac5e;
        --gold-s:    #2e2512;
        --ok:        #86b58e;
        --ok-s:      #16281a;
        --ok-d:      #5d8a66;
        --on-ok:     #0e1a10;

        --dir-text:     var(--accent);
        --dir-text-s:   var(--accent-s);
        --dir-bots:     #d9a45c;
        --dir-bots-s:   #2f2411;
        --dir-visual:   #b0a0d8;
        --dir-visual-s: #252038;
        --dir-web:      #74bdb3;
        --dir-web-s:    #16302c;
        --dir-voice:    #96b0d4;
        --dir-voice-s:  #1c2436;
        --dir-agency:   #adc188;
        --dir-agency-s: #242c16;
        --dir-pentest:   #d87d7d;
        --dir-pentest-s: #301818;

        --shadow-1: none;
        --shadow-2: 0 1px 2px rgba(0,0,0,.5);
        --shadow-3: 0 8px 28px -10px rgba(0,0,0,.7);
    }
}

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

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Иконки: контур наследует цвет текста, поэтому работают в обеих темах. */
.ic { display: block; flex: none; }

/* ---------- Верхняя панель ---------- */

.topbar[hidden] { display: none; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line-soft);
    padding-top: env(safe-area-inset-top, 0px);
}
.topbar-in {
    display: flex; align-items: center; gap: 10px;
    max-width: 720px; margin: 0 auto;
    padding: 9px 14px;
}
.back {
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--card);
    width: 34px; height: 34px; border-radius: var(--r-sm);
    color: var(--ink); flex: none; padding: 0;
    transition: transform .12s ease;
}
.back:active { transform: scale(.93); }
/* display:flex выше перебил бы штатный [hidden], поэтому прячем явно. */
.back[hidden] { display: none; }

.logo { display: flex; flex: none; color: var(--accent); }
.logo-mark { display: block; border-radius: 9px; }

.brand { flex: 1; min-width: 0; }
.brand-name {
    display: block; font-weight: 700; font-size: 14.5px;
    letter-spacing: -.015em; line-height: 1.2;
}
.brand-sub {
    display: block; font-size: 11.5px; color: var(--muted); line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wallet { display: flex; gap: 6px; flex: none; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 5px 9px 5px 7px; border-radius: 999px; white-space: nowrap;
    line-height: 1;
}
.chip .ic { width: 15px; height: 15px; }
.chip-fire { background: var(--accent-s); color: var(--accent); }
.chip-coin { background: var(--gold-s);   color: var(--gold);   }
.chip-combo { background: var(--bg-sunk); color: var(--muted); border: 1px solid var(--line); }
.chip-combo.is-frenzy { background: var(--accent); color: var(--on-accent); border-color: transparent; animation: frenzyPulse 1.8s ease-in-out infinite alternate; }
@keyframes frenzyPulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ---------- Каркас ---------- */

.screen {
    max-width: 720px; margin: 0 auto;
    padding: 18px 14px calc(88px + var(--safe-b));
}

.tabbar[hidden] { display: none; }
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: center; gap: 4px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line-soft);
    padding: 7px 8px calc(7px + var(--safe-b));
}
.tab {
    flex: 1; max-width: 150px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; padding: 5px 4px; border-radius: var(--r-md);
    color: var(--faint);
    transition: color .15s ease;
}
.tab-ico { display: flex; }
.tab-ico-wrap { display: flex; position: relative; }
.tab.is-active { color: var(--accent); }
.tab.is-active .tab-ico .ic { stroke-width: 2; }
.tab-txt { font-size: 11px; font-weight: 600; letter-spacing: -.005em; }

/* Заблокированная вкладка остаётся видимой — состояние, а не исчезновение
   (редизайн 2026-08, REDESIGN_PLAN.md §Фаза 1: раньше пропадала через display:none).
   Бейдж-замок лежит рядом с .tab-ico, не внутри — paintStaticIcons() перезаписывает
   innerHTML именно .tab-ico при каждой перерисовке иконок, вложенный бейдж бы стирало. */
.tab-lock-badge {
    display: none;
    position: absolute; top: -3px; right: -6px;
    width: 13px; height: 13px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--line-soft);
    color: var(--faint);
    align-items: center; justify-content: center;
}
.tab-lock-badge .ic { width: 8px; height: 8px; stroke-width: 3; }
.tab.is-locked { opacity: .55; }
.tab.is-locked .tab-lock-badge { display: flex; }

/* ---------- Типографика ---------- */

h1 {
    font-size: 25px; line-height: 1.2; letter-spacing: -.028em;
    margin: 0 0 6px; font-weight: 750;
}
h2 {
    font-size: 17.5px; line-height: 1.3; letter-spacing: -.018em;
    margin: 0 0 9px; font-weight: 700;
}
h3 { font-size: 14.5px; margin: 0 0 5px; font-weight: 650; letter-spacing: -.008em; }
h1, h2, h3 { font-family: "Geologica", "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
p  { margin: 0 0 12px; }

.lead  { color: var(--muted); font-size: 15px; line-height: 1.5; }
.small { font-size: 13px; color: var(--muted); }
.tiny  { font-size: 12px; color: var(--faint); line-height: 1.45; }
.center { text-align: center; }
.num   { font-variant-numeric: tabular-nums; }

.eyebrow {
    display: inline-block; font-size: 10.5px; font-weight: 800;
    letter-spacing: .09em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 7px;
}

/* ---------- Карточки ---------- */

.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 16px; margin-bottom: 10px;
    box-shadow: var(--shadow-1);
}
.card-flat { box-shadow: none; }
.card-tint { background: var(--accent-s); border-color: transparent; box-shadow: none; }
.card-ok   { background: var(--ok-s);     border-color: transparent; box-shadow: none; }
.card-gold { background: var(--gold-s);   border-color: transparent; box-shadow: none; }

/* ---------- Кнопки ---------- */

.btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 15px 16px; border: 0; border-radius: var(--r-md);
    background: var(--accent); color: var(--on-accent);
    font-size: 16px; font-weight: 650; letter-spacing: -.01em;
    margin-top: 4px;
    transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); opacity: .92; }
/* Неактивная кнопка — своя заливка, а не прозрачность. Полупрозрачный лайм на
   near-black превращался в мутную оливу с тёмным текстом поверх: нечитаемо.
   Явные приглушённые токены дают и «выключено», и сохранённую читаемость. */
.btn[disabled] { background: var(--bg-sunk); color: var(--faint); opacity: 1; transform: none; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-quiet { background: transparent; color: var(--muted); font-weight: 600; padding: 13px; }
/* Цвет текста — токен, а не #fff: в тёмной теме --ok светло-зелёный, и белый
   текст на нём не читался. Тот же приём, что и с --on-accent. */
.btn-ok    { background: var(--ok); color: var(--on-ok); }
.btn-row   { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }
.btn-sm    { padding: 11px 13px; font-size: 13.5px; border-radius: var(--r-sm); gap: 6px; }
.btn .ic   { width: 17px; height: 17px; }

/* ---------- Месяц ---------- */

.month {
    margin: 0 0 8px;
    padding: 14px 16px; border-radius: var(--r-lg);
    background: var(--card); border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.month-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.month-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.015em; }
.month-target {
    font-size: 12px; font-weight: 700; color: var(--ok);
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.month-goal { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.bar {
    display: block;
    height: 7px; border-radius: 999px; background: var(--bg-sunk);
    overflow: hidden; margin-top: 11px;
}
/* Заливка — акцент, а не градиент: прежний перламутр был светлым, и на светлом
   же треке (--bg-sunk) шкала переставала читаться совсем. Раньше это сходило с
   рук только потому, что градиент был кислотно-лаймовый на near-black. */
.bar-in {
    display: block;
    height: 100%; background: var(--accent); border-radius: 999px;
    transition: width .45s cubic-bezier(.16,1,.3,1);
}
.bar-ok .bar-in { background: var(--ok); }
/* Внутри блока, окрашенного в направление, шкала следует за ним. */
[data-dir] .bar    { background: color-mix(in srgb, var(--dir) 18%, transparent); }
[data-dir] .bar-in { background: var(--dir); }

/* ---------- Недели ---------- */

.week {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 13px 14px; margin-bottom: 7px;
    box-shadow: var(--shadow-1);
    transition: transform .12s ease;
}
.week:active { transform: scale(.99); }
.week.is-locked { background: transparent; border-color: var(--line-soft); box-shadow: none; }
.week.is-done   { border-color: color-mix(in srgb, var(--ok) 28%, var(--line)); }

.week-num {
    flex: none; width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums;
    background: var(--accent-s); color: var(--accent);
}
.week.is-done   .week-num { background: var(--ok-s); color: var(--ok); }
.week.is-locked .week-num { background: var(--bg-sunk); color: var(--faint); }

.week-body { flex: 1; min-width: 0; }
.week-title { display: block; font-weight: 650; font-size: 15px; letter-spacing: -.012em; }
.week-sub   { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.week-meta  { display: block; font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.week.is-locked .week-title { color: var(--muted); }
.week-go { flex: none; color: var(--faint); display: flex; }

/* ---------- Переключатель направления (редизайн 2026-08, REDESIGN_PLAN.md) ----------
   Постоянно видимая строка чипов вместо пункта списка внизу главного экрана.
   Каждое направление подсвечивается своим токеном --dir-* (см. §1 палитры). */

/* Общий каскад: любой элемент с data-dir="text|bots|visual" получает --dir/--dir-s,
   дальше все дочерние правила ссылаются только на них — не на --dir-text/-bots/-visual
   напрямую. Так путь урока красится в цвет ТЕКУЩЕГО направления, а не всегда в text. */
/* Запасное значение идёт ПЕРВЫМ: у [data-dir] и [data-dir="..."] одинаковая
   специфичность, побеждает последнее правило. Направление без своей строки
   ниже рисовалось пустым — var(--dir) не резолвился, рамка активного чипа
   падала на currentColor, подложка уходила в прозрачность. */
[data-dir]          { --dir: var(--accent);     --dir-s: var(--accent-s); }

[data-dir="text"]   { --dir: var(--dir-text);   --dir-s: var(--dir-text-s); }
[data-dir="bots"]   { --dir: var(--dir-bots);   --dir-s: var(--dir-bots-s); }
[data-dir="visual"] { --dir: var(--dir-visual); --dir-s: var(--dir-visual-s); }
[data-dir="web"]    { --dir: var(--dir-web);    --dir-s: var(--dir-web-s); }
[data-dir="voice"]  { --dir: var(--dir-voice);  --dir-s: var(--dir-voice-s); }
[data-dir="agency"] { --dir: var(--dir-agency); --dir-s: var(--dir-agency-s); }
[data-dir="pentest"] { --dir: var(--dir-pentest); --dir-s: var(--dir-pentest-s); }

/* .eyebrow по умолчанию везде --accent (бренд) — внутри направления-окрашенного
   контейнера красится в --dir. Задаём один раз здесь, а не инлайн-стилем на
   каждом месте вызова (см. viewDirection/viewPlacementResult/viewLesson). */
[data-dir] .eyebrow { color: var(--dir); }

/* Строка чипов .dir-row / .dir-chip удалена вместе с разметкой: переключение
   трека одним тапом на главной обесценивало выбор на три месяца и читалось
   как витрина. Выбор переехал на отдельный экран (колода .dir-deck ниже), на главной
   осталась только подпись текущего трека (.cur-track). */

/* Карточка, тонированная в цвет текущего направления — как .card-tint, но
   динамически по [data-dir], не захардкожена на --accent. */
.card[data-dir] { background: var(--dir-s); border-color: transparent; box-shadow: none; }

/* ---------- Главный путь: карточка следующего шага ----------
   Единственная карточка на экране такого веса — намеренно крупнее и заметнее
   второстепенного (.list-compact ниже), чтобы у новичка был один явный CTA.

   Подложка — сплошной тон текущего направления (--dir-s), без градиента.
   Градиент здесь был всегда светлым в обеих темах и тянул за собой отдельную
   пару токенов на текст (--on-iri / --on-iri-dim), мимо остальной системы.
   Сплошной --dir-s тонируется темой сам, поэтому текст берёт обычные --ink и
   --muted, а карточка заодно отвечает на вопрос «в каком я треке» цветом, а
   не только подписью.

   --faint внутри карточки не используем: на тёмных подложках направлений он
   даёт 4.15–4.48:1, ниже нормы. Третичный текст здесь — --muted (от 5.08:1). */

.path-card {
    position: relative; overflow: hidden;
    border-radius: var(--r-lg); padding: 16px 16px 15px; margin-bottom: 22px;
    background: var(--dir-s);
    border: 1px solid color-mix(in srgb, var(--dir) 20%, transparent);
    color: var(--ink);
    box-shadow: var(--shadow-2);
}

/* Шапка карточки: знак направления, подпись шага и кольцо прогресса недели.
   Раньше подпись и шкала шагов стояли в одну строку и на 375px подпись
   переносилась, разрывая ряд сегментов. Теперь это сетка: знак — колонка
   фиксированной ширины, текст — резиновая, кольцо — снова фиксированная. */
.path-head {
    display: flex; align-items: center; gap: 11px; margin-bottom: 13px;
}
.path-badge {
    flex: none; width: 40px; height: 40px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dir); color: var(--card);
}
.path-head-body { flex: 1; min-width: 0; }
.path-eyebrow {
    display: block; margin-bottom: 7px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--dir);
}
.path-segs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.path-segs .seg {
    display: block; height: 4px; flex: 1 1 8px; max-width: 22px; min-width: 6px;
    border-radius: 2px; overflow: hidden;
    background: color-mix(in srgb, var(--dir) 22%, transparent);
}
.path-segs .seg i { display: block; height: 100%; width: 0%; background: var(--dir); }
.path-segs .seg.is-done i    { width: 100%; }
.path-segs .seg.is-current i { width: 55%; }

/* Кольцо недели — тот же компонент, что на экране профиля, в уменьшенном виде:
   отдельный виджет ради одного места заводить незачем (см. DESIGN_SYSTEM.md). */
.path-ring { position: relative; flex: none; width: 46px; height: 46px; }
/* .ring в разметке — span, а не div: без display:block ширина/высота на нём
   не сработают и кольцо схлопнется в ноль. */
.path-ring .ring {
    display: block;
    --ring-c: var(--dir);
    --ring-track: color-mix(in srgb, var(--dir) 26%, transparent);
}
.path-ring .ring-mid {
    font-size: 11.5px; font-weight: 750; color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.path-card h2 {
    font-size: 21px; font-weight: 750; letter-spacing: -.028em;
    margin: 0 0 6px; line-height: 1.18; text-wrap: balance; color: var(--ink);
}
.path-card p  { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin: 0 0 14px; max-width: 34ch; }

/* CTA — обычный бренд-акцент: «тёплый красный = действие» значит одно и то же
   на всех экранах и не зависит от того, в каком ты треке. Внутри — иконка типа
   шага слева и шеврон справа, подпись между ними: кнопка читается как объект,
   а не как строка текста. */
.path-cta { justify-content: flex-start; gap: 10px; text-align: left; }
.path-cta .path-cta-txt { flex: 1; min-width: 0; }
.path-cta .path-cta-go  { flex: none; opacity: .8; display: flex; }

.path-meta {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin-top: 12px; font-size: 11.5px; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.path-meta span { display: inline-flex; align-items: center; gap: 5px; }
.path-meta .ic { width: 13px; height: 13px; color: var(--dir); }

/* ---------- Каскадное появление (Material) ----------
   Блоки въезжают снизу с затуханием, по очереди. Порядок задаётся инлайновым
   --i на каждом элементе, а не длинным списком :nth-child: количество карточек
   на экране выбора зависит от числа направлений, а не зашито в стили.

   Кривая — «эмфазированное замедление»: быстро стартует, мягко приходит.
   Смещение 14px, не больше: на 375px крупный сдвиг читается как рывок.
   Анимация выключается глобальным правилом prefers-reduced-motion в конце файла. */

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
/* Задержка ограничена восемью шагами: без потолка последняя из четырнадцати
   карточек выезжала на 0.7 с, и низ экрана заметно «догонял» верх. Каскад
   должен читаться как одно движение, а не как поочерёдная загрузка. */
.rise {
    animation: riseIn .42s cubic-bezier(.05, .7, .1, 1) both;
    animation-delay: calc(min(var(--i, 0), 8) * 45ms);
}

/* ---------- Вступление при первом запуске: концепция «Черновик» ----------
   Экран притворяется страницей, которая правит сама себя. Три такта = три
   правки; переключает data-act на корне. Иллюстраций нет вообще: вся графика —
   слова, которые появляются, вычёркиваются терракотовой чертой и заменяются.

   Все классы с префиксом in-: имена вроде .act, .new, .body, .dot, .top в
   приложении уже заняты, и без префикса вступление подралось бы с ними.

   Одна сетка на все три такта: надзаголовок сверху, блок по центру, вывод под
   чертой снизу. Ниже полосы — точки тактов и кнопка, они общие.

   Движение: только transform / opacity / color. Базовое состояние каждого
   элемента КОНЕЧНОЕ и видимое, скрытое живёт исключительно в @keyframes from —
   глобальный prefers-reduced-motion в конце файла снимает анимации целиком,
   и при отключённом движении текст обязан остаться на месте. */

.intro {
    position: relative;
    margin: -18px -14px calc(-88px - var(--safe-b));
    min-height: 100vh; min-height: 100dvh;
    overflow: hidden;
    display: flex; flex-direction: column;
    background: var(--bg);
}

.in-top {
    flex: none; height: 46px;
    display: flex; align-items: center; justify-content: flex-end;
    padding: env(safe-area-inset-top, 0px) 18px 0;
}
.in-skip {
    border: 0; background: none; padding: 6px 2px;
    font-size: 14px; font-weight: 600; color: var(--faint);
}
.in-skip:active { opacity: .5; }
.in-skip[hidden] { visibility: hidden; display: block; }

.in-stage { position: relative; flex: 1 1 auto; min-height: 0; }

/* Акты лежат друг на друге, виден один. display, а не opacity: скрытый акт не
   должен ни занимать место, ни держать свои анимации запущенными. */
.in-act {
    position: absolute; inset: 0;
    display: none; flex-direction: column;
    padding: 2px 24px 20px;
}
.intro[data-act="1"] .in-act1,
.intro[data-act="2"] .in-act2,
.intro[data-act="3"] .in-act3 { display: flex; }

.in-kicker {
    flex: none; margin: 0;
    font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--faint);
}
.in-body {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column; justify-content: center;
}
.in-foot {
    flex: none; margin: 0; padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* Общая механика правки: старое тускнеет и перечёркивается, новое встаёт под ним. */
.in-old { position: relative; display: inline-block; color: var(--faint); }
.in-cut {
    position: absolute; left: -3px; right: -3px; top: 54%; height: 2px;
    background: var(--accent); transform-origin: left center; border-radius: 2px;
}
.in-ar { color: var(--accent); font-weight: 700; margin-right: 9px; }

/* --- Правка 1 --- */
.in-edits { display: flex; flex-direction: column; gap: 26px; }
.in-edit { display: flex; flex-direction: column; }
.in-edit .in-old { font-size: 20px; align-self: flex-start; }
.in-new { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.16; margin-top: 1px; }
.in-a1-final { font-size: 26px; font-weight: 700; line-height: 1.24; letter-spacing: -.02em; }
.in-a1-final b { color: var(--accent); }

/* --- Правка 2 --- */
.in-q {
    flex: none; margin: 0 0 22px;
    font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25;
    transform-origin: left center;
}
.in-dirs { display: flex; flex-direction: column; gap: 13px; }
/* Слово и подпись — две строки от ОДНОЙ левой вертикали. Подпись сбоку от
   крупного слова читалась как продолжение строки, а не как пояснение к нему. */
.in-d { margin: 0; display: flex; flex-direction: column; align-items: flex-start; }
.in-d b {
    font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.08;
    color: var(--dir, var(--accent));
}
.in-d span { font-size: 13.5px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.in-a2-foot { font-size: 16px; color: var(--muted); line-height: 1.4; }
.in-a2-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- Правка 3 --- */
.in-lead { margin: 0 0 2px; font-size: 20px; color: var(--muted); }
.in-swap { margin: 0; font-size: 22px; }
.in-big {
    margin: 6px 0 0;
    font-size: 44px; font-weight: 800; letter-spacing: -.038em; line-height: 1.04;
    color: var(--accent);
}
.in-why { margin: 24px 0 0; font-size: 16px; line-height: 1.45; color: var(--muted); }
.in-why b { color: var(--ink); font-weight: 700; }
.in-tag {
    display: inline-block; margin-left: 5px; vertical-align: 1px;
    background: var(--ok-s); color: var(--ok);
    font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    padding: 2px 9px; border-radius: 999px;
}
.in-m-row { display: flex; align-items: baseline; gap: 10px; }
.in-m-lab { font-size: 15px; color: var(--muted); width: 24px; flex: none; }
.in-m-num {
    font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: var(--gold);
    font-variant-numeric: tabular-nums; line-height: 1.15; word-spacing: 2px;
}
.in-m-cur { margin: 7px 0 0; font-size: 13.5px; color: var(--faint); line-height: 1.35; }

/* --- Низ --- */
.in-bottom {
    flex: none; padding: 14px 24px calc(16px + var(--safe-b));
    display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.in-dots { display: flex; gap: 5px; }
.in-dot {
    width: 22px; height: 3px; border-radius: 999px;
    background: var(--line); transition: background .2s ease;
}
.in-dot.is-on { background: var(--accent); }
.in-bottom .btn { width: 100%; }

/* ---------- Переход на выбор направления ----------
   Тот же жест, что и вычёркивание внутри тактов, только во всю ширину: черта
   прочерчивается по экрану, страница уезжает вверх и уступает место. Следующий
   экран поднимается снизу своим общим каскадом (staggerIn в render), поэтому
   стык читается как одно движение, а не как подмена картинки.

   340 мс в bindIntro согласованы с длительностями ниже: навигация происходит,
   когда страница уже ушла, но до того, как анимация формально закончится —
   иначе на стыке заметен «мёртвый» кадр. */
.in-wipe {
    position: absolute; left: 0; right: 0; top: 50%; height: 2px; z-index: 4;
    background: var(--accent); border-radius: 2px;
    transform: scaleX(0); transform-origin: left center;
    pointer-events: none;
}
.intro.is-leaving .in-wipe   { animation: inWipe .26s cubic-bezier(.4,0,.2,1) both; }
.intro.is-leaving .in-stage  { animation: inLeave .3s cubic-bezier(.4,0,1,1) .04s both; }
.intro.is-leaving .in-top,
.intro.is-leaving .in-bottom { animation: inLeaveSoft .26s ease .04s both; }

@keyframes inWipe {
    from { transform: scaleX(0); opacity: 1; }
    70%  { transform: scaleX(1); opacity: 1; }
    to   { transform: scaleX(1); opacity: 0; }
}
@keyframes inLeave    { to { opacity: 0; transform: translateY(-26px); } }
@keyframes inLeaveSoft { to { opacity: 0; } }

/* ---------- Движение внутри тактов ---------- */
@keyframes inRise   { from { opacity: 0; transform: translateY(10px); } }
@keyframes inRiseLg { from { opacity: 0; transform: translateY(18px); } }
@keyframes inCut    { from { transform: scaleX(0); } }
@keyframes inDim    { from { color: var(--ink); } }
@keyframes inPop    { from { opacity: 0; transform: scale(.7); } }

/* Правка 1: четыре возражения по очереди — появилось, вычеркнулось, заменилось. */
.intro[data-act="1"] .in-act1 .in-ow  { animation: inRise .32s cubic-bezier(.2,.8,.3,1) both;  animation-delay: calc(var(--i) * .58s); }
.intro[data-act="1"] .in-act1 .in-old { animation: inDim .28s linear both;                     animation-delay: calc(var(--i) * .58s + .34s); }
.intro[data-act="1"] .in-act1 .in-cut { animation: inCut .24s cubic-bezier(.4,0,.2,1) both;    animation-delay: calc(var(--i) * .58s + .34s); }
.intro[data-act="1"] .in-act1 .in-new { animation: inRiseLg .4s cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(var(--i) * .58s + .48s); }
.intro[data-act="1"] .in-a1-final     { animation: inRiseLg .5s cubic-bezier(.2,.8,.3,1) both; animation-delay: 2.85s; }

/* Правка 2: вопрос стоит плакатом, ужимается до строки и уходит наверх.
   Пустых кадров быть не должно: у плаката НЕТ фазы прозрачности, поэтому с
   первого кадра такта на экране крупный вопрос, а направления стартуют раньше,
   чем он доехал — уход одного и приход других идут внахлёст. */
.in-act2 { --poster-y: 222px; }
@keyframes inShrink {
    0%   { transform: translateY(var(--poster-y)) scale(2.1); }
    38%  { transform: translateY(var(--poster-y)) scale(2.1); }
    100% { transform: none; }
}
.intro[data-act="2"] .in-q       { animation: inShrink 1.25s cubic-bezier(.6,0,.2,1) both; }
.intro[data-act="2"] .in-kicker  { animation: inRise .34s ease both;                      animation-delay: .04s; }
.intro[data-act="2"] .in-d       { animation: inRise .34s cubic-bezier(.2,.8,.3,1) both;  animation-delay: calc(.9s + var(--i) * .07s); }
.intro[data-act="2"] .in-a2-foot { animation: inRise .42s ease both;                      animation-delay: 1.4s; }

/* Правка 3: та же грамматика — «когда-нибудь» вычёркивается сроком. */
.intro[data-act="3"] .in-lead { animation: inRise .36s ease both;                       animation-delay: .1s; }
.intro[data-act="3"] .in-ow   { animation: inRise .32s ease both;                       animation-delay: .3s; }
.intro[data-act="3"] .in-old  { animation: inDim .28s linear both;                      animation-delay: .7s; }
.intro[data-act="3"] .in-cut  { animation: inCut .24s cubic-bezier(.4,0,.2,1) both;     animation-delay: .7s; }
.intro[data-act="3"] .in-big  { animation: inRiseLg .46s cubic-bezier(.2,.8,.3,1) both; animation-delay: .88s; }
.intro[data-act="3"] .in-why  { animation: inRise .42s ease both;                       animation-delay: 1.45s; }
.intro[data-act="3"] .in-tag  { animation: inPop .34s cubic-bezier(.2,1.4,.4,1) both;   animation-delay: 2s; }
.intro[data-act="3"] .in-money { animation: inRise .46s ease both;                      animation-delay: 2.3s; }

/* Экраны ниже iPhone SE: ужимаем крупный кегль, чтобы ничего не срезало. */
@media (max-height: 720px) {
    .in-edits { gap: 16px; }
    .in-edit .in-old { font-size: 18px; }
    .in-new { font-size: 23px; }
    .in-a1-final { font-size: 22px; }
    .in-q { font-size: 18px; margin-bottom: 16px; }
    .in-dirs { gap: 7px; }
    .in-d b { font-size: 23px; }
    .in-big { font-size: 34px; }
    .in-why { margin-top: 16px; font-size: 15px; }
    .in-m-num { font-size: 29px; }
    .in-foot { padding-top: 14px; }
}

/* ---------- Колода направлений: листаешь и выбираешь ----------
   Метафора переключателя приложений iOS: на экране одна карточка целиком,
   соседние подглядывают по краям уменьшенными и приглушёнными. Так выбор
   читается как решение («вот этот путь»), а не как строка в прайс-листе —
   ровно то, чего не хватало прежней ленте чипов на главной.

   Прокрутка со snap по центру, без библиотек. Масштаб и прозрачность соседей
   считает bindDirDeck() покадрово и кладёт в --s / --o: CSS сам расстояние до
   центра прокрутки не знает, а scroll-driven анимации поддержаны ещё не везде.
   Псевдоэлементы ::before/::after дают поля, чтобы первая и последняя карточки
   тоже вставали по центру, а не упирались в край. */

.dir-deck {
    --slide-w: min(78vw, 320px);
    display: flex; gap: 12px;
    margin: 0 -14px; padding: 4px 0 14px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.dir-deck::-webkit-scrollbar { display: none; }
/* Поля считаем от ширины самой ленты (100%), а не от 100vw: на широком экране
   .screen ограничен 720px, и поле в пол-вьюпорта увело бы центр колоды вбок. */
.dir-deck::before, .dir-deck::after {
    content: ""; flex: none; width: calc(50% - var(--slide-w) / 2);
}

.dir-slide {
    flex: none; width: var(--slide-w); scroll-snap-align: center;
    display: flex; flex-direction: column; gap: 10px;
    text-align: left; font: inherit; color: inherit;
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: var(--r-lg); padding: 16px;
    transform: scale(var(--s, 1)); opacity: var(--o, 1);
    transform-origin: 50% 55%;
    will-change: transform, opacity;
}
.dir-slide.is-current { border-color: var(--dir); background: var(--dir-s); }

.dir-slide-ico {
    width: 46px; height: 46px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dir-s); color: var(--dir);
}
.dir-slide.is-current .dir-slide-ico { background: var(--dir); color: var(--card); }

.dir-slide-title { font-size: 18px; font-weight: 750; letter-spacing: -.022em; line-height: 1.2; }
.dir-slide-sub   { font-size: 13px; color: var(--muted); line-height: 1.4; }

.dir-slide-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-fact {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 650; line-height: 1.5;
    padding: 3px 9px; border-radius: 999px;
    background: var(--bg-sunk); color: var(--muted);
}
.dir-fact .ic { width: 12px; height: 12px; color: var(--dir); }
.dir-fact-money { background: var(--ok-s); color: var(--ok); }
.dir-fact-money .ic { color: var(--ok); }

.dir-slide-plan { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.dir-slide-plan li {
    display: flex; gap: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.4;
}
.dir-slide-plan li::before { content: ""; flex: none; width: 4px; height: 4px; margin-top: 7px; border-radius: 50%; background: var(--dir); }

.dir-slide .btn { margin-top: auto; }

/* Точки под колодой — где я в списке. Активная вытягивается в капсулу, а не
   просто меняет цвет: на 375px разница в размере заметнее разницы в тоне. */
.deck-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 18px; }
.deck-dot {
    width: 6px; height: 6px; border-radius: 999px; background: var(--line);
    transition: width .22s cubic-bezier(.2,.9,.25,1), background .22s ease;
}
.deck-dot.is-on { width: 20px; background: var(--dir, var(--accent)); }

/* Строка текущего трека на главной — не переключатель, а подпись «где я».
   Ведёт на экран выбора, но выглядит как статус, а не как кнопка выбора. */
.cur-track {
    display: flex; align-items: center; gap: 9px; width: 100%;
    background: none; border: 0; padding: 0; margin: 0 0 14px;
    font: inherit; color: inherit; text-align: left;
}
.cur-track-ico {
    flex: none; width: 26px; height: 26px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dir-s); color: var(--dir);
}
.cur-track-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.cur-track-go { flex: none; font-size: 11.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 3px; }
.cur-track-go .ic { width: 12px; height: 12px; }


/* ---------- Заголовок секции: группирует, а не украшает ---------- */

.section-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; }
.section-head h3 { font-size: 13px; font-weight: 750; letter-spacing: -.005em; margin: 0; color: var(--ink); }
.section-line { flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- Второстепенный список: компактнее .week, ровно настолько,
   чтобы читаться как «не основной путь» ---------- */

.list-compact { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 22px; background: var(--card); }
.list-row {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    padding: 12px 13px; border: 0; border-bottom: 1px solid var(--line-soft);
    background: transparent; font: inherit; color: inherit;
}
.list-row:last-child { border-bottom: 0; }
.list-ico {
    flex: none; width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-sunk); color: var(--muted);
}
.list-body { flex: 1; min-width: 0; }
.list-title { display: block; font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; }
.list-sub   { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.list-go { flex: none; color: var(--faint); display: flex; }

/* ---------- Шаги недели ---------- */

.step {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 12px 13px; margin-bottom: 7px;
    transition: transform .12s ease;
}
.step:active { transform: scale(.99); }
.step.is-locked { background: transparent; border-color: var(--line-soft); }
.step-ico {
    flex: none; width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-s); color: var(--accent);
    font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.step.is-done   .step-ico { background: var(--ok-s); color: var(--ok); }
.step.is-locked .step-ico { background: var(--bg-sunk); color: var(--faint); }
/* Строка направления курса (viewDirections) — иконка тонируется в цвет
   направления, как .step.is-done тонируется в --ok. Активное (выбранное
   сейчас) направление получает акцентную обводку, как .dir-chip.is-active. */
.step[data-dir] .step-ico { background: var(--dir-s); color: var(--dir); }
.step.is-active-dir { border-color: var(--dir); }
.step-body { flex: 1; min-width: 0; }
.step-title { display: block; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.step-sub   { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.step.is-locked .step-title { color: var(--muted); }
.step-mark { flex: none; color: var(--faint); display: flex; align-items: center; gap: 4px; }
.step-val  { font-size: 12.5px; color: var(--faint); }

/* ---------- Настройки ---------- */

.group-title {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--faint); margin: 18px 2px 7px;
}
.group-title:first-child { margin-top: 0; }

.avatar-row { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.avatar-big {
    flex: none; width: 52px; height: 52px; border-radius: 50%;
    background: var(--accent-s); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}
.settings-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }

/* ---------- Теория ---------- */

.theory p { font-size: 15.5px; line-height: 1.62; }
.theory p:last-child { margin-bottom: 0; }

.ex { border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; font-size: 14.5px; }
.ex-bad  { background: var(--accent-s); }
.ex-good { background: var(--ok-s); }
.ex-tag {
    display: flex; align-items: center; gap: 5px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; margin-bottom: 6px;
}
.ex-tag .ic { width: 14px; height: 14px; }
.ex-bad  .ex-tag { color: var(--accent); }
.ex-good .ex-tag { color: var(--ok); }
.ex-body { display: block; white-space: pre-wrap; line-height: 1.5; }
.ex-note { font-size: 13px; color: var(--muted); margin-top: 9px; line-height: 1.45; }

/* ---------- Сборка промпта из блоков (тап, не ввод текста) ---------- */

.block-target {
    display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start;
    min-height: 74px; background: var(--bg-sunk); border: 1.5px dashed var(--line);
    border-radius: var(--r-md); padding: 11px;
}
.block-empty { font-size: 13.5px; color: var(--faint); line-height: 1.5; padding: 4px 2px; }
.block-bank { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.block-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
    padding: 9px 14px; font-size: 13.5px; line-height: 1.3; text-align: left;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.block-chip:active { transform: scale(.97); }
.block-chip.is-selected { border-color: var(--accent); background: var(--accent-s); color: var(--accent); font-weight: 600; }
/* Успешная сборка — токены .card-ok (--ok/--ok-s), в форме чипа. */
.block-chip.is-correct { border-color: var(--ok); background: var(--ok-s); color: var(--ok); font-weight: 600; }
.block-chip .ic { flex: none; width: 13px; height: 13px; stroke-width: 3; }
/* Вычеркнутая строка в формате «убери лишнее». Токены те же, что у .opt.is-wrong. */
.block-chip.is-wrong {
    border-color: var(--accent); background: var(--accent-s); color: var(--accent);
    text-decoration: line-through; opacity: .6; font-weight: 500;
}
/* Плитка «улетает» в собранный промпт. Класс навешивался в gamified.js
   с самого начала, а правила не было — анимация не играла. */
.block-chip.is-flying {
    transform: scale(.92); opacity: .35;
    transition: transform .14s ease, opacity .14s ease;
}

.block-meta {
    display: flex; justify-content: space-between;
    font-size: 11.5px; color: var(--faint); margin: 8px 2px 14px;
    font-variant-numeric: tabular-nums;
}

.builder-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.token-counter { font-variant-numeric: tabular-nums; }

/* ---------- Прикладные Utility-задачи (Prompt Utilities) ---------- */

.utility-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--dir-s, var(--accent-s));
    color: var(--dir, var(--accent));
    border: 1px solid var(--dir, var(--accent));
    border-radius: var(--r-sm);
    padding: 3px 8px; font-size: 11px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 8px;
}
.utility-badge .ic { width: 13px; height: 13px; stroke-width: 2.2; }

.utility-sample {
    margin: 12px 0 16px;
    background: var(--bg-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
}
.utility-sample-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: 11.5px; font-weight: 700;
    color: var(--faint); text-transform: uppercase; letter-spacing: .05em;
}
.utility-sample-head span { display: inline-flex; align-items: center; gap: 5px; }

.utility-copy-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--card); border: 1.5px solid var(--ok);
    color: var(--ok); font-weight: 600; font-size: 13px;
    border-radius: var(--r-sm); padding: 9px 14px; cursor: pointer;
    transition: all .15s ease; width: 100%; margin-top: 10px;
}
.utility-copy-btn:hover { background: var(--ok-s); }
.utility-copy-btn:active { transform: scale(.98); }
.utility-copy-btn .ic { width: 15px; height: 15px; }

/* ---------- Словарь урока простыми словами (для новичков) ---------- */

.glossary-box {
    margin: 12px 0 16px;
    background: var(--bg-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 10px 14px;
    transition: background .2s ease, border-color .2s ease;
}
.glossary-box[open] {
    background: var(--card);
    border-color: var(--line);
    box-shadow: var(--shadow-1);
}
.glossary-summary {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; font-size: 12.5px; color: var(--muted);
    user-select: none; list-style: none;
}
.glossary-summary::-webkit-details-marker { display: none; }
.glossary-summary span { display: inline-flex; align-items: center; gap: 6px; }
.glossary-summary .ic { width: 14px; height: 14px; color: var(--dir, var(--accent)); }
.glossary-summary b { color: var(--ink); font-weight: 600; }
.glossary-chevron { font-size: 11px; opacity: .7; transition: transform .2s ease; }
.glossary-box[open] .glossary-chevron { transform: rotate(180deg); }

.glossary-list {
    margin-top: 10px;
    display: flex; flex-direction: column; gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
}
.glossary-item {
    font-size: 12px; line-height: 1.45;
}
.glossary-term {
    font-weight: 700; color: var(--dir, var(--accent)); margin-right: 4px;
}
.glossary-desc {
    color: var(--muted);
}

/* ---------- A/B выбор промпта ---------- */

.ab-card {
    display: block; width: 100%; text-align: left; border: 1px solid var(--line);
    cursor: pointer; font: inherit; color: inherit;
}
.ab-card.is-locked { pointer-events: none; }
.card-bad { background: var(--accent-s); border-color: transparent; box-shadow: none; }

/* ---------- Найди ошибку: пропуск в тексте ---------- */

.gap-slot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 90px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
    border: 1.5px dashed var(--line); color: var(--faint); background: var(--bg-sunk);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.gap-slot.is-filled { border-style: solid; border-color: var(--ok); background: var(--ok-s); color: var(--ok); }
.answer-opts { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.answer-opts .block-chip { width: 100%; justify-content: center; }
.answer-opts .block-chip.is-used { opacity: .4; }

/* ---------- Обратная связь "неверно" — лёгкая встряска, только transform ----------
   Само @keyframes shake объявлено ниже, в блоке Duolingo-эффектов. Здесь его
   дубль с другой амплитудой раньше молча перекрывался тем, что идёт позже в
   файле: два одноимённых набора кадров — это не два варианта, а один, и какой
   именно применится, решает порядок строк, а не намерение. */
.is-shaking { animation: shake .32s ease; }

.pre {
    white-space: pre-wrap; word-break: break-word;
    background: var(--bg-sunk); border-radius: var(--r-sm); padding: 12px 13px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px; line-height: 1.55;
}

/* ---------- Результат проверки ---------- */

.score { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.score-num {
    font-size: 42px; font-weight: 750; letter-spacing: -.04em; line-height: .95;
    font-variant-numeric: tabular-nums;
}
/* --muted, а не --faint: это смысловые числа (из скольких, вес критерия), а не
   декор. На тонированной карточке успеха третичный цвет не дотягивал до нормы
   контраста, да и по смыслу их нужно читать, а не угадывать. */
.score-of { font-size: 14px; color: var(--muted); font-weight: 650; }
.score-txt { font-size: 14px; color: var(--muted); line-height: 1.45; }

.crit {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.crit:last-child { border-bottom: 0; padding-bottom: 0; }
.crit-ico { flex: none; margin-top: 1px; }
.crit.is-hit  .crit-ico { color: var(--ok); }
.crit.is-miss .crit-ico { color: var(--faint); }
.crit-label { flex: 1; font-size: 14px; line-height: 1.4; }
.crit.is-miss .crit-label { color: var(--muted); }
.crit-w {
    flex: none; font-size: 11.5px; color: var(--muted); font-weight: 700;
    font-variant-numeric: tabular-nums; margin-top: 2px;
}

/* ---------- Тест ---------- */

.q { margin-bottom: 20px; }
.q-title { font-weight: 650; font-size: 15.5px; margin-bottom: 10px; line-height: 1.4; letter-spacing: -.012em; }
.opt {
    display: flex; align-items: flex-start; gap: 10px;
    width: 100%; text-align: left;
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: var(--r-md); padding: 12px 13px; margin-bottom: 7px;
    font-size: 14.5px; line-height: 1.4;
    transition: border-color .15s ease, background .15s ease;
}
.opt.is-picked { border-color: var(--accent); background: var(--accent-s); }
.opt.is-right  { border-color: var(--ok);     background: var(--ok-s); }
.opt.is-wrong  { border-color: var(--accent); background: var(--accent-s); }
.opt-dot {
    flex: none; width: 19px; height: 19px; border-radius: 50%;
    border: 1.5px solid var(--faint); margin-top: 1px;
    display: flex; align-items: center; justify-content: center;
}
.opt-dot .ic { width: 12px; height: 12px; stroke-width: 3; }
.opt.is-picked .opt-dot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.opt.is-right  .opt-dot { border-color: var(--ok);     background: var(--ok);     color: var(--on-ok); }
.opt.is-wrong  .opt-dot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* Визуальные варианты (фигуры вместо слов) — сетка 2×2, точка-индикатор в углу. */
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 7px; }
.opt-grid .opt { margin-bottom: 0; }
.opt-visual {
    flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: 16px 10px; position: relative; color: var(--ink);
}
.opt-visual .opt-dot { position: absolute; top: 8px; right: 8px; margin-top: 0; }

/* Ряд фигур перед визуальным вопросом: «▲ ■ ⬠ → ?» */
.iq-prompt { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.iq-tile {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 38px; height: 38px; color: var(--ink);
    border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card);
}
.iq-tile.is-q { color: var(--accent); font-weight: 800; font-size: 17px; border-style: dashed; }

/* ---------- Боевое задание ---------- */

.check {
    display: flex; align-items: flex-start; gap: 11px;
    width: 100%; text-align: left;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 12px 13px; margin-bottom: 7px;
    font-size: 14.5px; line-height: 1.4;
    transition: background .15s ease, border-color .15s ease;
}
.check.is-on { background: var(--ok-s); border-color: transparent; }
.check-box {
    flex: none; width: 21px; height: 21px; border-radius: 7px;
    border: 1.5px solid var(--faint); color: var(--on-ok);
    display: flex; align-items: center; justify-content: center;
}
.check-box .ic { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.check.is-on .check-box { background: var(--ok); border-color: var(--ok); }
.check.is-on .check-box .ic { opacity: 1; }

.money-in {
    width: 100%; padding: 14px; border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--card);
    font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.money-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- Рейтинг ---------- */

.seg {
    display: flex; gap: 3px; background: var(--bg-sunk);
    padding: 3px; border-radius: var(--r-md); margin-bottom: 14px;
}
.seg button {
    flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 11px;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    transition: background .15s ease, color .15s ease;
}
.seg button.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-2); }

.row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row.is-me { background: var(--accent-s); border-radius: var(--r-sm); border-bottom-color: transparent; }
.row-pos {
    flex: none; width: 24px; font-weight: 750; font-size: 13.5px;
    color: var(--faint); text-align: center; font-variant-numeric: tabular-nums;
}
.row.is-me .row-pos { color: var(--accent); }
.row-name { flex: 1; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.row-val { flex: none; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.league-zone { padding: 12px 6px 6px; }
.league-zone:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- Профиль ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px; }
.stat {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 13px 8px; text-align: center;
    box-shadow: var(--shadow-1);
}
.stat-num {
    font-size: 21px; font-weight: 750; letter-spacing: -.028em;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 3px; }

.money-big {
    font-size: 29px; font-weight: 750; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 7px; }
.badge {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center; padding: 13px 6px; border-radius: var(--r-md);
    background: var(--card); border: 1px solid var(--line);
}
.badge.is-off { background: transparent; border-color: var(--line-soft); }
.bdg-ring {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-s); color: var(--gold);
}
.badge.is-off .bdg-ring { background: var(--bg-sunk); color: var(--faint); }
.badge-name { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.badge.is-off .badge-name { color: var(--muted); }

.head-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.head-row .ic { color: var(--muted); }

/* ---------- Кольцо прогресса и легенда (референс: экран статистики) ----------
   Донат-кольцо на conic-gradient, без SVG и без библиотек: доля задаётся одной
   переменной --pct прямо из разметки. Дырка вырезается mask'ом, поэтому число
   в центре — сосед кольца, а не его потомок (иначе маска съела бы и текст). */

.ring-row { display: flex; align-items: center; gap: 20px; }

.ring-wrap { position: relative; flex: none; width: 112px; height: 112px; }
.ring {
    width: 100%; height: 100%; border-radius: 50%;
    /* Трек — --line, а не --bg-sunk: утопленный фон темнее карточки и кольцо
       читалось бы дырой в ней, а не шкалой. Нужен тон чуть светлее карточки. */
    /* Трек вынесен в --ring-track: на белой карточке профиля верна --line, а на
       тонированной подложке героя она сливается с фоном и кольцо пропадает. */
    background: conic-gradient(from -90deg,
        var(--ring-c, var(--accent)) calc(var(--pct, 0) * 1%),
        var(--ring-track, var(--line)) 0);
    -webkit-mask: radial-gradient(circle, #0000 56%, #000 57%);
            mask: radial-gradient(circle, #0000 56%, #000 57%);
    transition: background .5s cubic-bezier(.16,1,.3,1);
}
.ring-mid {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.ring-num {
    font-size: 26px; font-weight: 750; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.ring-lbl { font-size: 10.5px; color: var(--faint); }

.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--legend-c, var(--faint)); }
.legend-name { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Уведомления ---------- */

.toast-wrap {
    position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b));
    z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 8px;
    background: var(--ink); color: var(--bg);
    padding: 12px 15px; border-radius: var(--r-md); font-size: 14px; font-weight: 600;
    max-width: 420px; width: 100%; line-height: 1.35;
    box-shadow: var(--shadow-3);
    animation: pop .26s cubic-bezier(.2,1,.3,1);
}
.toast-ok  { background: var(--ok);     color: var(--on-ok); }
.toast-bad { background: var(--accent); color: var(--on-accent); }
.toast .ic { flex: none; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.fade { animation: fade .3s cubic-bezier(.16,1,.3,1) both; }
@keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.hr { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- Статус-теги ----------
   Информационные, не кнопки: полупрозрачная заливка, тонкая обводка, без тени
   и без press-scale — тап по ним не должен ощущаться как нажатие CTA. */

.status-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: -.005em;
    line-height: 1.5; white-space: nowrap;
    background: color-mix(in srgb, var(--accent) 11%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.status-tag[data-sheet] { cursor: pointer; }
.status-tag[data-sheet]:active { opacity: .68; }
.status-tag .ic { width: 11px; height: 11px; stroke-width: 2.4; }

.status-tag-ok {
    background: color-mix(in srgb, var(--ok) 12%, transparent);
    color: var(--ok);
    border-color: color-mix(in srgb, var(--ok) 24%, transparent);
}
.status-tag-gold {
    background: color-mix(in srgb, var(--gold) 13%, transparent);
    color: var(--gold);
    border-color: color-mix(in srgb, var(--gold) 26%, transparent);
}
.status-tag-muted {
    background: transparent;
    color: var(--faint);
    border-color: var(--line);
}
.status-tag-accent {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

/* ==========================================================================
   Прогрессивная обратная связь: нажатие, разбор ответа, награда

   Механика взята у тренажёров-игр (осязаемое нажатие с торцом, всплывающий
   разбор снизу, вылет награды) — но перекрашена в системные токены. Раньше
   здесь стояли фирменные цвета Duolingo (#58cc02 зелёный, #ff4b4b красный,
   #ffc800 жёлтый) прямо в HEX: чужой бренд поверх своего, мимо тем и мимо
   контрастных проверок. Ни одного HEX ниже — только токены, поэтому блок
   переезжает вместе с палитрой и работает в обеих темах.
   ========================================================================== */

/* ---------- Осязаемое нажатие: кнопки и чипы ---------- */

/* Торец — затемнённый тон той же заливки (--accent-d / --ok-d), а не
   нейтральная линия: у цветной кнопки серый торец читается как грязь. */
.btn {
    position: relative;
    border-radius: var(--r-md);
    box-shadow: 0 3px 0 var(--accent-d);
    transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--accent-d);
}
.btn-ghost, .btn-quiet {
    box-shadow: 0 3px 0 var(--line);
}
.btn-ghost:active:not(:disabled), .btn-quiet:active:not(:disabled) {
    box-shadow: 0 1px 0 var(--line);
}
.btn[disabled] { box-shadow: 0 3px 0 var(--line); }

.btn-ok, .btn-3d-ok {
    background: var(--ok);
    color: var(--on-ok);
    border: none;
    box-shadow: 0 3px 0 var(--ok-d);
    font-weight: 700;
}
.btn-ok:active:not(:disabled), .btn-3d-ok:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ok-d);
}

/* «Ещё раз» после неудачи — тот же акцент, что и все остальные действия.
   Отдельный «опасный красный» здесь врал: неверный ответ в тренажёре не
   разрушительное действие, а обычный следующий шаг. */
.btn-3d-danger {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    box-shadow: 0 3px 0 var(--accent-d);
    font-weight: 700;
}
.btn-3d-danger:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--accent-d);
}

.block-chip {
    position: relative;
    box-shadow: 0 2px 0 var(--line);
    cursor: pointer;
    user-select: none;
    transition: transform .1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .1s ease, border-color .15s ease, background .15s ease;
}
.block-chip:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--line);
}
.block-chip.is-selected {
    box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 40%, transparent);
}
.block-chip.is-correct {
    box-shadow: 0 2px 0 color-mix(in srgb, var(--ok) 45%, transparent);
    animation: chipPop .35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Наведение — только там, где есть настоящий курсор: на тач-экране :hover
   залипает после тапа, и чип остаётся приподнятым до следующего касания. */
@media (hover: hover) and (pointer: fine) {
    .block-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--line); }
}

/* ---------- Индикатор прогресса урока ---------- */

.lesson-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.lesson-progress-wrap {
    flex: 1;
    height: 12px;
    background: var(--bg-sunk);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.lesson-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width .4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
/* Блик сверху — единственная декорация шкалы; светлый полупрозрачный, поэтому
   работает и на терракоте в светлой теме, и на ней же в тёмной. */
.lesson-progress-bar::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    height: 2px;
    background: color-mix(in srgb, var(--on-accent) 40%, transparent);
    border-radius: 999px;
}
.lesson-step-badge {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Разбор ответа: выезжающая снизу панель ---------- */

.duo-feedback {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 20px calc(18px + var(--safe-b));
    transform: translateY(105%);
    transition: transform .35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -8px 32px -12px rgba(0,0,0,.35);
    color: var(--ink);
}
.duo-feedback.is-visible {
    transform: translateY(0);
}

/* Смысл несут подложка и кант сверху, а текст остаётся --ink: цветной текст
   на цветной подложке пришлось бы проверять на контраст в четырёх сочетаниях
   (две темы × два исхода), а --ink проходит на обеих подложках по построению. */
.duo-feedback.is-success {
    background: var(--ok-s);
    border-top: 2px solid var(--ok);
}
.duo-feedback.is-error {
    background: var(--accent-s);
    border-top: 2px solid var(--accent);
}

.duo-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.duo-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.duo-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    animation: duoBounceIn .45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.duo-feedback.is-success .duo-icon-box {
    background: var(--ok);
    color: var(--on-ok);
    box-shadow: 0 3px 0 var(--ok-d);
}
.duo-feedback.is-error .duo-icon-box {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 3px 0 var(--accent-d);
}

.duo-title-wrap { flex: 1; min-width: 0; }
.duo-title {
    font-size: 18px;
    font-weight: 750;
    margin: 0 0 2px;
    letter-spacing: -.02em;
}
.duo-sub {
    font-size: 13.5px;
    color: var(--muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.duo-reward-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.duo-reward-chip .ic { color: var(--gold); }

.duo-action-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: var(--r-md);
    cursor: pointer;
    margin-top: 0;
}

.duo-preview-toggle {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}
/* Свой значок «▾» в подписи уже есть, поэтому системный треугольник убираем —
   иначе в строке два разных указателя раскрытия подряд. */
.duo-preview-toggle summary {
    font-weight: 700;
    cursor: pointer;
    outline: none;
    color: var(--ink);
    list-style: none;
}
.duo-preview-toggle summary::-webkit-details-marker { display: none; }
.duo-preview-toggle .pre {
    margin-top: 8px;
    max-height: 140px;
    overflow-y: auto;
}

/* ---------- Вылет награды ---------- */

.flying-reward {
    position: fixed;
    z-index: 1000;
    font-size: 15px;
    font-weight: 750;
    pointer-events: none;
    animation: duoFlyUp 1s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Те же токены, что у .toast: всплывающая плашка в приложении одна по смыслу,
   и выглядеть она должна одинаково, откуда бы ни прилетела. */
.fly-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ink);
    color: var(--bg);
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow-3);
}
.fly-chip .ic { color: var(--gold); }

/* ---------- Анимации ---------- */

@keyframes chipPop {
    0%   { transform: scale(0.9); }
    50%  { transform: scale(1.07); }
    100% { transform: scale(1); }
}

@keyframes duoBounceIn {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.18); }
    80%  { transform: scale(0.94); }
    100% { transform: scale(1); opacity: 1; }
}

/* Амплитуда 5px, а не 8: на 375px восемь пикселей в каждую сторону уводят
   карточку под край экрана и читаются как сбой отрисовки, а не как отказ. */
@keyframes shake {
    0%, 100%  { transform: translateX(0); }
    20%, 60%  { transform: translateX(-5px); }
    40%, 80%  { transform: translateX(5px); }
}

@keyframes duoFlyUp {
    0%   { opacity: 0; transform: translateY(0) scale(0.7); }
    25%  { opacity: 1; transform: translateY(-20px) scale(1.12); }
    75%  { opacity: 1; transform: translateY(-50px) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* Одно определение на всё приложение. Их было два — .is-shaking с shake .32s
   и второе с duoShake .35s !important; побеждало второе, первое было мёртвым
   кодом, а JS снимал класс через 320ms и обрывал анимацию на середине. */
.is-shaking { animation: shake .3s ease-in-out; }

/* ---------- Bottom sheet ---------- */

.sheet-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(10, 8, 6, .44);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
}
.sheet-overlay.is-open { opacity: 1; pointer-events: auto; }
.sheet-overlay[hidden] { display: none; }

.sheet {
    width: 100%; max-width: 560px; max-height: min(78vh, 640px);
    background: var(--card);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-3);
    padding: 8px 18px calc(18px + var(--safe-b));
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2,.9,.25,1);
}
.sheet-overlay.is-open .sheet { transform: translateY(0); }
.sheet-overlay.is-dragging .sheet { transition: none; }

.sheet-handle {
    width: 36px; height: 4px; border-radius: 3px;
    background: var(--line); margin: 6px auto 12px; flex: none;
    touch-action: none;
}
.sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 12px; flex: none;
    touch-action: none;
}
.sheet-head h3 { margin: 0; font-size: 16.5px; }
.sheet-close {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: var(--bg-sunk); color: var(--muted); border: 0; padding: 0;
}
.sheet-close .ic { width: 15px; height: 15px; }
.sheet-close:active { transform: scale(.9); }

.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-body p:last-child { margin-bottom: 0; }


/* ==========================================================================
   ЕЖЕДНЕВНАЯ ПЕТЛЯ, ДОСТИЖЕНИЯ, ЛАВКА  (разметку строит quests.js)

   Ни одного нового цвета: всё собрано из --accent / --ok / --gold / --line и
   их подложек. Правило то же, что и во всём файле — переменная берётся только
   если она объявлена в :root выше, HEX не хардкодится.
   ========================================================================== */

/* ---------- Норма дня на главной ---------- */

.daily-card {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 13px 14px; margin: 0 0 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-1); text-align: left; color: inherit;
    -webkit-tap-highlight-color: transparent;
}
.daily-card:active { transform: scale(.985); }
.daily-card.is-done { background: var(--ok-s); border-color: transparent; box-shadow: none; }

/* Кольцу нужен собственный размер и позиционирование: .ring тянется на 100%
   родителя, а .ring-mid позиционируется по нему через inset. */
.daily-ring { position: relative; flex: none; width: 54px; height: 54px; }
.daily-ring .ring { display: block; }
.daily-ring .ring-num { font-size: 15px; }
.ring-den { font-size: 11px; color: var(--faint); font-weight: 650; }

.daily-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.daily-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.daily-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.daily-week { display: flex; gap: 5px; margin-top: 6px; }
.daily-go { flex: none; color: var(--faint); display: flex; }
.daily-card.is-done .daily-title,
.daily-card.is-done .daily-go { color: var(--ok); }

/* ---------- Полоса семи дней ---------- */

/* Показывает не число серии, а какие дни закрыты: пропуск виден глазами.
   Точка — состояние дня, подпись — его имя; вместе они читаются без легенды. */
.streak-strip { display: flex; gap: 7px; margin-top: 14px; justify-content: space-between; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.day i {
    display: block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--line); transition: background .3s ease, transform .3s ease;
}
.day b { font-size: 9.5px; font-weight: 600; color: var(--faint); text-transform: lowercase; }
.day.is-on i { background: var(--accent); transform: scale(1.15); }
.day.is-on b { color: var(--muted); }
.day.is-today i { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.daily-card.is-done .day.is-on i { background: var(--ok); }

/* ---------- Задания дня ---------- */

.quest-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.quest {
    display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.quest.is-done { background: var(--ok-s); border-color: transparent; }
.quest-mark {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-sunk); color: var(--muted);
}
.quest.is-done .quest-mark { background: var(--ok); color: var(--on-ok); }
.quest-body { flex: 1; min-width: 0; }
.quest-title { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.quest-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.quest .bar { display: block; margin-top: 9px; height: 5px; }
.quest.is-done .bar-in { background: var(--ok); }
.quest-prize {
    flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
    font-size: 13px; font-weight: 750; color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.quest-coin { display: flex; align-items: center; gap: 3px; }
.quest-cnt { font-size: 10.5px; font-weight: 600; color: var(--faint); }

/* ---------- Выбор нормы ---------- */

.goal-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
.goal-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 13px 14px; text-align: left; color: inherit;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.goal-opt:active { transform: scale(.985); }
.goal-opt.is-on { background: var(--accent-s); border-color: var(--accent); }
.goal-num {
    font-size: 22px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.goal-opt.is-on .goal-num { color: var(--accent); }
.goal-title { font-size: 13.5px; font-weight: 700; }
.goal-desc { font-size: 11.5px; color: var(--muted); }

/* ---------- Лавка ---------- */

.shop-purse { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-purse-ico { display: flex; color: var(--gold); }
.shop-purse-num {
    font-size: 26px; font-weight: 750; letter-spacing: -.03em; color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.shop-purse-lbl { font-size: 12.5px; color: var(--muted); }

.shop-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.shop-item {
    display: flex; align-items: center; gap: 11px; padding: 13px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.shop-item.is-blocked { opacity: .62; }
.shop-ico {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--r-sm);
    background: var(--gold-s); color: var(--gold);
}
.shop-body { flex: 1; min-width: 0; }
.shop-title { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.shop-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.shop-limit { display: block; font-size: 11px; color: var(--faint); margin-top: 4px; }
/* .btn задаёт width:100% — в строке лавки такая кнопка растягивалась на всю
   карточку, выдавливала описание в колонку по одному слову и вылезала за край.
   Здесь кнопка — цена сбоку, а не главное действие экрана. */
.shop-buy {
    flex: none; width: auto; margin-top: 0; align-self: center;
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.shop-buy.is-off { background: var(--bg-sunk); color: var(--faint); box-shadow: none; }

/* ---------- Достижения ---------- */

.section-num { font-size: 11.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.section-more {
    display: inline-flex; align-items: center; gap: 3px; padding: 0;
    background: none; border: 0; color: var(--accent);
    font-size: 11.5px; font-weight: 700;
}

.ach-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.ach {
    display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px;
    background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
}
.ach.is-on { border-color: var(--line); }
.ach-art {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg-sunk); color: var(--faint);
}
.ach.is-on .ach-art { background: var(--accent-s); color: var(--accent); }
.ach-body { flex: 1; min-width: 0; }
.ach-title { display: block; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.ach.is-on .ach-title { color: var(--ink); }
.ach:not(.is-on) .ach-title { color: var(--muted); }
.ach-desc { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; line-height: 1.35; }
.ach .bar { display: block; margin-top: 8px; height: 5px; }
.ach-cnt { display: block; font-size: 10.5px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.ach-check {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--ok); color: var(--on-ok);
}

/* ---------- Всплывающий значок ---------- */

/* Значки выпадают пачками, поэтому плашка узкая и уходит сама: очередь в
   quests.js показывает их по одной, а перекрывать экран ради каждой — значит
   превратить закрытие недели в череду закрываний окон. */
.badge-pop {
    position: fixed; left: 12px; right: 12px; z-index: 9998;
    top: calc(env(safe-area-inset-top, 0px) + 62px);
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    pointer-events: none;
    animation: badgePopIn .28s cubic-bezier(.16,1,.3,1) both;
}
.badge-pop.is-out { animation: badgePopOut .24s ease both; }
@keyframes badgePopIn {
    from { opacity: 0; transform: translateY(-16px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes badgePopOut {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(-12px) scale(.97); }
}
.badge-pop-art {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--accent-s); color: var(--accent);
    animation: badgeSpin .6s cubic-bezier(.16,1,.3,1);
}
@keyframes badgeSpin {
    from { transform: rotate(-160deg) scale(.4); }
    to   { transform: none; }
}
.badge-pop-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.badge-pop-eyebrow { font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.badge-pop-title { font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; }
.badge-pop-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* ---------- Крупное празднование: уровень и норма дня ---------- */

.big-celebrate {
    position: fixed; inset: 0; z-index: 9997;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
    animation: bigFadeIn .3s ease both;
}
.big-celebrate.is-out { animation: bigFadeOut .28s ease both; }
@keyframes bigFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bigFadeOut { from { opacity: 1; } to { opacity: 0; } }
.big-inner {
    position: relative; width: 100%; max-width: 320px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 30px 22px 22px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    animation: bigRise .42s cubic-bezier(.16,1,.3,1) both;
}
@keyframes bigRise {
    from { transform: translateY(18px) scale(.94); }
    to   { transform: none; }
}

/* Лучи — коническая заливка под иконкой, а не картинка: вращается один слой,
   цвет берётся из токена и переезжает вместе с темой. */
.big-rays {
    position: absolute; top: 6px; left: 50%; width: 190px; height: 190px;
    margin-left: -95px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(
        var(--accent-s) 0 6deg, transparent 6deg 30deg,
        var(--accent-s) 30deg 36deg, transparent 36deg 60deg,
        var(--accent-s) 60deg 66deg, transparent 66deg 90deg,
        var(--accent-s) 90deg 96deg, transparent 96deg 120deg,
        var(--accent-s) 120deg 126deg, transparent 126deg 150deg,
        var(--accent-s) 150deg 156deg, transparent 156deg 180deg,
        var(--accent-s) 180deg 186deg, transparent 186deg 210deg,
        var(--accent-s) 210deg 216deg, transparent 216deg 240deg,
        var(--accent-s) 240deg 246deg, transparent 246deg 270deg,
        var(--accent-s) 270deg 276deg, transparent 276deg 300deg,
        var(--accent-s) 300deg 306deg, transparent 306deg 330deg,
        var(--accent-s) 330deg 336deg, transparent 336deg 360deg);
    -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%);
            mask: radial-gradient(circle, #000 18%, transparent 62%);
    animation: raysTurn 14s linear infinite;
    opacity: .9;
}
@keyframes raysTurn { to { transform: rotate(360deg); } }
.big-celebrate.is-goal .big-rays { background-image: none; background: radial-gradient(circle, var(--ok-s) 0%, transparent 62%); animation: none; }

.big-ico {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 82px; height: 82px; border-radius: 50%; margin-bottom: 16px;
    background: var(--accent-s); color: var(--accent);
    animation: bigPop .55s cubic-bezier(.34,1.56,.64,1) .1s backwards;
}
.big-celebrate.is-goal .big-ico { background: var(--ok-s); color: var(--ok); }
@keyframes bigPop {
    from { transform: scale(.3); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.big-title { position: relative; margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.big-sub { position: relative; margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.big-cta { position: relative; margin-top: 20px; width: 100%; }

/* ---------- Разминка перед теорией ---------- */

.warmup { background: var(--bg-sunk); border-color: transparent; box-shadow: none; }
.warmup .ab-card { margin-top: 8px; }
.warmup .small { margin-top: 8px; }

/* Разбор верного варианта после выбора в A/B. */
.ab-why {
    display: flex; flex-direction: column; gap: 4px;
    margin-top: 10px; padding: 10px 12px;
    background: var(--card); border-radius: var(--r-sm);
}
.ab-why-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10.5px; font-weight: 750; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted);
}
.ab-why-body { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Ценник шага (сколько дадут за тест и боевое задание) ---------- */

.prize { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.prize-xp, .prize-co {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 2px 6px; border-radius: 999px; white-space: nowrap;
}
.prize-xp { background: var(--accent-s); color: var(--accent); }
.prize-co { background: var(--gold-s);   color: var(--gold);   }

/* ---------- Толчок чипа монет при начислении ---------- */

.chip.is-bumped { animation: chipBump .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes chipBump {
    0%   { transform: none; }
    35%  { transform: scale(1.16); }
    100% { transform: none; }
}

/* ---------- Босс недели ---------- */
.boss-card {
    position: relative; overflow: hidden;
    margin-bottom: 18px; padding: 16px;
    border: 1px solid var(--line);
}
.boss-head { display: flex; align-items: flex-start; gap: 12px; }
.boss-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: var(--r-md);
    background: var(--accent-s); color: var(--accent);
    flex: none;
}
.boss-card.card-ok .boss-avatar { background: var(--ok-s); color: var(--ok); }
.boss-info { flex: 1; min-width: 0; }
.boss-name { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.boss-quote {
    font-size: 13px; color: var(--muted); font-style: italic;
    margin-top: 4px; line-height: 1.4;
}
.boss-hp-wrap { margin-top: 14px; }
.boss-hp-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; font-weight: 700; margin-bottom: 5px;
}
.boss-hp-lbl { color: var(--muted); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
.boss-hp-num { font-variant-numeric: tabular-nums; color: var(--ink); }
.boss-hp-bar { height: 8px; background: var(--bg-sunk); }
.boss-hp-bar .bar-in { transition: width .45s ease, background-color .3s ease; }

/* ---------- Ежедневный сундук ---------- */
.chest-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid var(--line);
    cursor: pointer;
}
.chest-card .btn { width: auto; flex: none; }
.chest-card.is-ready {
    border-color: var(--ok);
    background: color-mix(in srgb, var(--ok-s) 25%, var(--card));
}
.chest-card-ico {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--r-sm);
    background: var(--accent-s); color: var(--accent);
    flex: none;
}
.chest-card.is-ready .chest-card-ico { background: var(--ok-s); color: var(--ok); }
.chest-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chest-card-title { font-size: 14px; font-weight: 750; color: var(--ink); }
.chest-card-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chest-sheet { padding: 4px 0 10px; }
.chest-ico-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--accent-s); color: var(--accent);
}
.chest-ico-wrap.is-ready { background: var(--ok-s); color: var(--ok); }
.chest-odds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.chest-odd-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--r-sm);
    background: var(--bg-sunk); font-size: 13px;
}
.odd-ico { color: var(--muted); display: flex; }
.odd-lbl { flex: 1; color: var(--ink); font-weight: 600; }
.odd-pct { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Древо навыков ---------- */
.perks-sheet { padding: 4px 0 10px; }
.perks-list { display: flex; flex-direction: column; gap: 8px; }
.perk-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-md);
    background: var(--card); border: 1px solid var(--line);
}
.perk-row.is-owned { background: var(--bg-sunk); border-color: transparent; }
.perk-ico {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--r-sm);
    background: var(--accent-s); color: var(--accent);
    flex: none;
}
.perk-row.is-owned .perk-ico { background: var(--ok-s); color: var(--ok); }
.perk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.perk-title { font-size: 13.5px; font-weight: 750; color: var(--ink); }
.perk-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }
.perk-act { flex: none; }
.perk-buy-btn { width: auto; padding: 6px 12px; }

/* Подсветка найденной ловушки перком «Шестое чувство» */
.block-chip.is-trap-hinted {
    border-color: var(--accent) !important;
    background: var(--accent-s) !important;
}

/* ---------- Недельные лиги ---------- */
.league-board { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.league-head-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border: 1px solid var(--line);
}
.league-tier-name { font-size: 16px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.league-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.league-zones { display: flex; gap: 14px; font-size: 11.5px; margin: 4px 0 8px; color: var(--muted); }
.league-zones span { display: inline-flex; align-items: center; gap: 4px; }
.league-zone-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-up { background: var(--ok); }
.dot-stay { background: var(--line); }
.dot-down { background: var(--accent); }

.league-table { display: flex; flex-direction: column; gap: 4px; }
.league-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--r-sm);
    background: var(--card); border: 1px solid transparent;
    font-size: 13.5px;
}
.league-row.is-me {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent-s) 40%, var(--card));
    font-weight: 700;
}
.league-row.zone-promote { box-shadow: inset 4px 0 0 var(--ok); }
.league-row.zone-relegate { box-shadow: inset 4px 0 0 var(--accent); }
.league-rank { width: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; }
.league-row.is-me .league-rank { color: var(--accent); }
.league-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-xp { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- Асинхронные дуэли ---------- */
.duel-card { border: 1px solid var(--line); margin-bottom: 14px; padding: 14px; }
.duel-head { display: flex; align-items: center; justify-content: space-between; }
.duel-versus {
    display: flex; align-items: center; justify-content: space-around;
    padding: 16px 10px; margin: 12px 0;
    background: var(--bg-sunk); border-radius: var(--r-md);
}
.duel-player { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 120px; }
.duel-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-s); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.duel-player-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.duel-vs-badge {
    font-size: 14px; font-weight: 800; color: var(--muted);
    padding: 4px 8px; border-radius: var(--r-sm);
    background: var(--card); border: 1px solid var(--line);
}
.duel-timer {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
    color: var(--accent); margin: 8px 0;
}
.duel-arena { padding: 4px 0; }

/* ---------- Артели ---------- */
.artel-card { border: 1px solid var(--line); padding: 14px; margin-bottom: 14px; }
.artel-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.artel-code {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 750; letter-spacing: .08em;
    padding: 3px 8px; border-radius: var(--r-sm);
    background: var(--bg-sunk); color: var(--muted);
}
.artel-members-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.artel-member-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: var(--r-sm);
    background: var(--bg-sunk); font-size: 13px;
}
.artel-member-name { font-weight: 600; color: var(--ink); }
.artel-member-cnt { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Виртуальный офис ---------- */
.office-viewport {
    position: relative; width: 100%; height: 210px;
    border-radius: var(--r-lg); overflow: hidden;
    background: var(--bg-sunk); border: 1px solid var(--line);
    margin-bottom: 14px;
}
.office-svg-scene { width: 100%; height: 100%; display: block; }
.office-cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.office-tab-btn {
    flex: none; font-size: 12px; font-weight: 700;
    padding: 6px 12px; border-radius: var(--r-md);
    background: var(--card); border: 1px solid var(--line);
    color: var(--muted); cursor: pointer;
}
.office-tab-btn.is-active {
    background: var(--accent-s); border-color: var(--accent); color: var(--accent);
}
.office-grid { display: flex; flex-direction: column; gap: 8px; }
.office-item-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-md);
    background: var(--card); border: 1px solid var(--line);
}
.office-item-row.is-active { border-color: var(--ok); background: color-mix(in srgb, var(--ok-s) 15%, var(--card)); }
.office-item-info { flex: 1; min-width: 0; }
.office-item-title { font-size: 13.5px; font-weight: 750; color: var(--ink); }
.office-item-desc { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.office-item-act { flex: none; }
.office-item-act .btn { width: auto; padding: 6px 12px; }

/* ---------- Сюжетные главы Кыргызстана ---------- */
.story-chapter-card { border: 1px solid var(--line); padding: 16px; margin-bottom: 14px; }
.story-chapter-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 750; text-transform: uppercase;
    letter-spacing: .05em; color: var(--accent); margin-bottom: 8px;
}
.story-chapter-title { font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1.25; margin-bottom: 8px; }
.story-chapter-text { font-size: 13.5px; color: var(--ink); line-height: 1.55; }
.story-income-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--r-sm);
    background: var(--ok-s); color: var(--ok);
    font-weight: 750; font-size: 13px; margin-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}


/* Код восстановления после регистрации: крупно, моноширинно, легко списать или скопировать. */
.recovery-code {
    margin-top: 12px; padding: 16px 12px; text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--ink);
    background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r-md);
    user-select: all;
}
