/* YKS Echo - дизайн-система «Живой рой» (You Know Studio, редизайн 2026-06) */

/* Вордмарк «echo». Исходный TTF - 208 КБ, на медленном канале доезжал за секунды и всё это
   время «echo» рисовался курсивом-фолбэком. Разбит на два woff2-сабсета по unicode-range:
   латиница (сам вордмарк) грузится сразу, кириллица - только если встретится на экране. */
@font-face {
    font-family: 'Sa No Rules';
    src: url('../fonts/sa-no-rules.latin.woff2') format('woff2');
    unicode-range: U+0000-00FF;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Sa No Rules';
    src: url('../fonts/sa-no-rules.cyr.woff2') format('woff2');
    unicode-range: U+0400-045F, U+2010-2027, U+20BD, U+2190-21BB;
    font-weight: 400;
    font-display: swap;
}

:root {
    --cream: #F2EEE6;
    --cream-2: #F4F1EA;
    --paper: #FBFAF6;
    --ink: #242423;
    --ink-soft: #4A4945;
    --muted: #8C887D;
    --line: #E2DCCF;
    --red: #D21749;
    --red-deep: #b3174a;
    --coral: #E8527A;
    --blue: #7BADF6;
    --blue-deep: #3F7FD6;
    --blue-soft: #A5CFF9;
    --gold: #C9A227;
    --graphite: #5B5A55;
    --good: #2E9E6B;
    --r-xl: 32px;
    --r-lg: 24px;
    --r-md: 16px;
    --r-sm: 11px;
    --sh-soft: 0 1px 2px rgba(74,60,30,.04), 0 8px 20px -8px rgba(74,60,30,.10), 0 24px 50px -28px rgba(120,90,40,.16);
    --sh-card: 0 1px 1px rgba(74,60,30,.04), 0 6px 14px -6px rgba(74,60,30,.10), 0 22px 48px -26px rgba(120,90,40,.18);
    --sh-lift: 0 2px 4px rgba(74,60,30,.05), 0 16px 30px -10px rgba(74,60,30,.14), 0 40px 70px -32px rgba(120,90,40,.22);
    --sh-pop: 0 2px 6px rgba(210,23,73,.10), 0 18px 40px -12px rgba(210,23,73,.18);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Hanken Grotesk', 'Inter', system-ui, sans-serif;
    background: var(--cream);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
    position: relative;
    overflow-x: hidden;
}

input, select, textarea, button { font-family: inherit; }

/* крупные заголовки - характерный grotesk */
h1, h2, h3, h4 {
    font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif;
    letter-spacing: -.02em;
}

/* ====================== ОРГАНИЧЕСКИЙ ФОН (brand blobs + grain) ====================== */
/* Фон: самая дорогая часть страницы. Раньше 4 круга по 640px несли filter:blur(110px) +
   mix-blend-mode + бесконечную анимацию transform - браузер на каждый кадр переразмывал и
   пересводил всю площадь экрана, из-за чего подтормаживал даже ввод текста в форме.
   Убрали blur (радиальные градиенты и так мягкие), оставили тот же рисунок и движение.
   contain+will-change держат фон отдельным слоем, чтобы он не перерисовывался вместе с UI. */
.bg-field { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
    contain: strict; }
.blob { position: absolute; border-radius: 50%; opacity: .5; mix-blend-mode: multiply;
    will-change: transform; }
@media (prefers-reduced-motion: reduce) { .blob { animation: none !important; } }
.blob.b1 { width: 640px; height: 640px; background: radial-gradient(circle at 30% 30%, rgba(210,23,73,.26), rgba(210,23,73,.10) 45%, transparent 72%); top: -200px; left: -140px; animation: drift1 26s ease-in-out infinite; }
.blob.b2 { width: 560px; height: 560px; background: radial-gradient(circle at 60% 40%, rgba(123,173,246,.34), rgba(123,173,246,.12) 45%, transparent 72%); top: 6%; right: -160px; animation: drift2 32s ease-in-out infinite; }
.blob.b3 { width: 520px; height: 520px; background: radial-gradient(circle at 50% 50%, rgba(91,90,85,.16), rgba(91,90,85,.06) 45%, transparent 72%); bottom: -240px; left: 38%; animation: drift3 38s ease-in-out infinite; }
.blob.b4 { width: 380px; height: 380px; background: radial-gradient(circle at 50% 50%, rgba(165,207,249,.32), rgba(165,207,249,.11) 45%, transparent 72%); top: 44%; left: 14%; animation: drift1 30s ease-in-out infinite reverse; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,60px) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.06); } }
.grain {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; contain: strict;
    opacity: .05; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* контент над фоновыми слоями */
body > .flex { position: relative; z-index: 2; }
/* модал получает класс .flex (openModal) → его ловит body > .flex;
   ID-специфичностью возвращаем fixed-оверлей поверх контента (z-index ниже) */
#modal { position: fixed; }
/* тот же капкан: #toast-container несёт .flex (стек тостов) → body > .flex делал его
   position:relative, и тост падал в поток вниз-влево, за пределы экрана. ID-специфичностью
   возвращаем fixed поверх всего (выше модалки) — уведомления должны быть видны всегда. */
#toast-container { position: fixed; z-index: 100; }

/* ---------- Сайдбар (светлый, «живой рой») ---------- */
.sidebar {
    background: linear-gradient(180deg, rgba(251,250,246,.82), rgba(244,241,234,.72));
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border-right: 1px solid rgba(226,220,207,.7);
}
/* логотип You Know - кремовый PNG перекрашиваем в графит для светлого фона */
.logo-img { filter: brightness(0); opacity: .85; }

.logo-echo {
    font-family: 'Sa No Rules', cursive;
    font-size: 36px;
    font-weight: 400;
    color: var(--red);
    cursor: pointer;
    line-height: .8;
    display: inline-block;
    position: relative;
    top: 3px;
}
.logo-echo:hover { opacity: .85; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color .2s, background .2s;
    position: relative;
}
.nav-item i { font-size: 20px; color: var(--muted); transition: color .2s; }
.nav-item:hover { color: var(--ink); background: rgba(242,238,230,.9); }
.nav-item:hover i { color: var(--ink-soft); }
.nav-item.active { color: var(--red-deep); background: linear-gradient(135deg, rgba(210,23,73,.10), rgba(210,23,73,.05)); }
.nav-item.active i { color: var(--red); }
/* без вертикальной красной черты слева: активный раздел читается одной полупрозрачной заливкой */

/* ====================== КАРТОЧКИ ИССЛЕДОВАНИЙ ====================== */
.card {
    position: relative;
    background: var(--paper);
    border: 1px solid rgba(226,220,207,.8);
    border-radius: var(--r-lg);
    padding: 24px 24px 22px;
    box-shadow: var(--sh-card);
    overflow: hidden;
}
/* Карточка мастера: тултипы-подсказки (yk-tip) не режутся краем - у верхних полей
   («Название», «Цель») тултип всплывает вверх и обрезался overflow:hidden. Обычные
   карточки (список исследований и пр.) сохраняют overflow:hidden. */
.card.wizard-card { overflow: visible; }
.card-hover { transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease; }
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--sh-lift); }
/* верхний блик */
.card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,0) 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: .7;
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card h3 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.02em; line-height: 1.16; color: var(--ink); max-width: 74%; }

