/* ==========================================================================
   С.Н.О.У. — дизайн-система
   Палитра (только эти три цвета и их оттенки/прозрачности):
     Alice Blue  #ECF4F7 — светлый фон и текст на тёмном
     Charcoal    #393F4B — основной тёмный цвет, текст, «хром»
     Burgundy    #910029 — акцент, главные действия, значимые результаты
   Шрифты: Foglihten No06 — заголовки; Montserrat — основной текст.
   Стиль: Liquid Chrome — металлические градиенты из Alice Blue и Charcoal,
   «жидкие» формы, звезда-блик из референса первого экрана.
   ========================================================================== */

:root {
    /* Базовые цвета */
    --alice: #ECF4F7;
    --charcoal: #393F4B;
    --burgundy: #910029;

    /* Оттенки, полученные смешением базовых цветов */
    --charcoal-ink: #1E2128;      /* charcoal, затемнённый на 45% — фон тёмных экранов */
    --charcoal-deep: #2B3039;     /* charcoal, затемнённый на 25% */
    --charcoal-mid: #5A616D;      /* charcoal + 20% alice */
    --charcoal-soft: #8A929F;     /* charcoal + 45% alice */
    --charcoal-mist: #C4CCD3;     /* charcoal + 75% alice */
    --alice-light: #F6FAFB;       /* alice, высветленный */
    --burgundy-deep: #6E001F;
    --burgundy-soft: #C2667F;     /* burgundy + 40% alice */
    --burgundy-tint: rgba(145, 0, 41, 0.10);

    /* Семантические токены (светлая тема — рабочие экраны) */
    --bg: var(--alice);
    --surface: var(--alice-light);
    --surface-glass: rgba(246, 250, 251, 0.78);
    --text: var(--charcoal);
    --text-muted: var(--charcoal-mid);
    --border: rgba(57, 63, 75, 0.14);
    --border-strong: rgba(57, 63, 75, 0.32);
    --accent: var(--burgundy);
    --accent-hover: var(--burgundy-deep);
    --focus-ring: 0 0 0 3px rgba(145, 0, 41, 0.25);

    --chrome: linear-gradient(135deg,
        #ECF4F7 0%, #8A929F 18%, #ECF4F7 34%, #C4CCD3 46%,
        #5A616D 62%, #ECF4F7 78%, #393F4B 100%);
    --chrome-text: linear-gradient(180deg, #ECF4F7 0%, #C4CCD3 45%, #8A929F 55%, #ECF4F7 100%);

    --font-display: 'Foglihten No06', 'Forum', 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgba(30, 33, 40, 0.06), 0 12px 32px -12px rgba(30, 33, 40, 0.18);
    --shadow-lg: 0 30px 80px -30px rgba(30, 33, 40, 0.45);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --container: 1200px;
}

/* Тёмная тема — главная и экраны входа (как первый экран из референса) */
.theme-dark {
    --bg: var(--charcoal-ink);
    --surface: var(--charcoal-deep);
    --surface-glass: rgba(43, 48, 57, 0.72);
    --text: var(--alice);
    --text-muted: var(--charcoal-mist);
    --border: rgba(236, 244, 247, 0.10);
    --border-strong: rgba(236, 244, 247, 0.24);
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
/* Атрибут hidden сильнее любых display у классов (.btn, .card…): скрипты прячут элементы именно им */
[hidden] { display: none !important; }
/* «К содержанию»: видна только при переходе клавишей Tab */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 10px 14px; background: var(--charcoal); color: var(--alice); border-radius: 8px; }
.skip-link:focus { left: 12px; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.theme-dark {
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(236, 244, 247, 0.07), transparent 70%),
        radial-gradient(40% 40% at 85% 85%, rgba(145, 0, 41, 0.16), transparent 70%),
        var(--charcoal-ink);
}

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-hover); }
.theme-dark a { color: var(--alice); }
.theme-dark a:hover { color: var(--burgundy-soft); }

h1, h2, h3, .display {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.08;
    margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.45rem; }
h4, h5 { font-family: var(--font-body); font-weight: 600; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--text-muted); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

main.page { flex: 1; padding: 32px 0 64px; overflow-x: clip; }  /* декоративные капли у края не дают горизонтальную прокрутку */

/* --------------------------------------------------------------------------
   Шапка: слева «Архив», по центру логотип (волк и название), справа пользователь
   -------------------------------------------------------------------------- */
