/* ==========================================================================
   DMS · демо интерфейсов
   Токены взяты из UI/UX-спеки: Primary #2563EB, slate-нейтрали, Inter.
   Layout: тёмная демо-панель сверху; под ней каждый интерфейс рисует свою
   оболочку — сцена с телефоном (Mini App, бот) или дашборд с боковым меню.
   ========================================================================== */

:root {
  --primary: #2563EB; --primary-dark: #1D4ED8; --primary-50: #EFF6FF; --primary-100: #DBEAFE; --on-primary: #FFFFFF;
  --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --surface-3: #E2E8F0;
  --text: #0F172A; --text-2: #64748B; --text-3: #94A3B8;
  --border: #E2E8F0; --border-2: #CBD5E1;
  --hover: rgba(15, 23, 42, .035); --ring: rgba(37, 99, 235, .22); --scrim: rgba(15, 23, 42, .45);
  --success: #16A34A; --success-50: #DCFCE7; --success-fg: #15803D;
  --warning: #F59E0B; --warning-50: #FEF3C7; --warning-fg: #B45309;
  --danger: #DC2626; --danger-50: #FEE2E2; --danger-fg: #B91C1C;
  --info: #0EA5E9; --info-50: #E0F2FE; --info-fg: #0369A1;
  --violet: #7C3AED; --violet-50: #EDE9FE; --violet-fg: #6D28D9;
  --st-pending: #F59E0B; --st-pending-bg: #FEF3C7; --st-pending-fg: #92400E;
  --st-confirmed: #2563EB; --st-confirmed-bg: #DBEAFE; --st-confirmed-fg: #1E40AF;
  --st-arrived: #7C3AED; --st-arrived-bg: #EDE9FE; --st-arrived-fg: #5B21B6;
  --st-progress: #0EA5E9; --st-progress-bg: #E0F2FE; --st-progress-fg: #075985;
  --st-completed: #16A34A; --st-completed-bg: #DCFCE7; --st-completed-fg: #166534;
  --st-cancelled: #94A3B8; --st-cancelled-bg: #F1F5F9; --st-cancelled-fg: #475569;
  --st-noshow: #DC2626; --st-noshow-bg: #FEE2E2; --st-noshow-fg: #991B1B;
  --c1: #2563EB; --c2: #EB6834; --c3: #1BAF7A; --c4: #EDA100; --c-muted: #CBD5E1;
  --grid: #EEF2F6; --axis: #CBD5E1;
  --chrome: #0F172A; --chrome-2: #1E293B; --chrome-fg: #E2E8F0; --chrome-muted: #94A3B8;
  --tg-head: #FFFFFF; --tg-chat: #D6E4F2; --tg-chat-2: #E7EFF8; --bubble: #FFFFFF; --bubble-out: #E1EEFF; --kb: rgba(30, 58, 95, .34); --kb-fg: #FFFFFF;
  --phone-frame: #0B1220; --hatch: rgba(100, 116, 139, .12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .18);
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --bar: 48px; --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #3B82F6; --primary-dark: #2563EB; --primary-50: rgba(59, 130, 246, .14); --primary-100: rgba(59, 130, 246, .26); --on-primary: #FFFFFF;
    --bg: #0A0F1C; --surface: #111827; --surface-2: #182132; --surface-3: #233047;
    --text: #E5E9F0; --text-2: #98A3B5; --text-3: #667085;
    --border: #1E293B; --border-2: #2D3B52;
    --hover: rgba(255, 255, 255, .035); --ring: rgba(59, 130, 246, .35); --scrim: rgba(2, 6, 23, .66);
    --success: #22C55E; --success-50: rgba(34, 197, 94, .14); --success-fg: #4ADE80;
    --warning: #FBBF24; --warning-50: rgba(251, 191, 36, .14); --warning-fg: #FCD34D;
    --danger: #F87171; --danger-50: rgba(248, 113, 113, .14); --danger-fg: #FCA5A5;
    --info: #38BDF8; --info-50: rgba(56, 189, 248, .14); --info-fg: #7DD3FC;
    --violet: #A78BFA; --violet-50: rgba(167, 139, 250, .14); --violet-fg: #C4B5FD;
    --st-pending: #F59E0B; --st-pending-bg: rgba(245, 158, 11, .16); --st-pending-fg: #FCD34D;
    --st-confirmed: #3B82F6; --st-confirmed-bg: rgba(59, 130, 246, .18); --st-confirmed-fg: #93C5FD;
    --st-arrived: #8B5CF6; --st-arrived-bg: rgba(139, 92, 246, .18); --st-arrived-fg: #C4B5FD;
    --st-progress: #0EA5E9; --st-progress-bg: rgba(14, 165, 233, .18); --st-progress-fg: #7DD3FC;
    --st-completed: #22C55E; --st-completed-bg: rgba(34, 197, 94, .16); --st-completed-fg: #86EFAC;
    --st-cancelled: #64748B; --st-cancelled-bg: rgba(148, 163, 184, .13); --st-cancelled-fg: #CBD5E1;
    --st-noshow: #EF4444; --st-noshow-bg: rgba(239, 68, 68, .16); --st-noshow-fg: #FCA5A5;
    --c1: #3B82F6; --c2: #D95926; --c3: #199E70; --c4: #C98500; --c-muted: #334155;
    --grid: #1A2436; --axis: #2D3B52;
    --chrome: #050913; --chrome-2: #131C2E; --chrome-fg: #E2E8F0; --chrome-muted: #8D99AE;
    --tg-head: #17212B; --tg-chat: #0E1621; --tg-chat-2: #121D2A; --bubble: #182533; --bubble-out: #2B5278; --kb: rgba(255, 255, 255, .10); --kb-fg: #E5E9F0;
    --phone-frame: #000000; --hatch: rgba(148, 163, 184, .10);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #3B82F6; --primary-dark: #2563EB; --primary-50: rgba(59, 130, 246, .14); --primary-100: rgba(59, 130, 246, .26); --on-primary: #FFFFFF;
  --bg: #0A0F1C; --surface: #111827; --surface-2: #182132; --surface-3: #233047;
  --text: #E5E9F0; --text-2: #98A3B5; --text-3: #667085;
  --border: #1E293B; --border-2: #2D3B52;
  --hover: rgba(255, 255, 255, .035); --ring: rgba(59, 130, 246, .35); --scrim: rgba(2, 6, 23, .66);
  --success: #22C55E; --success-50: rgba(34, 197, 94, .14); --success-fg: #4ADE80;
  --warning: #FBBF24; --warning-50: rgba(251, 191, 36, .14); --warning-fg: #FCD34D;
  --danger: #F87171; --danger-50: rgba(248, 113, 113, .14); --danger-fg: #FCA5A5;
  --info: #38BDF8; --info-50: rgba(56, 189, 248, .14); --info-fg: #7DD3FC;
  --violet: #A78BFA; --violet-50: rgba(167, 139, 250, .14); --violet-fg: #C4B5FD;
  --st-pending: #F59E0B; --st-pending-bg: rgba(245, 158, 11, .16); --st-pending-fg: #FCD34D;
  --st-confirmed: #3B82F6; --st-confirmed-bg: rgba(59, 130, 246, .18); --st-confirmed-fg: #93C5FD;
  --st-arrived: #8B5CF6; --st-arrived-bg: rgba(139, 92, 246, .18); --st-arrived-fg: #C4B5FD;
  --st-progress: #0EA5E9; --st-progress-bg: rgba(14, 165, 233, .18); --st-progress-fg: #7DD3FC;
  --st-completed: #22C55E; --st-completed-bg: rgba(34, 197, 94, .16); --st-completed-fg: #86EFAC;
  --st-cancelled: #64748B; --st-cancelled-bg: rgba(148, 163, 184, .13); --st-cancelled-fg: #CBD5E1;
  --st-noshow: #EF4444; --st-noshow-bg: rgba(239, 68, 68, .16); --st-noshow-fg: #FCA5A5;
  --c1: #3B82F6; --c2: #D95926; --c3: #199E70; --c4: #C98500; --c-muted: #334155;
  --grid: #1A2436; --axis: #2D3B52;
  --chrome: #050913; --chrome-2: #131C2E; --chrome-fg: #E2E8F0; --chrome-muted: #8D99AE;
  --tg-head: #17212B; --tg-chat: #0E1621; --tg-chat-2: #121D2A; --bubble: #182533; --bubble-out: #2B5278; --kb: rgba(255, 255, 255, .10); --kb-fg: #E5E9F0;
  --phone-frame: #000000; --hatch: rgba(148, 163, 184, .10);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--safe-top); z-index: 10; background: var(--chrome); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; letter-spacing: -.015em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-100); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* ---------- Утилиты ---------- */
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.b { font-weight: 600; }
.bb { font-weight: 700; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.up { color: var(--success-fg); }
.down { color: var(--danger-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; background: var(--surface-2); color: var(--text); transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; user-select: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--primary-50); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: var(--primary-100); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-danger:hover:not(:disabled) { filter: brightness(.94); }
.btn-danger-soft { background: var(--danger-50); color: var(--danger-fg); }
.btn-success { background: var(--success); color: #FFFFFF; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .spin, .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--primary); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.req::after { content: " *"; color: var(--danger); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--text-2); }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.select-sm, .input-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.field.err .input, .field.err .select, .field.err .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-50); }
.hint { font-size: 12px; color: var(--text-2); }
.field.err .hint { color: var(--danger-fg); }
.search { position: relative; min-width: 0; }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search > .input { padding-left: 36px; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }

.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { appearance: none; margin: 0; width: 100%; height: 100%; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background-color .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }

.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .cnt { font-size: 11px; color: var(--text-3); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 10px 12px 11px; color: var(--text-2); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); }
.tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tab .cnt { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }

/* ---------- Статусы и метки ---------- */
.st { --fg: var(--st-confirmed-fg); --bg: var(--st-confirmed-bg); --dot: var(--st-confirmed); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; }
.st > i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); flex: none; }
.st-sm { height: 20px; font-size: 11px; padding: 0 8px 0 6px; }
.st-pending { --fg: var(--st-pending-fg); --bg: var(--st-pending-bg); --dot: var(--st-pending); }
.st-confirmed { --fg: var(--st-confirmed-fg); --bg: var(--st-confirmed-bg); --dot: var(--st-confirmed); }
.st-arrived { --fg: var(--st-arrived-fg); --bg: var(--st-arrived-bg); --dot: var(--st-arrived); }
.st-progress { --fg: var(--st-progress-fg); --bg: var(--st-progress-bg); --dot: var(--st-progress); }
.st-completed { --fg: var(--st-completed-fg); --bg: var(--st-completed-bg); --dot: var(--st-completed); }
.st-cancelled { --fg: var(--st-cancelled-fg); --bg: var(--st-cancelled-bg); --dot: var(--st-cancelled); }
.st-noshow { --fg: var(--st-noshow-fg); --bg: var(--st-noshow-bg); --dot: var(--st-noshow); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-blue { background: var(--primary-50); color: var(--primary); }
.tag-red { background: var(--danger-50); color: var(--danger-fg); }
.tag-green { background: var(--success-50); color: var(--success-fg); }
.tag-amber { background: var(--warning-50); color: var(--warning-fg); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }

.avatar { --size: 36px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 600; font-size: calc(var(--size) * .36); color: #FFFFFF; letter-spacing: -.02em; background: var(--av, #2563EB); position: relative; user-select: none; }
.avatar.sq { border-radius: 30%; }
.avatar .on-dot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); min-height: 56px; }
.card-h.flat { border-bottom: 0; padding-bottom: 4px; }
.card-t { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-b { padding: 18px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--border); }
.card-pad { padding: 18px; }
.card.hover { transition: border-color .15s, box-shadow .15s, transform .15s; cursor: pointer; }
.card.hover:hover { border-color: var(--border-2); box-shadow: var(--shadow); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .k-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi .k-i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.kpi .k-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .k-d { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kpi .k-d b { font-weight: 600; }
.kpi.accent { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.kpi.accent .k-l, .kpi.accent .k-d { color: rgba(255, 255, 255, .82); }
.kpi.accent .k-i { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.kpi .spark { height: 28px; margin-top: 2px; }

.dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px 16px; font-size: 14px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; min-width: 0; font-weight: 500; }

.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list > li.click { cursor: pointer; }
.list > li.click:hover { background: var(--hover); }
.li-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.li-ic.t-pending { background: var(--st-pending-bg); color: var(--st-pending-fg); }
.li-ic.t-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.li-ic.t-arrived { background: var(--st-arrived-bg); color: var(--st-arrived-fg); }
.li-ic.t-progress { background: var(--st-progress-bg); color: var(--st-progress-fg); }
.li-ic.t-completed { background: var(--st-completed-bg); color: var(--st-completed-fg); }
.li-ic.t-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.li-ic.t-noshow { background: var(--st-noshow-bg); color: var(--st-noshow-fg); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.progress.sm { height: 6px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; align-items: center; gap: 12px; }
.meter .progress > i.hi { background: var(--warning); }
.meter .progress > i.max { background: var(--danger); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.alert > .ic { margin-top: 1px; }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--text); }
.alert-info > .ic { color: var(--primary); }
.alert-warn { background: var(--warning-50); border-color: transparent; }
.alert-warn > .ic { color: var(--warning-fg); }
.alert-danger { background: var(--danger-50); border-color: transparent; }
.alert-danger > .ic { color: var(--danger-fg); }
.alert-ok { background: var(--success-50); border-color: transparent; }
.alert-ok > .ic { color: var(--success-fg); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; }
.tl { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.tl::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: -14px; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); z-index: 1; }
.tl-dot.ok { background: var(--success); color: #FFFFFF; box-shadow: none; }
.tl-dot.now { background: var(--primary); color: #FFFFFF; box-shadow: 0 0 0 4px var(--primary-100); }
.tl-dot.warn { background: var(--warning); color: #FFFFFF; box-shadow: none; }
.tl-dot.bad { background: var(--danger); color: #FFFFFF; box-shadow: none; }

/* Пустые, загрузка, ошибка */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--text-2); }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); margin-bottom: 4px; }
.empty-ic.err { background: var(--danger-50); color: var(--danger-fg); }
.empty-ic.ok { background: var(--success-50); color: var(--success-fg); }
.empty h3, .empty h4 { color: var(--text); font-size: 16px; }
.empty p { max-width: 34ch; font-size: 13.5px; }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-hold { opacity: .45; pointer-events: none; transition: opacity .2s; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; min-width: 0; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl th:first-child { border-top-left-radius: 0; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--text); }
.tbl th .ic { opacity: .6; margin-left: 2px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tr.click { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tbl .sub { font-size: 12px; color: var(--text-2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 32px; height: 32px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.pager .pages button:hover { background: var(--surface-2); color: var(--text); }
.pager .pages button.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }

/* ---------- Диалоги, меню, тосты ---------- */
dialog.dlg { border: 0; padding: 0; margin: auto; color: var(--text); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; }
dialog.dlg:modal { overscroll-behavior: contain; }
dialog.dlg::backdrop { background: var(--scrim); backdrop-filter: blur(2px); overflow: hidden; overscroll-behavior: contain; }
dialog.dlg[open] { display: flex; flex-direction: column; animation: dlg-in .18s ease-out; }
dialog.dlg.lg { width: min(780px, calc(100vw - 32px)); }
dialog.dlg.xl { width: min(980px, calc(100vw - 32px)); }
dialog.dlg.sm { width: min(420px, calc(100vw - 32px)); }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); border-radius: 18px 0 0 18px; }
dialog.drawer[open] { animation: drawer-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: .4; } }
.dlg-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dlg-h h2 { font-size: 18px; font-weight: 700; }
.dlg-h p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.dlg-b { padding: 20px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.dlg-f { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.dlg-f .left { margin-right: auto; }

.menu[popover] { margin: 0; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); min-width: 220px; position: fixed; inset: auto; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; text-align: left; color: var(--text); }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu .m-sec { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 6px 0; }
.menu .danger { color: var(--danger-fg); }
.menu .muted-i { margin-left: auto; color: var(--text-3); font-size: 12px; }

.toasts[popover] { position: fixed; inset: auto max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--chrome); color: var(--chrome-fg); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .22s ease-out; }
.toast .t-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--success); color: #FFFFFF; margin-top: -1px; }
.toast.t-info .t-ic { background: var(--primary); }
.toast.t-warn .t-ic { background: var(--warning); }
.toast.t-error .t-ic { background: var(--danger); }
.toast .t-sub { color: var(--chrome-muted); font-size: 12.5px; margin-top: 2px; }
.toast .t-x { margin-left: auto; color: var(--chrome-muted); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.toast .t-x:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Демо-панель ---------- */
.demobar { position: sticky; top: var(--safe-top); z-index: 40; height: var(--bar); display: flex; align-items: center; gap: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--chrome); color: var(--chrome-fg); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.db-brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; font-weight: 700; letter-spacing: -.01em; flex: none; }
.db-logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #FFFFFF; }
.db-brand small { font-weight: 500; font-size: 11px; color: var(--chrome-muted); border: 1px solid rgba(255, 255, 255, .14); padding: 1px 6px; border-radius: 6px; letter-spacing: .02em; }
.db-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.db-nav a { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 8px; color: var(--chrome-muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.db-nav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .05); }
.db-nav a.on { color: #FFFFFF; background: rgba(255, 255, 255, .1); }
.db-act { display: flex; align-items: center; gap: 6px; flex: none; }
.db-btn { height: 32px; min-width: 32px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--chrome-muted); font-size: 12.5px; font-weight: 500; }
.db-btn:hover { color: #FFFFFF; background: rgba(255, 255, 255, .06); }
.db-clock { font-size: 12px; color: var(--chrome-muted); white-space: nowrap; }
.db-clock b { color: #FFFFFF; font-weight: 600; }

/* ---------- Оболочка дашбордов ---------- */
.dash { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - var(--bar) - var(--safe-top)); }
.side { position: sticky; top: calc(var(--bar) + var(--safe-top)); height: calc(100vh - var(--bar) - var(--safe-top)); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side-brand .lg { width: 36px; height: 36px; border-radius: 11px; background: var(--primary); color: #FFFFFF; display: grid; place-items: center; flex: none; }
.side-brand b { display: block; font-size: 14px; line-height: 1.2; }
.side-brand span { font-size: 12px; color: var(--text-2); }
.side-sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.on { background: var(--primary-50); color: var(--primary); }
.side-nav a .badge { margin-left: auto; }
.side-nav a .cnt { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 600; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.side-user b { display: block; font-size: 13px; line-height: 1.25; }
.side-user span { font-size: 12px; color: var(--text-2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: calc(var(--bar) + var(--safe-top)); z-index: 20; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar .crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; min-width: 0; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar .search { width: min(320px, 32vw); }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; border: 2px solid var(--bg); height: 20px; }
.burger { display: none; }
.content { padding: 24px 28px 56px; width: 100%; max-width: 1640px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-h p { color: var(--text-2); margin-top: 4px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.side-scrim { display: none; }

/* ---------- Календарь ---------- */
.cal-card { overflow: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.cal-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 420px; position: relative; }
.cal-grid { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(176px, 1fr)); min-width: max-content; position: relative; }
.cal-colh { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-height: 64px; }
.cal-colh.corner { left: 0; z-index: 8; border-left: 0; }
.cal-colh .nm { font-weight: 600; font-size: 13px; line-height: 1.25; }
.cal-colh .sp { font-size: 11.5px; color: var(--text-2); }
.cal-colh .ld { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.cal-colh .ld .progress { width: 54px; height: 4px; }
.cal-times { position: sticky; left: 0; z-index: 5; background: var(--surface); border-right: 1px solid var(--border); }
.cal-time { height: 64px; font-size: 11px; color: var(--text-3); text-align: right; padding: 0 8px 0 0; position: relative; top: -7px; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(var(--hover) 1px, transparent 1px); background-size: 100% 64px, 100% 32px; }
.cal-col.off { background-color: var(--surface-2); }
.cal-slot { position: absolute; left: 0; right: 0; height: 32px; display: flex; align-items: center; padding-left: 10px; font-size: 11.5px; color: transparent; border-radius: 6px; }
.cal-slot:hover { background: var(--primary-50); color: var(--primary); }
.cal-ev { position: absolute; left: 4px; right: 6px; z-index: 2; border-radius: 8px; padding: 5px 8px 5px 10px; overflow: hidden; background: var(--bg-ev, var(--st-confirmed-bg)); color: var(--text); font-size: 12px; line-height: 1.3; border-left: 3px solid var(--c-ev, var(--st-confirmed)); cursor: grab; box-shadow: 0 0 0 1px var(--surface); transition: box-shadow .15s; touch-action: none; }
.cal-ev:hover { box-shadow: 0 0 0 1px var(--surface), 0 4px 14px rgba(15, 23, 42, .14); z-index: 3; }
.cal-ev .tm { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.cal-ev .pn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .sv { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.is-cancelled, .cal-ev.is-noshow { opacity: .62; }
.cal-ev.is-cancelled .pn { text-decoration: line-through; }
.cal-ev.dragging { opacity: .9; cursor: grabbing; box-shadow: 0 12px 30px rgba(15, 23, 42, .28); z-index: 20; transition: none; }
.cal-ev.ghost-bad { outline: 2px dashed var(--danger); }
.cal-ev .rr { position: absolute; top: 5px; right: 6px; color: var(--warning-fg); }
.ev-pending { --bg-ev: var(--st-pending-bg); --c-ev: var(--st-pending); }
.ev-confirmed { --bg-ev: var(--st-confirmed-bg); --c-ev: var(--st-confirmed); }
.ev-arrived { --bg-ev: var(--st-arrived-bg); --c-ev: var(--st-arrived); }
.ev-progress { --bg-ev: var(--st-progress-bg); --c-ev: var(--st-progress); }
.ev-completed { --bg-ev: var(--st-completed-bg); --c-ev: var(--st-completed); }
.ev-cancelled { --bg-ev: var(--st-cancelled-bg); --c-ev: var(--st-cancelled); }
.ev-noshow { --bg-ev: var(--st-noshow-bg); --c-ev: var(--st-noshow); }
.cal-blk { position: absolute; left: 4px; right: 6px; z-index: 1; border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--text-2); background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px); border: 1px dashed var(--border-2); display: flex; align-items: flex-start; gap: 6px; }
.cal-now { position: absolute; left: 58px; right: 0; height: 2px; background: var(--danger); z-index: 7; pointer-events: none; }
.cal-now::before { content: attr(data-t); position: absolute; left: -54px; top: -9px; background: var(--danger); color: #FFFFFF; font-size: 10.5px; font-weight: 600; padding: 2px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.wk-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(120px, 1fr)); min-width: max-content; }
.wk-grid .cal-colh { flex-direction: column; align-items: flex-start; gap: 0; }
.wk-grid .cal-colh .dnum { font-size: 20px; font-weight: 700; line-height: 1.1; }
.wk-grid .cal-colh.today .dnum { color: var(--primary); }
.wk-grid .cal-ev { left: 3px; right: 3px; }
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head div { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.mo-cell { min-height: 112px; padding: 8px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; text-align: left; transition: background-color .15s; min-width: 0; }
.mo-cell:nth-child(7n) { border-right: 0; }
.mo-cell:hover { background: var(--hover); }
.mo-cell.out { background: var(--bg); color: var(--text-3); }
.mo-cell .dn { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.mo-cell.today .dn b { background: var(--primary); color: #FFFFFF; border-radius: 8px; padding: 1px 7px; }
.mo-cell .cnt { font-size: 12px; color: var(--text-2); }
.mo-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: auto; }
.mo-bar i { display: block; height: 100%; }
.mo-load { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }

/* ---------- Графики ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart .ax { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .ax-l { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .bl { stroke: var(--axis); stroke-width: 1; }
.chart .val { fill: var(--text); font-size: 11.5px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .xh { stroke: var(--text-3); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar-m { transition: opacity .15s; }
.chart .dim .bar-m { opacity: .35; }
.chart .dim .bar-m.hot { opacity: 1; }
.ch-tip { position: absolute; z-index: 10; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.ch-tip.on { opacity: 1; transform: none; }
.ch-tip .tt { color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.ch-tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ch-tip .tr span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.ch-tip .tr i { width: 12px; height: 2px; border-radius: 1px; background: var(--k); }
.ch-tip .tr b { color: var(--text); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.legend i.ln { height: 2px; width: 14px; border-radius: 1px; }

/* ---------- Обзор (хаб) ---------- */
.hub { max-width: 1240px; margin: 0 auto; padding-block: 48px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 56px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.06; letter-spacing: -.035em; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 54ch; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-art { position: relative; min-height: 380px; }
.hero-art .ha { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; }
.ha-1 { top: 0; left: 6%; right: 18%; }
.ha-2 { top: 150px; right: 0; width: 56%; }
.ha-3 { top: 214px; left: 0; width: 50%; }
.ha-4 { bottom: -4px; right: 12%; width: 44%; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sec-h h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sec-h p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.role { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s; }
.role:hover { border-color: var(--border-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.role .r-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.role h3 { font-size: 17px; font-weight: 700; }
.role p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.role ul { display: flex; flex-wrap: wrap; gap: 6px; }
.role .go { margin-top: auto; display: flex; align-items: center; justify-content: space-between; color: var(--primary); font-weight: 600; font-size: 13.5px; padding-top: 4px; }
.flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.flow { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.flow ol { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow ol li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.flow ol li + li::before { content: "→"; color: var(--text-3); }
.arch { display: grid; gap: 12px; }
.arch-row { display: grid; gap: 12px; }
.arch-row.r5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.arch-row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.arch-box { padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.arch-box b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.arch-box span { color: var(--text-2); font-size: 12.5px; }
.arch-api { background: var(--primary); color: var(--on-primary); border-color: var(--primary); text-align: center; align-items: center; padding: 16px; }
.arch-api span { color: rgba(255, 255, 255, .8); }
.arch-link { height: 22px; display: grid; grid-template-columns: repeat(5, 1fr); }
.arch-link i { justify-self: center; width: 2px; height: 100%; background: linear-gradient(var(--border-2) 50%, transparent 0) 0 0 / 2px 6px; }
.arch-link.l3 { grid-template-columns: repeat(3, 1fr); }
.roadmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rm { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.rm h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rm li { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; color: var(--text-2); }
.rm li .ic { color: var(--text-3); }
.rm li.in .ic { color: var(--success); }
.rm li.in { color: var(--text); }

/* ---------- Mini App: сцена с телефоном ---------- */
.stage { display: grid; grid-template-columns: 264px minmax(0, 1fr) 300px; gap: 24px; padding-block: 24px 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); align-items: start; max-width: 1480px; margin: 0 auto; }
.stage-side { position: sticky; top: calc(var(--bar) + var(--safe-top) + 24px); max-height: calc(100vh - var(--bar) - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stage-side h2 { font-size: 15px; font-weight: 700; }
.scr-group { display: flex; flex-direction: column; gap: 2px; }
.scr-group .g { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 8px 4px; }
.scr-group a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.scr-group a:hover { background: var(--surface-2); color: var(--text); }
.scr-group a.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.scr-group a .n { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); min-width: 18px; }
.scr-group a.on .n { color: var(--primary); }
.info-card { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.info-card h3 { font-size: 14px; font-weight: 700; }
.info-card p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.api { display: flex; flex-direction: column; gap: 4px; }
.api code { display: block; font-family: var(--mono); font-size: 11.5px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text); overflow-x: auto; white-space: nowrap; }
.api code b { color: var(--primary); font-weight: 600; margin-right: 4px; }
.phone-wrap { display: flex; justify-content: center; min-width: 0; }
.phone { width: 390px; height: min(844px, calc(100vh - var(--bar) - 64px)); min-height: 640px; border-radius: 52px; padding: 11px; background: var(--phone-frame); box-shadow: 0 0 0 1px rgba(148, 163, 184, .25), var(--shadow-lg); position: relative; flex: none; }
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 112px; height: 32px; border-radius: 20px; background: #000000; z-index: 5; }
.screen { position: relative; height: 100%; border-radius: 42px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; isolation: isolate; }
.sbar { height: 50px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 30px 6px 36px; font-weight: 600; font-size: 15px; background: var(--tg-head); color: var(--text); }
.sbar .ics { display: flex; gap: 6px; align-items: center; }
.tg-h { flex: none; height: 48px; display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; padding: 0 10px; background: var(--tg-head); border-bottom: 1px solid var(--border); position: relative; z-index: 3; }
.tg-h .tg-l { display: flex; align-items: center; gap: 2px; color: var(--primary); font-size: 15px; font-weight: 500; justify-self: start; padding: 6px 4px; }
.tg-h .tg-c { text-align: center; line-height: 1.2; min-width: 0; }
.tg-h .tg-c b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-h .tg-c span { font-size: 11.5px; color: var(--text-2); }
.tg-h .tg-r { justify-self: end; color: var(--primary); padding: 6px; }
.pa-body { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: none; background: var(--bg); }
.pa-body::-webkit-scrollbar { display: none; }
.pa-nav { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface); }
.pa-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 2px; color: var(--text-3); font-size: 11px; font-weight: 500; border-radius: 10px; position: relative; }
.pa-nav button.on { color: var(--primary); }
.pa-nav button .badge { position: absolute; top: 2px; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10px; border: 2px solid var(--surface); }
.mainbtn { flex: none; padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); }
.mainbtn .btn { width: 100%; height: 50px; border-radius: 12px; font-size: 15px; }
.p-pad { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.p-h { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.p-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.p-sec { display: flex; flex-direction: column; gap: 10px; }
.p-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-sec-h h3 { font-size: 16px; font-weight: 700; }
.p-card { background: var(--surface); border-radius: 16px; border: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.p-card.click { cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left; width: 100%; color: var(--text); }
.p-card.click:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.p-card.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.p-group { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.p-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; color: var(--text); min-width: 0; }
.p-row:last-child { border-bottom: 0; }
button.p-row:hover, a.p-row:hover { background: var(--hover); }
.p-row .chev { color: var(--text-3); margin-left: auto; }
.p-row .ri { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.cta { position: relative; overflow: hidden; border-radius: 20px; padding: 18px; background: var(--primary); color: #FFFFFF; display: flex; flex-direction: column; gap: 12px; }
.cta::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, .09); }
.cta h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; position: relative; z-index: 1; }
.cta p { color: rgba(255, 255, 255, .82); font-size: 13.5px; position: relative; z-index: 1; max-width: 26ch; }
.cta .btn { align-self: flex-start; background: #FFFFFF; color: #1D4ED8; position: relative; z-index: 1; }
.cta .btn:hover { background: #EFF6FF; }
.date-tile { width: 52px; flex: none; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 0; line-height: 1.1; }
.date-tile b { font-size: 20px; font-weight: 700; }
.date-tile span { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.svc-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x mandatory; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.svc-mini { width: 148px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--text); }
.svc-mini:hover { border-color: var(--border-2); }
.svc-mini b { font-size: 13.5px; line-height: 1.3; font-weight: 600; min-height: 35px; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--primary); }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.slot:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.slot.on { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.slot:disabled { color: var(--text-3); background: var(--surface-2); text-decoration: line-through; cursor: not-allowed; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.mcal .wd { font-size: 11.5px; color: var(--text-3); font-weight: 600; padding: 4px 0; }
.mcal button { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.mcal button:hover:not(:disabled) { background: var(--primary-50); }
.mcal button:disabled { color: var(--text-3); font-weight: 400; cursor: default; }
.mcal button.today { box-shadow: inset 0 0 0 1.5px var(--primary-100); }
.mcal button.on { background: var(--primary); color: #FFFFFF; }
.mcal button i { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--success); }
.mcal button.few i { background: var(--warning); }
.mcal button.on i { background: #FFFFFF; }
.dstrip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.dstrip button { flex: none; width: 54px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.dstrip button span { font-size: 11px; color: var(--text-2); text-transform: capitalize; }
.dstrip button b { font-size: 17px; font-variant-numeric: tabular-nums; }
.dstrip button.on { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.dstrip button.on span { color: rgba(255, 255, 255, .8); }
.dstrip button:disabled { opacity: .45; cursor: not-allowed; }
.ring { --p: 40; width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::before { content: attr(data-v); width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.sheet-ov { position: absolute; inset: 0; background: var(--scrim); z-index: 20; animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 16px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 88%; overflow-y: auto; animation: sheet-in .25s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); align-self: center; }
.sheet h3 { font-size: 18px; font-weight: 700; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--primary); color: #FFFFFF; text-align: center; padding: 24px; }
.splash .logo { width: 88px; height: 88px; border-radius: 26px; background: #FFFFFF; color: #2563EB; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); animation: pop .6s cubic-bezier(.2, .9, .3, 1.3); }
.splash h2 { font-size: 26px; letter-spacing: -.02em; }
.splash p { color: rgba(255, 255, 255, .8); }
.dots { display: flex; gap: 6px; margin-top: 18px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .85); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.success-mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--success-50); color: var(--success); animation: pop .5s cubic-bezier(.2, .9, .3, 1.3); }
.mapbox { height: 120px; border-radius: 14px; position: relative; overflow: hidden; background: linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px, linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px, var(--surface-2); }
.mapbox::before { content: ""; position: absolute; left: -10%; right: -10%; top: 58%; height: 10px; background: var(--surface); transform: rotate(-8deg); box-shadow: 0 0 0 1px var(--border); }
.mapbox::after { content: ""; position: absolute; top: -10%; bottom: -10%; left: 62%; width: 8px; background: var(--surface); transform: rotate(12deg); box-shadow: 0 0 0 1px var(--border); }
.mapbox .pin { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -100%); color: var(--danger); z-index: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.quote { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.55; position: relative; }

/* ---------- Telegram-бот ---------- */
.chat { width: 390px; height: min(820px, calc(100vh - var(--bar) - 64px)); min-height: 620px; border-radius: 52px; padding: 11px; background: var(--phone-frame); box-shadow: 0 0 0 1px rgba(148, 163, 184, .25), var(--shadow-lg); position: relative; flex: none; }
.chat::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 112px; height: 32px; border-radius: 20px; background: #000000; z-index: 5; }
.chat-h { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--tg-head); border-bottom: 1px solid var(--border); }
.chat-h .bk { color: var(--primary); display: flex; align-items: center; font-size: 15px; }
.chat-h b { display: block; font-size: 15px; }
.chat-h span { font-size: 12px; color: var(--text-2); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 10px 10px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(circle at 20% 20%, var(--tg-chat-2) 0 2px, transparent 3px) 0 0 / 34px 34px, radial-gradient(circle at 70% 60%, var(--tg-chat-2) 0 2px, transparent 3px) 0 0 / 46px 46px, var(--tg-chat); scrollbar-width: none; }
.chat-body::-webkit-scrollbar { display: none; }
.msg-wrap { display: flex; flex-direction: column; gap: 4px; max-width: 88%; align-self: flex-start; scroll-margin: 20px; }
.msg-wrap.out { align-self: flex-end; }
.msg { background: var(--bubble); color: var(--text); border-radius: 16px 16px 16px 6px; padding: 8px 11px 6px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(15, 23, 42, .08); white-space: pre-line; overflow-wrap: anywhere; }
.msg-wrap.out .msg { background: var(--bubble-out); border-radius: 16px 16px 6px 16px; }
.msg .mt { display: block; text-align: right; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.msg-wrap.hl .msg { box-shadow: 0 0 0 2px var(--primary), 0 1px 1px rgba(15, 23, 42, .08); }
.kb { display: flex; flex-direction: column; gap: 4px; }
.kb-row { display: flex; gap: 4px; }
.kb-btn { flex: 1; min-height: 38px; padding: 6px 8px; border-radius: 10px; background: var(--kb); color: var(--kb-fg); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; backdrop-filter: blur(6px); }
.kb-btn:hover { filter: brightness(1.12); }
.kb-btn .ic { opacity: .85; }
.day-sep { align-self: center; font-size: 12px; font-weight: 500; color: #FFFFFF; background: rgba(30, 58, 95, .35); padding: 3px 10px; border-radius: 999px; margin: 6px 0; }
.chat-in { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--tg-head); border-top: 1px solid var(--border); }
.chat-in .menu-b { height: 34px; padding: 0 12px; border-radius: 10px; background: var(--primary); color: #FFFFFF; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chat-in .fake { flex: 1; height: 36px; border-radius: 18px; background: var(--surface-2); color: var(--text-3); display: flex; align-items: center; padding: 0 14px; font-size: 14px; }
.cb-pop { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); z-index: 30; background: rgba(15, 23, 42, .86); color: #FFFFFF; font-size: 13px; padding: 9px 14px; border-radius: 12px; max-width: 80%; text-align: center; animation: fade .15s; }
.tpl-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; color: var(--text-2); font-size: 13px; }
.tpl-item:hover { background: var(--surface-2); color: var(--text); }
.tpl-item.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tpl-item .n { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); min-width: 18px; }

/* ---------- Врач: зубная формула, документ ---------- */
.teeth { display: flex; flex-direction: column; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.jaw { display: flex; gap: 14px; justify-content: center; min-width: max-content; }
.jaw .half { display: flex; gap: 4px; }
.tooth { width: 36px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.tooth svg { color: var(--t-c, var(--border-2)); }
.tooth svg path { fill: var(--t-f, var(--surface)); }
.tooth.t-caries { --t-c: var(--danger); --t-f: var(--danger-50); }
.tooth.t-filled { --t-c: var(--primary); --t-f: var(--primary-50); }
.tooth.t-endo { --t-c: var(--warning); --t-f: var(--warning-50); }
.tooth.t-crown { --t-c: var(--violet); --t-f: var(--violet-50); }
.tooth.t-implant { --t-c: var(--info); --t-f: var(--info-50); }
.tooth.t-missing { opacity: .4; }
.tooth.t-missing svg path { stroke-dasharray: 3 2; fill: transparent; }
button.tooth:hover { background: var(--surface-2); }
.tooth.sel { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.jaw-sep { height: 1px; background: var(--border); min-width: max-content; }
.teeth-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.teeth-legend span { display: inline-flex; align-items: center; gap: 6px; }
.teeth-legend i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--t-c, var(--border-2)); background: var(--t-f, var(--surface)); }
.ws-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; }
.ws-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.ws-facts > div { padding: 12px 18px; border-right: 1px solid var(--border); min-width: 0; }
.ws-facts > div:last-child { border-right: 0; }
.ws-facts span { display: block; font-size: 12px; color: var(--text-2); }
.ws-facts b { font-size: 14px; font-weight: 600; }
.a4 { background: #FFFFFF; color: #0F172A; border-radius: 10px; padding: 28px 30px; box-shadow: 0 0 0 1px #E2E8F0, var(--shadow); font-size: 12.5px; line-height: 1.55; max-width: 640px; margin: 0 auto; width: 100%; }
.a4 h4 { font-size: 15px; letter-spacing: 0; margin: 14px 0 8px; text-align: center; }
.a4 .a4-h { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid #2563EB; }
.a4 .a4-h b { color: #2563EB; font-size: 14px; }
.a4 .a4-muted { color: #64748B; }
.a4 table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.a4 td, .a4 th { border: 1px solid #E2E8F0; padding: 6px 8px; text-align: left; vertical-align: top; }
.a4 th { background: #F8FAFC; font-weight: 600; }
.a4 .sig { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 20px; gap: 12px; }
.a4 .stamp { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(37, 99, 235, .55); color: rgba(37, 99, 235, .75); display: grid; place-items: center; text-align: center; font-size: 9px; font-weight: 700; transform: rotate(-12deg); line-height: 1.2; padding: 8px; }
.doc-lines i { display: block; height: 8px; border-radius: 4px; background: #E2E8F0; margin: 8px 0; }
.ver { display: flex; flex-direction: column; gap: 0; }
.ver > div { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 8px 0; font-size: 13px; }
.ver i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--border-2); }
.ver > div.cur i { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.form-sec { display: flex; flex-direction: column; gap: 12px; }
.form-sec > h4 { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; text-transform: uppercase; }
.dx-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--primary-50); color: var(--primary); font-size: 13px; font-weight: 600; }
.dx-pill button { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; }
.dx-pill button:hover { background: var(--primary-100); }
.suggest { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.suggest button { display: flex; gap: 10px; width: 100%; padding: 8px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--surface-2); }
.rx-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }

/* ---------- Директор ---------- */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.filterbar .sep { width: 1px; height: 24px; background: var(--border); }
.chart-card .card-h .seg button { height: 26px; font-size: 12px; padding: 0 9px; }
.rank { counter-reset: r; }
.rank tr td:first-child::before { counter-increment: r; content: counter(r); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; margin-right: 10px; }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

/* ---------- Дизайн-система ---------- */
.ds { max-width: 1240px; margin: 0 auto; padding-block: 32px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 28px; }
.ds-sec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding-top: 28px; border-top: 1px solid var(--border); }
.ds-sec > header h2 { font-size: 18px; font-weight: 700; }
.ds-sec > header p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border-radius: 14px; border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.swatch .sw { height: 64px; background: var(--sw); }
.swatch .si { padding: 8px 10px; font-size: 12px; }
.swatch .si b { display: block; font-size: 13px; }
.type-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
.type-row:last-child { border-bottom: 0; }
.space-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.space-row i { display: block; height: 12px; background: var(--primary-100); border-radius: 3px; }
.ds-demo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Адаптив ---------- */
@media (max-width: 1280px) {
  .stage { grid-template-columns: 240px minmax(0, 1fr); }
  .stage-info { display: none; }
}
@media (max-width: 1100px) {
  .dash { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 14px 10px; }
  .side-brand { justify-content: center; padding: 4px 0 12px; }
  .side-brand > div, .side-sec, .side-nav a .lbl, .side-nav a .badge, .side-nav a .cnt, .side-user > div { display: none; }
  .side-nav a { justify-content: center; padding: 0; }
  .side-user { justify-content: center; padding: 8px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-facts > div:nth-child(2) { border-right: 0; }
  .ws-facts > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .stage-side.screens { position: static; max-height: none; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .flows, .roadmap { grid-template-columns: minmax(0, 1fr); }
  .arch-row.r5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arch-link { display: none; }
  .ds-sec { grid-template-columns: minmax(0, 1fr); }
  .rx-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 767px) {
  :root { --bar: 52px; }
  .db-brand span.t, .db-clock, .db-btn .lbl { display: none; }
  .db-nav a { padding: 0 9px; }
  .db-nav a .lbl-l { display: none; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: calc(var(--bar) + var(--safe-top)); bottom: 0; height: auto; width: 272px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); z-index: 45; }
  .side-brand { justify-content: flex-start; padding: 4px 8px 14px; }
  .side-brand > div, .side-sec, .side-nav a .lbl, .side-nav a .badge, .side-nav a .cnt, .side-user > div { display: revert; }
  .side-nav a { justify-content: flex-start; padding: 0 10px; }
  .side-nav a .badge { display: inline-grid; }
  .side-user { justify-content: flex-start; }
  .dash.nav-open .side { transform: none; }
  .dash.nav-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: var(--scrim); }
  .burger { display: grid; }
  .topbar { padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); min-height: 58px; }
  .topbar .search { display: none; }
  .content { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); gap: 16px; }
  .page-h h1 { font-size: 23px; }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .k-v { font-size: 22px; }
  .hub { padding-block: 28px 56px; gap: 40px; }
  .stage { padding: 0; gap: 0; }
  .stage-side.screens { display: none; }
  .phone, .chat { width: 100%; height: calc(100dvh - var(--bar) - var(--safe-top) - 52px); min-height: 560px; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .phone::before, .chat::before { display: none; }
  .screen { border-radius: 0; }
  .sbar { display: none; }
  .mobile-pick { display: flex !important; }
  .ws-head { grid-template-columns: auto minmax(0, 1fr); }
  .ws-head > .acts { grid-column: 1 / -1; }
  .ds-sec { padding-top: 20px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .meter { grid-template-columns: minmax(0, 1fr) 80px 40px; }
  dialog.drawer { width: 100vw; border-radius: 0; }
  dialog.dlg:not(.drawer) { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .tbl th, .tbl td { padding: 10px 12px; }
}
.mobile-pick { display: none; align-items: center; gap: 8px; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--border); height: 52px; }
.mobile-pick .select { height: 36px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
