/* Hallmark · shape: app screen · genre: modern-minimal · theme: Console · brand: bitwire (spec 2026-11-08) · signature: два канала статуса, циан отправлено, маджента в очереди · built: the project · v2.0.0
 * nav: the project's sidebar, kept · signature: status channel · states: loading, empty, error, full on lists; eight states on controls
 * motion: login logo scan-glitch intro 650ms then the exact logo, brand fade 200ms, row rise 420ms, live ring on the ok dot, control colour and transform 120–200ms · transform and opacity only · reduced-motion: none
 * axes: graphite ground · Inter + DejaVu Sans Mono · cyan action, magenta attention · contrast: pass · v2.0.0 */
/* ── bitwire: панель оператора ──
   Палитра по брендбуку bitwire (раздел 5):
   тёмная  — ночь #050505, белый #FFFFFF, циан #00E5FF, маджента #FF2BD6, серый #8A8A8A
   светлая — белый #FFFFFF, чернила #0A0A0A, циан светлый #00C2E0, серый тёмный #6E6E6E
   Циан — действие и выбор (как левый канал логотипа), маджента — внимание (очередь, DRY-RUN),
   как правый канал. Ошибки в брендбуке не заданы: красный взят в тон магенте.
   Шрифты (раздел 6): Inter — интерфейс, DejaVu Sans Mono — технические подписи.
   По умолчанию тёмная. Переключатель в боковой панели, выбор хранится в localStorage.
   Токены: surface / line / text / accent / ok / danger / pending / muted. */

:root {
    color-scheme: dark;

    --bg: #050505;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #181818;
    --line: #1c1c1c;
    --line-strong: #2e2e2e;

    --text: #ffffff;
    --text-2: #b8b8b8;
    --text-3: #8a8a8a;

    --accent: #00e5ff;
    --accent-hover: #5cf0ff;
    --accent-text: #00e5ff;
    --accent-ink: #050505;
    --accent-soft: rgba(0, 229, 255, 0.12);
    --accent-line: rgba(0, 229, 255, 0.4);

    --pending: #ff2bd6;
    --pending-soft: rgba(255, 43, 214, 0.12);
    --ok: #00e5ff;
    --ok-soft: rgba(0, 229, 255, 0.1);
    --danger: #ff4d6d;
    --danger-soft: rgba(255, 77, 109, 0.12);
    --muted: #8a8a8a;
    --muted-soft: rgba(138, 138, 138, 0.12);

    --focus: #00e5ff;

    --dur-micro: 120ms;
    --dur-short: 200ms;
    --dur-enter: 420ms;
    --dur-glitch: 650ms;
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-lift: 0 24px 60px -30px rgba(0, 0, 0, 0.9);

    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "DejaVu Sans Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #ffffff;
    --surface: #fafafa;
    --surface-2: #f2f2f2;
    --surface-3: #e8e8e8;
    --line: #e6e6e6;
    --line-strong: #cacaca;

    --text: #0a0a0a;
    --text-2: #3a3a3a;
    --text-3: #6e6e6e;

    --accent: #00c2e0;
    --accent-hover: #00a9c4;
    --accent-text: #007f97;
    --accent-ink: #050505;
    --accent-soft: rgba(0, 194, 224, 0.14);
    --accent-line: rgba(0, 194, 224, 0.55);

    --pending: #c21db0;
    --pending-soft: rgba(194, 29, 176, 0.1);
    --ok: #00809a;
    --ok-soft: rgba(0, 194, 224, 0.12);
    --danger: #c81e3c;
    --danger-soft: rgba(200, 30, 60, 0.09);
    --muted: #6e6e6e;
    --muted-soft: rgba(110, 110, 110, 0.1);

    --focus: #007f97;
    --shadow-lift: 0 24px 60px -34px rgba(10, 10, 10, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--line-strong) transparent;
}

