/* webapp/static/css/client_app.css
   Структурные стили клиентского WebApp (app_v2.html): модалки, bottom sheet,
   слайдеры ЦНС, каркас и таб-бар. Цвета — только из tokens.css.
   Без этого файла модалки не скрывались и рендерились прямо в потоке страницы. */

.hidden { display: none !important; }

html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; overscroll-behavior-y: none; padding-bottom: calc(65px + var(--safe-b, 0px)); }

.flex-grow-wrapper { flex: 1; display: flex; flex-direction: column; }

/* ─── Overlay & Modal ─── */
.overlay {
    position: fixed; inset: 0; z-index: 40; display: none;
    background: var(--lt-scrim, rgba(8, 4, 32, .78));
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.overlay.active { display: block; }

.modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 50; display: none;
    width: calc(100% - 32px); max-width: 400px; max-height: calc(100dvh - 48px); overflow-y: auto;
    padding: 24px; box-sizing: border-box;
    background: var(--bg); color: var(--ink);
    border: 1px solid var(--hair); border-radius: var(--rad-card);
    box-shadow: var(--shadow-hi);
}
.modal.active { display: block; }

/* ─── Окно и шторка под переключателем ролей (cnsmodal1) ───
   У тренера вверху клиентского приложения виден переключатель «Мои тренировки /
   Кабинет тренера» (components.css, z-index 60 — выше оверлея и окна, чтобы из
   опроса ЦНС можно было сразу уйти в кабинет). Высокое окно (опрос ЦНС перед
   тренировкой: сон, стресс, крепатура, галочки, три кнопки) начиналось в 24px
   от верха, а переключатель занимает 8–50px: полоса нависала над верхом окна
   (сообщение владельца, 08.11). Когда переключатель виден, окно и шторка
   начинаются ниже него (50px + 8px зазор), низ окна — как был (24px).
   Без переключателя (обычный клиент, тренер в аккаунте клиента) — как было. */
body:has(#role-switch:not([hidden])) .modal { top: calc(50% + 17px); max-height: calc(100dvh - 82px); }
body:has(#role-switch:not([hidden])) .bottom-sheet { max-height: calc(100vh - 58px); max-height: calc(100dvh - 58px); }

/* ─── Bottom Sheet (Smart Swap, «Тарифы») ───
   Не выше экрана и со своей прокруткой: шторка «Тарифы» (сроки, промокод,
   8 тарифов) — около 1200px, на телефоне её верх уходил за край экрана, а
   страница под шторкой не листается (body:has(.overlay.active)) — до сроков и
   первых тарифов было не добраться (прод, 2026-10-06). vh — для старых
   WebView без dvh. */
.bottom-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    transform: translateY(110%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
    padding: 24px 20px calc(32px + var(--safe-b, 0px));
    background: var(--bg); color: var(--ink);
    border-top: 1px solid var(--hair);
    border-radius: var(--rad-card) var(--rad-card) 0 0;
}
.bottom-sheet.active { transform: translateY(0); visibility: visible; transition: transform .3s var(--ease); }
.bottom-sheet button { background: var(--g1); border: 1px solid var(--hair); border-radius: var(--rad-sm); color: var(--ink); }
/* У шторки и окна фон сплошной (--bg): размытие под карточками ничего не меняет,
   а на Android семь «стёкол» тарифов в прокручиваемой шторке WebView рисовал
   плитками — при листании карточки пропадали и появлялись квадратами (прод,
   2026-10-09). Как у карточки упражнения ниже — без вложенного размытия. */
.bottom-sheet .glass, .bottom-sheet .btn-glass,
.modal .glass, .modal .btn-glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
/* Автопродление — только при оплате звёздами (renderAutorenewBox); класс flex
   перебивал атрибут hidden, и галочка была видна при оплате на сайте. */
#tariff-autorenew-box[hidden], #nutrition-fill-btn[hidden] { display: none; }

/* ─── Слайдеры ЦНС ─── */
.range-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; margin: 15px 0; outline: none;
    border-radius: var(--rad-pill); background: var(--hair);
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    background: var(--a1); box-shadow: 0 0 10px var(--a-soft);
}
.range-slider::-moz-range-thumb {
    width: 24px; height: 24px; border: none; border-radius: 50%; cursor: pointer;
    background: var(--a1);
}

.neon-btn { background: var(--grad); color: var(--on-a); font-weight: 800; border-radius: var(--rad-pill); }
.neon-btn:active { transform: scale(.98); }

/* ─── Поля подходов ─── */
input[type="number"], .set-grid input[inputmode] {
    width: 100%; padding: 8px 4px; box-sizing: border-box;
    text-align: center; font-size: 16px; font-weight: 700;
    background: var(--well); color: var(--ink);
    border: 1px solid var(--hair); border-radius: var(--rad-sm);
}
input[type="number"]:focus, .set-grid input[inputmode]:focus { outline: none; border-color: var(--a1); }
/* Видимый фокус с клавиатуры (WCAG 2.4.7, gem19): outline: none у ползунков и focus:outline-none у полей его
   снимали совсем. html + :is — сильнее и класса, и focus:outline-none Tailwind. */
html :is(a, button, input, select, textarea, [tabindex], [role="button"]):focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; }
.rir-help { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; cursor: pointer; }
input[type="number"]::placeholder, .set-grid input[inputmode]::placeholder { color: var(--ink-2); font-weight: 400; }