.type-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 11.5px; padding: 5px 11px 5px 9px; border-radius: 999px; white-space: nowrap; margin-bottom: 14px; }
.type-badge i { font-size: 14px; }
.type-badge.t-creative { background: rgba(210,23,73,.10); color: var(--red-deep); }
.type-badge.t-audience { background: rgba(63,127,214,.12); color: var(--blue-deep); }
.type-badge.t-blogger  { background: rgba(201,162,39,.16); color: #8a6e12; }

/* статус-пилюля (новый стиль карточек) */
.status { display: inline-flex; align-items: center; gap: 7px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 11.5px; padding: 6px 12px 6px 10px; border-radius: 999px; white-space: nowrap; }
.status i { font-size: 14px; }
.status.done  { background: rgba(46,158,107,.12); color: #1c6e48; }
.status.live  { background: rgba(210,23,73,.11); color: var(--red-deep); }
.status.draft { background: rgba(91,90,85,.11); color: var(--graphite); }
.status.err   { background: rgba(210,23,73,.11); color: var(--red-deep); }
.status .lvdot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.3s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* мета-чипы карточки */
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); background: rgba(242,238,230,.9); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.meta-chip i { font-size: 14px; color: var(--muted); }
.meta-chip.lens { background: rgba(201,162,39,.13); border-color: rgba(201,162,39,.4); color: #8a6e12; }
.meta-chip.lens i { color: var(--gold); }

/* футер-итог */
.outcome { display: flex; align-items: center; gap: 10px; padding-top: 15px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-soft); }
.outcome .ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.outcome.win .ic { background: rgba(46,158,107,.14); color: #1c6e48; }
.outcome.barrier .ic { background: rgba(201,162,39,.18); color: #8a6e12; }
.outcome.draft .ic { background: rgba(91,90,85,.1); color: var(--graphite); }
.outcome b { font-weight: 700; color: var(--ink); }
.outcome .go { margin-left: auto; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 13px; color: var(--red); white-space: nowrap; }
.outcome .date { margin-left: auto; font-size: 12px; color: var(--muted); }

/* info-тултип (иконка i) - подсказка по наведению/фокусу */
.yk-info { position: relative; display: inline-flex; align-items: center; cursor: help; }
.yk-info .yk-tip {
    position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px);
    width: 264px; max-width: 70vw; background: var(--ink); color: #fff; font-size: 12px; font-weight: 400;
    line-height: 1.5; text-align: left; padding: 10px 12px; border-radius: 11px;
    opacity: 0; visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility .16s;
    z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2); pointer-events: none; white-space: normal;
}
.yk-info .yk-tip::after {
    content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: var(--ink);
}
.yk-info:hover .yk-tip, .yk-info:focus .yk-tip, .yk-info:focus-within .yk-tip {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* активная диктовка цели - пульсация кнопки микрофона */
.mic-on { background: rgba(210,23,73,.12) !important; color: var(--red) !important; animation: micpulse 1.3s ease-in-out infinite; }
@keyframes micpulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(210,23,73,.4); }
    50% { box-shadow: 0 0 0 6px rgba(210,23,73,0); }
}