body {
    overflow-x: clip;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.005em;
    color: var(--text);
    background: var(--bg);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ── Иконки (SVG-спрайт из base.html) ── */

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.i {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Оболочка: сайдбар + контент ── */

.shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100dvh;
}

.sidebar {
    position: relative;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 20px 20px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

/* логотип bitwire: белая версия на тёмной теме, чёрная на светлой (брендбук, раздел 7) */
.brand-logo {
    display: block;
    width: 100%;
    max-width: 178px;
    height: auto;
    animation: fade-in var(--dur-short) var(--ease-out) both;
}

.brand-logo-light { display: none; }
:root[data-theme="light"] .brand-logo-dark { display: none; }
:root[data-theme="light"] .brand-logo-light { display: block; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--text-3);
    background: var(--surface-2);
}

.icon-btn:active { transform: scale(0.96); }

/* иконка «куда переключить»: в тёмной теме солнце, в светлой луна */
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}

.nav-link .i {
    color: var(--text-3);
    transition: color var(--dur-micro) var(--ease-out);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-link:hover .i { color: var(--text-2); }

.nav-link[aria-current="page"] {
    color: var(--text);
    background: var(--surface-3);
}

.nav-link[aria-current="page"] .i { color: var(--accent-text); }

.side-stats {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    border-top: 1px solid var(--line);
}

.stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.stat-label {
    font-size: 12px;
    color: var(--text-3);
}

.stat-num {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.side-foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-foot .tag { align-self: flex-start; }

.content {
    min-width: 0;
    max-width: 1180px;
    padding: 44px clamp(20px, 4vw, 56px) 80px;
}

/* Канбан занимает всю ширину рабочей области, остальные страницы остаются в 1180px */
.content.content-wide {
    max-width: none;
}

/* ── Заголовки страниц ── */

.page-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.page-title {
    font-size: 26px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

.page-sub {
    max-width: 60ch;
    font-size: 14px;
    color: var(--text-2);
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--dur-micro) var(--ease-out);
}

.link-back:hover { color: var(--accent-text); }

.link {
    color: var(--accent-text);
    text-decoration: none;
}

.link:hover { text-decoration: underline; }

/* ── Кнопки ── */

.btn,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.btn .i { width: 15px; height: 15px; }

.btn:hover,
.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--text-3);
}

.btn:active,
.btn-secondary:active { transform: scale(0.98); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    gap: 8px;
    font-size: 12px;
}

.btn-sm .i { width: 13px; height: 13px; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: var(--surface-2);
    border-color: transparent;
    color: var(--text);
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn-block { width: 100%; }

/* ── Статусы: pill (состояние кандидата), tag (признаки), dot (индикатор) ── */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-pending { color: var(--pending); background: var(--pending-soft); }
.pill-sent { color: var(--ok); background: var(--ok-soft); }
.pill-skipped { color: var(--muted); background: var(--muted-soft); }
.pill-failed,
.pill-error { color: var(--danger); background: var(--danger-soft); }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-2);
    white-space: nowrap;
}

.tag .i {
    width: 12px;
    height: 12px;
}

.tag-dry {
    color: var(--pending);
    border-color: var(--accent-line);
    background: var(--pending-soft);
}

.tag-need {
    color: var(--accent-text);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.tag-ok {
    color: var(--ok);
    border-color: transparent;
    background: var(--ok-soft);
}

.tag-no,
.tag-skip {
    color: var(--muted);
    border-color: transparent;
    background: var(--muted-soft);
}

.tag-fail {
    color: var(--danger);
    border-color: transparent;
    background: var(--danger-soft);
}

.dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--muted);
}

.dot-ok {
    position: relative;
    background: var(--ok);
}

.dot-ok::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ok);
    animation: live-ring 2.4s var(--ease-out) infinite;
}

.dot-pending { background: var(--pending); }
.dot-idle { background: var(--text-3); }
.dot-off { background: var(--muted); opacity: 0.6; }

