/* ==========================================================================
   Coffee Dream · кабинет сети. Вид «Дрим» (03.10.2026).
   Светлая тема основная, тёмная «ночное синее небо». Токены здесь, компоненты вида — в dream.css.
   ========================================================================== */

/* Стамп «Дрим» (03.10.2026, выбран Рахманом из четырёх вариантов: «дрим победил»; до него был «Стол»
   06.09–03.10, петроль hue 210). Регистр продукт, бренд заметнее: тёмно-синий логотипа (hue 258) держит крупные
   плоскости — рельс, полосу раздела и вход сделаны из синей ткани (img/fabric-velvet.webp); ярко-синий Дримчека —
   действие, выбор и фокус. Персонаж Дримчек ведёт по делам и живёт в рабочих моментах (img/dreamchek/*.webp).
   Шрифты: Unbounded (заголовки и крупные суммы) + Onest (всё остальное; цифры табличные, у Onest они есть, у
   Unbounded нет — поэтому суммы в таблицах Onest). Ночь — синее небо, не чёрный экран: глубина светлотой слоёв,
   действие в ночи светлое с тёмным текстом (акцент служит и заливкой кнопки, и цветом ссылки). Паспорт — DESIGN.md. */
:root {
  --h: 258;

  --bg:        oklch(96.9% .012 252);
  --bg-deep:   oklch(94.4% .017 252);
  --surface:   oklch(99.75% .003 252);
  --surface-2: oklch(97.3% .01 252);
  --line:      oklch(90.6% .017 252);
  --line-soft: oklch(93.9% .012 252);

  --ink:      oklch(24% .065 258);
  --ink-2:    oklch(37% .055 258);
  --ink-3:    oklch(48% .042 258);
  --ink-4:    oklch(54% .032 258);

  --navy:        oklch(30.5% .115 258);
  --dream:       oklch(58% .19 259);
  --accent:      oklch(54% .19 259);
  --accent-ink:  oklch(99.5% .005 259);
  --accent-soft: oklch(94.2% .038 259);
  --accent-line: oklch(84% .075 259);
  --accent-edge: oklch(42% .17 259);
  --accent-strong: oklch(47% .18 259);   /* текст на светло-синей плашке: 4,5:1 и выше */
  --warn-strong: oklch(47% .12 62);      /* охра текстом на светлой плашке */
  --ok:          oklch(50% .12 155);  --ok-soft:   oklch(95.2% .04 155);
  --warn:        oklch(54% .13 62);   --warn-soft: oklch(95.6% .045 80);
  --risk:        oklch(54% .19 25);   --risk-soft: oklch(95.2% .03 25);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 18px;
  --r-xl: 22px;
  --rail: 272px;
  --topbar: 64px;

  --shadow-1:     0 1px 2px oklch(25% .06 258 / .06);
  --shadow-pop:   0 18px 40px -18px oklch(22% .09 258 / .42), 0 1px 3px oklch(22% .09 258 / .1);
  --shadow-modal: -30px 0 70px -40px oklch(15% .08 258 / .55);

  --ease:        cubic-bezier(.16, 1, .3, 1);
  --ease-inout:  cubic-bezier(.65, 0, .35, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --fast: 120ms;
  --mid:  220ms;
  --slow: 340ms;

  --font-ui: "Onest", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Onest", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Onest", "Segoe UI", system-ui, sans-serif;
  --display-weight: 600;
  --display-track: -0.015em;

  /* плоскости из ткани: рельс, полоса раздела, вход */
  --fabric: url("img/fabric-velvet.webp");
  --band-tint: linear-gradient(115deg, oklch(33% .12 258 / .5), oklch(22% .09 258 / .78));
  --band-ink: oklch(99.5% .003 252);
  --band-ink-2: oklch(100% 0 0 / .8);

  --rail-bg: var(--navy);
  --rail-line: oklch(100% 0 0 / .12);
  --rail-ink: oklch(99% .004 252);
  --rail-ink-2: oklch(100% 0 0 / .8);
  --rail-ink-3: oklch(100% 0 0 / .56);
  --rail-active-bg: oklch(99.7% .003 252);
  --rail-active-ink: var(--navy);
  --rail-tint: linear-gradient(180deg, oklch(31% .115 258 / .5), oklch(21% .09 258 / .86));

  --tab-bg: var(--surface);
  --scrim: oklch(20% .07 258 / .45);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:        oklch(18.5% .045 258);
  --bg-deep:   oklch(16% .04 258);
  --surface:   oklch(22.5% .05 258);
  --surface-2: oklch(25.5% .052 258);
  --line:      oklch(32% .05 258);
  --line-soft: oklch(28% .048 258);

  --ink:      oklch(95.5% .012 255);
  --ink-2:    oklch(86% .02 255);
  --ink-3:    oklch(73% .03 255);
  --ink-4:    oklch(64% .035 255);

  --navy:        oklch(27% .095 258);
  --dream:       oklch(70% .15 259);
  --accent:      oklch(77% .12 259);
  --accent-ink:  oklch(21% .08 258);
  --accent-soft: oklch(31% .08 259);
  --accent-line: oklch(45% .1 259);
  --accent-edge: oklch(58% .12 259);
  --accent-strong: var(--accent);
  --warn-strong: var(--warn);
  --ok:          oklch(79% .13 155);  --ok-soft:   oklch(30% .06 155);
  --warn:        oklch(82% .13 75);   --warn-soft: oklch(32% .065 70);
  --risk:        oklch(75% .15 22);   --risk-soft: oklch(31% .08 22);

  --shadow-1:     none;
  --shadow-pop:   0 18px 44px -16px oklch(6% .03 258 / .8), 0 1px 3px oklch(6% .03 258 / .4);
  --shadow-modal: -30px 0 70px -36px oklch(5% .03 258 / .9);

  --band-tint: linear-gradient(115deg, oklch(20% .07 258 / .66), oklch(13% .05 258 / .86));
  --rail-bg: oklch(14.5% .04 258);
  --rail-line: oklch(100% 0 0 / .08);
  --rail-active-bg: oklch(31% .1 258);
  --rail-active-ink: oklch(97% .01 258);
  --rail-tint: linear-gradient(180deg, oklch(16% .05 258 / .8), oklch(11% .035 258 / .92));

  --tab-bg: oklch(20.5% .048 258);
  --scrim: oklch(8% .03 258 / .62);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--mid) var(--ease), color var(--mid) var(--ease);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.num { letter-spacing: -0.02em; }

/* ============================ каркас ============================ */

.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100dvh;
}