.locked { opacity: .5; pointer-events: none; }
.progress-bar-fill { transition: width .3s ease; }

/* ─── Tab Bar ─── */
.tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; align-items: center;
    min-height: 65px; border-top: 1px solid var(--edge);
}
.tab-bar.hidden { display: none !important; }
/* Четыре вкладки делят ширину поровну: на экране 320px «ТРЕНИРОВКА» и
   «МАГАЗИН» помещаются без наезда. */
.tab-item { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 2px 10px; font-size: 10px; font-weight: 700; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tab-icon { font-size: 20px; margin-bottom: 2px; filter: grayscale(100%); opacity: .5; }
.tab-item.active .tab-icon { filter: none; opacity: 1; }

/* ─── Чекин ЦНС на экране тренировки ─── */
#neuro-buttons button.selected { background: var(--a-soft); border-color: var(--a1); color: var(--a-ink); }

body:has(.overlay.active) { overflow: hidden !important; }

/* ─── Сетка подходов ───────────────────────────────────────────────────────
   Одна сетка на заголовок и на строки подходов. Раньше строка несла сразу
   два несовместимых описания: Tailwind-классы grid-cols-12 с col-span и
   класс .set-row из components.css с пятью колонками (32px 1fr 1fr 64px
   40px). Побеждал .set-row, а col-span-3 ссылались на седьмую–двенадцатую
   колонки, которых в нём нет: браузер добирал их как неявные, строка
   становилась шире экрана и ломалась. Заголовок при этом оставался на 12
   колонках и не совпадал с полями.

   Селектор .set-row.set-grid — из двух классов, чтобы перебить .set-row из
   components.css независимо от порядка подключения файлов. */
.set-grid,
.set-row.set-grid {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 46px 40px;
    gap: 6px;
    align-items: center;
}
.set-row.set-grid { min-height: 44px; padding: 5px 0; }

/* Внутри карточки упражнения размытие фона не нужно: она сама уже стекло,
   а вложенное размытие удваивало цену прокрутки длинной тренировки. */
.exercise-card .glass,
.exercise-card .btn-glass { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Рукоять и хват из скобок имени — строкой под движением, мельче и приглушённо
   (exercise_names.js splitName: «рукоять «Краб» · средний хват»). */
.exercise-card .ex-grip-line { font-size: 12px; line-height: 1.3; opacity: 0.7; margin-top: 2px; overflow-wrap: anywhere; }
/* Подсказка клиенту «Грудь · сидя» под названием и кнопки подачи (workout_view.js, core/client_hint). */
.exercise-card .ex-hint-line { font-size: 12px; line-height: 1.3; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.view-bar { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; font-size: 12px; }
.view-bar__label { color: var(--ink-3); }
.view-btn { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line, rgba(255,255,255,.15)); color: var(--ink-2, #d4d4d8); }
.view-btn--on { background: var(--a-soft); border-color: var(--a1); color: var(--a-ink); font-weight: 700; }
.view-btn:disabled { cursor: default; }
.view-bar[data-view="short"] ~ * .ex-hint-line:not(.ex-hint-line--short),
.view-bar[data-view="dry"] ~ * .ex-hint-line,
.view-bar[data-view="dry"] ~ * .ex-tempo__hint { display: none; }
/* Мышцы «Работают: … · помогают: …» (core/exercise_muscles) — только в «Подробно». */
.exercise-card .ex-muscles-line { display: none; font-size: 12px; line-height: 1.3; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.view-bar[data-view="full"] ~ * .ex-muscles-line { display: block; }
/* «Коротко» — сухой план (wview2, владелец 08.11): разминка, «1. Жим — 3×10, 60 кг» + подходы, заминка; ⚠️ в строке. */
.wv-dry, .exercise-card .ex-dry { display: none; }
.view-bar[data-view="dry"] ~ .wv-dry, .view-bar[data-view="dry"] ~ * .ex-dry { display: block; }
.view-bar[data-view="dry"] ~ * :is(.ex-head, .ex-info, .weight-note, .rir-help, .warmup-sets__hint) { display: none; }
body:has(.view-bar[data-view="dry"]) :is(.phase-note, .window-note, .plan-flags, .warmup-card, .cooldown-card, .optional-note) { display: none; }
.wv-dry { font-size: 14px; line-height: 1.4; margin: 0 0 12px; } .wv-dry__head { font-weight: 700; margin-bottom: 8px; }
.ex-dry { font-size: 15px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; } .ex-dry__warn { font-size: 13px; font-weight: 400; margin-top: 2px; }
/* dryvid1 (владелец 26.11): в «Коротко» без степперов gym1 и абзаца «Разминка: …» (только скрыты — ввод цел), плотнее;
   поля и ✅ — не меньше 44 px (G-4). Разминочные подходы «ⓘ Разминка: N подх.» у упражнения остаются. */
.view-bar[data-view="dry"] ~ * .gym-steps, .view-bar[data-view="dry"] + .wv-dry:not(.wv-dry__head) { display: none; }
.view-bar[data-view="dry"] ~ * .exercise-card, .view-bar[data-view="dry"] ~ .exercise-card { padding: 6px 10px; margin-bottom: 8px; }
.view-bar[data-view="dry"] ~ * .ex-dry { margin-bottom: 2px; }
.view-bar[data-view="dry"] ~ * .warmup-sets { margin-bottom: 2px; padding: 4px 8px; } .view-bar[data-view="dry"] ~ * .warmup-sets__chips { margin: 4px 0 0; }
.view-bar[data-view="dry"] ~ * .set-grid { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 46px 44px; margin-bottom: 0; }
.view-bar[data-view="dry"] ~ * .set-row.set-grid { padding: 0; }
.view-bar[data-view="dry"] ~ * .set-grid :is(input[inputmode], input[type="number"]) { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
.view-bar[data-view="dry"] ~ * .set-row .check-btn { width: 44px; height: 44px; }

/* «🔧 Другая рукоять»: лист с вариантами движения (app_v2_smart_swap.js). */
.variant-sheet .variant-sub { color: var(--ink-2, #d4d4d8); }
.variant-list { display: flex; flex-direction: column; gap: 8px; }
.variant-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; min-height: 48px; text-align: left; font-weight: 700; font-size: 15px; cursor: pointer; }
.variant-opt.is-current { border-color: var(--a1, #39FF14); }
.variant-opt__label { min-width: 0; overflow-wrap: anywhere; }
.variant-opt__now { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--a1, #39FF14); }
.variant-error { margin-top: 10px; font-size: 13px; color: var(--danger-ink); text-align: center; }
.variant-error[hidden] { display: none; }
.variant-sheet.is-busy .variant-opt { opacity: 0.6; pointer-events: none; }
#swap-variant-btn[hidden] { display: none; }

/* «📴 Без связи» над тренировкой из кэша и в окне самочувствия (app_v2_offline.js). */
.offline-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; font-size: 12px; line-height: 1.4; text-align: center;
    font-weight: 700; color: var(--ink, #fff); background: var(--lt-warn-tint, rgba(250, 204, 21, 0.14)); border: 1px solid var(--lt-warn-edge, rgba(250, 204, 21, 0.45)); }
.offline-note[hidden] { display: none; }

/* «До конца цикла» в меню замены (app_v2_smart_swap.js): выбор срока и список равноценных замен. */
#swap-scope[hidden], #swap-cycle-box[hidden], #swap-today-box[hidden], #swap-coached-note[hidden] { display: none; }
.swap-cycle-lead { color: var(--ink-2, #d4d4d8); }
.variant-opt__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.variant-opt__sub { font-size: 12px; font-weight: 500; opacity: 0.7; }
#smart-swap-sheet.is-busy .variant-opt { opacity: 0.6; pointer-events: none; }

/* Поля в строке подхода уже обычных: по горизонтали почти нет отступа, и
   все пять элементов встают в одну строку даже на узком экране. Кегль
   остаётся 16px — меньше, и iOS зумит страницу при фокусе. */
.set-grid input[type="number"], .set-grid input[inputmode] { padding: 7px 2px; border-radius: var(--rad-sm); min-width: 0; display: block; }

/* Кнопка ✅ подхода. Раньше рядом с ней в той же ячейке лежал таймер отдыха:
   .glass задаёт position: relative и перебивал absolute из Tailwind, таймер
   вставал в строку и сдвигал кнопку. Теперь таймер отдельный (#rest-timer). */
.set-row .check-btn {
    width: 40px; height: 40px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
/* ○ — не отмечен, ✅ на заливке — сделан (ux-gpt п. 2: ✅ до подхода читался «уже сделано»). */
.set-row .check-btn { font-size: 20px; color: var(--ink-2); }
.set-row[data-done] .check-btn { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }

/* Отметка подхода докручивает экран к следующему (startRestTimer): отступ
   снизу — плашка таймера и панель вкладок, сверху — шапка с прогрессом. */
.set-row { scroll-margin: 110px 0 calc(150px + var(--safe-b, 0px)); }

/* Вес словами из плана («Лёгкая гантель 4-8 кг», «~60% от 1ПМ»): над
   таблицей, если он один на все подходы, иначе — под своим подходом. */
.weight-note {
    margin: 0 0 8px; padding: 7px 10px;
    border-radius: var(--rad-sm); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
    font-size: 12px; line-height: 1.35; font-weight: 600; color: var(--ink);
}
.weight-note__label { font-weight: 400; color: var(--ink-3); }

/* Темп и предупреждение тренера под фокусом упражнения (workout_view.js). */
.ex-tempo { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ex-tempo__hint { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.ex-safety { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--ink); }

/* Разминочные подходы (core/warmup.py): над рабочими, отметки — только на
   экране. Не .set-row — счётчик подходов и журнал их не видят. */
.warmup-sets {
    margin: 0 0 8px; padding: 7px 10px;
    border-radius: var(--rad-sm); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
}
.warmup-sets__head { font-size: 12px; font-weight: 700; color: var(--ink); }
.warmup-sets__hint { font-size: 11px; font-weight: 400; color: var(--ink-3); line-height: 1.3; }
.warmup-sets__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.warmup-chip {
    min-height: 32px; padding: 4px 10px; border-radius: var(--rad-pill);
    font: 600 12px/1.2 var(--f); color: var(--ink);
    background: transparent; box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.warmup-chip[aria-pressed="true"] { background: var(--a-soft); box-shadow: inset 0 0 0 1px var(--a1); color: var(--a-ink, var(--ink)); }
.warmup-chip[aria-pressed="true"]::before { content: "✓ "; }
.set-row .set-note {
    grid-column: 2 / -1; margin-top: -2px;
    font-size: 11px; line-height: 1.3; color: var(--ink-3); text-align: left;
}

/* Контрольный вопрос (отчёт 32 §6 шаг 5, workout_view.js): у последнего
   подхода главного упражнения в неделю 3 мезоцикла вместо поля RIR — ответ
   кнопками 0…5+ строкой под подходом; плановый запас не показывается, чтобы
   не подсказывать. Кнопки тянутся на всю ширину: на 320 px шесть штук
   встают в одну строку. */
.set-row--control { padding-bottom: 8px; }
.set-row .control-cell {
    min-height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--rad-sm); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
    font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.set-row .control-ask {
    grid-column: 1 / -1; margin-top: 2px; padding: 7px 10px;
    border-radius: var(--rad-sm); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
    text-align: left;
}
.control-ask__q { font-size: 12px; line-height: 1.3; font-weight: 700; color: var(--ink); }
.control-ask__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.control-chip {
    flex: 1 1 34px; min-width: 34px; min-height: 36px; padding: 4px 6px; border-radius: var(--rad-pill);
    font: 700 14px/1.2 var(--f); color: var(--ink); font-variant-numeric: tabular-nums;
    background: transparent; box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.control-chip[aria-pressed="true"] { background: var(--a-soft); box-shadow: inset 0 0 0 1px var(--a1); color: var(--a-ink, var(--ink)); }
.control-chip:disabled { opacity: .5; cursor: default; }

/* Кнопки в карточке упражнения: «▶ Как делать» и «📸 Проверить технику». Свой класс, а не
   btn-pill: у .btn-pill высота 48px и поля по 24px, и он перебивал утилиты
   Tailwind (px-2.5 py-1 min-h-0) — кнопки раздувались. */
.ex-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ex-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-height: 36px; padding: 6px 14px; border-radius: var(--rad-pill);
    font: 700 11px/1.2 var(--f); letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink); background: linear-gradient(155deg, var(--g1), var(--g2));
    box-shadow: inset 0 0 0 1px var(--rim-1); cursor: pointer;
    transition: transform .2s var(--ease);
}
.ex-action:active { transform: scale(.97); }
/* Видео в библиотеке нет: кнопка на месте, но тише — окно объяснит. */
.ex-action--muted { color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }

/* Кнопки «Заряжен / В норме / Выжат»: значок над подписью, без полей
   .btn-pill — три кнопки помещаются и на экране шириной 320px. */
.neuro-btn {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px; border-radius: var(--rad-sm);
    font: 700 12px/1.2 var(--f); color: var(--ink); text-align: center;
    background: linear-gradient(155deg, var(--g1), var(--g2));
    border-color: var(--hair); cursor: pointer;
}
.neuro-btn__icon { font-size: 18px; line-height: 1; }

/* Напоминания на вкладке «👤 Профиль»: семь дней недели в строку и три
   времени — помещаются и на экране шириной 320px (без полей .btn-pill). */
.remind-row { display: grid; gap: 6px; }
.remind-row--days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.remind-row--hours { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* «👤 Профиль» тремя разделами (2026-10-18): заголовок раздела крупнее подписей карточек. */
.account-section__title { font: 700 1rem/1.3 var(--f); color: var(--ink); margin: 20px 4px 10px; }
.account-section:first-of-type .account-section__title { margin-top: 0; }
.account-section[hidden], #analytics-view .progress-top [hidden] { display: none; }
.remind-opt {
    min-height: 40px; min-width: 0; padding: 6px 2px; border-radius: var(--rad-sm);
    font: 600 12px/1.2 var(--f); color: var(--ink-2); text-align: center;
    background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.remind-opt[aria-pressed="true"] { background: var(--grad); color: var(--on-a); box-shadow: none; }
.remind-opt:disabled { opacity: .45; pointer-events: none; }

/* Галочки самочувствия (modals.html): 20 px, строка ≥ 44 px нажимается целиком — это <label> (ux-gpt). */
.cns-check-row { min-height: 44px; }
.cns-check { width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: var(--a1); }

/* Графики вкладки «Аналитика» (app_v2_progress.js): SVG рисуется по ширине
   карточки; календарь — 12 недель столбцами, сверху понедельник. */
.progress-chart svg, .progress-exercise svg, #progress-body svg { display: block; width: 100%; height: auto; overflow: visible; }
.progress-bar { fill: var(--a1); opacity: .85; }   /* .6 — 2,3:1 к карточке, нужно 3:1 (gem19) */
.progress-bar--current { fill: var(--a2); opacity: 1; }
.progress-bar--empty { fill: var(--hair); opacity: 1; }
.progress-label { fill: var(--ink-3); font: 500 10px var(--f); }
.progress-line { fill: none; stroke: var(--a1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.progress-dot { fill: var(--a1); }
.progress-dot--last { fill: var(--a2); }
.progress-dates { display: flex; justify-content: space-between; margin-top: 4px; font: 500 11px/1.2 var(--f); color: var(--ink-3); }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.progress-head__name { min-width: 0; font: 600 14px/1.3 var(--f); color: var(--ink); overflow-wrap: anywhere; }
.progress-head__value { flex-shrink: 0; font: 600 13px/1.3 var(--f); color: var(--a-ink); white-space: nowrap; }
.progress-calendar {
    display: grid; grid-auto-flow: column; gap: 4px;
    grid-template-rows: repeat(7, auto); grid-template-columns: repeat(12, minmax(0, 1fr));
    max-width: 560px;   /* на ПК — без квадратов-гигантов ниже экрана (ux-gpt) */
}
.progress-day { aspect-ratio: 1; border-radius: 4px; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.progress-day--on { background: var(--grad); box-shadow: none; }
.progress-day--today { outline: 1.5px solid var(--a-ink); outline-offset: 1px; }
.progress-day--future { opacity: .35; }

/* ─── Таймер отдыха ───────────────────────────────────────────────────────
   Один на экран, прижат к низу над панелью вкладок. Раньше он висел внутри
   строки подхода: вставал в строку, вылезал за правый край экрана и закрывал
   кнопки ✅. Без .glass — тот задаёт position: relative. */
.rest-timer {
    position: fixed; z-index: 35;
    left: calc(16px + var(--safe-l, 0px)); right: calc(16px + var(--safe-r, 0px));
    bottom: calc(74px + var(--safe-b, 0px));
    max-width: 480px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 8px 8px 14px; border-radius: var(--rad-well);
    background: var(--bg); color: var(--ink);
    border: 1px solid var(--a1); box-shadow: var(--shadow-hi);
    cursor: pointer;
}
.rest-timer[hidden] { display: none; }
/* Панели вкладок нет (тренер в аккаунте клиента) — к краю экрана. */
.tab-bar.hidden ~ .rest-timer { bottom: calc(12px + var(--safe-b, 0px)); }
.rest-timer__clock { flex-shrink: 0; min-width: 4.6ch; font: 700 1.5rem/1 var(--f); font-variant-numeric: tabular-nums; }
.rest-timer__fact { flex: 1; min-width: 0; font-size: 11px; line-height: 1.3; font-style: italic; color: var(--ink-2); }
.rest-timer__close {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--well); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
}

/* ─── Обучающее видео ─────────────────────────────────────────────────────
   Окно поверх тренировки; плеер заполняет openVideo (app_v2_media.js). */
.modal.video-modal { width: calc(100% - 24px); max-width: 560px; padding: 14px; }
.video-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.video-modal__title { margin: 4px 0 0; font: 600 1rem/1.3 var(--f); color: var(--ink); }
.video-modal__close {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--well); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
}
.video-player {
    position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--rad-sm); background: #000;
}
.video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* YouTube Shorts — вертикальное видео. */
.video-player--vertical { width: auto; height: min(70dvh, 560px); aspect-ratio: 9 / 16; margin: 0 auto; }
/* Файл: размер задаёт само видео, высота — не больше экрана. */
.video-player--file { aspect-ratio: auto; }
.video-player--file video { display: block; width: 100%; max-height: 70dvh; }
/* Ролик библиотеки (dryvid1): плеер vidlib.css целиком — шапка, сцена, ×0,5/×1; не влезает — прокручивается окно. */
.video-player--library { aspect-ratio: auto; overflow: visible; background: transparent; border-radius: 0; }
.video-player--empty {
    aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 24px 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
    font-size: 14px; line-height: 1.4; color: var(--ink-2); text-align: center;
}
.video-player--empty p { margin: 0; }

/* ─── Замок пейволла ──────────────────────────────────────────────────────
   Отступы задаются одним gap, а не набором margin у каждого элемента:
   раньше иконка, текст и кнопка держали свои margin-bottom и на узком
   экране наезжали друг на друга. */
.paywall-lock {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: rgba(var(--shade-rgb), .55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
/* Открытый замок прячет атрибут hidden. Селектор с атрибутом нужен потому,
   что display:flex выше перебил бы и [hidden], и класс hidden из Tailwind. */
.paywall-lock[hidden] { display: none; }
/* То же для вкладки «Магазин» и кнопок покупки: .tab-item и .btn-pill задают
   display и перебивали hidden — клиент тренера видел «🛒» и «⭐ Повысить
   тариф», хотя скрипт их прятал (аудит пути клиента 2026-10-07). */
.tab-item[hidden], .paywall-lock button[hidden], #paywall-view button[hidden] { display: none; }

/* Содержимое под закрытым замком. Снимает класс applyFeatureLocks
   (app_v2_ui.js), когда сервер подтвердил доступ. */
.paywall-blur {
    filter: blur(12px);
    opacity: .4;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
.paywall-lock__icon { font-size: 2.75rem; line-height: 1; }
.paywall-lock__text {
    margin: 0;
    max-width: 24ch;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
}

/* Плашка «Вы в аккаунте клиента»: тренер ведёт тренировку за клиента.
   Выше оверлеев — её должно быть видно всегда. */
.proxy-banner { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--a1); color: var(--on-a, #fff); font: 600 .8125rem var(--f); }
.proxy-banner[hidden] { display: none; }
.proxy-banner__exit { flex-shrink: 0; padding: 6px 12px; border-radius: var(--rad-pill); background: var(--lt-field, rgba(var(--shade-rgb), .28)); color: inherit; font: inherit; }

/* Разовая подсказка над первым упражнением (app_v2_hints.js). Карточка в потоке,
   кнопок не перекрывает; цвета — токены темы, как у соседних .glass. */
.hint-card { padding: 14px 16px; margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 10px; }
.hint-card__text { font: 350 .875rem/1.45 var(--f); color: var(--ink-2); }
.hint-card__btn {
  align-self: flex-end; min-height: 36px; padding: 6px 16px; border-radius: var(--rad-sm);
  border: 1px solid var(--a-ink); background: transparent; color: var(--a-ink);
  font: 500 .8125rem/1 var(--f); cursor: pointer;
}

/* ─── «📓 Дневник» (app_v2_diary.js, client/tab_diary.html) ───────────────────
   Бесплатный экран записи своей тренировки. Таймер отдыха прилипает к верху
   экрана, пока листаешь упражнения; поля подходов — две колонки, как у экрана
   тренировки, и помещаются на ширине 320px. */
.diary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.diary-back {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; line-height: 1;
    color: var(--ink); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.diary-timer {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 12px; background: var(--lt-panel-94, rgba(30, 22, 74, .94));
}
.diary-timer__clock {
    flex: 0 0 auto; min-width: 4.6ch; font: 700 1.5rem/1 var(--f); font-variant-numeric: tabular-nums; color: var(--ink);
}
.diary-timer__clock.is-idle { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.diary-timer__clock.is-done { color: var(--ok); animation: pulse 1s ease-in-out infinite; }
.diary-timer__btns { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; justify-content: flex-end; }
.diary-chip {
    min-height: 36px; padding: 6px 10px; border-radius: var(--rad-pill); font: 700 12px/1.2 var(--f);
    color: var(--ink-2); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.diary-chip[aria-pressed="true"] { background: var(--a-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--a1); }
.diary-chip--stop { color: var(--hot-text); }
.diary-chip[hidden] { display: none; }

.diary-input {
    width: 100%; min-width: 0; padding: 10px 12px; border-radius: 12px; outline: none;
    background: var(--well); border: 1px solid var(--hair); color: var(--ink); font: 500 14px/1.2 var(--f);
}
.diary-input:focus { box-shadow: 0 0 0 2px var(--a1); }
.diary-num { -moz-appearance: textfield; appearance: textfield; text-align: center; padding-left: 4px; padding-right: 4px; }
.diary-num::-webkit-outer-spin-button, .diary-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.diary-results {
    margin-top: 6px; max-height: 280px; overflow-y: auto; border-radius: var(--rad-sm);
    background: var(--well); box-shadow: inset 0 0 0 1px var(--hair);
}
.diary-results[hidden] { display: none; }
.diary-results__label { padding: 8px 12px 2px; font: 700 10px/1.2 var(--f); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.diary-result {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
    padding: 10px 12px; text-align: left; font: 600 13px/1.3 var(--f); color: var(--ink);
    background: none; border-bottom: 1px solid var(--hair-soft); cursor: pointer;
}
.diary-result:last-child { border-bottom: 0; }
.diary-result > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.diary-result small { flex: 0 0 auto; max-width: 45%; text-align: right; font: 500 11px/1.2 var(--f); color: var(--ink-3); }
.diary-result--custom { color: var(--a-ink); }

.diary-ex { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair-soft); }
.diary-ex__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.diary-ex__name { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.diary-x {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; font-size: 13px; line-height: 1;
    color: var(--ink-3); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
}
.diary-set { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.diary-set--head { font: 700 10px/1.2 var(--f); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.diary-set__n { text-align: center; font: 600 12px/1 var(--f); color: var(--ink-3); }
.diary-add {
    width: 100%; min-height: 40px; margin-top: 2px; border-radius: var(--rad-sm); font: 700 12px/1.2 var(--f);
    color: var(--a-ink); background: var(--a-soft); cursor: pointer;
}
.diary-add:disabled { opacity: .4; cursor: default; }

.diary-hist { padding: 10px 0; border-bottom: 1px solid var(--hair-soft); }
.diary-hist:last-child { border-bottom: 0; }
.diary-hist__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
.diary-hist__date { font-weight: 700; }
.diary-hist__tag { padding: 2px 8px; border-radius: var(--rad-pill); font: 600 11px/1.4 var(--f); color: var(--ink-2); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.diary-hist__ex { margin: 2px 0; overflow-wrap: anywhere; }
.diary-hist__ex b { font-weight: 700; }
.diary-hist__sum { margin-top: 2px; font-size: 11px; color: var(--ink-3); }

/* «🛑 Мне плохо / Стоп» (stop1, app_v2_stop.js): заметно, но без мигания; карточка экстренной помощи — та же гамма. */
/* Текст — светлее --hot: #F0385E на своей заливке 4,3:1, #FF6B8B — 6,1:1; «Позвонить» — белым на #C81E45 (5,6:1, было 3,9:1) — gem19. */
.unwell-btn { background: var(--hot-14); color: var(--hot-ink); border: 1px solid var(--hot); }
.bottom-sheet .unwell-opt { display: block; width: 100%; text-align: left; padding: 12px 16px; margin-bottom: 8px; font-weight: 700; }
.bottom-sheet .unwell-call { display: block; width: 100%; text-align: center; padding: 14px; margin-bottom: 8px; font-weight: 800;
    border-radius: var(--rad-sm); background: #C81E45; color: #fff; text-decoration: none; }
.bottom-sheet .unwell-opt[aria-pressed="true"] { border: 2px solid var(--hot); background: var(--hot-14); }
#unwell-card.unwell-card--sos { border-color: var(--hot); background: var(--hot-14); }

/* Вкладка «Питание»: атрибут hidden у кнопок btn-pill и с классом flex перебивался их display — прежняя кнопка
   «Добавить прием пищи» и «➕ Добавить еду» (food1, app_v2_meal_entry.js) были видны вместе. */
#nutrition-view [hidden] { display: none !important; }

/* ─── «🏋️ Провести тренировку» (gym1, app_v2_gym.js; body.gym-proxy — только тренер за клиента) ─── */
.gym-proxy #neuro-checkin, .gym-proxy #ai-thought, .gym-proxy .rest-timer__fact { display: none !important; }
/* G-6: заблокированное после ✅ поле принимает касание — отметка снимается (focusin в app_v2_gym.js). */
.gym-proxy .set-row input.locked { pointer-events: auto; }
.gym-steps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.gym-steps__pair { display: inline-flex; align-items: center; gap: 2px; }
.gym-steps__label { font-size: 11px; color: var(--ink-2); min-width: 3ch; text-align: center; }
.gym-step { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 20px; font-weight: 800; border-radius: var(--rad-sm);
    background: var(--well); color: var(--ink); border: 1px solid var(--hair); }
.gym-step:active { transform: scale(.96); }
.gym-step--same { font-size: 13px; margin-left: auto; }
.gym-proxy .set-row .check-btn { min-width: 44px; min-height: 44px; }
/* G-5: число подставлено из плана — видно, правится степпером; «max» — повторы надо вписать. */
.set-grid input.val-from-plan { box-shadow: inset 0 0 0 2px var(--warn, #f59e0b); }
.set-grid input.val-need { box-shadow: inset 0 0 0 2px var(--hot, #ef4444); }
.gym-steps__plan { font-size: 11px; font-weight: 700; color: var(--warn, #f59e0b); margin-left: 4px; }
.gym-steps__plan[hidden] { display: none; }
.gym-info > summary { cursor: pointer; font-size: 12px; color: var(--ink-2); list-style: none; }
.gym-info > summary::-webkit-details-marker { display: none; }
.rest-timer__shift { min-width: 44px; min-height: 44px; padding: 0 6px; font-weight: 800; font-size: 13px; border-radius: var(--rad-sm);
    background: var(--well); color: var(--ink); border: 1px solid var(--hair); }
/* Вода: «± стакан» — маленькие кнопки, высота — для пальца (44 px). */
.water-glass { min-height: 44px; padding: 0 12px; font-size: 12px; }
/* Предупреждение о воде — мелким текстом, всегда видно. */
.water-warn { font-size: 11px; line-height: 1.35; color: var(--ink); opacity: .75; overflow-wrap: anywhere; }