@keyframes live-ring {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(3); opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glitch-a {
    0%, 14%, 36%, 58%, 100% { opacity: 0; transform: none; }
    8% { opacity: 0.75; transform: translate3d(-7px, 0, 0); }
    22% { opacity: 0.6; transform: translate3d(5px, 0, 0); }
    46% { opacity: 0.5; transform: translate3d(-3px, 0, 0); }
}

@keyframes glitch-b {
    0%, 12%, 30%, 52%, 100% { opacity: 0; transform: none; }
    6% { opacity: 0.7; transform: translate3d(6px, 0, 0); }
    18% { opacity: 0.55; transform: translate3d(-5px, 0, 0); }
    40% { opacity: 0.6; transform: translate3d(4px, 0, 0); }
}

@keyframes scan-out {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ── Вкладки-фильтры ── */

.filters {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter-tab {
    position: relative;
    padding: 12px 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-micro) var(--ease-out);
}

.filter-tab:hover { color: var(--text); }

.filter-tab.active { color: var(--text); }

.filter-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-text);
}

/* ── Список кандидатов: строки, а не карточки ── */

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.cand-list,
.rows {
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.cand-row {
    position: relative;
    padding: 16px 20px 16px 24px;
    border-top: 1px solid var(--line);
    transition: background-color var(--dur-micro) var(--ease-out);
    animation: rise var(--dur-enter) var(--ease-enter) both;
    animation-delay: min(calc(var(--i, 0) * 45ms), 360ms);
}

.cand-row:first-child { border-top: 0; }

.cand-row:hover { background: var(--surface-2); }

.cand-row.cand-pending { box-shadow: inset 0 0 0 1px var(--pending); }

.cand-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

/* растянутая ссылка: клик по любому месту строки открывает кандидата */
.cand-open {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.cand-open::after {
    content: "";
    position: absolute;
    inset: 0;
}

.cand-open:hover { color: var(--accent-text); }

.cand-ext {
    position: relative;
    z-index: 1;
    display: inline-flex;
    color: var(--text-3);
    transition: color var(--dur-micro) var(--ease-out);
}

.cand-ext:hover { color: var(--accent-text); }

.cand-chat {
    font-size: 12px;
    color: var(--text-3);
}

/* группа чата: из какого контекста пришло сообщение. Контур, чтобы не путать с ключевым словом */
.cand-group {
    padding: 4px 8px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    font-size: 11px;
    color: var(--accent-text);
    white-space: nowrap;
}

.cand-group.is-none {
    border-color: var(--line-strong);
    color: var(--text-3);
}

.cand-time {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

.cand-msg {
    max-width: 72ch;
    margin-top: 8px;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.cand-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.cand-keyword {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent-text);
}

/* ── Пустое состояние ── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 40px 28px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.empty-ico {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-3);
}

.empty-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.empty-hint {
    font-size: 13px;
    color: var(--text-3);
}

/* ── Карточка-панель (только там, где нужна иерархия) ── */

.panel {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.panel-title {
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-3);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.detail-col,
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.detail-side {
    position: sticky;
    top: 24px;
}

.kv {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
    padding: 12px 0;
}

.kv + .kv { border-top: 1px solid var(--line); }

.kv-col {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.kv-key {
    font-size: 12px;
    color: var(--text-3);
}

.kv-val {
    min-width: 0;
    font-size: 13px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.kv-col .kv-val { color: var(--text-2); }

.msg-block {
    position: relative;
    margin-bottom: 20px;
    padding: 16px 20px 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


.draft-input {
    display: block;
    width: 100%;
    min-height: 180px;
    padding: 16px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    transition: border-color var(--dur-micro) var(--ease-out);
}

.draft-input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.draft-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

/* выбор способа отправки перед кнопкой «Отправить» */
.draft-actions .send-mode {
    width: auto;
    min-width: 230px;
    cursor: pointer;
}

/* ── Вердикт LLM: решение крупно, объяснение отдельно ── */

.verdict {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.verdict-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 16px 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    box-shadow: inset 2px 0 0 var(--tone, var(--muted));
    --tone: var(--muted);
    --tone-soft: var(--muted-soft);
}

.verdict-hero.verdict-ok {
    --tone: var(--ok);
    --tone-soft: var(--ok-soft);
}

.verdict-hero.verdict-danger {
    --tone: var(--danger);
    --tone-soft: var(--danger-soft);
}

.verdict-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    background: none;
    color: var(--tone);
}

.verdict-icon .i {
    width: 18px;
    height: 18px;
}

.verdict-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.verdict-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.verdict-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
}

.verdict-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verdict-label {
    font-size: 12px;
    color: var(--text-3);
}

.verdict-quote {
    padding: 4px 0 4px 16px;
    border-left: 2px solid var(--line-strong);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    overflow-wrap: anywhere;
}

.verdict-note {
    font-size: 13px;
    color: var(--text-3);
}

.verdict-details {
    font-size: 13px;
    color: var(--text-2);
}

.verdict-details summary {
    width: max-content;
    cursor: pointer;
    transition: color var(--dur-micro) var(--ease-out);
}

.verdict-details summary:hover { color: var(--text); }

.verdict-details pre {
    margin-top: 8px;
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--danger);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.verdict-footer {
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-3);
}

/* ── Формы: label сверху, подсказка и ошибка снизу ── */

.form-grid {
    display: grid;
    gap: 20px;
}

.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.span-2 { grid-column: 1 / -1; }

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}

.form-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--dur-micro) var(--ease-out);
}

.form-input::placeholder {
    color: var(--text-3);
    opacity: 1;
}

.form-input:hover { border-color: var(--text-3); }

.form-input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--dur-micro) var(--ease-out);
}