/* --- боковая навигация --- */
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--rail-bg);
  color: var(--rail-ink);
  border-right: 1px solid var(--rail-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--rail-line);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-sub { font-size: 11px; color: var(--rail-ink-3); white-space: nowrap; }

.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 10px 18px;
  position: relative;
  scrollbar-width: thin;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.nav-group { margin: 12px 0 4px; }
.nav-group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--rail-ink-3);
  padding: 0 10px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-m);
  background: transparent;
  color: var(--rail-ink-2);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .78; }
.nav-item span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--rail-ink-3);
  border: 1px solid var(--rail-line);
  border-radius: 20px;
  padding: 1px 6px;
}
@media (hover: hover) {
  .nav-item:hover { background: var(--rail-active-bg); color: var(--rail-ink); }
  .nav-item:hover svg { opacity: 1; }
}
.nav-item.is-active {
  background: var(--rail-active-bg);
  color: var(--rail-ink);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--rail-line);
}
.nav-item.is-active svg { opacity: 1; color: var(--accent); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rail-foot {
  border-top: 1px solid var(--rail-line);
  padding: 12px 14px 14px;
  font-size: 11px;
  color: var(--rail-ink-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-foot .live { display: flex; align-items: center; gap: 7px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 18%, transparent);
}

/* --- верхняя панель --- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);   /* Safari до 18 знает только с приставкой (Лера, Safari 16.6) */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.burger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); cursor: pointer;
  place-items: center;
}
.crumbs { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.crumbs b { color: var(--ink); font-weight: 500; }
.topbar-spacer { flex: 1 1 auto; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.pill svg { width: 14px; height: 14px; opacity: .7; }
@media (hover: hover) { .pill:hover { border-color: var(--accent-line); color: var(--ink); } }
.pill:active { transform: scale(.975); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pill.is-open { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.pill .swatch { width: 8px; height: 8px; border-radius: 3px; }
.pill b { font-weight: 500; color: var(--ink); }

.demo-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid color-mix(in oklab, var(--warn) 24%, transparent);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* выпадающие меню */
.menu {
  position: absolute; top: calc(var(--topbar) - 8px); z-index: 60;
  min-width: 232px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.985);
  pointer-events: none;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-4); padding: 8px 10px 6px;
}
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 0; border-radius: var(--r-s);
  background: transparent; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--ink-2);
}
.menu-item small { display: block; font-size: 11px; color: var(--ink-4); }
@media (hover: hover) { .menu-item:hover { background: var(--surface-2); color: var(--ink); } }
.menu-item.is-on { color: var(--ink); font-weight: 500; }
.menu-item.is-on::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ============================ контент ============================ */