.snou-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--border);
}
.snou-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 68px;
}
.snou-header__left, .snou-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.snou-header__right { justify-content: flex-end; }
.snou-header a { color: var(--text); }
.snou-header a:hover { color: var(--accent); }
.theme-dark .snou-header a:hover { color: var(--burgundy-soft); }
.snou-logo { display: inline-flex; align-items: center; gap: 10px; }
.snou-logo__mark { display: block; width: 40px; height: 40px; border-radius: 50%; transition: transform .6s var(--ease); }
.snou-logo:hover .snou-logo__mark { transform: scale(1.08); }
.snou-logo__text { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .04em; text-transform: none; }
.nav-icon { width: 15px; height: 15px; flex: none; }
.nav-hide-mobile { display: none; }
@media (min-width: 768px) { .nav-hide-mobile { display: inline-flex; } }
/* На планшете (768–1099 px) в шапке остаются только основные ссылки, иначе строки переносятся */
@media (min-width: 768px) and (max-width: 1099px) { .nav-hide-tablet { display: none; } }
.snou-header a, .snou-header .link-button { white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.user-chip__avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-grid; place-items: center;
    background: var(--chrome); color: var(--charcoal);
    font-size: .8rem; font-weight: 700;
}
.inline-form { display: inline; margin: 0; }
.link-button {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.link-button:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--burgundy); color: var(--alice) !important; box-shadow: 0 10px 24px -10px rgba(145, 0, 41, .7); }
.btn-primary:hover { background: var(--burgundy-deep); }
.btn-chrome {
    background: var(--chrome);
    background-size: 200% 200%;
    color: var(--charcoal) !important;
    border-color: rgba(236, 244, 247, .5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 24px -12px rgba(30, 33, 40, .6);
    animation: chrome-shift 8s ease-in-out infinite;
}
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent) !important; }
.theme-dark .btn-ghost:hover { color: var(--alice) !important; border-color: var(--alice); }
.btn-sm { padding: 8px 14px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

@keyframes chrome-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --------------------------------------------------------------------------
   Карточки, сетки, статистика
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card--glass { background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.card--accent { border-color: rgba(145, 0, 41, .45); box-shadow: 0 0 0 1px rgba(145, 0, 41, .12), var(--shadow); }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__title h3, .card__title h4 { margin: 0; }

.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }      /* таблицы и графики внутри карточек не растягивают сетку */
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat__value { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.stat__label { margin-top: 6px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.stat--accent .stat__value { color: var(--burgundy); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.theme-dark .eyebrow { color: var(--burgundy-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--text-muted); margin-bottom: 18px; }

.progress { height: 10px; border-radius: var(--radius-pill); background: rgba(57, 63, 75, .12); overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--burgundy-deep), var(--burgundy)); border-radius: inherit; transition: width .6s var(--ease); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--radius-pill);
    font-size: .74rem; font-weight: 600; letter-spacing: .02em;
    background: rgba(57, 63, 75, .08); color: var(--charcoal);
    border: 1px solid var(--border);
}
.badge--accent { background: var(--burgundy-tint); color: var(--burgundy); border-color: rgba(145, 0, 41, .25); }
.badge--solid { background: var(--burgundy); color: var(--alice); border-color: var(--burgundy); }
.badge--muted { color: var(--charcoal-mid); }
.theme-dark .badge { background: rgba(236, 244, 247, .08); color: var(--alice); }

/* --------------------------------------------------------------------------
   Таблицы
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
.table th {
    text-align: left; padding: 12px 14px;
    font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); background: rgba(57, 63, 75, .05);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(145, 0, 41, .03); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { text-align: center; color: var(--text-muted); padding: 28px !important; font-style: italic; }

/* --------------------------------------------------------------------------
   Формы
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid--2 { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label, .form-label { font-size: .86rem; font-weight: 600; color: var(--text); }
.field .help { font-size: .78rem; color: var(--text-muted); }
.field .errorlist, .errorlist { list-style: none; margin: 0; padding: 0; color: var(--burgundy); font-size: .82rem; font-weight: 500; }
.theme-dark .errorlist { color: var(--burgundy-soft); }

.form-control,
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field input[type=url],
.field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.theme-dark .form-control, .theme-dark .field input, .theme-dark .field select, .theme-dark .field textarea {
    background: rgba(236, 244, 247, .05);
}
/* Выпадающий список браузер рисует сам и берёт фон из системной (светлой) темы, а цвет
   текста — от поля, то есть светлый: получался светлый текст на белом. Тёмная схема
   и явные цвета пунктов дают тёмный фон списка и светлые пункты. */
.theme-dark select { color-scheme: dark; }
/* Само поле — почти как соседние поля ввода (у них полупрозрачный фон), список — тёмный */
.theme-dark .field select, .theme-dark select.form-control { background-color: var(--charcoal-deep); }
.theme-dark select option, .theme-dark select optgroup { background-color: var(--charcoal-ink); color: var(--alice); }
.theme-dark select option:checked { background-color: var(--charcoal-mid); }

/* Кнопка «показать пароль» (добавляется скриптом в snou.js к каждому полю пароля) */
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px !important; }
.password-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer;
}
.password-toggle:hover { color: var(--text); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .icon-hide, .password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }
.form-control:focus, .field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--burgundy); box-shadow: var(--focus-ring);
}
.field textarea { resize: vertical; min-height: 90px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.check input[type=checkbox], .check input[type=radio] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--burgundy); flex: none; }
.field ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.field ul label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.field ul input { accent-color: var(--burgundy); }

/* Сегментированный выбор (дизайн исследования) */
.segmented { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    padding: 10px 20px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); cursor: pointer;
    font-weight: 600; font-size: .9rem; color: var(--text-muted);
    transition: all .25s var(--ease);
}
.segmented input:checked + label { background: var(--charcoal); color: var(--alice); border-color: var(--charcoal); }
.segmented input:focus-visible + label { box-shadow: var(--focus-ring); }

