/* Layout: тёмная колонка разделов слева, рабочая область справа, ИИ-помощник плавает в правом нижнем углу */
:root {
  --bg: #F4F3F8; --surface: #FDFCFF; --surface-2: #EEEDF4; --ink: #1B1D3A; --muted: #545779; --line: #E1E0EA;
  --accent: #C2185B; --accent-ink: #FFFFFF; --accent-soft: #FBE3EE; --accent-soft-ink: #6E0E35;
  --nav: #1B1D3A; --nav-ink: #E9E8F2; --nav-muted: #A9ABC8; --nav-active: #2E3160; --nav-dot: #FF6FA6;
  --bad-bg: #FADBD8; --bad-fg: #8C1D18; --warn-bg: #FBEACC; --warn-fg: #6E4100; --ok-bg: #D7F0E4; --ok-fg: #14573C;
  --info-bg: #DCE7F7; --info-fg: #1D3F73; --neutral-bg: #E7E6EF; --neutral-fg: #3B3E63;
  --bad: #B3261E; --good: #1F7A55; --warn: #9A5B00; --bar: #8E90B5;
  --pain-bg: #FDECEA; --pain-fg: #4A1410; --pain-label: #8C1D18; --fix-bg: #E3F2EA; --fix-fg: #0F3D2A; --fix-label: #14573C;
  --shadow: 0 16px 48px rgba(27, 29, 58, 0.22);
  --display: 'Unbounded', 'Arial Black', Arial, sans-serif;
  --body: 'Golos Text', 'Segoe UI', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111226; --surface: #1A1C38; --surface-2: #23264A; --ink: #ECEBF5; --muted: #A3A5C4; --line: #2F3256;
    --accent: #FF5C9A; --accent-ink: #1A0A12; --accent-soft: #3A1630; --accent-soft-ink: #FFC2DA;
    --nav: #0B0C1C; --nav-ink: #E9E8F2; --nav-muted: #A9ABC8; --nav-active: #23264A;
    --bad-bg: #4A1A17; --bad-fg: #FFB4AB; --warn-bg: #4A3410; --warn-fg: #FFD59A; --ok-bg: #123D2B; --ok-fg: #9EE6C0;
    --info-bg: #1B2E4D; --info-fg: #B5CFF5; --neutral-bg: #2A2D52; --neutral-fg: #CFD0E8;
    --bad: #FF8A80; --good: #6FD3A2; --warn: #F0B35A; --bar: #6A6D99;
    --pain-bg: #3A1714; --pain-fg: #FFD2CC; --pain-label: #FFB4AB; --fix-bg: #10301F; --fix-fg: #BDEBD0; --fix-label: #9EE6C0;
    --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111226; --surface: #1A1C38; --surface-2: #23264A; --ink: #ECEBF5; --muted: #A3A5C4; --line: #2F3256;
  --accent: #FF5C9A; --accent-ink: #1A0A12; --accent-soft: #3A1630; --accent-soft-ink: #FFC2DA;
  --nav: #0B0C1C; --nav-ink: #E9E8F2; --nav-muted: #A9ABC8; --nav-active: #23264A;
  --bad-bg: #4A1A17; --bad-fg: #FFB4AB; --warn-bg: #4A3410; --warn-fg: #FFD59A; --ok-bg: #123D2B; --ok-fg: #9EE6C0;
  --info-bg: #1B2E4D; --info-fg: #B5CFF5; --neutral-bg: #2A2D52; --neutral-fg: #CFD0E8;
  --bad: #FF8A80; --good: #6FD3A2; --warn: #F0B35A; --bar: #6A6D99;
  --pain-bg: #3A1714; --pain-fg: #FFD2CC; --pain-label: #FFB4AB; --fix-bg: #10301F; --fix-fg: #BDEBD0; --fix-label: #9EE6C0;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
* { box-sizing: border-box; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 32px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.small { font-size: 13px; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad-text { color: var(--bad); font-weight: 700; }
.warn-text { color: var(--warn); }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Каркас */
.app { display: flex; min-height: 100%; }
.nav { flex: none; width: 236px; background: var(--nav); color: var(--nav-ink); padding: 24px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; padding: 0 8px; }
.brand-name { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: 0.03em; }
.brand-sub { font-size: 12px; color: var(--nav-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: none; border-radius: 8px; background: transparent; color: var(--nav-muted); text-align: left; font-size: 14px; }
.nav-item:hover { color: var(--nav-ink); }
.nav-item.on { background: var(--nav-active); color: #FFFFFF; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nav-dot); flex: none; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--nav-ink); min-height: 32px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--nav-dot); }
.main { flex: 1; min-width: 0; padding-block: 28px 120px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }

@media (max-width: 880px) {
  .app { flex-direction: column; }
  .nav { width: auto; height: auto; position: static; padding: 14px max(16px, env(safe-area-inset-left, 0px)); gap: 12px; }
  .nav-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { width: auto; white-space: nowrap; flex: none; }
  .nav-foot { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 0; padding: 0; }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: 20px; }
  h1 { font-size: 22px; }
}

/* Страница */
.page { display: flex; flex-direction: column; gap: 20px; max-width: 1360px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 16px; }
.grow1 { flex: 1 1 320px; min-width: 0; }
.grow2 { flex: 2 1 480px; min-width: 0; }
.grow { flex: 1 1 240px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card-head.wrap { flex-wrap: wrap; align-items: center; }
.kpis { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi { flex: 1 1 190px; gap: 4px; padding: 16px 18px; }
.kpi-value { font-family: var(--display); font-size: 22px; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-value.bad { color: var(--bad); }
.kpi-value.good { color: var(--good); }
.kpi-value.warn { color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stub { max-width: 680px; border-style: dashed; }

.pains { display: flex; flex-wrap: wrap; gap: 12px; }
.pain, .fix { flex: 1 1 300px; min-width: 0; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.pain { background: var(--pain-bg); color: var(--pain-fg); }
.fix { background: var(--fix-bg); color: var(--fix-fg); }
.pain-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pain .pain-label { color: var(--pain-label); }
.fix .pain-label { color: var(--fix-label); }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.ghost-dark { background: transparent; border-color: rgba(233, 232, 242, 0.3); color: var(--nav-ink); }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-align: left; min-height: 28px; }
.link-btn.strong { color: var(--ink); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.seg { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.seg button { border: none; border-radius: 8px; padding: 6px 14px; min-height: 36px; background: transparent; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(27, 29, 58, 0.14); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 13px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }

/* Бейджи */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-bad { background: var(--bad-bg); color: var(--bad-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-info { background: var(--info-bg); color: var(--info-fg); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 620px; }
th { text-align: left; padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
th.num, td.num { text-align: right; }
th.center, td.center { text-align: center; }
tr.selected td { background: var(--accent-soft); }
tr.fresh td { background: var(--info-bg); }
.matrix { min-width: 760px; }
.cell { display: inline-block; min-width: 40px; padding: 5px 4px; border-radius: 6px; font-weight: 500; text-align: center; }
.cell.zero { background: var(--bad-bg); color: var(--bad-fg); font-weight: 700; }
.cell.one { background: var(--warn-bg); color: var(--warn-fg); font-weight: 700; }
.cell.extra { background: var(--info-bg); color: var(--info-fg); font-weight: 700; }
.cell.avail { background: var(--ok-bg); color: var(--ok-fg); font-weight: 700; }
.inbound { display: block; font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.legend .cell { min-width: 28px; padding: 2px 6px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }

/* График и полосы */
.chart { height: 220px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); padding-top: 8px; }
.bar-col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; height: 100%; }
.bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--bar); }
.bar.last { background: var(--accent); }
.chart-labels { display: flex; gap: 4px; margin-top: -8px; }
.chart-labels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.hbar { display: flex; flex-direction: column; gap: 4px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.track.tall { height: 10px; }
.fill { height: 100%; border-radius: 4px; background: var(--bar); }
.fill.accent { background: var(--accent); }
.fill.ink { background: var(--ink); }
.fill.bar { background: var(--bar); }
.fill.badfill { background: var(--bad); }
.fill.goodfill { background: var(--good); }

/* Сигналы */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border-left: 4px solid var(--muted); }
.alert.sev-bad { border-left-color: var(--bad); }
.alert.sev-warn { border-left-color: var(--warn); }
.alert-body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; font-size: 14px; }
.alert-level { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.alert-level.bad { color: var(--bad); }
.alert-level.warn { color: var(--warn); }
.alert-level.neutral { color: var(--muted); }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid transparent; text-align: left; }
button.mini:hover { border-color: var(--line); }
.mini strong { font-size: 20px; font-variant-numeric: tabular-nums; }

/* Kaspi */
.sync { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.sync-box { flex: 1 1 280px; min-width: 0; padding: 16px; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sync-box.soft { background: var(--surface-2); border-color: transparent; }
.sync-arrow { align-self: center; font-size: 28px; color: var(--muted); }
.log { display: flex; flex-direction: column; gap: 4px; font-size: 13px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); }

/* Обращения */
.thread-list { gap: 6px; padding: 12px; }
.thread { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); text-align: left; font-size: 14px; }
.thread.on { border-color: var(--accent); background: var(--accent-soft); }
.thread-top { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.convo { gap: 12px; }
.messages { display: flex; flex-direction: column; gap: 10px; min-height: 260px; }
.msg { max-width: 80%; padding: 10px 12px; border-radius: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; white-space: pre-wrap; }
.msg.from-client { align-self: flex-start; background: var(--surface-2); }
.msg.from-bot { align-self: flex-end; background: var(--ink); color: var(--bg); }
.msg-author { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.75; }
.msg-note { font-size: 12px; opacity: 0.8; }

/* Найм */
.kanban { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.lane { flex: 1 1 200px; min-width: 0; background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; }
.lane-head h2 { font-size: 14px; }
.cand { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 14px; }

/* Финансы */
.detail { flex-direction: row; flex-wrap: wrap; gap: 24px; }
.detail > .grow2 { display: flex; flex-direction: column; gap: 12px; }
.advice { flex: 1 1 280px; min-width: 0; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; align-self: flex-start; }
.advice.pain { background: var(--pain-bg); color: var(--pain-fg); }
.advice.fix { background: var(--fix-bg); color: var(--fix-fg); }
.scenario { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid currentColor; }

/* Дашборд по месяцам */
.scope-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.days-chart { gap: 3px; }
.days-chart .bar-col { position: relative; border: none; background: none; padding: 0; border-radius: 4px; }
.days-chart .bar-col:hover { background: var(--surface-2); }
.days-chart .bar-col.on { background: var(--accent-soft); }
.bar.under { background: var(--warn); }
.plan-tick { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); z-index: 1; }
.chart-labels span.wk { color: var(--accent); font-weight: 600; }
.swatch.barc { background: var(--bar); }
.swatch.underc { background: var(--warn); }
.swatch.tick { height: 2px; background: var(--ink); }
.side { display: flex; flex-direction: column; gap: 14px; }
.day-big { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.rank-row.btnlike { border: 1px solid transparent; text-align: left; width: 100%; }
.rank-row.btnlike:hover { border-color: var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.search input { min-width: 240px; }
@media (max-width: 480px) { .search input { min-width: 0; width: 100%; } .search { flex: 1 1 100%; } }
.grid-wrap { max-height: 640px; overflow: auto; border: 1px solid var(--surface-2); border-radius: 8px; }
.day-grid { min-width: 1200px; font-size: 12px; border-collapse: separate; border-spacing: 0; }
.day-grid th, .day-grid td { padding: 6px 6px; border-bottom: 1px solid var(--surface-2); white-space: nowrap; }
.day-grid thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.day-grid .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; text-align: left; font-size: 14px; }
.day-grid thead .sticky { z-index: 3; }
.day-grid tr.total-row td { font-weight: 700; border-bottom: 2px solid var(--line); }
.day-grid tr.selected td.sticky { background: var(--accent-soft); }
.day-h span { display: block; text-align: right; }
.day-h .dow { font-weight: 400; font-size: 11px; color: var(--muted); }
.day-h.wk span:first-child { color: var(--accent); }
.day-h.today, td.heat.today { box-shadow: inset 0 0 0 2px var(--ink); }
.day-h.sel, td.heat.sel { box-shadow: inset 0 0 0 2px var(--accent); }
td.heat { font-variant-numeric: tabular-nums; min-width: 44px; }
.pnl-stores { min-width: 1080px; }
.pnl-stores .pnl-sub td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.pnl-stores .pnl-total td { font-weight: 700; border-top: 2px solid var(--ink); }

/* ОПиУ */
.pnl { min-width: 680px; }
.pnl.wide { min-width: 1500px; }
.pnl td:first-child { padding-left: 20px; }
.pnl .pnl-total td, .pnl .pnl-sub td { font-weight: 700; }
.pnl .pnl-total td:first-child, .pnl .pnl-sub td:first-child { padding-left: 8px; }
.pnl .pnl-sub td { border-top: 1px solid var(--line); background: var(--surface-2); }
.pnl .pnl-total td { border-top: 2px solid var(--ink); }
.pnl .pnl-ratio td { color: var(--muted); font-size: 13px; }
.pnl .pnl-section td { padding: 14px 8px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: none; }

/* Формы */
.select-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
select, .select-wrap input { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row .grow { flex: 1 1 260px; }
.till-info { display: flex; flex-direction: column; gap: 4px; min-height: 40px; justify-content: flex-end; }

/* Каталог */
.score { display: inline-block; width: 64px; height: 8px; }
.score .fill { display: block; }
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo { aspect-ratio: 3 / 4; max-width: 100%; border-radius: 8px; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.photo.has { border-style: solid; background: var(--surface-2); color: var(--ink); }
.checklist { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.check-row { display: flex; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

/* Аналитика */
.curve { display: flex; gap: 12px; align-items: flex-end; min-height: 220px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.curve-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.curve-bars { display: flex; gap: 4px; align-items: flex-end; height: 164px; }
.cbar { width: 22px; border-radius: 4px 4px 0 0; }
.cbar.demand, .swatch.demand { background: var(--ink); }
.cbar.stock, .swatch.stock { background: var(--accent); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* Настройки */
.access { min-width: 900px; }
.access th { vertical-align: bottom; }
.vert { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; }
.access input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ИИ-помощник */
.ai-fab { position: fixed; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(194, 24, 91, 0.35); display: flex; align-items: center; justify-content: center; z-index: 21; }
.ai-panel { position: fixed; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 400px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; z-index: 20; font-size: 14px; }
@media (max-width: 480px) { .ai-panel { right: 16px; left: 16px; width: auto; } .ai-fab { right: 16px; } }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--nav); color: var(--nav-ink); }
.ai-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ai-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-title span { font-size: 12px; color: var(--nav-muted); }
.icon-btn { width: 36px; height: 36px; border: none; border-radius: 8px; background: var(--nav-active); color: var(--nav-ink); font-size: 18px; flex: none; }
.ai-tier { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ai-tier .seg button { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.ai-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 16px; }
.ai-body.chat { gap: 10px; }
.ai-group { display: flex; flex-direction: column; gap: 8px; }
.sugg { text-align: left; padding: 10px 12px; min-height: 44px; border: 1px solid var(--accent-soft); border-radius: 10px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.session { text-align: left; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.bubble { max-width: 90%; padding: 10px 12px; border-radius: 12px; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.bubble.err { background: var(--warn-bg); color: var(--warn-fg); }
.thinking { color: var(--muted); }
.md { display: flex; flex-direction: column; gap: 6px; }
.md ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.md-head { font-weight: 700; }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-input input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ai-input .btn { min-width: 48px; }

/* Каналы продаж */
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.stack-part { height: 100%; }
.stack-part.ink, .swatch.ink { background: var(--ink); }
.stack-part.accent, .swatch.accent { background: var(--accent); }
.stack-part.bar, .swatch.bar { background: var(--bar); }
.ch-list { display: flex; flex-direction: column; gap: 8px; }
.ch-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; font-size: 14px; }