/* LIVE-карточка: спокойное «дышащее» коралловое свечение (не рой) */
.livecard { background: linear-gradient(180deg, #FBFAF6, #FBF3F1); }
.breath-wrap { position: relative; height: 124px; margin: 2px 0 14px; border-radius: var(--r-md); overflow: hidden; background: radial-gradient(130% 130% at 50% 50%, rgba(232,82,122,.07), transparent 70%); display: flex; align-items: center; justify-content: center; }
.breath-core { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.breath-core .ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 50%, rgba(232,82,122,.40), rgba(210,23,73,.16) 45%, transparent 70%); animation: breathe 6s ease-in-out infinite; }
.breath-core .ring.r2 { inset: -24px; background: radial-gradient(circle at 50% 50%, rgba(232,82,122,.14), transparent 65%); animation: breathe 6s ease-in-out infinite; animation-delay: -1.4s; }
.breath-core .dot-c { position: relative; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #F07A9A, var(--red) 70%); box-shadow: 0 0 22px rgba(210,23,73,.45), inset 0 0 0 1px rgba(255,255,255,.3); animation: breatheDot 6s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.16); opacity: 1; } }
@keyframes breatheDot { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- Фазовая мини-анимация на карточке активного прогона ---------- */
.mini-stage { position: relative; height: 108px; margin: 2px 0 12px; border-radius: var(--r-md); overflow: hidden; display: flex; align-items: center; justify-content: center; background: radial-gradient(130% 130% at 50% 42%, rgba(232,82,122,.07), transparent 70%); }
.mini-stage .ms-cap { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-family: 'Bricolage Grotesque', sans-serif; font-size: 11.5px; font-weight: 600; color: var(--muted); }
/* building - двойники проявляются и собираются в аудиторию */
.msb { display: grid; grid-template-columns: repeat(5, 11px); gap: 8px; }
.msb i { width: 11px; height: 11px; border-radius: 50%; opacity: 0; background: radial-gradient(circle at 38% 34%, #F07A9A, var(--red) 75%); box-shadow: 0 0 9px rgba(210,23,73,.4); animation: msb-pop 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.12s); }
@keyframes msb-pop { 0%,100% { opacity: 0; transform: scale(.35); } 42%,68% { opacity: 1; transform: scale(1); } }
/* survey - поток ответов (точки перетекают и меняют цвет) */
.mss { display: flex; gap: 10px; }
.mss i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: mss-flow 1.5s ease-in-out infinite; animation-delay: calc(var(--i) * 0.12s); }
@keyframes mss-flow { 0% { transform: translateY(7px); opacity: .35; background: var(--blue); } 50% { transform: translateY(-7px); opacity: 1; background: var(--coral); } 100% { transform: translateY(7px); opacity: .35; background: var(--blue); } }
/* report - сборка отчёта (растущие столбики) */
.msr { display: flex; align-items: flex-end; gap: 6px; height: 48px; }
.msr i { width: 11px; height: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--coral), var(--red)); transform: scaleY(.25); transform-origin: bottom; animation: msr-rise 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.1s); }
@keyframes msr-rise { 0%,100% { transform: scaleY(.25); opacity: .55; } 50% { transform: scaleY(1); opacity: 1; } }

.progress-inline { display: flex; align-items: center; gap: 12px; padding-top: 15px; border-top: 1px dashed var(--line); }
.progress-inline .bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(91,90,85,.12); overflow: hidden; }
.progress-inline .bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--red)); box-shadow: 0 0 12px rgba(210,23,73,.4); transition: width 1s ease; }
.progress-inline .pc { font-weight: 600; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-inline .pc small { color: var(--muted); font-weight: 400; }

/* ---------- Поля ввода ---------- */
.inp { width: 100%; background: rgba(251,250,246,.85); border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px; font-size: 15px; outline: none; transition: border .15s, box-shadow .15s; }
.inp:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(210,23,73,.12); }
textarea.inp { resize: vertical; }
/* Плейсхолдеры единообразны во всех полях: мелкий шрифт (как хелпер-текст на карточке) и
   один приглушённый цвет - чтобы подсказка не выглядела как введённый текст. Префикс body -
   поднять специфичность над Tailwind-preflight (input::placeholder{color:#9ca3af}), который
   грузится после styles.css. */
body input::placeholder, body textarea::placeholder { font-size: 13px; color: var(--muted); opacity: 1; }
/* font-size 13px — у select нет placeholder, его текст брал базовые 15px .inp и смотрелся
   крупнее соседних placeholder-инпутов (13px). Единственный select.inp — фильтр «Любой пол». */
select.inp { -webkit-appearance: none; appearance: none; cursor: pointer; color: var(--muted); font-size: 13px; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%235B5A55' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* слайдер доли пола - нейтрально-серый (без акцентного цвета и заливки) */
.split-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: #dcd8cf; outline: none; cursor: pointer; }
.split-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: #dcd8cf; }
.split-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 1.5px solid #b0aaa0; box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; }
.split-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1.5px solid #b0aaa0; box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; }
.split-range::-moz-range-track { height: 6px; border-radius: 999px; background: #dcd8cf; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ---------- Кнопки ---------- */
.btn-primary { font-family: 'Bricolage Grotesque', sans-serif; background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; border-radius: 999px; padding: 12px 21px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; box-shadow: var(--sh-pop); transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .25s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(210,23,73,.18), 0 22px 44px -12px rgba(210,23,73,.32); }
.btn-dark { font-family: 'Bricolage Grotesque', sans-serif; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 12px 19px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: transform .2s, opacity .2s; }
.btn-dark:hover { opacity: .92; transform: translateY(-1px); }
.btn-ghost { font-family: 'Bricolage Grotesque', sans-serif; background: rgba(251,250,246,.7); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 11px 17px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; box-shadow: var(--sh-soft); transition: background .2s, transform .2s; }
.btn-ghost:hover { background: var(--paper); transform: translateY(-1px); }
/* «магическая» кнопка генерации - переливающийся фирменный градиент */
.btn-magic {
    font-family: 'Bricolage Grotesque', sans-serif; color: #fff; border: none; border-radius: 999px;
    padding: 12px 19px; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    background: linear-gradient(120deg, var(--red), var(--coral), var(--blue), var(--red));
    background-size: 280% 100%; box-shadow: var(--sh-pop);
    animation: magic-flow 6s linear infinite;
    transition: transform .2s, box-shadow .25s, filter .2s;
}
.btn-magic:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 6px 14px rgba(210,23,73,.2), 0 22px 44px -12px rgba(210,23,73,.32); }
.btn-magic i { filter: drop-shadow(0 0 6px rgba(255,255,255,.5)); }
.btn-magic:disabled { animation-play-state: paused; }
@keyframes magic-flow { 0% { background-position: 0% 50%; } 100% { background-position: 280% 50%; } }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Защита от двойного нажатия: красная кнопка → белый фон + красный лоадер ---------- */
/* Чистый CSS-оверлей: содержимое прячем, поверх крутим спиннер. Логика - js/components/btn-guard.js */
.btn-loading {
    position: relative !important;
    color: transparent !important;
    background: #fff !important;
    border: 1.5px solid var(--red) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    pointer-events: none;
    cursor: default !important;
    animation: none !important;          /* гасим magic-flow у .btn-magic */
    transform: none !important;
    filter: none !important;
}
.btn-loading > * { visibility: hidden !important; }
.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(210, 23, 73, .22);
    border-top-color: var(--red);
    border-radius: 50%;
    visibility: visible !important;
    animation: btn-load-spin .6s linear infinite;
}
@keyframes btn-load-spin { to { transform: rotate(360deg); } }