/* --------------------------------------------------------------------------
   Сообщения (toast)
   -------------------------------------------------------------------------- */
.toasts { position: fixed; top: 84px; right: 16px; left: 16px; z-index: 100; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
    pointer-events: auto;
    max-width: 440px; width: 100%;
    padding: 14px 18px; border-radius: var(--radius-sm);
    background: var(--charcoal); color: var(--alice);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--charcoal-soft);
    font-size: .9rem; font-weight: 500;
    animation: toast-in .4s var(--ease);
}
.toast--success { border-left-color: var(--alice); }
.toast--error, .toast--warning { border-left-color: var(--burgundy); background: var(--burgundy-deep); }
.toast.is-hiding { opacity: 0; transform: translateY(-6px); transition: all .4s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Модальное окно
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.modal.is-open { display: flex; }
.modal__backdrop { position: fixed; inset: 0; background: rgba(30, 33, 40, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal__dialog {
    position: relative; width: 100%; max-width: 720px; margin: auto;
    background: var(--alice-light); color: var(--charcoal);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 28px; animation: modal-in .45s var(--ease);
}
.modal__close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--charcoal); }
.modal__close:hover { border-color: var(--burgundy); color: var(--burgundy); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.result-box { margin-top: 20px; padding: 20px; border-radius: var(--radius); background: var(--charcoal); color: var(--alice); }
.result-box__numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 12px 0; }
.result-box__numbers .stat { background: rgba(236, 244, 247, .06); border-color: rgba(236, 244, 247, .12); }
.result-box__numbers .stat__label { color: var(--charcoal-mist); }
.result-box__numbers .stat--accent .stat__value { color: var(--alice); }
.is-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Liquid Chrome: «жидкий» блоб, хромированный текст
   -------------------------------------------------------------------------- */
.chrome-text {
    background: var(--chrome-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--alice);
}
.blob {
    position: absolute;
    width: var(--size, 380px);
    height: var(--size, 380px);
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .95) 0 6%, transparent 18%),
        radial-gradient(circle at 70% 75%, rgba(30, 33, 40, .55) 0 10%, transparent 40%),
        var(--chrome);
    background-size: 100% 100%, 100% 100%, 220% 220%;
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .45));
    animation: blob-morph 14s ease-in-out infinite, chrome-shift 10s ease-in-out infinite;
    opacity: .9;
    pointer-events: none;
}
@keyframes blob-morph {
    0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: rotate(0deg) translateY(0); }
    33% { border-radius: 63% 37% 39% 61% / 55% 62% 38% 45%; transform: rotate(12deg) translateY(-12px); }
    66% { border-radius: 36% 64% 52% 48% / 38% 37% 63% 62%; transform: rotate(-8deg) translateY(8px); }
}

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

/* --------------------------------------------------------------------------
   Главная страница. Порядок блоков — в main/templates/main/main.html.
   Тёмная тема, светлые вставки (.section--light) и хром из img/chrome/.
   -------------------------------------------------------------------------- */
.home main.page { padding: 0; }

/* Общие секции */
.section { padding: 72px 0; position: relative; }
.section--tight { padding: 48px 0; }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section__head h2 { margin-bottom: 0; }
@media (max-width: 767px) { .section { padding: 56px 0; } .section--tight { padding: 40px 0; } }

/* Светлая вставка на тёмной главной: возвращаем токены светлой темы */
.section--light {
    --bg: var(--alice);
    --surface: var(--alice-light);
    --text: var(--charcoal);
    --text-muted: var(--charcoal-mid);
    --border: rgba(57, 63, 75, 0.14);
    --border-strong: rgba(57, 63, 75, 0.32);
    background: var(--alice);
    color: var(--text);
}
.section--light a { color: var(--burgundy); }
.section--light a:hover { color: var(--burgundy-deep); }
.section--light .eyebrow { color: var(--burgundy); }

/* 1. Первый экран: текст слева, маскот справа */
.hero { position: relative; overflow: hidden; padding: 56px 0 40px; text-align: center; }
.hero__title { font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: .98; text-transform: lowercase; margin: 0 auto 18px; max-width: 12ch; }
.hero__lead { max-width: 560px; margin: 0 auto 30px; color: var(--text-muted); font-size: 1.05rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 48px; }

.hero--split { padding: 40px 0 88px; }
.hero__grid { display: grid; gap: 8px; align-items: center; }
.hero__art { order: -1; justify-self: center; width: min(240px, 62vw); margin-bottom: 8px; }
.hero__art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .5)); will-change: transform; }
.hero--split .hero__actions { margin-bottom: 0; }
@media (min-width: 992px) {
    .hero--split { padding: 72px 0 112px; text-align: left; }
    .hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; }
    .hero--split .hero__title { font-size: clamp(3.4rem, 5.6vw, 5.4rem); }
    .hero--split .hero__title, .hero--split .hero__lead { margin-left: 0; }
    .hero--split .hero__actions { justify-content: flex-start; }
    /* волк вертикальный (617×831): ширину ограничиваем, чтобы первый экран не вытягивался */
    .hero__art { order: 0; width: 100%; max-width: 420px; justify-self: end; margin-bottom: 0; }
}