.form-textarea:hover { border-color: var(--text-3); }

.form-textarea:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-3);
}

.input-with-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-toggle .form-input {
    flex: 1;
    min-width: 0;
}

.toggle-btn { flex: none; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

/* переключатель вместо чекбокса: сам input скрыт, виден трек */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    flex: none;
    width: 36px;
    height: 20px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-3);
    transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-2);
    transition: transform var(--dur-short) var(--ease-enter), background-color var(--dur-short) var(--ease-out);
}

.switch input:checked + .switch-track {
    background: var(--accent);
    border-color: var(--accent);
}

.switch input:checked + .switch-track::after {
    transform: translateX(16px);
    background: var(--accent-ink);
}

.switch input:focus-visible + .switch-track {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ── Alert и результаты проверок ── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}

.alert .i { margin-top: 2px; }

.alert[hidden] { display: none; }

.draft-error-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* В узкой колонке кнопки повтора встают друг под другом на всю ширину и переносят текст */
.draft-error-body .draft-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
}

.draft-error-body .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
}

.alert-warn {
    background: var(--pending-soft);
    color: var(--text);
}

.alert-warn .i { color: var(--pending); }

.alert-err {
    background: var(--danger-soft);
    color: var(--danger);
}

.test-result {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
}

.test-result.show { display: block; }

.test-result.ok {
    background: var(--ok-soft);
    box-shadow: inset 2px 0 0 var(--ok);
}

.test-result.err {
    background: var(--danger-soft);
    box-shadow: inset 2px 0 0 var(--danger);
}

.test-result.ok b { color: var(--ok); }
.test-result.err b { color: var(--danger); }

.test-result pre {
    margin-top: 8px;
    padding: 12px;
    border-radius: 6px;
    background: var(--bg);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-2);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    font-size: 13px;
    color: var(--text);
    box-shadow: none;
    transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
    animation: toast-in var(--dur-short) var(--ease-out) both;
}

.toast::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: var(--muted);
}

.toast-ok::before { background: var(--ok); }
.toast-err::before { background: var(--danger); }