/* ---------- Авто-растущее поле вопроса (CSS-зеркало, без JS-измерений и скроллов) ---------- */
/* ::after дублирует текст тем же шрифтом и задаёт высоту grid-ячейки; textarea растягивается под неё.
   Не зависит от тайминга загрузки шрифта: при подмене шрифта зеркало и поле рефлоу́ят синхронно. */
.autogrow { display: grid; }
.autogrow > textarea,
.autogrow::after {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.375;
    letter-spacing: 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    padding: 0;
    margin: 0;
    border: 0;
}
.autogrow::after {
    content: attr(data-value) " ";
    visibility: hidden;
}
.autogrow > textarea {
    resize: none;
    overflow: hidden;
    background: transparent;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
            appearance: none;
}
.autogrow > textarea::placeholder { color: var(--muted); }

/* ---------- Чипы статусов (legacy: statusBadge в отчёте/прочих местах) ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 12px; }
.st-done  { background: rgba(46,158,107,.12); color: #1c6e48; }
.st-run   { background: rgba(210,23,73,.11); color: var(--red-deep); }
.st-draft { background: rgba(91,90,85,.11); color: var(--graphite); }
.st-err   { background: rgba(210,23,73,.11); color: var(--red-deep); }
.st-warn  { background: #FBF1DE; color: #9b6a14; }

/* ====================== Визард пополнения (баланс → способ → карта/счёт) ====================== */
.pay-sum { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(210,23,73,.06), rgba(210,23,73,.02));
    border: 1px solid rgba(210,23,73,.14); border-radius: 16px; padding: 13px 16px; margin-bottom: 18px; }