/* Расшифровка названия: крупные буквы, под ними слова; на телефоне — столбиком */
.name-band { text-align: center; border-top: 1px solid var(--border); }
.name-band__title { margin: 0 0 28px; }
.acronym { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 16px 44px; }
.acronym li { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.acronym__letter { font-family: var(--font-display); font-size: clamp(3.6rem, 7vw, 6rem); line-height: .9; }
.acronym__word { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.acronym__and .acronym__word { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0; text-transform: none; line-height: 1; }
@media (max-width: 767px) {
    .acronym { flex-direction: column; align-items: flex-start; width: fit-content; margin: 0 auto; gap: 4px; }
    .acronym li { flex-direction: row; align-items: center; gap: 16px; }
    .acronym__letter { width: 2.6rem; font-size: 3rem; text-align: center; }
    .acronym__and { padding-left: calc(2.6rem + 16px); }
    .acronym__and .acronym__word { font-size: 1.2rem; }
}

/* Стрелка «листать дальше» */
.scroll-cue {
    position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--border-strong); color: var(--text) !important;
    animation: cue-float 2.6s ease-in-out infinite;
}
.scroll-cue svg { width: 20px; height: 20px; }
.scroll-cue:hover { border-color: var(--alice); }
@keyframes cue-float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* 2. Возможности: четыре карточки с иконками */
.features { grid-template-columns: 1fr; }
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feature {
    padding: 26px 24px; border-radius: var(--radius);
    background: rgba(236, 244, 247, .04); border: 1px solid var(--border);
    transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.feature:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.feature__icon {
    display: block; width: 52px; height: 52px; padding: 11px; margin-bottom: 18px; border-radius: 50%;
    color: var(--alice); background: rgba(236, 244, 247, .06);
    box-shadow: inset 0 0 0 1px rgba(236, 244, 247, .22), 0 0 0 4px rgba(145, 0, 41, .14);
}
.feature h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; line-height: 1.3; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* 3. Для кого: заголовок с хромом слева, роли справа */
.audience { display: grid; gap: 28px; }
.audience__head h2 { margin-bottom: 20px; }
.audience__art { display: block; width: 100%; max-width: 300px; height: auto; margin: -12px auto -24px; }
.audience__lead { font-size: 1.1rem; line-height: 1.6; margin-bottom: 28px; }
.audience__list { margin: 0; border-top: 1px solid var(--border); }
.audience__list dt { font-weight: 700; padding-top: 18px; }
.audience__list dd { margin: 4px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .94rem; }
@media (min-width: 992px) {
    .audience { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
    .audience__art { max-width: 440px; margin: 0; }
}

/* 4–6. Модули: ряды «текст + скриншот», чётные зеркальные */
.feature-row { display: grid; gap: 32px; align-items: center; }
.feature-row + .feature-row { margin-top: 72px; }
.feature-row__text h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.feature-row__text p { color: var(--text-muted); }
@media (min-width: 992px) {
    .feature-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 64px; }
    .feature-row--reverse { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .feature-row--reverse .feature-row__text { order: 2; }
    .feature-row + .feature-row { margin-top: 112px; }
}

/* Список с галочками */
.checks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; font-size: .94rem; }
.checks li::before {
    content: ''; position: absolute; left: 0; top: .2em; width: 18px; height: 18px; border-radius: 50%;
    background: var(--burgundy-tint); box-shadow: inset 0 0 0 1px rgba(194, 102, 127, .55);
}
.checks li::after {
    content: ''; position: absolute; left: 6px; top: calc(.2em + 4px); width: 5px; height: 9px;
    border: solid var(--burgundy-soft); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checks--small li { font-size: .86rem; }
.section--light .checks li::after { border-color: var(--burgundy); }

/* Ссылка со стрелкой */
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.link-arrow::after { content: '→'; transition: transform .25s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* Скриншот в рамке окна */
.shot {
    position: relative; margin: 0; padding: 10px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    background: linear-gradient(180deg, rgba(236, 244, 247, .08), rgba(236, 244, 247, .02));
    box-shadow: var(--shadow-lg);
}
.shot__bar { height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 8px 8px; }
.shot__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--charcoal-mid); display: block; }
.shot__bar i:first-child { background: var(--burgundy); }
.shot > img:not(.shot__drop):not(.shot__phone) { display: block; width: 100%; height: auto; border-radius: 12px; }
/* Хромовая капля на углу скриншота — только украшение */
.shot__drop { position: absolute; z-index: 1; right: -24px; top: -46px; width: 120px; height: auto; pointer-events: none; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .45)); }
@media (max-width: 767px) { .shot__drop { width: 76px; right: -8px; top: -30px; } }
/* Телефон поверх скриншота конструктора */
.shot--with-phone { margin-right: 28px; margin-bottom: 40px; }
.shot__phone {
    position: absolute; z-index: 1; right: -28px; bottom: -40px; width: 30%; max-width: 180px; height: auto;
    border-radius: 22px; border: 5px solid var(--charcoal-deep); background: var(--alice);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7);
}
@media (max-width: 600px) {
    .shot { padding: 6px; border-radius: var(--radius); }
    .shot__bar { height: 16px; padding-bottom: 6px; }
    .shot--with-phone { margin-right: 14px; }
    .shot__phone { right: -14px; border-width: 3px; border-radius: 14px; }
}

