/* GoldTrade Admin — свой CSS без фреймворков. Вид повторяет образец (materials/reference/admin-gipo/). */
:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --line: #e7ecf3;
    --line-2: #e2e8f0;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --side: #0f172a;
    --side-2: #182238;
    --side-text: #94a3b8;
    --purple: #7c5cf6;
    --purple-2: #8b5cf6;
    --indigo: #4f46e5;
    --blue: #2563eb;
    --green: #22c55e;
    --green-2: #16a34a;
    --cyan: #06b6d4;
    --cyan-2: #22d3ee;
    --red: #ef4444;
    --red-2: #dc2626;
    --amber: #f59e0b;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* атрибут hidden сильнее любого display у класса */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 100; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); font-size: 13px; }
.pos { color: var(--green-2); }
.neg { color: var(--red-2); }

/* ---- каркас ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: 0 0 260px; background: var(--side); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 24px; color: #fff; font-weight: 700; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #8b5cf6, #6366f1); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(124, 92, 246, .35); }
.brand-logo .ic { width: 22px; height: 22px; }
.nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.nav-section { padding: 18px 24px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #5b6b85; }
.nav-item { display: flex; align-items: center; gap: 12px; margin: 2px 12px; padding: 11px 14px; border-radius: 10px; color: var(--side-text); font-size: 15px; font-weight: 500; background: none; border: 0; width: calc(100% - 24px); text-align: left; cursor: pointer; }
.nav-item .ic { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--side-2); color: #fff; }
.nav-item.active .ic { color: #a78bfa; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 0 12px; }
.me { display: flex; align-items: center; gap: 12px; padding: 6px 28px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.avatar-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-name { color: #fff; font-weight: 600; font-size: 14px; }
.me-role { color: #5b6b85; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.logout-form { margin: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 70px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 5; }
.burger { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.burger:hover { background: #f8fafc; }
.clock { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 15px; font-weight: 500; white-space: nowrap; }
.clock .ic { color: var(--muted); }
.content { padding: 24px 28px 8px; flex: 1; }
.footer { margin-top: 24px; background: #fff; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; padding: 22px; }
.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 19; }

/* ---- карточки ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 24px; min-width: 0; }
.card-title { margin: 0 0 18px; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--text); }
.card-title .ic { color: var(--text-2); width: 19px; height: 19px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--text); letter-spacing: -.01em; }
.stat-sub { margin-top: 8px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.stat-sub .ic { width: 14px; height: 14px; }
.stat-sub.down { color: var(--red-2); }
.stat-sub.up { color: var(--green-2); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.stat-icon .ic { width: 22px; height: 22px; }
.stat-icon.purple { background: #7c5cf6; }
.stat-icon.green { background: #22c55e; }
.stat-icon.cyan { background: #22d3ee; }
.stat-icon.red { background: #ef4444; }
.stat-icon.amber { background: #f5b000; }
.stat-track { height: 4px; border-radius: 4px; background: #eef2f7; overflow: hidden; }
.stat-track span { display: block; height: 100%; border-radius: 4px; }
.stat-track.purple span { background: #7c5cf6; }
.stat-track.green span { background: #22c55e; }
.stat-track.cyan span { background: #22d3ee; }
.stat-track.red span { background: #ef4444; }
.stat-track.amber span { background: #f5b000; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chart-box { position: relative; height: 320px; }
.donut-box { height: 300px; }

/* ---- воронка ---- */
.funnel-row { margin-bottom: 18px; }
.funnel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.funnel-label { color: var(--text-2); font-size: 14px; }
.funnel-num { font-weight: 700; color: var(--text); font-size: 14px; }
.funnel-num small { color: var(--muted); font-weight: 400; font-size: 13px; }
.funnel-track { background: #edf1f6; border-radius: 8px; height: 32px; overflow: hidden; }
.funnel-fill { display: block; height: 100%; min-width: 48px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 13px; text-align: right; line-height: 32px; padding-right: 10px; white-space: nowrap; }

/* ---- таблицы ---- */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: #f8fafc; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 13px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child { border-radius: 0 8px 8px 0; }
.table td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: var(--text); font-size: 14px; }
.table tbody tr:nth-child(even) td { background: #f8fafc; }
.table tbody tr:hover td { background: #f1f5fb; }
.td-date { color: var(--text-2); min-width: 92px; max-width: 112px; }  /* «13.10.2026 15:00» в две строки, как у образца */
.td-user a { color: var(--text); font-weight: 500; }
.td-empty { text-align: center; color: var(--muted); padding: 28px 16px !important; }
.td-actions { text-align: right; white-space: nowrap; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 6px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.chip-id { background: #eef2ff; color: #4f46e5; }
.chip-link { background: #ede9fe; color: #6d28d9; }
a.chip:hover { text-decoration: none; filter: brightness(.96); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: #e0f2fe; color: #0e7490; }
.badge.st-started { background: #e0f7fb; color: #0e7490; }
.badge.st-registered { background: #ede9fe; color: #6d28d9; }
.badge.st-demo { background: #dbeafe; color: #1d4ed8; }
.badge.st-awaiting { background: #fef3c7; color: #b45309; }
.badge.st-real { background: #d1fae5; color: #047857; }
.badge.st-deposit { background: #dcfce7; color: #15803d; font-weight: 600; }
.badge-gray { background: #f1f5f9; color: var(--muted); }
.bot { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.bot .ic { width: 15px; height: 15px; }
.bot-active { color: var(--green-2); }
.bot-blocked { color: var(--red-2); }
.bot-banned { color: var(--text-2); }
.email-mask { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; font-family: var(--mono); font-size: 12.5px; }
.email-mask:hover { color: var(--indigo); }
.icon-btn { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text-2); background: #fff; }
.icon-btn:hover { background: #f8fafc; color: var(--indigo); text-decoration: none; }
th.sortable a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--text-2); text-decoration: none; }
.sort-ic { width: 13px; height: 13px; }
.sort-ic.dim { opacity: .45; }
th.sorted { color: var(--text-2); }
.table-card { padding-bottom: 16px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; flex-wrap: wrap; }
.shown { color: var(--muted); font-size: 13.5px; }
.pager { display: flex; gap: 6px; }
.page { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; color: var(--blue); font-size: 14px; background: #fff; }
.page:hover { background: #f8fafc; text-decoration: none; }
.page.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.page.disabled { color: var(--muted-2); pointer-events: none; }
.page.dots { border: 0; color: var(--muted); }
.page .ic { width: 16px; height: 16px; }

/* ---- фильтры ---- */
.filters { padding: 18px 24px 8px; }
.tabs { display: inline-flex; gap: 2px; background: #f1f5f9; border-radius: 10px; padding: 4px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: none; padding: 7px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.tab.active { background: #fff; color: var(--indigo); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e2e8f0; color: var(--text-2); font-size: 12px; font-weight: 600; }
.pill.green { background: #dcfce7; color: #15803d; }
.pill.amber { background: #fef3c7; color: #b45309; }
.pill.red { background: #fee2e2; color: #dc2626; }
.filters-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.select { height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 34px 0 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center/16px; color: var(--text-2); font: inherit; appearance: none; -webkit-appearance: none; min-width: 200px; }
.select-sm { height: 34px; min-width: 76px; padding-left: 10px; }
.date-group { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; height: 40px; overflow: hidden; background: #fff; }
.date-ic { width: 40px; height: 100%; display: inline-flex; align-items: center; justify-content: center; background: #f8fafc; color: var(--muted); border-right: 1px solid var(--line-2); }
.date-ic .ic { width: 16px; height: 16px; }
.date { border: 0; height: 100%; padding: 0 8px; font: inherit; color: var(--text-2); background: #fff; min-width: 140px; }
.date-sep { color: var(--muted-2); }
.date-clear { width: 36px; height: 100%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); border-left: 1px solid var(--line-2); }
.date-clear:hover { background: #f8fafc; }
.date-clear .ic { width: 15px; height: 15px; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 12px 0 8px; flex-wrap: wrap; }
.show { color: var(--text-2); display: inline-flex; align-items: center; gap: 10px; }
.search { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.search input { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; font: inherit; width: 220px; }
.search input:focus, .select:focus, .date:focus, .field:focus { outline: 2px solid #c7d2fe; outline-offset: 0; border-color: #a5b4fc; }

/* ---- кнопки ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--purple); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-block { width: 100%; height: 44px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #dcfce7; color: #15803d; }
.flash.bad { background: #fee2e2; color: #b91c1c; }

/* ---- вход ---- */
.login-body { background: var(--bg); margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; font: 14px/1.45 var(--font); color: var(--text); }
.login-wrap { width: 100%; max-width: 420px; padding: 24px 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(15, 23, 42, .08); padding: 36px 32px 30px; display: flex; flex-direction: column; }
.login-logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(124, 92, 246, .35); }
.login-logo .ic { width: 28px; height: 28px; }
.login-title { margin: 0; text-align: center; font-size: 24px; font-weight: 800; }
.login-sub { margin: 6px 0 22px; text-align: center; color: var(--muted); }
.field-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.field { height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; font: inherit; width: 100%; }
.field-sm { height: 40px; width: 220px; }
.login-card .btn-primary { margin-top: 22px; }
.login-foot { text-align: center; color: var(--muted-2); font-size: 12.5px; margin-top: 18px; }

/* ---- карточка человека ---- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 14px; font-size: 13.5px; }
.back .ic { width: 15px; height: 15px; }
.person-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.person-main { flex: 1; min-width: 240px; }
.person-name { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.person-nick { color: var(--muted); font-weight: 500; font-size: 15px; }
.person-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.person-actions form { display: flex; gap: 10px; align-items: center; margin: 0; flex-wrap: wrap; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.props dt { color: var(--muted); font-size: 13px; }
.props dd { margin: 0; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }

/* ---- заглушка ---- */
.stub { text-align: center; padding: 56px 24px; }
.stub-icon { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; background: #ede9fe; color: #6d28d9; display: flex; align-items: center; justify-content: center; }
.stub-icon .ic { width: 30px; height: 30px; }
.stub h2 { margin: 0 0 8px; }
.stub p { color: var(--muted); margin: 0 0 18px; }
.stub-code { font-size: 48px; font-weight: 800; color: #cbd5e1; }

/* ---- мобильная раскладка ---- */
@media (max-width: 1200px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
    .shell.open .sidebar { transform: translateX(0); }
    .shell.open .backdrop { display: block; }
    .grid-2 { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px 16px 8px; }
    .card { padding: 18px 16px; }
    .table-wrap { margin: 0 -16px; padding: 0 16px; }
    .props { grid-template-columns: 1fr; gap: 2px 0; }
    .props dt { margin-top: 8px; }
}
@media (max-width: 640px) {
    .cards { grid-template-columns: 1fr; gap: 14px; }
    .stat-value { font-size: 26px; }
    .select { min-width: 0; flex: 1; }
    .date-group { width: 100%; }
    .date { min-width: 0; flex: 1; }
    .search { width: 100%; }
    .search input { width: 100%; }
    .clock { font-size: 13px; }
    .table-foot { justify-content: center; }
}
@media (hover: none) { .table tbody tr:hover td { background: inherit; } }

/* ==== Рассылка (G2) — форма 1 в 1 с образцом, история, карточка ==== */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-head .card-title { margin-bottom: 14px; }
.bc-card { padding-bottom: 26px; }
.bc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.bc-col { min-width: 0; }
.bc-col + .bc-col { border-left: 1px solid var(--line); padding-left: 36px; margin-left: -18px; }
.bc-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.bc-label:first-child { margin-top: 2px; }
.bc-label .ic { width: 15px; height: 15px; color: var(--muted); }
.bc-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.bc-label-row .bc-label { margin: 0; }
.bc-select { width: 100%; min-width: 0; }
.bc-note { color: var(--muted); font-size: 12.5px; margin: 0 0 6px; display: block; }
.bc-note-up { margin-top: -4px; }
.bc-field { height: 40px; border-radius: 8px; }
.bc-input-wrap { position: relative; }
.bc-input-wrap > .ic { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.bc-input-wrap .bc-field { padding-left: 36px; }
.bc-audience { margin: 14px 0 2px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.bc-audience .ic { width: 16px; height: 16px; color: var(--muted); }
.bc-audience b { color: var(--text); }
.bc-aud-unknown { color: var(--red-2); }
.bc-when-at { margin-top: 10px; }
.bc-limits { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.bc-limit { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; background: #f1f5f9; color: var(--muted); font-size: 12.5px; }
.bc-limit .ic { width: 14px; height: 14px; }
.bc-files { margin: 10px 0 4px; }
.file { font: inherit; font-size: 13px; color: var(--text-2); width: 100%; }
.bc-file-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.bc-file-preview img { height: 72px; border-radius: 8px; border: 1px solid var(--line-2); object-fit: cover; }
.bc-file-preview .chip { align-self: center; }
.bc-reuse { display: block; margin: 8px 0 2px; font-size: 13px; color: var(--text-2); }

/* чипы статусов (мультивыбор) */
.chips { position: relative; }
.chips-box { min-height: 40px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; }
.chips-box:focus { outline: 2px solid #c7d2fe; outline-offset: 0; border-color: #a5b4fc; }
.chips-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.chip-opt { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; background: #eef2ff; color: #4f46e5; font-size: 13px; }
.chip-opt .chip-x { cursor: pointer; font-weight: 700; color: #6366f1; }
.chip-opt.chip-all { background: #eef2ff; }
.chips-clear { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.chips-clear:hover { color: var(--text); }
.chips-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); padding: 6px; z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.chips-opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.chips-opt:hover { background: #f8fafc; }
.chips-opt input { margin: 0; }

/* сегменты-переключатели (Сейчас/Отложить, тип контента) */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; user-select: none; }
.seg-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-btn .ic { width: 15px; height: 15px; }
.seg-btn:hover { background: #f8fafc; }
.seg-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.seg-btn:focus-within { outline: 2px solid #c7d2fe; outline-offset: 1px; }

/* редактор */
.editor { border: 1px solid var(--line-2); border-radius: 10px; background: #fff; overflow: hidden; }
.editor-tools { display: flex; gap: 2px; padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tool { width: 32px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tool:hover { background: #e2e8f0; color: var(--text); }
.tool .ic { width: 15px; height: 15px; }
.editor-text { display: block; width: 100%; border: 0; padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.5; min-height: 132px; resize: vertical; background: #fff; }
.editor-text:focus { outline: none; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 8px; color: var(--muted); font-size: 12.5px; border-top: 1px solid #f1f5f9; }
.editor-count { font-weight: 500; color: var(--muted); }
.editor-count.over { color: var(--red-2); font-weight: 700; }

/* inline-клавиатура: ряды и кнопки */
.kb { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.kb-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: #fafbfd; }
.kb-btn { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; align-items: center; }
.kb-btn input { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13.5px; min-width: 0; }
.kb-btn input:focus { outline: 2px solid #c7d2fe; outline-offset: 0; border-color: #a5b4fc; }
.kb-row-foot { display: flex; gap: 8px; align-items: center; }
.btn-outline { background: #fff; border-color: #c7d2fe; color: var(--indigo); }
.btn-outline:hover { background: #eef2ff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-ghost { background: #f1f5f9; color: var(--text-2); }
.btn-send { width: 100%; height: 50px; margin-top: 20px; font-size: 15px; background: linear-gradient(90deg, #7c5cf6, #8b5cf6 60%, #6366f1); box-shadow: 0 8px 22px rgba(124, 92, 246, .35); }
.btn-send .ic { width: 18px; height: 18px; }
.btn-send:disabled { opacity: .6; cursor: progress; }
.icon-btn.icon-red { color: var(--red-2); }
.icon-btn.icon-green { color: var(--green-2); }
.inline-form { display: inline; margin: 0; }
.td-actions .icon-btn { margin-left: 4px; }

/* предпросмотр «как увидит человек» */
.preview { background: #e8edf3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1.2' fill='%23cfd8e3'/%3E%3C/svg%3E"); border-radius: 12px; padding: 14px; margin-top: 8px; }
.preview-errors { background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.preview-errors div { display: flex; align-items: center; gap: 6px; }
.preview-errors .ic { width: 14px; height: 14px; flex: 0 0 auto; }
.bubble { background: #fff; border-radius: 14px 14px 14px 4px; padding: 10px 14px; max-width: 420px; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(15,23,42,.08); white-space: normal; }
.bubble-empty { color: var(--muted-2); font-style: italic; }
.bubble-media { margin: -4px -8px 8px; padding: 18px 10px; border-radius: 10px; background: #f1f5f9; color: var(--muted); font-size: 13px; text-align: center; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.bubble-img { max-width: 100%; max-height: 240px; border-radius: 8px; }
.bubble code, .bubble pre { font-family: var(--mono); font-size: 13px; background: #f1f5f9; border-radius: 4px; padding: 1px 4px; }
.bubble pre { padding: 8px 10px; overflow-x: auto; white-space: pre; }
.bubble blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #a78bfa; color: var(--text-2); background: #f8f7ff; border-radius: 4px; }
.bubble a { color: var(--blue); }
.bubble .tg-spoiler { background: #94a3b8; color: transparent; border-radius: 4px; cursor: pointer; }
.bubble .tg-spoiler:hover { background: #e2e8f0; color: inherit; }
.bubble-kb { display: flex; flex-direction: column; gap: 4px; max-width: 420px; margin-top: 4px; }
.bubble-kb-row { display: flex; gap: 4px; }
.bubble-btn { flex: 1; text-align: center; background: rgba(255,255,255,.9); color: #2563eb; border-radius: 8px; padding: 7px 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble-btn:hover { background: #fff; text-decoration: none; }
.preview-foot { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: right; }

/* модальное подтверждение */
.modal { border: 0; border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(15,23,42,.25); width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(15, 23, 42, .5); }
.modal-card { margin: 0; padding: 26px 28px 22px; }
.modal-title { margin: 0 0 14px; font-size: 18px; }
.modal-props { margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* история рассылок */
.bc-table td { vertical-align: middle; }
.bc-id a { font-weight: 700; color: var(--text); }
.type-ic { width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; }
.type-ic .ic { width: 15px; height: 15px; }
.type-ic-lg { width: 56px; height: 56px; border-radius: 14px; }
.type-ic-lg .ic { width: 26px; height: 26px; }
.type-text { background: #dbeafe; color: #1d4ed8; }
.type-photo { background: #dcfce7; color: #16a34a; }
.type-video { background: #ede9fe; color: #6d28d9; }
.type-media_group { background: #fef3c7; color: #b45309; }
.bc-msg { max-width: 300px; min-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bc-progress { min-width: 150px; }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.prog-pct { color: var(--muted); font-size: 12.5px; }
.prog-track { height: 6px; border-radius: 6px; background: #e8edf3; overflow: hidden; margin-top: 5px; }
.prog-fill { display: block; height: 100%; border-radius: 6px; transition: width .4s ease; }
.prog-fill.ok { background: #22c55e; }
.prog-fill.bad { background: #f59e0b; }
.prog-err { color: var(--red-2); font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.prog-err .ic { width: 8px; height: 8px; }
.bc-progress-lg { max-width: 360px; margin-top: 10px; }
.bc-when { white-space: nowrap; line-height: 1.3; }
.badge.bs-scheduled { background: #ede9fe; color: #6d28d9; }
.badge.bs-sending { background: #e0f2fe; color: #0e7490; }
.badge.bs-stopped { background: #fef3c7; color: #b45309; }
.badge.bs-done { background: #dcfce7; color: #15803d; }
.badge.bs-failed { background: #fee2e2; color: #b91c1c; }
.err-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid #fecaca; border-radius: 8px; color: var(--red-2); background: #fff5f5; font-size: 13px; font-weight: 600; }
.err-badge:hover { background: #fee2e2; text-decoration: none; }
.err-badge .ic { width: 14px; height: 14px; }

/* карточка рассылки */
.bc-sub { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.bc-errors { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.bc-raw { margin-top: 12px; color: var(--muted); font-size: 13px; }
.bc-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; background: #f8fafc; border-radius: 8px; padding: 10px 12px; color: var(--text-2); }
.bc-media-list { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bc-err-text { color: var(--red-2); font-size: 13px; max-width: 360px; overflow-wrap: anywhere; }
a.tab { text-decoration: none; }

@media (max-width: 1100px) {
    .bc-grid { grid-template-columns: 1fr; }
    .bc-col + .bc-col { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 20px; }
}
@media (max-width: 640px) {
    .kb-btn { grid-template-columns: 1fr; }
    .bubble, .bubble-kb { max-width: 100%; }
}

/* ==== Deeplinks (G3) — шапка, вкладки, карточки, сводка, лиды, «Свои аккаунты» (1 в 1 с 04-deeplinks.png) ==== */
.dl-head { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 360px); gap: 18px 28px; padding: 20px 24px 16px; }
.dl-head-col { margin: 0; min-width: 0; }
.dl-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.dl-label-note { color: var(--muted); font-weight: 400; }
.dl-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.dl-noscript { margin-top: 8px; }
.input-group { display: flex; min-width: 0; }
.input-group .field { flex: 1; min-width: 0; height: 38px; border-radius: 8px 0 0 8px; border-right: 0; font-family: var(--mono); font-size: 13.5px; color: var(--text-2); }
.input-group .btn { height: 38px; border-radius: 0 8px 8px 0; padding: 0 14px; }
.dl-head .date-group { height: 38px; max-width: 100%; }
.nav-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin: 0 0 18px; overflow-x: auto; overflow-y: hidden; }
.nav-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px 10px; margin-bottom: -1px; border: 1px solid transparent; border-radius: 8px 8px 0 0; color: var(--blue); font-size: 15px; white-space: nowrap; }
.nav-tab .ic { width: 16px; height: 16px; }
.nav-tab:hover { text-decoration: none; border-color: #e9eef5 #e9eef5 var(--line-2); }
.nav-tab.active { color: var(--text-2); background: #fff; border-color: var(--line-2) var(--line-2) #fff; }
.dl-stat { cursor: default; }
.stat-text { min-width: 0; }
.stat-info { width: 13px; height: 13px; margin-left: 5px; vertical-align: -2px; color: var(--muted-2); }
.dl-block { padding-top: 16px; }
.dl-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -24px 4px; padding: 0 24px 14px; border-bottom: 1px solid var(--line); }
.dl-block-head .card-title { margin: 0; flex-wrap: wrap; row-gap: 2px; font-size: 16px; }
.card-title .ic-purple { color: var(--purple); }
.card-title .ic-blue { color: var(--blue); }
.card-sub { font-size: 13.5px; font-weight: 400; color: var(--muted); }
.chip-dl { background: #f6f6fe; color: #6366f1; }
.chip-po { background: #f6f6fe; color: #6366f1; }
.chip-country { background: #e4e5e7; color: #4b5563; font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; }
.dl-nolink { color: var(--muted); cursor: help; }
.dl-orphan { cursor: help; }
.table td.num-regs { color: #17a2b8; font-weight: 700; }   /* сильнее .table td — у образца числа цветные */
.table td.num-ftd { color: #f5a112; font-weight: 700; }
.conv-pill { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #f8f9fa; border: 1px solid #eef0f2; color: var(--text); font-size: 12px; font-weight: 600; }
.td-acts { white-space: nowrap; }
.act { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 1px solid currentColor; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 500; vertical-align: middle; }
.act + .act { margin-left: 6px; }
.act:hover { text-decoration: none; background: #f8f8ff; }
.act .ic { width: 15px; height: 15px; }
.act-ftd { color: #6366f1; }
.act-regs { color: #17a2b8; }
.act-regs:hover { background: #f2fbfd; }
.act-sym { font-weight: 700; }
.dl-filters-box { margin: 0 -24px; padding: 16px 24px 18px; background: #f9f9fe; border-bottom: 1px solid var(--line); }
.dl-filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .85fr); gap: 14px 24px; }
.dl-filter { min-width: 0; }
.dl-filter .select, .dl-filter .field { width: 100%; min-width: 0; height: 38px; border-radius: 8px; }
.dl-filter .date-group { width: 100%; height: 38px; }
.dl-filter .date { min-width: 0; flex: 1; width: 0; padding: 0 6px; }
.dl-filter-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-outline-gray { background: #fff; border-color: #6c757d; color: #6c757d; }
.btn-outline-gray:hover { background: #f8f9fa; }
.dl-found { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 -24px; padding: 12px 24px; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.dl-found b { color: var(--text); }
.dl-found .sep { width: 1px; height: 16px; background: #cbd5e1; }
.dl-found .f-regs, .dl-found .f-regs b { color: #17a2b8; }
.dl-found .f-ftd, .dl-found .f-ftd b { color: #f59e0b; }
.dl-found .f-sum, .dl-found .f-sum b { color: #10b981; }
.dl-found .f-camp { color: var(--muted); }
.badge.ev-reg { background: #e0f6fa; color: #0891b2; }
.badge.ev-ftd { background: #fef5e6; color: #b45309; }
.td-nowrap { white-space: nowrap; color: var(--text-2); }
.td-lead-user a { font-weight: 500; }
.td-lead-user a.lead-nick { color: #007bff; }
.td-lead-user a.lead-name { color: var(--text); }
.amount { color: #10b981; font-weight: 700; white-space: nowrap; }
.balance { white-space: nowrap; font-weight: 600; cursor: help; }
@media (max-width: 1100px) {
    .dl-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .dl-head { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 14px; }
    .dl-block-head, .dl-filters-box, .dl-found { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 640px) {
    .dl-filters { grid-template-columns: minmax(0, 1fr); }
    .dl-block-head { flex-wrap: wrap; }
    .dl-head .date-group { width: 100%; }
    .dl-head .date { min-width: 0; flex: 1; width: 0; }
}

/* ---- G4: роли, страна с источником, депозиты по одному правилу, журнал действий ---- */
.flash.info { background: #eef2ff; color: #4338ca; }
.me-manager .avatar { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.select-country { min-width: 170px; }
.select-role { min-width: 150px; }
.country { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: help; }
.country-src { font-size: 11px; color: var(--muted); border-bottom: 1px dotted var(--muted-2); }
.country-why { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.card-note { margin: -8px 0 12px; }
.dep-badge-counted { background: #dcfce7; color: #15803d; }
.dep-badge-twin { background: #ede9fe; color: #6d28d9; }
.dep-badge-not_counted { background: #f1f5f9; color: var(--muted); }
.dep-table tr.dep-twin td, .dep-table tr.dep-not_counted td { color: var(--muted); }
.dep-twin-of { margin-top: 2px; font-size: 12px; }
.dl-zip { margin-left: auto; align-self: center; flex: 0 0 auto; }
.badge.jr-auth { background: #e0f2fe; color: #0369a1; }
.badge.jr-bad { background: #fee2e2; color: #b91c1c; }
.badge.jr-good { background: #dcfce7; color: #15803d; }
.badge.jr-bc { background: #ede9fe; color: #6d28d9; }
.badge.jr-warn { background: #fef3c7; color: #b45309; }
.badge.jr-gray, .badge.jr-other { background: #f1f5f9; color: var(--muted); }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.role-pill.role-owner { background: #ede9fe; color: #6d28d9; }
.role-pill.role-manager { background: #e0f2fe; color: #0369a1; }
.role-pill.role-system { background: #f1f5f9; color: var(--muted); }
.jr-detail { color: var(--text-2); font-size: 13px; max-width: 520px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .dl-zip { margin-left: 8px; }
    .select-country, .select-role { min-width: 0; }
}
.filters .card-title, #deposits .card-title { flex-wrap: wrap; row-gap: 2px; }
.input-group .field[readonly]:only-child { border-right: 1px solid var(--line-2); border-radius: 8px; background: #f8fafc; }
.dep-table td.mono { white-space: nowrap; }

/* ---- Доступ (G5): блок карточки человека, «Выбрано N» в Пользователях, предупреждение в окне подтверждения ---- */
.access-card .card-title { flex-wrap: wrap; row-gap: 2px; }
.th-check, .td-check { width: 34px; padding-right: 0 !important; }
.td-check input, .th-check input { width: 17px; height: 17px; accent-color: var(--purple); cursor: pointer; vertical-align: middle; margin: 0; }
.td-check input:disabled { cursor: not-allowed; opacity: .35; }
.td-level label { cursor: pointer; display: block; }
.lvl-n { font-weight: 600; }
.lvl-name { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.td-by.by-owner { color: var(--indigo); font-weight: 500; }
.td-by.by-revoked { color: #b45309; }
.lvl-reason { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.access-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.access-controls .field-sm { flex: 1 1 200px; width: auto; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--purple); margin: 0; }
.btn-outline-red { background: #fff; border-color: #fecaca; color: var(--red-2); }
.btn-outline-red:hover { background: #fef2f2; }
.access-error { color: var(--red-2); font-size: 13px; margin: 8px 0 0; }
.access-hint { font-size: 12.5px; line-height: 1.45; margin: 10px 0 0; }
.sub-title { font-size: 14.5px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--text); }
.sub-title .ic { width: 16px; height: 16px; color: var(--text-2); }
.access-path { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.access-path .access-hint { margin-top: 4px; }
.access-path .props { margin-top: 14px; }
.access-path .flash { margin: 14px 0 0; }
.access-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.access-actions form { margin: 0; }
.badge.mode-demo { background: #dbeafe; color: #1d4ed8; }
.badge.mode-real { background: #fef3c7; color: #b45309; font-weight: 600; }
.access-history { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; }
.access-history summary { cursor: pointer; list-style: none; }
.access-history summary::-webkit-details-marker { display: none; }
.access-history summary::after { content: "▾"; color: var(--muted); font-size: 12px; margin-left: 2px; }
.access-history[open] summary::after { content: "▴"; }
.access-history[open] summary { margin-bottom: 10px; }
.access-hist td { font-size: 13px; }
.modal-warn { background: #fef3c7; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; margin: -6px 0 18px; }
.bulk-bar { position: sticky; top: 78px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; box-shadow: 0 6px 18px rgba(79, 70, 229, .10); }
.bulk-count { font-size: 14px; color: var(--indigo); white-space: nowrap; }
.bulk-bar .select-sm { height: 32px; }
.bulk-bar .field-sm { flex: 1 1 180px; width: auto; min-width: 0; height: 32px; }
@media (max-width: 640px) {
    .bulk-bar { top: 74px; }
    .bulk-bar .select-sm { flex: 1 1 100%; }
    .access-controls .btn { flex: 1 1 auto; }
}
.access-hist .hist-reason { min-width: 110px; overflow-wrap: anywhere; }
.access-hist .hist-notify { min-width: 120px; }
.bulk-bar #bulk-clear { margin-right: auto; }

/* ---- Версии бота (план V, V1): бейдж шапки, текущее состояние, карточки v1 / v2 ---- */
.ver-badge { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; background: #ede9fe; color: #6d28d9; font-size: 13.5px; font-weight: 600; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.ver-badge span { overflow: hidden; text-overflow: ellipsis; }
.ver-badge .ic { width: 15px; height: 15px; flex: none; }
a.ver-badge:hover { text-decoration: none; background: #ddd6fe; }
.ver-badge-short { display: none; font-family: var(--mono); }
.ver-journal .jr-detail { min-width: 260px; }   /* на телефоне колонка не сжимается в столбик — таблица листается вбок */
.flash.warn { background: #fef3c7; color: #92400e; }
.ver-unsaved { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; }
.ver-unsaved .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ver-now-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 18px 28px; align-items: start; }
.ver-now-main .field-label { margin-top: 0; }
.ver-now-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ver-now-title { font-size: 18px; font-weight: 700; color: var(--text); }
.ver-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 28px; padding: 0 10px; border-radius: 8px; background: #eef2ff; color: var(--indigo); font: 700 14px/1 var(--mono); }
.ver-pill.big { min-width: 52px; height: 40px; font-size: 18px; background: var(--purple); color: #fff; }
.ver-live { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 11px 14px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.ver-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-2); flex: none; margin-top: 6px; }
.ver-live-ok .ver-dot { background: var(--green); }
.ver-live-wait .ver-dot { background: var(--amber); animation: ver-blink 1s ease-in-out infinite; }
.ver-live-bad { background: #fef2f2; border-color: #fecaca; }
.ver-live-bad .ver-dot { background: var(--red); }
@keyframes ver-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ver-live-wait .ver-dot { animation: none; } }
.ver-warn-text { color: #b45309; font-weight: 500; }
.ver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ver-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 0; }
.ver-card.is-active { border-color: #c4b5fd; box-shadow: 0 0 0 2px #ede9fe, var(--shadow); }
.ver-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ver-title { font-size: 16px; font-weight: 700; color: var(--text); }
.ver-desc { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ver-diff > div + div { margin-top: 6px; }
.ver-ids { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.ver-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--green-2); font-weight: 500; }
.ver-ok .ic { width: 15px; height: 15px; }
.ver-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 4px; }
.ver-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.ver-form .field-sm { flex: 1 1 180px; width: auto; min-width: 0; }
.ver-form .btn { flex: 0 1 auto; }
.ver-describe { border-top: 1px solid var(--line); padding-top: 12px; }
.ver-describe summary { cursor: pointer; list-style: none; }
.ver-describe summary::-webkit-details-marker { display: none; }
.ver-describe[open] summary { margin-bottom: 4px; }
.ver-describe-form .btn { margin-top: 12px; }
.ver-textarea { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.ver-result { display: flex; flex-direction: column; gap: 4px; }
.ver-retry { margin: 8px 0 0; }
.ver-grid + .table-card { margin-top: 24px; }
@media (max-width: 1100px) {
    .ver-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .ver-now-row { grid-template-columns: 1fr; }
    .ver-badge { max-width: 52vw; padding: 0 10px; font-size: 12.5px; }
    .ver-badge .ver-badge-full { display: none; }
    .ver-badge .ver-badge-short { display: inline; }
    .ver-form .btn { flex: 1 1 100%; }
}