.screen { padding: 24px 22px 60px; max-width: 1420px; }

.screen-head { margin-bottom: 20px; }
.screen-kicker {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 8px;
}
.screen-head h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: 1.12;
}
.screen-head p { color: var(--ink-2); margin-top: 8px; max-width: 74ch; font-size: 13.5px; }

/* сетки */
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, .62fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* карточка */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px;
  min-width: 0;
  transition: border-color var(--fast) var(--ease);
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card.tint { background: var(--surface-2); }
@media (hover: hover) { .card.hoverable:hover { border-color: var(--accent-line); transform: translateY(-1px); } }

.card-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 13.5px; font-weight: 600; }
.card-head .sub { font-size: 11.5px; color: var(--ink-3); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4);
}

/* главное число */
.hero-metric { display: flex; flex-direction: column; gap: 6px; }
.hero-value {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-value small { font-size: .42em; color: var(--ink-3); font-weight: 400; letter-spacing: 0; margin-left: 6px; }

.metric-row { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 4px; }
.metric { min-width: 96px; }
.metric .v {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px;
}
.metric .v span.unit { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.metric .k { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.delta { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--risk); }
.delta.flat { color: var(--ink-3); }

/* бейджи и чипы */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px; line-height: 1.35;
  border: 1px solid var(--line);
  color: var(--ink-2); background: var(--surface-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge .glyph { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok   { color: var(--ok);   background: var(--ok-soft);   border-color: color-mix(in oklab, var(--ok) 22%, transparent); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 24%, transparent); }
.badge.risk { color: var(--risk); background: var(--risk-soft); border-color: color-mix(in oklab, var(--risk) 24%, transparent); }
.badge.acc  { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 20px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; touch-action: manipulation;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--ink-4); color: var(--ink); } }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip:active { transform: scale(.97); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* кнопки — один словарь на весь кабинет:
   primary  заливка медью: главное действие экрана, одно на экран;
   .btn     рамка: вторичные действия;
   .ghost   без рамки: закрыть, назад, отмена;
   .danger  красный текст и рамка: снять, удалить (в конце ряда, не рядом с главной).
   Иконка 16px слева говорит, что произойдёт; ярлык = глагол результата. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; touch-action: manipulation;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--ink-4); background: var(--surface-2); } }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .14);
}
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, black); border-color: color-mix(in oklab, var(--accent) 88%, black); }
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; } }
.btn.danger, .btn.ghost.danger {
  color: var(--risk); border-color: color-mix(in oklab, var(--risk) 32%, transparent); background: var(--surface);
}
@media (hover: hover) and (pointer: fine) { .btn.danger:hover, .btn.ghost.danger:hover { background: var(--risk-soft); border-color: var(--risk); } }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; }
}

