/* Стили админки studio-bot. Дизайн-токены и компоненты перенесены из docs/admin-mockup.html
   без изменений значений (SPEC 5, «Дизайн админки»); экраны макета не переносятся. */
:root {
  --bg: #f3f5f7;          /* фон рабочей области, холодный серый с уклоном в бирюзу */
  --surface: #ffffff;     /* карточки и формы */
  --surface-2: #f8fafb;   /* поля, полосы таблиц */
  --ink: #17202b;         /* основной текст */
  --ink-2: #4c5a68;       /* вторичный текст */
  --ink-3: #8593a1;       /* подписи, плейсхолдеры */
  --line: #e1e6eb;        /* границы */
  --line-2: #cdd5dd;      /* границы полей */
  --side: #14232b;        /* сайдбар */
  --side-ink: #c9d6dc;
  --side-active: #1f3742;
  --accent: #0e7c7b;      /* действия, ссылки, фокус */
  --accent-ink: #ffffff;
  --accent-soft: #e2f3f2;
  --ok: #1f8a4c;   --ok-soft: #e3f4ea;
  --warn: #b26a00; --warn-soft: #fbf0dc;
  --danger: #c2372f; --danger-soft: #fbe7e5;
  --tg-bg: #dfe8ee;       /* фон чата в превью */
  --tg-bubble: #ffffff;
  --tg-btn: #eef3f6;
  --tg-btn-ink: #2b7ab8;
  --k-menu: #5b6b7a;   --k-menu-bg: #eceff2;
  --k-choice: #0e7c7b; --k-choice-bg: #e2f3f2;
  --k-multi: #6a4bc4;  --k-multi-bg: #eeeafb;
  --k-text: #b26a00;   --k-text-bg: #fbf0dc;
  --k-phone: #1f8a4c;  --k-phone-bg: #e3f4ea;
  --k-file: #3d6fa8;   --k-file-bg: #e5eef8;
  --k-finish: #b83b6a; --k-finish-bg: #fae6ee;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 43, .06), 0 1px 1px rgba(20, 35, 43, .04);
  --shadow-lg: 0 8px 24px rgba(20, 35, 43, .10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: var(--fs-md); font-weight: 650; }
h3 { font-size: var(--fs); font-weight: 650; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ── каркас ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 12px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 700; }
.brand b { display: block; color: #fff; font-size: var(--fs); }
.brand span { font-size: var(--fs-xs); color: #8aa1ab; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: var(--side-active); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; font-size: var(--fs-xs); background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); }
.bot-link { display: flex; align-items: center; gap: 8px; color: var(--side-ink); }
.side-foot button { all: unset; cursor: pointer; color: #8aa1ab; font-size: var(--fs-sm); }
.side-foot button:hover { color: #fff; }

.main { min-width: 0; padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.main-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── кнопки и поля ─────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 var(--fs)/1 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #0b6a69; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.icon-btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.btn svg, .icon-btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.hint { font-size: var(--fs-xs); color: var(--ink-3); }
.input, .select, .textarea { width: 100%; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: var(--fs)/1.4 var(--font); }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238593a1' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.search .input { padding-left: 34px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); user-select: none; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* ── карточки, плашки, бейджи ───────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid; font-size: var(--fs-sm); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-error { background: var(--danger-soft); border-color: #f1c6c2; color: #7d221c; }
.alert-ok { background: var(--ok-soft); border-color: #bfe2cc; color: #145c33; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.k-menu { color: var(--k-menu); background: var(--k-menu-bg); }
.k-choice { color: var(--k-choice); background: var(--k-choice-bg); }
.k-multi { color: var(--k-multi); background: var(--k-multi-bg); }
.k-text { color: var(--k-text); background: var(--k-text-bg); }
.k-phone { color: var(--k-phone); background: var(--k-phone-bg); }
.k-file { color: var(--k-file); background: var(--k-file-bg); }
.k-finish { color: var(--k-finish); background: var(--k-finish-bg); }
.s-ok { color: var(--ok); background: var(--ok-soft); }
.s-warn { color: var(--warn); background: var(--warn-soft); }
.s-off { color: var(--ink-3); background: var(--line); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip svg { width: 12px; height: 12px; flex: none; }

/* ── «Сценарий» ─────────────────────────────────────── */
.scenario { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.blocks { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.blocks a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.blocks a:hover { background: var(--surface-2); text-decoration: none; }
.blocks a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.blocks .n { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.blocks .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.steps-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.steps-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.steps-toolbar .search { flex: 1 1 240px; }
.block-title { display: flex; align-items: baseline; gap: 10px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: inherit; transition: border-color .12s, box-shadow .12s; }
.step:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); text-decoration: none; }
.step-n { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.step-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-title { font-weight: 600; color: var(--ink); }
.step-text { color: var(--ink-2); font-size: var(--fs-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.step-side { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.step.is-off { background: var(--surface-2); }
.step.is-off .step-title, .step.is-off .step-text { color: var(--ink-3); }
.step-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); background: transparent; font: 500 var(--fs) var(--font); cursor: pointer; }
.step-add:hover { border-color: var(--accent); color: var(--accent); }

/* ── редактор шага ─────────────────────────────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.toggles { display: flex; gap: 20px; flex-wrap: wrap; }
.opts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.opt { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.opt:first-child { border-top: 0; }
.opt-head { background: var(--surface-2); font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-block: 8px; }
.opt .move { display: flex; flex-direction: column; gap: 2px; }
.opt .move button { all: unset; cursor: pointer; width: 24px; height: 16px; display: grid; place-items: center; border-radius: 4px; color: var(--ink-3); }
.opt .move button:hover { background: var(--line); color: var(--ink); }
.opt .move svg { width: 12px; height: 12px; }
.opt-extra { grid-column: 2 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.opt-extra .input { height: 32px; font-size: var(--fs-sm); flex: 1 1 220px; }
.opt.is-hidden .input:not(.prompt) { color: var(--ink-3); background: var(--surface-2); }
.opt-actions { display: flex; gap: 2px; }
.opt-add { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.refs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sticky-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }

/* превью Telegram */
.preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.preview-label { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.phone { border-radius: 26px; background: var(--side); padding: 10px; box-shadow: var(--shadow-lg); }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; color: #fff; }
.phone-top .ava { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }
.phone-top small { display: block; color: #8aa1ab; font-size: 11px; }
.chat { background: var(--tg-bg); border-radius: 18px; padding: 14px 12px; min-height: 360px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.bubble { background: var(--tg-bubble); border-radius: 14px 14px 14px 4px; padding: 9px 12px 6px; font-size: var(--fs-sm); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble time { display: block; text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.kb { display: flex; flex-direction: column; gap: 4px; }
.kb span { display: block; text-align: center; background: var(--tg-btn); color: var(--tg-btn-ink); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-sm); font-weight: 500; overflow-wrap: anywhere; }
.kb span.svc { background: rgba(255,255,255,.55); color: var(--ink-2); }

/* ── заявки ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="true"] { color: var(--accent); border-color: var(--accent); }
.tabs .n { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
th { text-align: left; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.lead-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
.kv dt, .kv dd { margin: 0; padding: 11px 20px; border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-2); font-size: var(--fs-sm); }
.kv dd { overflow-wrap: anywhere; }
.kv > :nth-child(-n+2) { border-top: 0; }
.contact { display: flex; flex-direction: column; gap: 12px; }
.contact-row { display: flex; gap: 10px; align-items: flex-start; }
.contact-row svg { width: 16px; height: 16px; color: var(--ink-3); margin-top: 2px; flex: none; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.file svg { width: 20px; height: 20px; color: var(--k-file); }

/* ── настройки ─────────────────────────────────────── */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.settings-nav a:hover { background: var(--surface); text-decoration: none; }
.settings-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.inline-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: #0b5554; font-size: var(--fs-sm); }
.inline-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

/* ── вход ───────────────────────────────────────────── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, #dcefee 0, transparent 45%), var(--bg); }
.login .card { width: min(380px, 100%); }
.login .card-body { padding: 28px; gap: 18px; }


/* ── главная ────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.hero-text { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.hero-text p { margin: 0; color: var(--ink-2); max-width: 62ch; }
.hero-flow { padding: 24px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.hero-flow b { color: #fff; font-weight: 600; }
.flow-row { display: flex; align-items: center; gap: 10px; }
.flow-dot { width: 26px; height: 26px; border-radius: 8px; background: var(--side-active); display: grid; place-items: center; flex: none; color: #9fd8d6; }
.flow-dot svg { width: 14px; height: 14px; }
.flow-line { width: 2px; height: 10px; background: var(--side-active); margin-left: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 28px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--fs-sm); color: var(--ink-2); }
.stat-value.sm { font-size: var(--fs-md); line-height: 1.6; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.start-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.start-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.start-list li:first-child { border-top: 0; }
.start-list .step-n.done { background: var(--ok-soft); border-color: #bfe2cc; color: var(--ok); }
.start-list .t { font-weight: 600; }
.start-list .d { font-size: var(--fs-sm); color: var(--ink-2); }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 20px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.check-row svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.check-row.warn svg { color: var(--warn); }
.check-row.ok svg { color: var(--ok); }
.mini-leads { display: flex; flex-direction: column; }
.mini-leads a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: inherit; }
.mini-leads a:first-child { border-top: 0; }
.mini-leads a:hover { background: var(--surface-2); text-decoration: none; }
.mini-leads .sub { font-size: var(--fs-xs); color: var(--ink-3); }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }


/* ── адаптив ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; max-width: 360px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 7px 10px; }
  .side-foot { display: none; }
  .brand span { display: none; }
  .scenario, .lead-grid, .settings, .home-grid, .hero { grid-template-columns: minmax(0, 1fr); }
  .blocks { position: static; flex-direction: row; overflow-x: auto; }
  .blocks a { white-space: nowrap; }
  .blocks .sep { display: none; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .main-inner { padding: 0; }
}
@media (max-width: 600px) {
  .form-grid, .row-2, .stats { grid-template-columns: minmax(0, 1fr); }
  .start-list li { grid-template-columns: 28px minmax(0, 1fr); }
  .start-list li > .btn { grid-column: 2; justify-self: start; }
  .opt { grid-template-columns: 30px minmax(0, 1fr); }
  .opt > .select, .opt-actions { grid-column: 2; }
  .opt-head { display: none; }
  .step { grid-template-columns: minmax(0, 1fr) auto; }
  .step-n { display: none; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0; border-top: 1px solid var(--line); }
  .kv dd { border-top: 0; padding-top: 2px; }
  .nav a span.lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── дополнение к макету ────────────────────────────── */
[hidden] { display: none !important; }
.side-foot form { margin: 0; }
