/* Склад — mobile-first. Крупные цели нажатия, высокий контраст, тёмная тема. */
:root {
  --bg: #f4f5f7; --card: #fff; --text: #14161a; --muted: #6b7280; --line: #e3e5e9;
  --accent: #2563eb; --accent-ink: #fff; --accent-soft: #e8efff;
  --ok: #16a34a; --ok-soft: #e7f6ec; --low: #d97706; --low-soft: #fdf3e2; --out: #dc2626; --out-soft: #fdecec;
  --none: #9ca3af; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --tabbar: 64px;
  /* Категориальная палитра (цвет склада). Проверена на CVD/контраст против #fff и #181b21. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  /* Последовательная шкала (интенсивность), один тон: светлый → тёмный */
  --q0: #eef0f3; --q1: #b7d3f6; --q2: #6da7ec; --q3: #2a78d6; --q4: #184f95;
  /* Оформление графиков */
  --grid: #e9eaee; --axis: #c9ccd3; --ink-2: #52514e; --ink-3: #898781;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b21; --text: #eceef2; --muted: #9aa1ad; --line: #2a2e36;
    --accent: #5b8cff; --accent-soft: #1d2a48; --ok-soft: #12291b; --low-soft: #33250f; --out-soft: #3a1717;
    --shadow: none; color-scheme: dark;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --q0: #22262e; --q1: #1c5cab; --q2: #2a78d6; --q3: #5598e7; --q4: #9ec5f4;
    --grid: #262a32; --axis: #383d47; --ink-2: #c3c2b7; --ink-3: #898781;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0; line-height: 1.2; }
h2 { font-size: 17px; margin: 22px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 12px; }

/* Верхняя панель */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
}
.topbar .row { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { font-size: 26px; line-height: 1; padding: 4px 8px 4px 0; color: var(--text); }
.wh-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }

/* Нижняя навигация как в приложении */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar nav { display: flex; max-width: 760px; margin: 0 auto; }
.tabbar a {
  flex: 1; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 11px; position: relative;
}
.tabbar a .ico { font-size: 22px; line-height: 1; }
.tabbar a.on { color: var(--accent); font-weight: 600; }
.tabbar .badge {
  position: absolute; top: 8px; left: 50%; margin-left: 6px; background: var(--out); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 9px; padding: 1px 5px; min-width: 18px; text-align: center;
}

/* Карточки и списки */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card + .card { margin-top: 10px; }
.pad { padding: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }

/* Сообщения */
.flash { margin: 10px 0; padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--out-soft); color: var(--out); }
.flash.info, .flash.warning { background: var(--low-soft); color: var(--low); }

/* Сводка склада */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; display: block; color: var(--text); }
.stat b { display: block; font-size: 24px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.out b { color: var(--out); } .stat.low b { color: var(--low); }
.stat.on { outline: 2px solid var(--accent); }

/* Поиск */
.search { position: sticky; top: calc(env(safe-area-inset-top) + 58px); z-index: 15; padding: 8px 0; background: var(--bg); }
.search input {
  width: 100%; font-size: 17px; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239aa1ad' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 13px 50%;
  color: var(--text);
}

/* Группа */
.group-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 6px; }
.group-h h2 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.group-h a { font-size: 14px; }

/* Строка позиции */
.item-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; }
.item-row .thumb {
  width: 44px; height: 44px; border-radius: 10px; flex: none; object-fit: cover; background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted);
}
.item-row .main { flex: 1; min-width: 0; color: var(--text); }
.item-row .name { font-weight: 600; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); transition: width .3s; }
.st-low .bar i { background: var(--low); } .st-out .bar i { background: var(--out); }
.item-row .qty { text-align: right; min-width: 52px; }
.item-row .qty b { font-size: 18px; display: block; line-height: 1.1; }
.item-row .qty small { color: var(--muted); font-size: 12px; }
.st-low .qty b { color: var(--low); } .st-out .qty b { color: var(--out); }
.quick { display: flex; gap: 6px; }
.quick button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  font-size: 22px; font-weight: 600; color: var(--text); padding: 0; touch-action: manipulation;
}
.quick button:active { transform: scale(.94); background: var(--accent-soft); }
.flashrow { animation: flashrow .8s; }
@keyframes flashrow { from { background: var(--accent-soft); } to { background: transparent; } }

/* Статус-бейдж */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.low { background: var(--low-soft); color: var(--low); }
.pill.out { background: var(--out-soft); color: var(--out); }
.pill.none { background: var(--line); color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--low); } .dot.bad { background: var(--out); } .dot.none { background: var(--none); }