/* таблицы */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
table.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl td.num, table.tbl td.money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
table.tbl tr.clickable { cursor: pointer; }
@media (hover: hover) { table.tbl tbody tr:hover { background: var(--surface-2); } }
table.tbl tfoot td {
  border-top: 1px solid var(--line);
  font-weight: 600;
  background: var(--surface-2);
}
.t-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.t-name .swatch { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }
.t-name .who { min-width: 0; }
.t-name .who b { font-weight: 500; display: block; }
.t-name .who small { color: var(--ink-3); font-size: 11.5px; }
.neg { color: var(--risk); }
.pos { color: var(--ok); }

/* прогресс и мини-графика */
.bar { height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 4px;
  background: var(--accent);
  width: 100%; transform: scaleX(0); transform-origin: left;
  transition: transform var(--slow) var(--ease);
}
.bar.ok > i   { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.risk > i { background: var(--risk); }

.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--ink-4); font-size: 9.5px; font-family: var(--font-mono); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.prev { stroke: var(--ink-4); stroke-width: 1.5; stroke-dasharray: 3 4; }
.chart .area { fill: url(#fadeAccent); opacity: .5; }
.chart .col { fill: var(--accent); opacity: .82; transition: opacity var(--fast) var(--ease); }
.chart .col.dim { fill: var(--ink-4); opacity: .5; }
@media (hover: hover) { .chart .col:hover { opacity: 1; } }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }

/* столбцы днями блоками: подписи не тянутся вместе с холстом */
.colchart { display: flex; align-items: stretch; gap: 3px; width: 100%; }
.colchart.dense { gap: 2px; }
.colchart .col-item {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
}
.colchart .col-track { flex: 1; display: flex; align-items: flex-end; min-height: 0; }
.colchart .col-track > i {
  display: block; width: 100%; background: var(--accent); opacity: .82;
  border-radius: 3px 3px 2px 2px; transform-origin: center bottom;
  animation: grow 620ms var(--ease) both;
  transition: opacity var(--fast) var(--ease);
}
.colchart .col-item.dim .col-track > i { background: var(--ink-4); opacity: .5; }
@media (hover: hover) { .colchart .col-item:hover .col-track > i { opacity: 1; } }
.colchart .col-lab {
  height: 15px; padding-top: 4px; text-align: center;
  font: 400 9.5px/1 var(--font-mono); color: var(--ink-4);
  white-space: nowrap; overflow: hidden;
}

.spark { width: 100%; height: 34px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; }
.spark path.flatline { stroke: var(--ink-4); }

/* списки-события */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 11px; padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.feed-item:last-child { border-bottom: 0; }
.feed-item .when {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink-4); width: 46px; flex: 0 0 auto; padding-top: 1px;
}
.feed-item .body { min-width: 0; }
.feed-item .body b { font-weight: 500; }
.feed-item .body p { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.feed-item .mark { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--ink-4); }
.feed-item.ok .mark { background: var(--ok); }
.feed-item.warn .mark { background: var(--warn); }
.feed-item.risk .mark { background: var(--risk); }

/* «зачем это лучше таблицы» */
.why {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface-2);
  overflow: hidden;
}
.why-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.why-head h3 { font-size: 13.5px; }
.why-head .label { margin-left: auto; }
.why-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.why-col { padding: 15px 16px 17px; border-right: 1px solid var(--line-soft); }
.why-col:last-child { border-right: 0; }
.why-col h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); margin-bottom: 9px; font-weight: 500;
}
.why-col.now h4 { color: var(--ok); }
.why-col.next h4 { color: var(--accent); }
.why-col.gap h4 { color: var(--warn); }
.why-col ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.why-col li { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; line-height: 1.45; }
.why-col li::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-4); margin-top: 7px; flex: 0 0 auto;
}
.why-col.now li::before { background: var(--ok); }
.why-col.next li::before { background: var(--accent); }
.why-col.gap li::before { background: var(--warn); }