/* ── Настройки и аккаунты: подпись слева, управление справа ── */

.settings {
    border-top: 1px solid var(--line);
}

.set-sec {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
}

.set-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.set-desc {
    max-width: 36ch;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-2);
}

.set-body { min-width: 0; }

.rows { margin-top: 20px; }

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    transition: background-color var(--dur-micro) var(--ease-out);
    animation: rise var(--dur-enter) var(--ease-enter) both;
    animation-delay: min(calc(var(--i, 0) * 45ms), 360ms);
}

.row:first-child { border-top: 0; }

.row:hover { background: var(--surface-2); }

.row.is-active { box-shadow: inset 2px 0 0 var(--ok); }

.row.is-off { opacity: 0.6; }

.row-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.row-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 8px;
    font-size: 14px;
    font-weight: 600;
}

.row-meta {
    font-size: 12px;
    color: var(--text-3);
    overflow-wrap: anywhere;
}

.row-meta code {
    font-family: var(--mono);
    color: var(--text-2);
}

.row-id {
    min-width: 136px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
}

.row-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-2);
}

.row-state {
    font-size: 12px;
    color: var(--text-3);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

/* форма в колонке настроек ~400px: две колонки, поля в две строки, кнопка справа внизу */
.chat-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 12px;
}

.chat-fallback { margin-top: 16px; }

.group-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

/* импорт ID чатов: отделён от экспорта линией, итог показывается под кнопкой */
.import-box {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.import-result {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
}

.import-help p + p { margin-top: 8px; }

/* промпты группы: свёрнуты по умолчанию, подпись справа показывает, свои они или мастер-промпт */
.group-prompts {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.group-prompts summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    list-style: none;
}

.group-prompts summary::-webkit-details-marker { display: none; }

.group-prompts summary:hover { color: var(--text); }

.group-prompts[open] summary {
    color: var(--text);
    border-bottom: 1px solid var(--line);
}

.group-prompt-mode {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
}

.group-prompts-body {
    display: grid;
    gap: 16px;
    padding: 16px;
}

/* выбор группы в строке чата: ширина по содержимому, на телефоне растягивается */
.row-group {
    width: auto;
    min-width: 180px;
    max-width: 220px;
}

/* ── Вход ── */

.login-body {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 24px 20px;
    background: var(--bg);
}

.login {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 380px;
}

.login-top {
    display: flex;
    justify-content: flex-end;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: none;
}

/* Вход: сбой развёртки — интро загрузки (брендбук, раздел 9). Финальный кадр — обычный логотип,
   сам файл не меняется. Сбой только на входе, на мелких размерах в панели его нет. */
.login-brand {
    position: relative;
    display: block;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1400 / 429;
}

.login-logo {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    animation: fade-in var(--dur-short) var(--ease-out) both;
}

.logo-ghost {
    position: absolute;
    inset: 0;
    background: no-repeat center / contain;
    opacity: 0;
    pointer-events: none;
}

.logo-ghost-a {
    background-image: url("brand/logo-dark.png");
    animation: glitch-a var(--dur-glitch) linear both;
}

.logo-ghost-b {
    background-image: url("brand/logo-dark.png");
    animation: glitch-b var(--dur-glitch) linear both;
}

:root[data-theme="light"] .logo-ghost-a,
:root[data-theme="light"] .logo-ghost-b {
    background-image: url("brand/logo-light.png");
}

/* строчная развёртка поверх логотипа, гаснет к концу интро */
.login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, color-mix(in srgb, var(--text) 12%, transparent) 2px 3px);
    opacity: 0;
    pointer-events: none;
    animation: scan-out var(--dur-glitch) linear both;
}

.login-logo-light { display: none; }
:root[data-theme="light"] .login-logo-dark { display: none; }
:root[data-theme="light"] .login-logo-light { display: block; }