/* Кнопки и формы */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; touch-action: manipulation; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.in { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.out { background: var(--out); border-color: var(--out); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--out); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa1ad' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Карточка позиции */
.hero-photo { width: 100%; max-height: 300px; object-fit: contain; background: var(--card); border-radius: var(--radius); display: block; }
.big-qty { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.big-qty small { font-size: 20px; font-weight: 600; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: stretch; margin: 12px 0 8px; }
.stepper button { font-size: 30px; font-weight: 600; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.stepper input { text-align: center; font-size: 28px; font-weight: 700; padding: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 7px 14px; font: inherit; font-size: 15px; color: var(--text); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { white-space: nowrap; }

/* История */
.hist { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.hist .d { font-weight: 700; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.hist .d.plus { color: var(--ok); } .hist .d.minus { color: var(--out); } .hist .d.zero { color: var(--muted); }
.hist .who { flex: 1; min-width: 0; font-size: 14px; }
.hist .who .c { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.hist.cancelled { opacity: .45; } .hist.cancelled .d { text-decoration: line-through; }

/* Недавние */
.recent { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent a { flex: none; max-width: 150px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; color: var(--text); font-size: 13px; }
.recent a b { display: block; font-size: 15px; }

/* Дашборд */
.grid-wh { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .grid-wh { grid-template-columns: 1fr 1fr; } }
.wh-card { display: block; color: var(--text); padding: 14px; border-left: 5px solid var(--accent); }
.wh-card .nums { display: flex; gap: 14px; margin: 8px 0 6px; }
.wh-card .nums div b { font-size: 22px; display: block; line-height: 1.1; }
.wh-card .nums div span { font-size: 12px; color: var(--muted); }
.wh-card .nums .o b { color: var(--out); } .wh-card .nums .l b { color: var(--low); }
.ppl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; }
.ppl .n { flex: 1; min-width: 0; }
.ppl .t { text-align: right; font-size: 13px; }

/* Toast с отменой */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); z-index: 50;
  max-width: 520px; margin: 0 auto; background: #1f2937; color: #fff; border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  transform: translateY(150%); transition: transform .25s;
}
.toast.show { transform: none; }
.toast span { flex: 1; font-size: 15px; }
.toast button { background: none; border: 0; color: #93b4ff; font: inherit; font-weight: 700; padding: 4px; }
.toast.err { background: var(--out); }

/* Пусто */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .e { font-size: 40px; }

/* Вход */
.login { max-width: 380px; margin: 0 auto; padding: 12vh 16px 24px; }
.login .logo { font-size: 48px; text-align: center; }
.login h1 { text-align: center; margin: 8px 0 24px; }

/* Сканер */
.scanbox { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 1; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanbox .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* Этикетки для печати */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.label { background: #fff; color: #000; border: 1px dashed #bbb; border-radius: 8px; padding: 8px; text-align: center; break-inside: avoid; }
.label svg { width: 100%; height: auto; max-width: 140px; }
.label .n { font-weight: 700; font-size: 12px; line-height: 1.2; margin-top: 4px; }
.label .c { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #444; }
@media print {
  body { background: #fff; padding: 0; }
  .topbar, .tabbar, .noprint, .flash { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .labels { grid-template-columns: repeat(4, 1fr); gap: 4mm; }
  .label { border: 1px dashed #999; }
}
.hidden { display: none !important; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; }
table.simple th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; }

/* ================= Графики и аналитика =================
   Тонкие метки, скругление 4px на конце данных, зазор 2px цвета фона между заливками,
   волосяная сетка, подписи — цветом текста (не цветом серии). */
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; margin: 12px 0 4px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 15px; }
.seg a.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.filters { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; }
.filters .chip { font-size: 14px; padding: 6px 12px; white-space: nowrap; }
.filters .chip .wh-dot { width: 8px; height: 8px; margin-right: 5px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
@media (min-width: 620px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k-l { font-size: 13px; color: var(--muted); }
.kpi .k-v { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi .k-v small { font-size: 15px; font-weight: 500; color: var(--muted); }
.kpi .k-d { font-size: 12px; color: var(--muted); }
.kpi .k-d.up { color: var(--ok); } .kpi .k-d.down { color: var(--out); }

.chart-card { padding: 14px; margin-top: 12px; }
.chart-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-h h3 { font-size: 16px; margin: 0; }
.chart-sub { font-size: 12px; color: var(--muted); margin: 3px 0 12px; line-height: 1.35; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend.seq { gap: 4px 8px; align-items: center; }
.empty.small { padding: 14px 4px; text-align: left; }

/* Тултип: значение ведёт, подпись следует; ключ серии — короткая линия */
.ctip { position: fixed; z-index: 60; pointer-events: none; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px; min-width: 120px; max-width: 260px; }
.ctip .t { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ctip .r { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.ctip .r .k { width: 10px; height: 2px; border-radius: 1px; flex: none; background: var(--ink-3); }
.ctip .r b { font-variant-numeric: tabular-nums; }
.ctip .r span { color: var(--ink-2); }
.ctip .f { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 4px; color: var(--ink-2); font-size: 12px; }
[data-tip] { -webkit-tap-highlight-color: transparent; }
.hot { outline: 2px solid var(--text); outline-offset: 1px; border-radius: 3px; }

/* Горизонтальные столбцы: подпись над полосой — удобно на телефоне */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: block; color: inherit; border-radius: 6px; }
.hbar .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.hbar .lbl .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .lbl .v { flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbar .lbl .v b { color: var(--text); }
.hbar .track { display: block; height: 10px; border-left: 1px solid var(--axis); }
.hbar .fill { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; }
.hbar .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.hbar .sub .wh-dot { width: 8px; height: 8px; margin-right: 4px; vertical-align: 0; }
.hbar.hot { outline-offset: 4px; }
.hscale { position: relative; height: 16px; margin-top: 8px; border-top: 1px solid var(--grid); font-size: 11px; color: var(--ink-3); }
.hscale span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.hscale span:first-child { transform: none; } .hscale span:last-child { transform: translateX(-100%); }

/* 100% столбец из сегментов (состояние запасов) */
.hstack { display: flex; gap: 2px; height: 22px; }
.hstack span { display: flex; align-items: center; justify-content: center; min-width: 3px; color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hstack span:first-child { border-radius: 4px 0 0 4px; } .hstack span:last-child { border-radius: 0 4px 4px 0; }
.hstack span:only-child { border-radius: 4px; }

/* Столбцы по времени (сложены по складам) */
.cols, .line { position: relative; height: 150px; margin: 14px 0 0 30px; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.gl.base { border-top-color: var(--axis); }
.gl span { position: absolute; right: 100%; margin-right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.cols .bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.cols .col { flex: 1; display: flex; justify-content: center; align-items: flex-end; border-radius: 4px 4px 0 0; }
.cols .col.hot { outline: none; background: var(--accent-soft); }
.cols .stack { width: 100%; max-width: 24px; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; }
.cols .stack i { display: block; flex: none; }
.cols .stack i:last-child { border-radius: 4px 4px 0 0; }
.xax { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.xax.cols-x { margin-left: 30px; }
.xax span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.xax span.start { transform: none; } .xax span.end { transform: translateX(-100%); }

/* Линия остатка */
.line svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line path.l { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.line path.a { opacity: .1; stroke: none; }
.line .minl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--low); }
.line .minl span { position: absolute; left: 4px; bottom: 1px; font-size: 11px; color: var(--ink-2); background: var(--card); padding: 0 3px; border-radius: 3px; }
.line .dot { position: absolute; right: -5px; width: 10px; height: 10px; border-radius: 50%; transform: translateY(50%); box-shadow: 0 0 0 2px var(--card); }
.line .slices { position: absolute; inset: 0; display: flex; }
.line .slices i { flex: 1; }
.line .slices i.hot { outline: none; }
.xhair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); display: none; pointer-events: none; }
.chart.xh .xhair { display: block; }

/* Тепловая карта сотрудники × дни */
.hm { display: grid; grid-template-columns: minmax(84px, 120px) 1fr; gap: 6px 8px; align-items: center; }
.hm .who { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm .who .wh-dot { width: 8px; height: 8px; margin-right: 4px; vertical-align: 0; }
.hm .cells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.hm .cells i { display: block; height: 18px; border-radius: 3px; }
.hm .xax { margin-top: 0; }
.q0 { background: var(--q0); } .q1 { background: var(--q1); } .q2 { background: var(--q2); }
.q3 { background: var(--q3); } .q4 { background: var(--q4); }
.legend.seq i { border-radius: 2px; }

/* Мини-активность в карточке склада */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; border-bottom: 1px solid var(--axis); margin: 8px 0 2px; }
.spark i { flex: 1; max-width: 14px; border-radius: 2px 2px 0 0; opacity: .85; }
.spark-l { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }

/* Таблица-двойник у каждого графика */
details.tbl { margin-top: 10px; font-size: 13px; }
details.tbl summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; list-style: none; }
details.tbl summary::before { content: "▸ "; } details.tbl[open] summary::before { content: "▾ "; }
details.tbl summary::-webkit-details-marker { display: none; }
.tblwrap { overflow-x: auto; margin-top: 6px; -webkit-overflow-scrolling: touch; }
.tblwrap table { min-width: 100%; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