/* пустое состояние */
.empty {
  padding: 34px 20px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--r-l);
}
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 5px; }

/* чек-лист */
.check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; user-select: none;
}
.check:last-child { border-bottom: 0; }
.check .box {
  width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--line); flex: 0 0 auto; margin-top: 1px;
  display: grid; place-items: center;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.check .box svg { width: 11px; height: 11px; opacity: 0; transform: scale(.6); transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease); color: #fff; }
.check.done .box { background: var(--ok); border-color: var(--ok); }
.check.done .box svg { opacity: 1; transform: none; }
.check.done .txt { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line); }
.check .txt { font-size: 13px; }
@media (hover: hover) { .check:hover .box { border-color: var(--accent); } }

/* модальное окно */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: oklch(18% .015 var(--h) / .5);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--mid) var(--ease);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(660px, 100%);
  max-height: min(88dvh, 800px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  transform: translateY(18px) scale(.985);
  transition: transform var(--slow) var(--ease-drawer);
}
.overlay.is-open .modal { transform: none; }
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 17px 18px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head h3 { font-size: 15px; }
.modal-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.modal-head .x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.modal-body { padding: 16px 18px 18px; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 13px 18px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: var(--surface);
}

/* тосты */
.toasts {
  position: fixed; z-index: 120; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
  padding-bottom: env(safe-area-inset-bottom);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-m);
  padding: 11px 14px; font-size: 13px; line-height: 1.4;
  box-shadow: var(--shadow-pop);
  animation: toast-in 400ms var(--ease) both;
  max-width: min(360px, calc(100vw - 36px));
}
.toast .glyph { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.toast.leaving { animation: toast-out var(--fast) var(--ease) both; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(6px) scale(.98); } }

/* появление контента */
.enter { animation: enter-x var(--slow) var(--ease) both; }
@keyframes enter-x {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise var(--slow) var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.screen > * { animation: rise var(--mid) var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: 35ms; }
.screen > *:nth-child(3) { animation-delay: 70ms; }
.screen > *:nth-child(n+4) { animation-delay: 100ms; }

.count { display: inline-block; }

/* мелкие утилиты */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt-s { margin-top: 8px; }
.mt-m { margin-top: 14px; }
.mt-l { margin-top: 22px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }
.divider { height: 1px; background: var(--line-soft); margin: 12px 0; }
.nowrap { white-space: nowrap; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px; color: var(--ink-3);
  background: var(--surface-2);
}

/* мозаика ролей в настройках */
.matrix { overflow-x: auto; }
.matrix table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; white-space: nowrap; }
.matrix th { font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.matrix .yes { color: var(--ok); }
.matrix .no  { color: var(--ink-4); }
.matrix .part { color: var(--warn); }

/* ====================== рабочий реестр: инструмент ======================= */

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 16px 0;
}
.toolbar .search {
  display: flex; align-items: center; gap: 7px; flex: 1 1 260px; min-width: 200px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink-3);
}
.toolbar .search input {
  border: 0; background: none; width: 100%;
  font: 400 12.5px/1 var(--font-ui); color: var(--ink);
}
.toolbar .search:focus-within { border-color: var(--accent); outline: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); outline-offset: 0; }
.toolbar .search input:focus { outline-color: transparent; }
.cell-input {
  height: 30px; max-width: 100%; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 400 12.5px/1 var(--font-ui); color: var(--ink);
}
.cell-input:focus { border-color: var(--accent); outline: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); outline-offset: 0; }