/* Внутри платформы: карусель с прокруткой и привязкой к слайдам */
.carousel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.carousel-head h2 { margin: 0; }
.carousel-nav { display: flex; gap: 8px; }
.carousel-btn {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--border-strong); background: transparent; color: var(--text);
    font: inherit; font-size: 1.1rem; cursor: pointer; transition: border-color .2s, opacity .2s;
}
.carousel-btn:hover { border-color: var(--alice); }
.carousel-btn[disabled] { opacity: .35; cursor: default; }
.carousel {
    list-style: none; margin: 0; padding: 4px 2px 16px;
    display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: 18px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; scroll-behavior: smooth;
    scrollbar-width: thin; scrollbar-color: var(--charcoal-mid) transparent;
}
@media (min-width: 768px) { .carousel { grid-auto-columns: calc((100% - 18px) / 2); } }
@media (min-width: 1100px) { .carousel { grid-auto-columns: calc((100% - 36px) / 3); } }
.carousel__slide { scroll-snap-align: start; }
.carousel__slide figure { margin: 0; }
.carousel__slide img {
    display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left;
    border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--alice);
}
/* Телефон обрезаем по верху: виден прогресс и первые вопросы */
.carousel__slide--phone img { object-position: top center; background: var(--charcoal-deep); }
.carousel__slide figcaption { margin-top: 14px; font-size: .88rem; color: var(--text-muted); }
.carousel__slide figcaption b { display: block; color: var(--text); font-size: .98rem; margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .carousel { scroll-behavior: auto; } }

/* 7. Три дизайна: карточки со списком (на месте тарифов шаблона) */
.design-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 22px; border-radius: var(--radius);
    background: rgba(236, 244, 247, .05);
    border: 1px solid var(--border);
    color: var(--alice) !important;
    transition: transform .35s var(--ease), border-color .35s, background .35s;
    min-height: 210px;
}
.design-card:hover { transform: translateY(-4px); border-color: var(--burgundy-soft); background: rgba(145, 0, 41, .12); }
.design-card__index { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; }
.design-card h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; margin: 0; }
.design-card p { color: var(--charcoal-mist); font-size: .88rem; margin: 0; }
.design-card .badge { align-self: flex-start; margin-top: auto; }
.design-card--plan { padding: 28px 26px; gap: 16px; }
.design-card--plan h3 { font-size: 1.15rem; line-height: 1.3; }
.design-card--plan .checks { margin-bottom: 8px; }
.design-card--plan .btn { margin-top: auto; align-self: flex-start; }

/* 8. Методологическая основа: полоса с жидким хромом (на месте отзывов) */
.band { position: relative; overflow: hidden; padding: 88px 0; isolation: isolate; }
.band__bg { position: absolute; inset: 0; z-index: -1; }
.band__bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.band::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(30, 33, 40, .55), rgba(30, 33, 40, .35) 50%, rgba(30, 33, 40, .6)); }
.band__item {
    padding: 26px 24px; border-radius: var(--radius);
    background: rgba(30, 33, 40, .62); border: 1px solid rgba(236, 244, 247, .16);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.band__item h3 { font-size: 1.6rem; margin-bottom: 10px; }
.band__item p { color: var(--charcoal-mist); font-size: .9rem; margin: 0; }
@media (max-width: 767px) { .band { padding: 64px 0; } }

/* 9. Методы, на которых построены расчёты (на месте логотипов) */
.refs__title { font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); text-align: center; margin: 0 0 24px; }
.refs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 768px) { .refs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.refs li { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--bg); }
.refs b { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15; }
.refs span { font-size: .8rem; color: var(--text-muted); }