.login-sub {
    margin-top: -8px;
    font-size: 13px;
    color: var(--text-3);
}

.login-input {
    height: 44px;
    font-size: 15px;
}

.login-btn {
    height: 44px;
    font-size: 14px;
}

/* Вход через Telegram: кнопка виджета под паролем, по центру карточки */
.login-tg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.login-tg .alert { width: 100%; }

.login-tg .alert[hidden] { display: none; }

/* ── Статистика токенов ── */

.usage-key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 13px;
    color: var(--text-2);
}

.usage-key code {
    font-family: var(--mono);
    color: var(--text);
}

.usage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.usage-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-card .panel-title { margin-bottom: 4px; }

.usage-num {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.usage-sub {
    font-size: 12px;
    color: var(--text-3);
}

.usage-period { margin-top: 28px; }

.usage-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.usage-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.usage-kpi dt {
    font-size: 12px;
    color: var(--text-3);
}

.usage-kpi dd {
    font-family: var(--mono);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.usage-section { margin-top: 32px; }

.usage-figs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 16px;
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.usage-cost {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.usage-bar {
    display: block;
    width: 100%;
    max-width: 240px;
    height: 4px;
    margin-top: 8px;
    border-radius: 2px;
    background: var(--surface-3);
    overflow: hidden;
}

.usage-bar > span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.usage-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.usage-since {
    font-size: 12px;
    color: var(--text-3);
}

.usage-refresh {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 12px;
}

.usage-err {
    margin-top: 8px;
    font-size: 12px;
    color: var(--danger);
    overflow-wrap: anywhere;
}

.usage-note {
    margin-top: 12px;
    line-height: 1.5;
}

/* ── Мобильная адаптация ── */

@media (max-width: 1000px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-side { position: static; }

    .set-sec {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
    }

    /* сайдбар раскладывается на части: шапка сверху, статистика и кнопки в потоке, меню внизу */
    .sidebar { display: contents; position: static; }

    .side-top {
        position: sticky;
        top: env(safe-area-inset-top, 0px);
        z-index: 30;
        align-self: start;
        padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }


    /* нижняя панель вкладок */
    .nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        flex-direction: row;
        gap: 0;
        padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
        background: var(--surface);
        border-top: 1px solid var(--line);
    }

    .nav-link {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        height: 56px;
        padding: 8px 4px;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        font-size: 11px;
        line-height: 1.1;
        text-align: center;
    }

    .nav-link .i {
        width: 20px;
        height: 20px;
    }

    .nav-link:hover { background: none; }

    .nav-link[aria-current="page"] {
        background: none;
        box-shadow: none;
    }

    /* активная вкладка: тонкая полоска у верхнего края панели */
    .nav-link[aria-current="page"]::before {
        content: "";
        position: absolute;
        top: -6px;
        left: 50%;
        width: 28px;
        height: 2px;
        margin-left: -16px;
        border-radius: 0 0 2px 2px;
        background: var(--accent-text);
    }

    .side-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 16px 16px 0;
        border-top: 0;
    }

    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
    }

    .stat-num { font-size: 16px; }

    .side-foot {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin: 12px 16px 0;
    }

    .side-foot .tag { align-self: center; }

    .side-foot .btn-block {
        width: auto;
        flex: 1 1 auto;
    }

    .content { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }

    .page-title { font-size: 22px; }

    /* цели для пальца не меньше 36-44px */
    .btn,
    .btn-secondary { height: 42px; }
    .btn-sm { height: 36px; }
    .icon-btn { width: 40px; height: 40px; }
    .form-input { height: 44px; font-size: 16px; }
    .filter-tab { padding: 12px 0 16px; }

    .toast {
        left: 16px;
        right: 16px;
        bottom: calc(88px + env(safe-area-inset-bottom));
        max-width: none;
    }

    .set-sec {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 24px 0;
    }

    .row-actions {
        width: 100%;
        margin-left: 0;
        padding-left: 16px;
    }

    .row-id { min-width: 0; }

    .draft-actions .btn { flex: 1 1 auto; }
    .draft-actions .send-mode { flex: 1 1 100%; min-width: 0; }

    .cand-time { margin-left: 0; }
}