/* ячейка, которую можно править прямо в таблице */
.cell-ed { cursor: text; border-bottom: 1px dashed transparent; transition: border-color var(--fast) var(--ease); }
.cell-ed:hover { border-bottom-color: var(--accent-line); }
.cell-ed.strong { font-weight: 500; }
.cell-ed input, .cell-ed select { width: 100%; }
.art-pill {
  display: inline-block; max-width: 190px; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink);
  font-size: 11.5px; line-height: 1.35; cursor: pointer;
}
.art-pill.empty { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 26%, transparent); color: var(--warn); }
.warn-txt { color: var(--warn); }

.pickcell { width: 34px; }
.pickbox {
  width: 17px; height: 17px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.pickbox:hover { border-color: var(--accent); }
.pickbox.on { background: var(--accent); border-color: var(--accent); }

table.reg td { vertical-align: middle; }
table.reg tr.is-picked td { background: var(--accent-soft); }
table.reg tr.is-edited td:first-child { box-shadow: inset 2px 0 0 var(--ok); }
table.reg tfoot td { border-top: 1px solid var(--line); font-weight: 500; background: var(--surface-2); }
.w-name { min-width: 210px; max-width: 340px; }
.dot-pt { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.rowacts { white-space: nowrap; opacity: .35; transition: opacity var(--fast) var(--ease); }
tr:hover .rowacts { opacity: 1; }
.icon-btn {
  width: 25px; height: 25px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn.danger:hover { color: var(--risk); border-color: color-mix(in oklab, var(--risk) 30%, transparent); }

/* шапка таблицы держится при прокрутке, как закреплённая строка в таблице */
.tbl-wrap thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
table.reg tfoot td { position: sticky; bottom: 0; z-index: 3; }
.th-sort {
  border: 0; background: none; padding: 0; cursor: pointer; color: inherit;
  font: inherit; text-transform: inherit; letter-spacing: inherit;
}
.th-sort:hover { color: var(--accent); }
tr.daysep td {
  background: var(--surface-2); padding: 5px 12px;
  font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}
tr.daysep td .num { color: var(--ink); font-weight: 500; margin-right: 10px; }

.bulkbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 16px 0; padding: 9px 12px;
  border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft);
}

/* табель: дни узкими колонками, имя и итог держатся по краям */
table.tabel { font-size: 12px; }
table.tabel .daycol { text-align: center; padding: 7px 3px; font-size: 10.5px; white-space: nowrap; }
table.tabel .daycol .wd { display: block; font-size: 9px; color: var(--ink-4); font-weight: 400; }
table.tabel .daycell { text-align: center; padding: 5px 3px; min-width: 34px; }
table.tabel .wknd { background: var(--surface-2); }
table.tabel .stick {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  min-width: 128px; box-shadow: 1px 0 0 var(--line-soft);
}
table.tabel thead .stick { background: var(--surface-2); z-index: 4; }
table.tabel tbody td:last-child, table.tabel tfoot td:last-child, table.tabel thead th:last-child {
  position: sticky; right: 0; background: var(--surface); box-shadow: -1px 0 0 var(--line-soft); z-index: 2;
}
table.tabel thead th:last-child { background: var(--surface-2); z-index: 4; }
table.tabel tfoot td { position: sticky; bottom: 0; background: var(--surface-2); z-index: 3; font-weight: 500; }
table.tabel tfoot tr:first-child td { bottom: 25px; }
table.tabel tfoot .stick { z-index: 5; background: var(--surface-2); }
table.tabel tfoot tr.tiny td { font-weight: 400; color: var(--ink-3); font-size: 11px; }
table.tabel .changed .cell-ed { color: var(--ok); font-weight: 500; }

.q-item { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.q-item:last-child { border-bottom: 0; padding-bottom: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld > span { font-size: 11px; color: var(--ink-3); }
.fld input, .fld select {
  height: 32px; padding: 0 9px; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 400 13px/1 var(--font-ui); color: var(--ink);
}
.fld input:focus, .fld select:focus { border-color: var(--accent); outline: 2px solid color-mix(in oklab, var(--accent) 55%, transparent); outline-offset: 0; }

/* ===================== сравнение, ценность, пояснения ==================== */

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

.qmark {
  width: 15px; height: 15px; padding: 0; margin-left: 2px;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3);
  font-size: 10px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.qmark:hover { border-color: var(--accent); color: var(--accent); }

table.cmp-tbl td.cmp { font-variant-numeric: tabular-nums; }
table.cmp-tbl td.best { color: var(--ok); font-weight: 500; background: color-mix(in oklab, var(--ok) 7%, transparent); }
table.cmp-tbl td.worst { color: var(--risk); background: color-mix(in oklab, var(--risk) 6%, transparent); }
table.cmp-tbl th .t-name b { font-weight: 500; }

.valcard {
  padding: 13px 14px; border: 1px solid var(--line-soft);
  border-radius: var(--r-m); background: var(--surface-2);
}
.valnum {
  font-size: 22px; font-weight: 500; letter-spacing: -0.02em;
  color: var(--accent); margin-bottom: 4px;
}

.tour-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left;
  padding: 11px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.tour-item:hover { border-color: var(--accent-line); background: var(--surface-2); }
.tour-item b { display: block; font-size: 13px; font-weight: 500; }
.tour-item small { display: block; color: var(--ink-3); font-size: 11.5px; line-height: 1.45; margin-top: 2px; }
.tour-item svg { margin-left: auto; color: var(--ink-4); transform: rotate(-90deg); flex: 0 0 auto; }
.tour-n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}

/* ======================= читалка про чужую систему ======================= */

.dodo-card { padding: 0; overflow: hidden; }
.dodo-head {
  width: 100%; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 0; background: transparent; cursor: pointer; text-align: left;
  transition: background var(--fast) var(--ease);
}
.dodo-head:hover { background: var(--surface-2); }
.dodo-num {
  flex: 0 0 auto; min-width: 34px; padding: 2px 7px; border-radius: 7px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font: 500 11px/1.5 var(--font-mono); text-align: center;
}
.dodo-title { flex: 1 1 auto; min-width: 0; }
.dodo-title b { display: block; font-size: 13.5px; font-weight: 500; }
.dodo-title small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.45; margin-top: 3px; }
.dodo-meta { flex: 0 0 auto; padding-top: 3px; }
.dodo-chev { flex: 0 0 auto; color: var(--ink-3); transition: transform var(--mid) var(--ease); padding-top: 2px; }
.dodo-card.is-open .dodo-chev { transform: rotate(180deg); }
.dodo-card.is-open { border-color: var(--accent-line); }
.dodo-body { padding: 0 16px 16px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.dodo-body .apply {
  padding: 10px 12px; border-radius: var(--r-s); background: color-mix(in oklab, var(--ok-soft) 70%, transparent);
}
.mod { padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-m); background: var(--surface-2); }

.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.tl-item:last-child { border-bottom: 0; }
.tl-year { flex: 0 0 118px; font-size: 11.5px; color: var(--accent); padding-top: 1px; }
.tl-item.ours .tl-year { color: var(--ok); }
.tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
ul.plain li { display: flex; gap: 9px; color: var(--ink-2); line-height: 1.5; }
ul.plain li::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-top: 8px; flex: 0 0 auto;
}