/* 10. Частые вопросы: заголовок слева, список справа */
.faq { display: grid; gap: 24px; }
.faq__head h2 { margin: 0; }
.faq__list { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item summary {
    position: relative; cursor: pointer; list-style: none;
    padding: 20px 44px 20px 0; font-weight: 600; font-size: 1rem; line-height: 1.4;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::before, .faq__item summary::after {
    content: ''; position: absolute; right: 8px; top: 50%; width: 16px; height: 1.5px;
    background: currentColor; transition: transform .3s var(--ease);
}
.faq__item summary::after { transform: rotate(90deg); }
.faq__item[open] summary::after { transform: rotate(0deg); }
.faq__item summary:hover { color: var(--burgundy-soft); }
.faq__item p { margin: 0; padding: 0 44px 22px 0; color: var(--text-muted); font-size: .94rem; }
.faq__item code { font-size: .86em; padding: 1px 6px; border-radius: 6px; background: rgba(236, 244, 247, .08); }
@media (min-width: 992px) {
    .faq { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 64px; align-items: start; }
    .faq__head { position: sticky; top: 100px; }
}

/* 11. Начать исследование: волк в прыжке и действия (на месте формы «демо») */
.cta {
    position: relative; display: grid; gap: 8px; align-items: center; overflow: hidden;
    padding: 32px 24px; border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(70% 90% at 0% 100%, rgba(145, 0, 41, .22), transparent 70%),
        linear-gradient(180deg, rgba(236, 244, 247, .07), rgba(236, 244, 247, .02));
}
.cta__art { display: block; width: min(280px, 72vw); height: auto; margin: 0 auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); }
.cta__body { text-align: center; }
.cta__body h2 { margin-bottom: 12px; }
.cta__actions { margin: 24px 0; }
.cta .ai-pill { margin: 0; }
.cta__ai-label { display: block; margin-bottom: 10px; font-size: .86rem; color: var(--text-muted); }
@media (min-width: 768px) {
    .cta { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding: 48px; }
    .cta__art { width: 100%; }
    .cta__body { text-align: left; }
    .cta__actions { justify-content: flex-start; }
}
@media (min-width: 992px) { .cta { grid-template-columns: 340px minmax(0, 1fr); padding: 56px 64px; } }

.ai-pill {
    display: flex; align-items: center; gap: 12px;
    max-width: 640px; margin: 0 auto;
    padding: 8px 8px 8px 22px; border-radius: var(--radius-pill);
    background: rgba(236, 244, 247, .07); border: 1px solid var(--border-strong);
}
.ai-pill__icon { display: block; width: 28px; height: 28px; border-radius: 50%; flex: none; }
.ai-pill input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--alice); font: inherit; font-size: 1rem; padding: 10px 0; }
.ai-pill input::placeholder { color: var(--charcoal-soft); }
.ai-pill input:focus { outline: none; }
.ai-pill:focus-within { border-color: var(--burgundy-soft); }
/* На узком экране кнопка уходит под поле, чтобы подсказка в поле читалась целиком */
@media (max-width: 520px) {
    .ai-pill { flex-wrap: wrap; gap: 8px 10px; padding: 12px 12px 12px 16px; border-radius: var(--radius); }
    .ai-pill input { flex-basis: calc(100% - 40px); font-size: .92rem; }
    .ai-pill .btn { flex: 1 1 100%; }
}

/* 12. Оператор персональных данных (на месте карты с контактами) */
.operator { border-top: 1px solid var(--border); }
.operator__list { margin: 0 0 16px; display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.operator__list dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.operator__list dd { margin: 4px 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.operator__note { text-align: center; font-size: .86rem; margin: 0; }
.operator__note a { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */
.snou-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .82rem; color: var(--text-muted); }
.snou-footer__inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.snou-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.snou-footer a { color: var(--text-muted); }
.snou-footer a:hover { color: var(--accent); }

/* Уведомление о cookie (core/templates/core/partials/cookie_notice.html): над подсказками, под окнами */
.cookie-notice {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 150;
    max-width: 760px; margin: 0 auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
    padding: 14px 18px; border-radius: var(--radius);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    font-size: .86rem; line-height: 1.5;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; flex: 1 1 300px; }
.cookie-notice a { color: var(--accent); }
.theme-dark .cookie-notice a { color: var(--alice); text-decoration: underline; }
@media print { .cookie-notice { display: none; } }

/* --------------------------------------------------------------------------
   Юридические документы
   -------------------------------------------------------------------------- */
.legal { max-width: 860px; margin: 0 auto; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.5rem; margin-top: 1.8em; }
.legal h3 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 600; margin-top: 1.4em; }
.legal ol, .legal ul { padding-left: 1.4em; }
.legal li { margin-bottom: .4em; }
.legal table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .9rem; }
.legal th, .legal td { border: 1px solid var(--border-strong); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.legal-nav .btn { white-space: normal; text-align: left; }
@media (max-width: 767px) {
    /* широкие таблицы (сроки, перечень cookie) прокручиваются внутри себя, а не всей страницей */
    .legal table { display: block; overflow-x: auto; }
}

/* Совместимость со старыми шаблонами когортного модуля */
.legacy-paper { color: var(--charcoal); }

/* ==========================================================================
   v3: ключевые слова, путь исследования, архив, глобальный поиск
   ========================================================================== */

/* Чипы (ключевые слова, фильтры, подсказки) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: .82rem; font-weight: 500; color: var(--text) !important;
    cursor: pointer; line-height: 1.2; font-family: inherit;
    transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--burgundy); color: var(--burgundy) !important; }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--charcoal); border-color: var(--charcoal); color: var(--alice) !important; }
.chip--accent { background: var(--burgundy-tint); border-color: rgba(145, 0, 41, .3); color: var(--burgundy) !important; }
.chip--added { opacity: .45; pointer-events: none; }
.chip__count { font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.chip.is-active .chip__count { color: var(--charcoal-mist); }
.chip__remove { border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; }

/* Блок помощи по ключевым словам */
.assist {
    margin-top: 10px; padding: 16px; border-radius: var(--radius-sm);
    background: rgba(57, 63, 75, .04); border: 1px dashed var(--border-strong);
    display: grid; gap: 12px;
}
.assist__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.assist__hint { font-size: .8rem; color: var(--text-muted); margin: 0; }
.assist__hint b { color: var(--text); }
.assist__source { font-size: .74rem; color: var(--text-muted); }
.assist ul.hint-list { margin: 0; padding-left: 18px; font-size: .8rem; color: var(--text-muted); display: block; }
.assist ul.hint-list li { margin: 2px 0; }
.mesh { font-size: .78rem; color: var(--text-muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Шаблоны протоколов */
.template-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 768px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .template-grid { grid-template-columns: repeat(4, 1fr); } }
.template-card {
    display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--text) !important;
    transition: border-color .2s, transform .25s var(--ease);
}
.template-card:hover, .template-card.is-active { border-color: var(--burgundy); transform: translateY(-2px); }
.template-card b { font-size: .92rem; }
.template-card span { font-size: .8rem; color: var(--text-muted); }
/* Значок шаблона: плитка в цвет акцента (main/partials/icon.html) */
.template-card .template-card__icon, .icon-tile {
    width: 42px; height: 42px; flex: none; display: grid; place-items: center; margin-bottom: 4px;
    border-radius: 12px; background: var(--burgundy-tint); color: var(--burgundy);
}
.template-card__icon .icon, .icon-tile .icon { width: 24px; height: 24px; }
.template-card.is-active .template-card__icon { background: var(--burgundy); color: var(--alice); }

/* Путь исследования (степпер) */
.stepper { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; margin: -6px 0 22px; scrollbar-width: thin; }
.stepper__item {
    flex: 1 0 auto; min-width: 128px; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border);
    background: var(--surface); color: var(--text-muted) !important; font-size: .8rem; font-weight: 600;
}
.stepper__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
    border: 1.5px solid var(--border-strong); font-size: .7rem; }