.pay-sum .k { font-size: 12px; color: var(--muted); }
.pay-sum .v { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.pay-sum .arr { color: var(--red); font-size: 20px; }

.pay-method { display: flex; gap: 13px; align-items: flex-start; width: 100%; text-align: left; background: var(--paper);
    border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; margin-bottom: 11px;
    transition: border .15s, box-shadow .15s, transform .15s; }
.pay-method:hover { border-color: rgba(210,23,73,.4); transform: translateY(-1px); box-shadow: var(--sh-soft); }
.pay-method.sel { border-color: var(--red); box-shadow: 0 0 0 3px rgba(210,23,73,.12); }
.pay-method .pm-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.pay-method .pm-ic.card { background: rgba(210,23,73,.10); color: var(--red); }
.pay-method .pm-ic.inv  { background: rgba(123,173,246,.16); color: var(--blue-deep); }
.pay-method .pm-t { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 15px; }
.pay-method .pm-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pay-method .pm-tick { margin-left: auto; width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; transition: .15s; }
.pay-method.sel .pm-tick { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 3px var(--paper); }

.pay-combo { position: relative; }
.pay-suggest { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 8px; background: var(--paper); }
.pay-sg { padding: 10px 13px; cursor: pointer; border-bottom: 1px solid rgba(226,220,207,.6); transition: background .12s; }
.pay-sg:last-child { border-bottom: 0; }
.pay-sg:hover { background: rgba(210,23,73,.05); }
.pay-sg .nm { font-size: 14px; font-weight: 600; font-family: 'Bricolage Grotesque', sans-serif; }
.pay-sg .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pay-sg .meta b { color: var(--ink-soft); font-weight: 600; }
.pay-sg-empty { padding: 11px 13px; font-size: 13px; color: var(--muted); }
.pay-req-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; border-radius: 11px; padding: 9px 12px; margin-bottom: 4px; }
.pay-req-note.hidden { display: none; }   /* перебиваем display:flex выше (styles.css грузится после tailwind .hidden) */
.pay-req-note.auto   { color: #1c6e48; background: rgba(46,158,107,.09); }
.pay-req-note.manual { color: var(--ink-soft); background: rgba(201,162,39,.10); }
.inp.locked { background: rgba(46,158,107,.06); border-color: rgba(46,158,107,.35); }

/* Превью медиа не загрузилось (сеть/сессия): вместо пустого квадрата - явный маркер */
.media-fallback { width: 64px; height: 64px; border-radius: var(--r-sm); flex-shrink: 0;
    display: grid; place-items: center; background: rgba(201,162,39,.10);
    border: 1px dashed rgba(201,162,39,.45); color: #9b6a14; font-size: 20px; }

/* ---------- Оценка отчёта (👍/👎 в самом конце отчёта; в PDF/печати скрыта — .no-print) ---------- */
.report-rating { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
    margin-top: 32px; padding: 18px 24px; border-radius: var(--r-md);
    background: rgba(251,250,246,.65); border: 1px solid var(--line); }
.report-rating__q { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.report-rating__btns { display: flex; gap: 10px; }
.report-rating .rate-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    font-size: 21px; background: #fff; border: 1px solid var(--line); color: var(--graphite); cursor: pointer;
    transition: transform .12s ease, background .15s, color .15s, border-color .15s; }
.report-rating .rate-btn:hover { transform: translateY(-2px); }
.report-rating .rate-btn.up:hover { background: rgba(46,158,107,.10); color: var(--good); border-color: rgba(46,158,107,.4); }
.report-rating .rate-btn.down:hover { background: rgba(210,23,73,.08); color: var(--red); border-color: rgba(210,23,73,.35); }
.report-rating.rated { background: rgba(46,158,107,.06); border-color: rgba(46,158,107,.25); }
.report-rating__done { font-size: 14px; font-weight: 600; color: var(--good); display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Теги (география, интересы, блогеры) ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; background: rgba(242,238,230,.9); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.tag button, .tag i { cursor: pointer; color: #9b968c; font-size: 14px; line-height: 1; }
.tag button:hover, .tag i:hover { color: var(--red); }

/* ---------- Варианты-креативы A/B (медиа: картинка/видео/текст) ---------- */
.variant-card { background: var(--cream-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.variant-badge { width: 36px; height: 36px; flex-shrink: 0; border: 0; outline: none; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600; }
.variant-thumb { width: 56px; height: 56px; flex-shrink: 0; border-radius: 10px; object-fit: cover; background: #000; border: 1px solid var(--line); }
.variant-media { display: flex; align-items: center; gap: 10px; background: rgba(251,250,246,.7); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.variant-media-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- Drag&drop дроп-зоны (медиа вариантов + бриф) ---------- */
.variant-drop { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--muted); background: rgba(251,250,246,.5); border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px 12px; transition: border-color .15s, background .15s, color .15s; }
.variant-drop:hover { border-color: var(--red); color: var(--red); }
.variant-drop i { font-size: 17px; }
.drop-over { border-color: var(--red) !important; background: rgba(210,23,73,.06) !important; color: var(--red) !important; box-shadow: 0 0 0 3px rgba(210,23,73,.10); }
.dropzone-wrap { position: relative; border-radius: 13px; transition: box-shadow .15s; }
.dropzone-wrap.drop-over { box-shadow: 0 0 0 3px rgba(210,23,73,.12); border-radius: 13px; }
.dropzone-wrap.drop-over::after { content: 'Отпусти файл'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(210,23,73,.06); border: 1.5px dashed var(--red); border-radius: 13px; font-size: 13px; color: var(--red); pointer-events: none; }

/* ---------- Степпер мастера ---------- */
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ---------- Лоадер Echo: знак + расходящиеся эхо-кольца ---------- */
/* Один на весь интерфейс. Кольца - три штуки со сдвигом, чтобы эхо читалось как волна,
   а не как одиночный пульс. Цвет наследуется (currentColor), поэтому работает и на красной кнопке. */
.yk-loader { position: relative; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; }
/* крупный - всегда фирменным красным (это знак Echo); мелкий наследует цвет места,
   иначе он бы спорил с белым текстом внутри красной кнопки */
.yk-loader-lg { width: 40px; height: 40px; color: var(--red); }
.yk-loader svg { width: 100%; height: 100%; display: block; animation: yk-echo-pulse 1.7s ease-in-out infinite; }
.yk-loader i { position: absolute; inset: 0; border: 1.4px solid currentColor; border-radius: 50%; opacity: 0;
    animation: yk-echo-ring 2s cubic-bezier(.2,.6,.3,1) infinite; }
.yk-loader-lg i { border-width: 2px; }
.yk-loader i:nth-of-type(2) { animation-delay: .66s; }
.yk-loader i:nth-of-type(3) { animation-delay: 1.32s; }
@keyframes yk-echo-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.93); } }
@keyframes yk-echo-ring { 0% { transform: scale(.28); opacity: .55; } 70% { opacity: .06; } 100% { transform: scale(1.75); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .yk-loader svg, .yk-loader i { animation: none; }
    .yk-loader i { opacity: .18; }
}

/* ---------- Markdown-отчёт (инсайт) ---------- */
.md-report h2 { font-size: 1.0rem; font-weight: 600; margin: 1.1rem 0 0.45rem; color: var(--ink); }
.md-report h3 { font-size: 0.9rem; font-weight: 600; margin: 0.9rem 0 0.35rem; }
.md-report p  { margin: 0.4rem 0; line-height: 1.6; }
.md-report ul, .md-report ol { margin: 0.4rem 0 0.4rem 1.25rem; }
.md-report ul { list-style: disc; }
.md-report ol { list-style: decimal; }
.md-report li { margin: 0.2rem 0; line-height: 1.55; }
.md-report blockquote { border-left: 3px solid var(--red); padding-left: 0.75rem; margin: 0.5rem 0; color: #6b675f; font-style: italic; }
.md-report hr { margin: 1rem 0; border-color: rgba(36,36,35,.1); }

/* ---------- Toast ---------- */
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 14px; color: #fff; font-size: 0.85rem; box-shadow: 0 12px 30px rgba(74,60,30,.25); animation: toast-in .18s ease-out; }
.toast-error { background: var(--red-deep); }
.toast-ok    { background: #1c6e48; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Инлайн-ошибка шага мастера - у кнопок, заметная и «красивая» (вместо тихого тоста в углу) */
.wizard-err { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.wizard-err.hidden { display: none; }
.wizard-err .pill { display: inline-flex; align-items: center; gap: 8px; background: #FDE7EC; color: var(--red-deep);
    border: 1px solid rgba(210,23,73,.28); padding: 9px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500;
    box-shadow: var(--sh-pop); animation: wiz-err-in .2s ease-out; }
.wizard-err .pill i { font-size: 16px; }
.wizard-err.shake .pill { animation: wiz-err-in .2s ease-out, wiz-shake .34s ease-in-out; }
@keyframes wiz-err-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wiz-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 60% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }

/* ---------- Появление вьюх ---------- */
.view-fade { animation: fadeUp .4s cubic-bezier(.22,1,.36,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Живая лента прогона ---------- */
.live-in { animation: live-in .4s cubic-bezier(.34,1.4,.64,1); }
@keyframes live-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; animation: live-pulse 1.2s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

#modal { z-index: 50; }   /* #toast-container — своё правило выше (fixed + z-index:100, поверх модалки) */

/* ====================== ПРОГОН (живой опрос) ====================== */
.run-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.mode-switch { display: inline-flex; gap: 4px; padding: 4px; background: rgba(251,250,246,.8); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--sh-soft); position: relative; }
.mode-switch button { position: relative; z-index: 2; border: none; background: transparent; cursor: pointer; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 13px; color: var(--muted); padding: 9px 16px; border-radius: 999px; display: flex; align-items: center; gap: 7px; transition: color .35s ease; white-space: nowrap; }
.mode-switch button i { font-size: 16px; }
.mode-switch button.active { color: var(--paper); }
.mode-switch .mpill { position: absolute; z-index: 1; top: 4px; height: calc(100% - 8px); border-radius: 999px; background: linear-gradient(135deg, var(--red), var(--red-deep)); box-shadow: var(--sh-pop); transition: left .5s cubic-bezier(0.34,1.56,0.64,1), width .5s cubic-bezier(0.34,1.56,0.64,1); }
.mode-hint { font-size: 13px; color: var(--muted); }
.mode-hint b { color: var(--ink-soft); font-weight: 600; }
.run-stage { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 980px) { .run-stage { grid-template-columns: 1fr; } }

/* ---------- Превью по каждому вопросу (фаза «идёт опрос») ---------- */
/* обзор всех вопросов под «картой движения» */
/* живое табло опроса: все графики сразу, без переключателя вопросов */
.live-board { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lb-head { padding: 2px 2px 0; }
.lb-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.lb-title i { color: var(--red); font-size: 18px; }
.lb-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.q-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
@media (max-width: 1500px) { .q-tiles { grid-template-columns: minmax(0, 1fr); } }
.q-tile { background: var(--paper); border: 1px solid rgba(226,220,207,.8); border-radius: var(--r-lg); padding: 15px 16px; box-shadow: var(--sh-card); display: flex; flex-direction: column; }
.q-tile-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; }
.qt-num { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); color: var(--cream); font-family: 'Bricolage Grotesque', sans-serif; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.qt-text { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qt-tag { font-size: 10.5px; color: var(--muted); background: rgba(242,238,230,.9); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; flex-shrink: 0; }
.q-tile-body { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 96px; }
.qt-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 4px; }
.qt-foot span { font-weight: 700; color: var(--ink-soft); }
.qt-note { margin-left: auto; font-style: normal; color: var(--red); font-weight: 600; }
/* scale - растущие столбцы 1..5 */
.qt-scale { display: flex; align-items: flex-end; justify-content: center; gap: 12px; height: 96px; width: 100%; }
.qt-col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; flex: 1; max-width: 40px; }
.qt-coln-v { font-size: 11px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-height: 14px; }
.qt-colbar { width: 100%; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height .8s cubic-bezier(.22,1,.36,1); background: linear-gradient(180deg, var(--coral), var(--red)); }
.qt-col:nth-child(1) .qt-colbar { background: linear-gradient(180deg, #9DB6CF, #8DA0B8); }
.qt-col:nth-child(2) .qt-colbar { background: linear-gradient(180deg, #A9CBF2, #7BADF6); }
.qt-col:nth-child(3) .qt-colbar { background: linear-gradient(180deg, #C9A6C0, #B98AA8); }
.qt-coln { font-size: 11px; color: var(--muted); font-weight: 600; }
/* choice/multi - заполняющиеся полосы вариантов */
.qt-opts { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.qt-opt-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.qt-opt-l { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qt-opt-pct { color: var(--red); font-weight: 600; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.qt-opt-bar { height: 7px; border-radius: 999px; background: rgba(91,90,85,.12); overflow: hidden; }
.qt-opt-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--red)); transition: width .8s cubic-bezier(.22,1,.36,1); }
/* лидер варианта - чтобы в шести полосках взгляду было за что зацепиться */
.qt-opt-top-pick .qt-opt-l { color: var(--ink); font-weight: 600; }
.qt-opt-top-pick .qt-opt-bar { background: rgba(210,23,73,.12); }
/* open - живые цитаты */
.qt-open { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); font-style: italic; line-height: 1.5; }
.qt-open i { color: var(--gold); font-size: 19px; flex-shrink: 0; font-style: normal; }
.qt-quote { transition: opacity .25s ease; }
.swarm-panel { position: relative; background: linear-gradient(170deg, #FBFAF6, #F4F0E7); border: 1px solid rgba(226,220,207,.85); border-radius: var(--r-xl); box-shadow: var(--sh-card); overflow: hidden; min-height: 520px; }
.swarm-panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.swarm-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.cluster-label { position: absolute; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; text-align: center; opacity: 0; transition: opacity .6s ease; }
.cluster-label small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 3px; }
.cluster-label .lt { font-size: 14px; color: var(--ink); }
.cluster-label .cnt { font-size: 30px; line-height: 1; margin-top: 3px; display: block; font-variant-numeric: tabular-nums; }
.run-counter { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 3; pointer-events: none; }
.run-counter .big { font-size: 46px; font-weight: 700; font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -.02em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.run-counter .big b { color: var(--red); font-weight: 700; }
.run-counter .big i { font-style: normal; color: var(--muted); font-size: 26px; }
.run-counter .sub { font-size: 12.5px; color: var(--muted); }
/* шапка-анонс анимации сбора/отчёта: «подписывает» движущуюся картинку */
.swarm-panel .build-head { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: 14px 18px 12px; background: linear-gradient(180deg, rgba(251,250,246,.96), rgba(251,250,246,0)); pointer-events: none; }
.swarm-panel .build-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.swarm-panel .build-title i { color: var(--red); font-size: 18px; }
.swarm-panel .build-decode { margin-top: 5px; font-size: 12.5px; color: var(--muted); max-width: 82%; line-height: 1.35; }
.swarm-panel .build-legend { display: flex; gap: 16px; margin-top: 10px; }
.swarm-panel .build-legend .bl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.bl-dot { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f0839c, var(--red)); box-shadow: 0 0 6px rgba(210,23,73,.4); display: inline-block; }
.bl-line { width: 16px; height: 0; border-top: 2px dotted rgba(232,82,122,.75); display: inline-block; }
.run-side { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--paper); border: 1px solid rgba(226,220,207,.8); border-radius: var(--r-lg); padding: 18px 19px; box-shadow: var(--sh-card); }
.panel-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.panel-title i { color: var(--red); font-size: 19px; }
.panel .sub-line { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.panel .eta { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.panel .eta b { color: var(--ink-soft); font-weight: 600; }

/* ---------- Степпер этапов прогона: сбор двойников → опрос → сборка отчёта ---------- */
/* общий прогресс-бар по всему прогону (взвешенный по этапам) */
.ov { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }
.ov-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(91,90,85,.12); overflow: hidden; }
.ov-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e8527a, var(--red)); transition: width 1s ease; }
.ov-pct { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.run-steps { display: flex; flex-direction: column; gap: 14px; }
.run-step { display: flex; align-items: flex-start; gap: 11px; }
.rs-ico { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; background: rgba(91,90,85,.10); color: var(--muted); }
.rs-active .rs-ico { background: rgba(210,23,73,.12); color: var(--red); }
.rs-done .rs-ico { background: var(--red); color: #fff; }
.rs-pending .rs-ico { opacity: .55; }
.rs-body { flex: 1; min-width: 0; }
.rs-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rs-pending .rs-label { color: var(--muted); font-weight: 500; }
.rs-pct { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rs-bar { height: 5px; border-radius: 999px; background: rgba(91,90,85,.12); overflow: hidden; }
.rs-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--red); transition: width 1s ease; }
.rs-done .rs-bar > span { background: rgba(210,23,73,.5); }
.rs-bar--indet > span { width: 38%; animation: rs-indet 1.25s ease-in-out infinite; }
@keyframes rs-indet { 0% { transform: translateX(-115%); } 100% { transform: translateX(290%); } }
.rs-note { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.35; }
/* min-height под 2 строки: короткая реплика не сжимает панель - экран не «моргает» при смене */
.typeline { display: flex; align-items: center; gap: 10px; background: rgba(242,238,230,.6); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; min-height: 60px; }
.typeline .ava { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #10355f; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.typeline .tw { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.caret { display: inline-block; width: 2px; height: 14px; background: var(--red); margin-left: 1px; vertical-align: text-bottom; animation: caret-blink 1s step-end infinite; }
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
/* объём источника в ленте сбора - качественно (3 точки + слово), без точных чисел */
.cf-vol { display: inline-flex; align-items: center; white-space: nowrap; }
.cf-vol .cf-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(140,136,125,.28); display: inline-block; margin-right: 3px; }
.cf-vol .cf-dot.on { background: var(--red); }
.cf-vol-w { margin-left: 4px; font-size: 11.5px; color: var(--muted); }
.value-note { position: relative; background: linear-gradient(135deg, rgba(210,23,73,.05), rgba(123,173,246,.05)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.value-note p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.value-note .src { margin-top: 8px; font-size: 12px; color: var(--red); display: flex; align-items: center; gap: 6px; font-weight: 600; }
/* резерв под 3 строки: подсказки разной длины не меняют высоту панели → грид не пересобирается,
   левая панель с цифрой не «моргает» на смене подсказки */
.run-tip { margin-top: 10px !important; font-size: 12.5px !important; line-height: 1.4; display: flex; align-items: flex-start; gap: 6px; min-height: 60px; }
.run-tip i { color: var(--gold); margin-top: 2px; font-size: 15px; }
.run-tip span { transition: opacity .25s ease; }

/* ====================== МОБИЛЬНАЯ АДАПТАЦИЯ ====================== */
/* топбар, бэкдроп и их элементы - только на узких экранах */
.m-topbar, #m-backdrop { display: none; }

@media (max-width: 1023px) {
    /* ---- мобильный топбар (fixed, перекрывается дравером) ---- */
    /* показываем только в приложении (не на экранах логина/регистрации) */
    body.app-authed .m-topbar { display: flex; }
    .m-topbar {
        align-items: center; gap: 12px;
        position: fixed; top: 0; left: 0; right: 0;
        height: 54px; padding: 0 14px;
        background: linear-gradient(180deg, rgba(251,250,246,.94), rgba(244,241,234,.88));
        backdrop-filter: blur(14px) saturate(1.1);
        -webkit-backdrop-filter: blur(14px) saturate(1.1);
        border-bottom: 1px solid rgba(226,220,207,.7);
        z-index: 40;
    }
    .m-burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; margin-left: -6px;
        border-radius: 12px; color: var(--ink-soft); cursor: pointer;
        transition: background .2s;
    }
    .m-burger i { font-size: 24px; }
    .m-burger:active { background: rgba(36,36,35,.06); }
    .m-topbar .m-logo { font-size: 30px; top: 2px; }
    .m-balance {
        margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
        font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 13.5px;
        color: var(--ink-soft); background: rgba(242,238,230,.9); border: 1px solid var(--line);
        border-radius: 999px; padding: 7px 13px; white-space: nowrap;
    }
    .m-balance i { font-size: 17px; color: var(--red); }

    /* ---- off-canvas сайдбар (перекрывает Tailwind w-64/sticky/h-screen/z-30) ---- */
    .sidebar {
        position: fixed !important;
        top: 0; left: 0;
        width: 284px !important; max-width: 86vw;
        height: 100dvh !important;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .32s cubic-bezier(.4,0,.2,1);
        z-index: 60 !important;
        background: linear-gradient(180deg, #FBFAF6, #F4F1EA) !important;
        box-shadow: 0 0 0 100vmax rgba(0,0,0,0); /* без эффекта, держит слой */
    }
    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(74,60,30,.22);
    }

    /* ---- бэкдроп ---- */
    #m-backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(36,36,35,.44);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
        opacity: 0; visibility: hidden;
        transition: opacity .3s ease, visibility .3s ease;
        z-index: 50;
    }
    body.nav-open #m-backdrop { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }   /* лок скролла под дравером */

    /* ---- контент: комфортные поля ---- */
    #main-content {
        padding-left: 16px; padding-right: 16px;
        padding-top: 24px; padding-bottom: 32px;
    }
    /* место под fixed-топбар - только когда он показан (в приложении) */
    body.app-authed #main-content { padding-top: 74px; }
}

/* совсем узкие экраны - ещё плотнее */
@media (max-width: 420px) {
    #main-content { padding-left: 13px; padding-right: 13px; }
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(36,36,35,.16); border-radius: 8px; border: 3px solid var(--cream); }

/* ---------- Печать через Ctrl+P (fallback). Кнопка «Скачать» отдаёт серверный PDF ---------- */
@media print {
    @page { margin: 14mm; }
    body { background: #fff !important; }
    body::before, body::after { display: none !important; }
    .bg-field, .grain, .sidebar, #toast-container, #modal, .no-print { display: none !important; }
    main { overflow: visible !important; }
    main > div { max-width: none !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid var(--line) !important; break-inside: avoid; }
    .view-fade { animation: none !important; }
    h1 { font-size: 22px !important; }
}

/* Шаг «Аудитория»: фон-холст кремовый, каждый блок - белая карточка-модуль */
.audience-shell { background: var(--cream); }
.audience-shell::before { display: none; }
.acard {
    background: #fff;
    border: 1px solid rgba(36, 36, 35, .08);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(36, 36, 35, .04);
}
.acard:last-child { margin-bottom: 0; }
/* выделенная карточка «На кого подписана» - тёплый кремовый, стоит особняком */
.acard-hi {
    background: #F1EADC;
    border: 1px solid rgba(36, 36, 35, .10);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
}
.acard-label { display: block; font-size: 13px; font-weight: 600; color: #242423; }

/* Экран выбора типа исследования: два режима-карточки + раскрытие подтипов по клику */
.chooser-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chooser-mode { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; position: relative;
  transition: background .55s ease, border-color .55s ease, box-shadow .55s ease, transform .2s ease; }
button.chooser-mode { cursor: pointer; width: 100%; font: inherit; color: inherit; }
button.chooser-mode:hover { transform: translateY(-2px); }
.chooser-mode.sel { background: #FBEEF2; border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.chooser-mode.dev { opacity: .6; filter: grayscale(.5); background: repeating-linear-gradient(-45deg, #fbfaf6, #fbfaf6 10px, #f4f1ea 10px, #f4f1ea 20px); cursor: not-allowed; }
.chooser-mode.dev h2 { color: rgba(36,36,35,.5); }
.chooser-mode h2 { font-size: 19px; font-weight: 700; margin: 8px 0 6px; }
.chooser-mode p { font-size: 12.5px; color: rgba(36,36,35,.55); line-height: 1.45; margin: 0; }
.cmode-kick { font-size: 10.5px; letter-spacing: .13em; font-weight: 700; color: rgba(36,36,35,.5); }
.cmode-dev { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(36,36,35,.55); background: #EFECE5; border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center; }
.cmode-chk { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; color: #fff; background: transparent; transition: .5s cubic-bezier(.34,1.4,.64,1); }
.cmode-chk i { font-size: 15px; opacity: 0; transform: scale(.3); transition: .34s .12s; }
.chooser-mode.sel .cmode-chk { background: var(--red); border-color: var(--red); }
.chooser-mode.sel .cmode-chk i { opacity: 1; transform: scale(1); }
.chooser-reveal { max-height: 0; opacity: 0; transform: translateY(16px); overflow: hidden;
  transition: max-height .8s cubic-bezier(.19,1,.28,1), opacity .55s ease, transform .7s cubic-bezier(.19,1,.28,1); }
.chooser-reveal.show { max-height: 900px; opacity: 1; transform: translateY(0); }
.chooser-revtag { display: inline-block; font-family: 'Sa No Rules','Caveat',cursive; color: var(--red); font-weight: 700; font-size: 18px;
  margin: 16px 0 8px; transform: translateX(-10px); opacity: 0; transition: .55s .18s ease; }
.chooser-reveal.show .chooser-revtag { transform: translateX(0); opacity: 1; }
.chooser-subs { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.csub { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; box-shadow: 0 1px 2px rgba(36,36,35,.03);
  opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .6s cubic-bezier(.19,1,.28,1), border-color .3s, box-shadow .3s; }
button.csub { cursor: pointer; width: 100%; font: inherit; color: inherit; }
.chooser-reveal.show .csub { opacity: 1; transform: translateY(0); }
.chooser-reveal.show .csub:nth-child(1) { transition-delay: .2s; }
.chooser-reveal.show .csub:nth-child(2) { transition-delay: .32s; }
.chooser-reveal.show .csub:nth-child(3) { transition-delay: .44s; }
.csub.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.csub.dev { opacity: .55; cursor: not-allowed; }
.csub b { font-weight: 600; font-size: 13.5px; display: block; margin-bottom: 4px; line-height: 1.3; }
.csub span { display: block; font-size: 12.5px; color: rgba(36,36,35,.55); line-height: 1.3; }
@media (max-width: 640px) { .chooser-modes { grid-template-columns: 1fr; } .chooser-subs { grid-template-columns: 1fr; } }

/* Развилка шага «Вопросы»: составить за меня / свои вопросы */
.q-fork-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px 18px 16px;
    display: flex; flex-direction: column; gap: 3px; cursor: pointer; font: inherit; color: inherit; width: 100%;
    box-shadow: 0 1px 2px rgba(36,36,35,.03); transition: transform .18s cubic-bezier(.34,1.4,.64,1), border-color .18s, box-shadow .18s; }
.q-fork-card:hover { transform: translateY(-2px); border-color: var(--red); box-shadow: 0 0 0 1px var(--red), var(--sh-pop); }
.q-fork-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px;
    background: rgba(210,23,73,.10); color: var(--red); font-size: 20px; }
.q-fork-card b { font-weight: 600; font-size: 15px; }
.q-fork-card span:last-child { font-size: 13px; color: rgba(36,36,35,.55); line-height: 1.4; }