/* ============================ адаптив ============================ */

@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-hero, .g-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  :root { --rail: 72px; }
  .brand-text, .nav-item span, .nav-item .tag, .nav-group-title, .rail-foot span.txt { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item.is-active::before { left: 0; }
  .brand { justify-content: center; padding: 16px 0 14px; }
  .rail-foot { align-items: center; padding: 12px 0; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --rail: 0px; --topbar: 56px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 100; left: 0; top: 0;
    width: 258px; --rail: 258px;
    transform: translateX(-100%);
    transition: transform var(--mid) var(--ease);
    box-shadow: 0 0 60px -20px rgba(0, 0, 0, .4);
  }
  .rail .brand-text, .rail .nav-item span, .rail .nav-group-title, .rail .rail-foot span.txt { display: block; }
  .rail .nav-item { justify-content: flex-start; padding: 9px 10px; }
  .rail .brand { justify-content: flex-start; padding: 16px 18px 14px; }
  .rail-foot { align-items: flex-start; padding: 12px 14px; }
  body.nav-open .rail { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; z-index: 90;
    background: rgba(20, 17, 14, .42);
  }
  .burger { display: grid; }
  .screen { padding: 16px 14px 60px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .why-cols { grid-template-columns: minmax(0, 1fr); }
  .why-col { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .why-col:last-child { border-bottom: 0; }
  .crumbs .hide-s { display: none; }
  .demo-flag, #tour-btn { display: none; }
  .menu { left: 12px; right: 12px; min-width: 0; }
  .toasts { left: 14px; right: 14px; align-items: stretch; }
  .toast { max-width: none; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 9px 10px; }
  .hero-value { font-size: 32px; }
}

/* карточки вместо таблицы на узком экране */
@media (max-width: 620px) {
  .tbl-cards table.tbl thead { display: none; }
  .tbl-cards table.tbl, .tbl-cards table.tbl tbody, .tbl-cards table.tbl tfoot { display: block; }
  .tbl-cards table.tbl tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px;
    padding: 12px; border-bottom: 1px solid var(--line-soft);
  }
  .tbl-cards table.tbl td { border: 0; padding: 0; text-align: left; }
  .tbl-cards table.tbl td:first-child { grid-column: 1 / -1; margin-bottom: 2px; }
  .tbl-cards table.tbl td[data-k]::before {
    content: attr(data-k);
    display: block; font-size: 10.5px; letter-spacing: .04em;
    text-transform: uppercase; color: var(--ink-4); margin-bottom: 1px;
  }
  .tbl-cards table.tbl td:first-child::before { content: none; }
  .tbl-cards table.tbl td.money, .tbl-cards table.tbl td.num { text-align: left; }
  .tbl-cards table.tbl tfoot tr { background: var(--surface-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}

/* анимации графики */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }

/* карточки в боковой сетке не растягиваются под соседа */
.g-side, .g-hero { align-items: start; }

/* топбар на телефоне: одна строка, без переносов */
.crumbs b, .pill b { white-space: nowrap; }
@media (max-width: 760px) {
  .topbar { gap: 7px; padding: 0 12px; }
  .pill { height: 32px; padding: 0 9px; font-size: 12px; }
  .pill svg:last-child { margin-left: -2px; }
}
@media (max-width: 480px) {
  .crumbs { display: none; }
  .topbar-spacer { flex: 0 0 auto; }
}

/* шапки карточек на телефоне переносятся, а не сжимаются в столбик букв */
@media (max-width: 760px) {
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-head h3 { flex: 0 1 auto; }
  .card-head .sub { flex: 1 1 100%; order: 3; }
  .card-head .right { order: 2; margin-left: auto; flex-wrap: wrap; row-gap: 6px; }
  .screen-head p { font-size: 13px; }
}

/* бейдж-кнопка с пояснением про данные */
button.demo-flag { cursor: pointer; font-family: inherit; }
@media (hover: hover) { button.demo-flag:hover { background: color-mix(in oklab, var(--warn) 18%, transparent); } }
button.demo-flag:active { transform: scale(.97); }

/* поля с автозаполнением браузера остаются в нашей палитре */
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset; -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink); transition: background-color 9999s ease-out;
}

/* дописать строку, которой нет в таблице документа (доставка, тара, услуга) */
.addline { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.addline > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px; list-style: none; }
.addline > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .addline > summary:hover { color: var(--ink); } }
.addline-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.addline-row { display: grid; grid-template-columns: 2fr .7fr .6fr 1fr; gap: 6px; }
#sheet-body .addline-row input, .addline-row input { height: 34px; font-size: 13px; padding: 0 8px; }
@media (max-width: 760px) { .addline-row { grid-template-columns: 1fr 1fr; } }