.stepper__item.is-done { color: var(--text) !important; }
.stepper__item.is-done .stepper__dot { background: var(--charcoal); border-color: var(--charcoal); color: var(--alice); }
.stepper__item.is-current { border-color: var(--burgundy); color: var(--burgundy) !important; box-shadow: 0 0 0 3px var(--burgundy-tint); }
.stepper__item.is-current .stepper__dot { border-color: var(--burgundy); }
.stepper__item.is-optional { border-style: dashed; }

/* Архив */
.archive { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 992px) { .archive { grid-template-columns: 270px 1fr; } }
.archive-search { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.archive-search__input {
    flex: 1; min-width: 0; padding: 14px 16px 14px 46px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: 1rem; color: var(--text);
}
.archive-search__input:focus { outline: none; border-color: var(--burgundy); box-shadow: var(--focus-ring); }
.archive-search__icon { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.archive-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; margin-bottom: 14px; }
.archive-toolbar select { padding: 8px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: .85rem; color: var(--text); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 500; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--charcoal-mist); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle input:checked { background: var(--burgundy); }
.toggle input:checked::after { transform: translateX(16px); }
.filters { display: grid; gap: 18px; }
.filters details { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.filters summary { cursor: pointer; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); list-style: none; margin-bottom: 10px; }
.filters summary::-webkit-details-marker { display: none; }
.filter-link { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 0 -10px; border-radius: var(--radius-sm); font-size: .88rem; color: var(--text) !important; }
.filter-link:hover { background: rgba(57, 63, 75, .06); }
.filter-link.is-active { background: var(--charcoal); color: var(--alice) !important; }
.filter-link .chip__count { margin-left: auto; }
.filter-link.is-active .chip__count { color: var(--charcoal-mist); }
.filter-link__box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); flex: none; display: grid; place-items: center; font-size: .7rem; }
.filter-link.is-active .filter-link__box { border-color: var(--alice); }
.filters-toggle { display: inline-flex; }
@media (min-width: 992px) { .filters-toggle { display: none; } }
@media (max-width: 991px) { .archive aside:not(.is-open) .filters { display: none; } }

.results { display: grid; gap: 12px; }
.result {
    position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px;
    padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
    transition: border-color .2s, box-shadow .2s;
}
.result:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.result.is-selected { border-color: var(--burgundy); box-shadow: 0 0 0 3px var(--burgundy-tint); }
.result__check { display: flex; justify-content: center; align-self: stretch; min-width: 32px; padding: 3px 6px 6px; margin: 0 -6px; cursor: pointer; }  /* крупная зона нажатия для телефона */
.result__check input { width: 18px; height: 18px; accent-color: var(--burgundy); cursor: pointer; }
.result__head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.result__title { font-family: var(--font-body); font-weight: 600; font-size: 1.02rem; color: var(--text) !important; margin: 0; line-height: 1.35; }
.result__title:hover { color: var(--burgundy) !important; }
.result__snippet { font-size: .86rem; color: var(--text-muted); margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: .78rem; color: var(--text-muted); margin-top: 10px; }
.result__progress { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; }
.result__progress .progress { height: 6px; flex: 1; min-width: 70px; }
.result__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fav { border: 0; background: none; cursor: pointer; padding: 2px; color: var(--charcoal-soft); font-size: 1.15rem; line-height: 1; }
.fav[aria-pressed="true"] { color: var(--burgundy); }
mark { background: rgba(145, 0, 41, .14); color: inherit; padding: 0 2px; border-radius: 3px; }
.empty-state { text-align: center; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); }
.empty-state h3 { color: var(--text); }