@media (max-width: 560px) {
    /* шесть пунктов меню (с «Выходом») в одну строку: подписи чуть меньше и без лишних отступов */
    .nav { padding-left: 4px; padding-right: 4px; }

    .nav-link {
        padding: 8px 0;
        font-size: 10px;
        gap: 4px;
    }

    .form-grid.cols-2,
    .chat-add,
    .group-add { grid-template-columns: minmax(0, 1fr); }

    .row-group {
        max-width: none;
        flex: 1 1 100%;
    }

    .kv {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .form-input { font-size: 16px; }
    .form-textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ── CRM: доски, канбан, карточки, переписка ── */

.board-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.board-switch {
    flex: 1 1 auto;
    min-width: 0;
}

.board-new {
    position: relative;
}

.board-new > summary {
    list-style: none;
    cursor: pointer;
}

.board-new > summary::-webkit-details-marker {
    display: none;
}

.board-form {
    position: absolute;
    z-index: 5;
    right: 0;
    display: grid;
    gap: 8px;
    width: min(360px, 90vw);
    margin-top: 8px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
}

.board-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
}

.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    align-items: start;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.kcol {
    display: flex;
    flex-direction: column;
    min-height: 240px;
    max-height: calc(100vh - 260px);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.kcol-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 64px;
    padding: 12px 12px 12px;
    border-bottom: 1px solid var(--line);
}

.kcol-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.kcol-count {
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface-3);
    border-radius: 999px;
    padding: 1px 8px;
}

.kcol-body {
    flex: 1;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: background-color var(--dur-micro) var(--ease-out);
}

.kcol-body.is-over {
    background: var(--accent-soft);
    outline: 1px dashed var(--accent-line);
    outline-offset: -4px;
}

.kcol-empty {
    margin: 8px 4px;
    font-size: 13px;
    color: var(--text-3);
}

.kcard {
    display: grid;
    gap: 8px;
    padding: 12px 12px;
    cursor: grab;
    user-select: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}

.kcard:hover {
    border-color: var(--line-strong);
}

.kcard.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.kcard-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.kcard-who {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.kcard-who:hover {
    color: var(--accent-text);
}

.kcard-chat {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-2);
}

.kcard-msg {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-2);
}

.kcard-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.kcard-verdict {
    color: var(--text-3);
}

.kcard-verdict.is-ok {
    color: var(--ok);
}

.kcard-note {
    font-size: 12px;
    color: var(--accent-text);
}

/* Автор ответил на наше сообщение: карточка ждёт реакции владельца */
.kcard-await {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-ink);
    background: var(--accent);
}

.kcard.is-awaiting {
    border-color: var(--accent-line);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dialog-list {
    display: grid;
    gap: 8px;
    max-height: 420px;
    margin: 12px 0;
    padding-right: 4px;
    overflow-y: auto;
}

.dialog-empty {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-3);
}

.dialog-msg {
    max-width: 82%;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.dialog-msg.is-out {
    justify-self: end;
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.dialog-text {
    font-size: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dialog-time {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-3);
}

.dialog-reply {
    display: grid;
    gap: 8px;
}

@media (max-width: 768px) {
    .kanban {
        grid-auto-columns: minmax(78vw, 300px);
    }

    .kcol {
        max-height: calc(100vh - 300px);
    }

    .board-form {
        right: auto;
        left: 0;
    }
}

/* ── Состояния управления (Hallmark): нажатие и недоступность ── */
.btn:active { transform: translateY(1px); }

.btn:disabled,
.form-input:disabled,
.form-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (min-width: 769px) {
    .sidebar { position: sticky; top: 0; }
}