/* Панель массовых действий */
.bulkbar {
    position: sticky; bottom: 16px; z-index: 40; margin-top: 16px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between;
    padding: 12px 18px; border-radius: 22px; background: var(--charcoal); color: var(--alice);
    box-shadow: var(--shadow-lg);
}
.bulkbar__count { padding-left: 6px; font-weight: 600; }
.bulkbar .btn-ghost { color: var(--alice) !important; border-color: rgba(236, 244, 247, .35); }
.bulkbar .btn-ghost:hover { border-color: var(--alice); }
.bulkbar select { padding: 8px 12px; border-radius: var(--radius-pill); border: 1px solid rgba(236, 244, 247, .35); background: transparent; color: var(--alice); font: inherit; font-size: .82rem; }
.bulkbar select option { color: var(--charcoal); }

/* Глобальный поиск (Ctrl+K) */
.search-trigger {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted);
    font: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .04em; cursor: pointer; text-transform: none;
}
.search-trigger:hover { border-color: var(--burgundy); color: var(--burgundy); }
kbd { font-family: var(--font-body); font-size: .7rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: rgba(57, 63, 75, .05); color: var(--text-muted); }
.palette .modal__dialog { max-width: 640px; padding: 0; overflow: hidden; margin-top: 8vh; }
.palette__input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 20px 22px; font: inherit; font-size: 1.05rem; background: transparent; color: var(--charcoal); }
.palette__input:focus { outline: none; }
.palette__list { max-height: 60vh; overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.palette__group { padding: 10px 14px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--charcoal-soft); }
.palette__item a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--charcoal) !important; }
.palette__item a small { margin-left: auto; color: var(--charcoal-soft); font-size: .74rem; white-space: nowrap; }
.palette__item.is-active a, .palette__item a:hover { background: var(--burgundy-tint); }
.palette__empty { padding: 18px; text-align: center; color: var(--charcoal-soft); font-size: .9rem; }
.palette__foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .74rem; color: var(--charcoal-soft); }

/* Кабинет: «следующий шаг» */
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.notice { padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid rgba(145, 0, 41, .3); background: var(--burgundy-tint); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.notice--info { border-color: var(--border-strong); background: rgba(57, 63, 75, .05); }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 10px 20px; font-size: .92rem; }
.kv dt { color: var(--text-muted); font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; white-space: pre-line; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }
.lib-group { margin-bottom: 14px; }
.lib-group h5 { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.lib-grid { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.otp-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius-sm); display: inline-block; }
.qr svg { display: block; width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; }

/* Панель массовых действий на телефоне: одна строка с прокруткой, не закрывает результаты */
@media (max-width: 640px) {
    .bulkbar { bottom: 8px; padding: 10px 12px; border-radius: 18px; gap: 8px; }
    .bulkbar .actions { flex-wrap: nowrap; overflow-x: auto; flex: 1 1 100%; min-width: 0; padding-bottom: 2px; scrollbar-width: none; }
    .bulkbar .actions::-webkit-scrollbar { display: none; }
    .bulkbar .btn, .bulkbar select { white-space: nowrap; flex: none; }
}

/* Шаг, который стоит дополнить, но который не блокирует работу */
.stepper__item.is-soft .stepper__dot { border-color: var(--burgundy); color: var(--burgundy); }
.stepper__item.is-soft small { color: var(--burgundy); }

/* Таблицы: бейджи и ссылки действий не переносим по словам */
.table .badge, .table td.num a { white-space: nowrap; }
/* Колонки архива не растягиваются содержимым (иначе на телефоне появляется горизонтальная прокрутка) */
.archive > * { min-width: 0; }
/* Декоративные «капли» за краем экрана не создают горизонтальную прокрутку (clip не ломает sticky-шапку) */
body { overflow-x: clip; }

/* --------------------------------------------------------------------------
   Экспорт графиков (main/static/js/chart_export.js): панель над каждым графиком Plotly
   -------------------------------------------------------------------------- */
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin: 0 0 6px; }
.chart-tools__btn {
    padding: 5px 11px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
    background: transparent; color: var(--text); font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer;
}
.chart-tools__btn:hover { border-color: var(--burgundy); color: var(--burgundy); }
.chart-tools__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.chart-tools__btn[disabled] { opacity: .5; cursor: progress; }
.chart-tools__wm { font-size: .76rem; margin-left: 4px; color: var(--text-muted); }
.chart-tools__wm input { width: 30px; height: 17px; }
.chart-tools__wm input::after { width: 13px; height: 13px; }
.chart-tools__wm input:checked::after { transform: translateX(13px); }

/* Простой список ссылок в карточке (анкеты протокола и т. п.) */
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

/* Источники формул под калькулятором объёма выборки (сноска в академическом стиле) */
.ss-sources { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .78rem; line-height: 1.5; color: var(--text-muted); }
.ss-sources__title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; color: var(--text-muted); }
.ss-sources__list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ss-sources__list li { transition: color .2s; }
.ss-sources__list li.is-used { color: var(--text); }
.ss-sources__list li.is-used::marker { color: var(--accent); font-weight: 700; }
.ss-sources__note { margin: 10px 0 0; }
