/* Финансы дизайн-студии — оформление интерфейса.
   Сделано «от телефона»: сначала мобильная раскладка, затем планшет и компьютер. */

:root {
  color-scheme: light;

  /* Фирменные цвета студии:
     Alice Blue #ECF4F7 — фон, Charcoal #393F4B — текст и тёмные плоскости,
     Burgundy #910029 — акцент. Остальные оттенки выведены из них. */
  --brand-alice: #ecf4f7;
  --brand-charcoal: #393f4b;
  --brand-burgundy: #910029;

  /* Рукописный знак «Line design» — густой бордовый, цвета крови.
     Три оттенка одного цвета: основной, блик сверху и тень снизу.
     Блик намеренно тоже красный, а не белый, иначе знак розовеет. */
  --brand-signature: #910029;
  --signature-hi: #bb1a3f;
  --signature-lo: #48001a;
  /* Экран входа всегда на тёмном фоне, поэтому цвета там свои. */
  --signature-on-dark: #b31235;
  --signature-on-dark-hi: #d9304c;
  --signature-on-dark-lo: #56031a;

  --bg: #ecf4f7;
  --surface: #ffffff;
  --surface-2: #f3f8fa;
  --ink: #252b34;
  --ink-2: #4a5261;
  --muted: #79828f;
  --line: #d9e3e9;
  --accent: #910029;
  --accent-soft: #f8e5ea;
  /* Акцент для текста: в тёмной теме светлее, чтобы читался на тёмном фоне. */
  --accent-text: var(--accent);
  --good: #14795a;
  --good-soft: #e0f2ec;
  --warn: #8a5a00;
  --warn-soft: #fbeeda;
  --danger: #a8102f;
  --danger-soft: #fae7eb;
  --info: #2a6099;
  --info-soft: #e8f0f9;

  /* Цвета графиков проверены на различимость при дальтонизме. */
  --series-1: #2a78d6;
  --series-2: #b3123c;
  --series-3: #8a63d2;

  /* Системный шрифт iPhone: тонкий, современный, отлично читается.
     Inter подхватывается на Android и компьютерах как замена. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Inter", system-ui, "Segoe UI", sans-serif;
  --topbar-h: calc(env(safe-area-inset-top) + 64px);
  /* Рукописный знак студии. Шрифт лежит рядом с приложением,
     поэтому подпись выглядит одинаково на любом устройстве. */
  --font-brand: "Mrs Saint Delafield", "Snell Roundhand", "Apple Chancery", cursive;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -18px rgba(37, 43, 52, 0.45);
  --shadow-lg: 0 24px 60px -24px rgba(37, 43, 52, 0.5);
  --tabbar: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1f26;
    --surface: #242a33;
    --surface-2: #2c333d;
    --ink: #ecf4f7;
    --ink-2: #b9c4ce;
    --muted: #8a95a2;
    --line: #333b46;
    --accent: #c41340;
    --brand-signature: #b31235;
    --signature-hi: #d9304c;
    --signature-lo: #56031a;
    --accent-soft: #3a141f;
    --accent-text: color-mix(in srgb, var(--accent) 62%, #fff);
    --good: #44be97;
    --good-soft: #12302a;
    --warn: #e0a54a;
    --warn-soft: #2c2214;
    --danger: #e4677f;
    --danger-soft: #341a21;
    --info: #6aa9ee;
    --info-soft: #152232;
    --series-1: #4b93e8;
    --series-2: #d1466a;
    --series-3: #9075d4;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1f26;
  --surface: #242a33;
  --surface-2: #2c333d;
  --ink: #ecf4f7;
  --ink-2: #b9c4ce;
  --muted: #8a95a2;
  --line: #333b46;
  --accent: #c41340;
  --brand-signature: #b31235;
  --signature-hi: #d9304c;
  --signature-lo: #56031a;
  --accent-soft: #3a141f;
  --accent-text: color-mix(in srgb, var(--accent) 62%, #fff);
  --good: #44be97;
  --good-soft: #12302a;
  --warn: #e0a54a;
  --warn-soft: #2c2214;
  --danger: #e4677f;
  --danger-soft: #341a21;
  --info: #6aa9ee;
  --info-soft: #152232;
  --series-1: #4b93e8;
  --series-2: #d1466a;
  --series-3: #9075d4;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
}

@font-face {
  font-family: "Mrs Saint Delafield";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/mrs-saint-delafield.woff2") format("woff2");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

/* На телефоне приложение ведёт себя как программа: удержание пальца
   не выделяет текст синим и не показывает лупу с маркерами.
   На компьютере выделение и копирование работают как обычно. */
@media (hover: none) and (pointer: coarse) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }
  input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
  }
}

/* Элементы управления не выделяются нигде, а браузер не ждёт второго
   касания для увеличения — нажатие срабатывает сразу. */
.tabbar__item, .chip, .btn, .fab, .icon-btn, .topbar__back,
.quick__item, .segmented__item, .tabs__item, .row, .stat, .card {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Долгое нажатие на строку списка или вкладку не должно открывать
   предпросмотр ссылки с адресом сервера. На теле страницы одного правила
   iPhone не хватает — нужно указать его и на самих ссылках. */
a, a *, .row, .tabbar__item, .card, .stat, .quick__item {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Двойное нажатие не увеличивает страницу: приложение всегда одного размера. */
  touch-action: manipulation;
}

body {
  font-family: var(--font);
  font-weight: 400;
  /* Долгое нажатие не вызывает системное меню ссылки
     («Открыть», «Скопировать ссылку»): приложение должно вести себя
     как программа, а не как страница в браузере. */
  -webkit-touch-callout: none;
  /* Своя анимация нажатия вместо серой вспышки Safari. */
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  /* экран не «отскакивает» при свайпе вверх-вниз */
  overscroll-behavior-y: none;
}

/* Неподвижная подложка: при переходах между разделами фон остаётся на месте. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 60% at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg);
}

/* Суммы выравниваются по разрядам — столбцы цифр читаются как в таблице. */
.stat__value, .row__amount, .hero__value, table.data td, table.data th,
.breakdown__value, .money-field__row input {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------- каркас */

.app {
  min-height: 100dvh;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 20px);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: env(safe-area-inset-top) 14px 0;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 0.5px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.topbar__back {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 0.5px solid var(--line);
  color: var(--ink-2);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.topbar__back:active { transform: scale(0.86); transition-duration: 0.06s; }
.topbar__back svg { width: 18px; height: 18px; }

.topbar__side {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  flex: 1 1 0;
  /* длинный заголовок обрезается, не доходя до знака студии по центру */
  max-width: calc(50% - 84px);
}
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Внутренний экран: заголовок занимает всю ширину до кнопок, знак студии
   плавно уходит (он остаётся на главных разделах). */
@media (max-width: 719px) {
  .is-inner .topbar__side { max-width: none; }
  .brand { transition: opacity 0.2s ease; }
  .is-inner .brand { opacity: 0; }
}

.topbar__title { min-width: 0; }
.topbar__title h1 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__title span {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Знак студии стоит ровно по центру экрана, независимо от длины заголовка.
   Он намеренно вынесен из шапки: у неё размытие фона, из-за которого
   тонкий рукописный шрифт рисовался мягко и выглядел затуманенным. */
.brand {
  position: fixed;
  z-index: 21;
  left: 50%;
  top: env(safe-area-inset-top);
  height: 64px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}
.brand__name {
  font-family: var(--font-brand);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  /* Глянец: блик по верхней кромке росчерка и уход в тень к низу,
     плюс мягкая тень под буквами — знак выглядит объёмным, как эмаль.
     Обводка своим же цветом делает росчерк чуть плотнее. */
  background-image: linear-gradient(168deg,
    var(--signature-hi) 0%,
    color-mix(in srgb, var(--signature-hi) 55%, var(--brand-signature)) 30%,
    var(--brand-signature) 54%,
    color-mix(in srgb, var(--signature-lo) 60%, var(--brand-signature)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0.5px var(--brand-signature);
  paint-order: stroke fill;
  /* Выпуклость: светлая кромка по верху росчерка, тёмная по низу,
     и мягкая тень, отброшенная на панель. */
  text-shadow:
    0 -0.5px 0 var(--signature-hi),
    0 1px 0.5px var(--signature-lo),
    0 3px 6px rgba(0, 0, 0, 0.55);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 0.5px solid var(--line);
  color: var(--ink-2);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s;
}
.icon-btn:active { transform: scale(0.86); transition-duration: 0.06s; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn--plain { background: none; border: 0; }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.viewport {
  position: relative;
  overflow-x: clip;
  min-height: calc(100dvh - var(--topbar-h) - var(--tabbar));
}

.view {
  /* Снизу место под круглую кнопку «+»: иначе она закрывала последнюю кнопку экрана. */
  padding: 14px 16px 96px;
  max-width: 1040px;
  margin: 0 auto;
  /* вертикальная прокрутка остаётся системной, горизонтальные жесты — наши */
  touch-action: pan-y;
}
.view > * + * { margin-top: 14px; }

/* Соседний раздел во время перелистывания. */
.view--ghost {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  visibility: hidden;
}
.viewport.is-swiping .view--ghost { visibility: visible; }
.viewport.is-animating .view,
.viewport.is-animating .view--ghost {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
  transition-duration: 0.28s; /* переопределяется по остатку пути */
}
/* во время жеста браузер не пересчитывает раскладку соседних слоёв */
.viewport.is-swiping .view,
.viewport.is-swiping .view--ghost { will-change: transform; }

.sync {
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.sync--saving i { background: var(--warn); }
.sync--offline i { background: var(--danger); }

/* ------------------------------------------------------------ навигация */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid color-mix(in srgb, var(--line) 80%, transparent);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px;
  height: var(--tabbar);
  /* подписи опущены ниже — ближе к краю экрана */
  padding-top: 11px;
  font-size: 8.5px;
  font-weight: 500;
  /* шесть вкладок в ряд: разрядку ужимаем, чтобы «Сотрудники» помещались */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), color 0.2s;
}
.tabbar__item:active { transform: scale(0.88); transition-duration: 0.06s; }
.tabbar__item.is-active { color: var(--accent); }
.tabbar__item svg {
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s;
  padding: 5px 13px;
  border-radius: 11px;
  box-sizing: content-box;
}
/* У выбранного раздела иконка подсвечивается подложкой — как на макете. */
.tabbar__item.is-active svg {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item.is-active { color: var(--accent); }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
  z-index: 31;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px; font-weight: 300;
  display: grid; place-items: center;
  box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--accent) 65%, transparent);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.fab:active { transform: scale(0.88); transition-duration: 0.06s; }

/* ---------------------------------------------------------------- карточки */

.card {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  transition: transform 0.34s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.card--flat { box-shadow: none; }
.card > * + * { margin-top: 10px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.section-title h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; }
.section-title a, .section-title button { font-size: 13px; color: var(--accent-text); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats--wide { grid-template-columns: 1fr; }

.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow);
  transition: transform 0.34s cubic-bezier(0.34, 1.4, 0.64, 1);
}
/* Нажатие чувствуется: элемент слегка проседает и пружинит обратно. */
/* Вдавливается только то, что действительно нажали. Карточка — просто
   подложка: раньше она проседала целиком, когда нажимали строку внутри неё. */
a.stat:active, a.card:active, button.card:active { transform: scale(0.972); transition-duration: 0.06s; }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 21px; font-weight: 600; letter-spacing: -0.03em; overflow-wrap: anywhere; }
/* Большие суммы не растягивают плитки и не дают странице уехать вбок. */
.stats > * { min-width: 0; }
.hero__value, .hero__cell b { overflow-wrap: anywhere; }
.stat__hint { font-size: 11.5px; color: var(--muted); }
.stat--good .stat__value { color: var(--good); }
.stat--danger .stat__value { color: var(--danger); }
.stat--warn .stat__value { color: var(--warn); }
.stat--accent { background: var(--accent); border-color: transparent; color: #fff; }
.stat--accent .stat__label, .stat--accent .stat__hint { color: rgba(255, 255, 255, 0.82); }

.hero {
  background: linear-gradient(135deg, var(--hero-from, #a3062f) 0%, var(--brand-burgundy) 45%, var(--hero-to, #4a1420) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}
.hero__label { font-size: 12.5px; opacity: 0.85; font-weight: 600; }
.hero__value { font-size: 32px; font-weight: 600; letter-spacing: -0.035em; margin-top: 2px; }
.hero__row { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.hero__cell { font-size: 12.5px; opacity: 0.92; }
.hero__cell b { display: block; font-size: 15px; font-weight: 700; }

/* ------------------------------------------------------------------ списки */

.list { display: flex; flex-direction: column; }
.list .row + .row { border-top: 1px solid var(--line); }

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0;
  min-height: 48px;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s;
  border-radius: 12px;
}
a.row:active, button.row:active {
  transform: scale(0.975);
  transition-duration: 0.06s;
}
.row__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.row__subtitle { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.row__amount { font-size: 15px; font-weight: 600; white-space: nowrap; letter-spacing: -0.02em; }
.row__amount.good { color: var(--good); }
.row__amount.danger { color: var(--danger); }
.row__amount.warn { color: var(--warn); }
.row__meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2);
  margin-top: 2px;
}
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--muted { background: var(--surface-2); color: var(--muted); }

.empty {
  text-align: center;
  padding: 26px 16px;
  color: var(--muted);
  font-size: 13.5px;
}
.empty p + * { margin-top: 12px; }

/* ------------------------------------------------------------------ кнопки */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  font-size: 15px; font-weight: 550;
  letter-spacing: -0.01em;
  background: var(--surface-2);
  border: 0.5px solid var(--line);
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.94); transition-duration: 0.06s; }
.btn--primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn--good { background: var(--good); border-color: transparent; color: #fff; }
.btn--danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn--ghost { background: none; }
.btn--sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row--grid { display: grid; grid-template-columns: repeat(2, 1fr); }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick__item {
  display: flex; align-items: center; gap: 11px;
  padding: 13px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid color-mix(in srgb, var(--line) 85%, transparent);
  font-size: 14px; font-weight: 500;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s;
  animation: quick-in 0.42s cubic-bezier(0.32, 0.72, 0, 1) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.quick__item:active { transform: scale(0.94); transition-duration: 0.06s; }
.quick__item:active .quick__icon { transform: scale(0.88) rotate(-4deg); }
.quick__label { line-height: 1.25; }

@keyframes quick-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.quick__icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
  transition: transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1), background 0.2s;
}
.quick__icon svg { width: 20px; height: 20px; }
.quick__icon--good { background: var(--good-soft); color: var(--good); }
.quick__icon--danger { background: var(--danger-soft); color: var(--danger); }

/* Лёгкое «дыхание» стрелок — иконка живая, но не отвлекает. */
.quick__icon .icon-arrow { animation: icon-bob 2.6s ease-in-out infinite; }
.quick__icon--danger .icon-arrow { animation-direction: reverse; }
.quick__icon .icon-plus { animation: icon-pulse 2.6s ease-in-out infinite; transform-origin: center; }

@keyframes icon-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.4px); }
}
@keyframes icon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .quick__icon .icon-arrow, .quick__icon .icon-plus { animation: none; }
  .quick__item { animation: none; }
  .viewport.is-animating .view, .viewport.is-animating .view--ghost { transition: none; }
}

/* --------------------------------------------------------- фильтры и поиск */

.searchbar input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.searchbar input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 8px 13px;
  border-radius: 999px;
  border: 0.5px solid var(--line);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.2s, color 0.2s;
}
.chip:active { transform: scale(0.92); transition-duration: 0.06s; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: transparent; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.tabs__item {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  font-size: 13px; font-weight: 650;
  color: var(--muted);
  text-align: center;
}
.tabs__item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------ формы */

.form__grid { display: grid; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface);
}
.field__hint { font-size: 11.5px; color: var(--muted); }

.form-intro { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.form__advanced { margin-top: 12px; }
.form__advanced summary {
  font-size: 13px; font-weight: 650; color: var(--accent-text);
  cursor: pointer; padding: 6px 0;
}
.form__advanced[open] summary { margin-bottom: 8px; }
.form__error {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px; font-weight: 600;
}

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.segmented__item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 650;
  color: var(--muted);
}
.segmented__item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented--sm .segmented__item { padding: 6px 9px; font-size: 12px; }
.segmented--full { display: flex; width: 100%; }
.segmented--full .segmented__item { flex: 1; text-align: center; }

.switch { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.switch input { width: 20px; height: 20px; min-height: 0; flex-shrink: 0; }

.money-field { display: flex; flex-direction: column; gap: 7px; }
.money-field__row { display: flex; gap: 8px; align-items: center; }
.money-field__row input {
  flex: 1; min-width: 0;
  min-height: 46px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 17px; font-weight: 700;
}
.money-suffix { font-size: 13px; color: var(--muted); font-weight: 650; }
.money-field__fx {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  flex-wrap: wrap;
}
.money-field__fx input {
  width: 92px; min-height: 36px; padding: 6px 10px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
}
.money-field__fx.is-hidden { display: none; }
.money-field__base { font-weight: 700; color: var(--ink-2); }

.confirm-text { font-size: 14.5px; }

/* ------------------------------------------------------------ нижняя панель */

.sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet.is-open { display: block; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(9, 14, 22, 0.45); }
.sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 92svh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.22s ease;
}
@keyframes sheet-up { from { transform: translateY(14px); opacity: 0.6; } }
.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 16px 8px;
}
.sheet__head h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.sheet__body { padding: 6px 16px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet__foot .btn { flex: 1; }
.sheet__foot { flex-wrap: wrap; }
.sheet__foot .sheet__main { flex-basis: 100%; }

/* ---------------------------------------------------------------- уведомление */

.toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 76px);
  z-index: 70;
  padding: 12px 15px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px; font-weight: 650;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--danger { background: var(--danger); color: #fff; }
.toast--good { background: var(--good); color: #fff; }

/* ------------------------------------------------------------------ графики */

.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__zero { stroke: color-mix(in srgb, var(--muted) 60%, transparent); stroke-width: 1; }
.chart__x { font-size: 9px; fill: var(--muted); font-weight: 600; }
.chart__bar { transition: opacity 0.15s; }
.chart__bar:focus { outline: none; }
/* подсветка столбика — только там, где есть мышь: на телефоне она «залипает» */
@media (hover: hover) {
  .chart__bar:hover { opacity: 0.75; }
}
.chart__tip {
  position: absolute; top: -4px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--ink); color: var(--bg);
  font-size: 11.5px; font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
}
.chart__scale { font-size: 11px; color: var(--muted); margin-top: 6px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.legend__item i { width: 10px; height: 10px; border-radius: 3px; }

.breakdown { display: flex; flex-direction: column; gap: 11px; }
.breakdown__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.breakdown__label { font-weight: 650; }
.breakdown__value { font-weight: 700; white-space: nowrap; }
.breakdown__value i { font-style: normal; color: var(--muted); font-weight: 600; margin-left: 6px; font-size: 12px; }
.breakdown__track { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.breakdown__fill { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }

.progress { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress__fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.progress__fill--good { background: var(--good); }
.progress__fill--warn { background: var(--warn); }

/* ------------------------------------------------------------------ таблица */

.table-wrap { overflow-x: auto; }
.table-caption { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 320px; }
table.data th, table.data td { padding: 9px 6px; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-size: 11.5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
table.data tbody tr + tr td { border-top: 1px solid var(--line); }
table.data tfoot td { border-top: 2px solid var(--line); font-weight: 800; }
td.good, .good-text { color: var(--good); }
td.danger, .danger-text { color: var(--danger); }

/* -------------------------------------------------------------------- вход */

.auth {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 32px) 22px calc(env(safe-area-inset-bottom) + 32px);
  background: linear-gradient(165deg, #2f3641 0%, #262c35 45%, #171b22 100%);
  color: var(--brand-alice);
  overflow: hidden;
}

/* Чертёжная графика на фоне — сразу понятно, чья это система. */
.auth__scene { position: absolute; inset: 0; pointer-events: none; }

.auth__plan {
  position: absolute;
  left: 50%; bottom: -6%;
  width: min(150vw, 680px);
  transform: translateX(-50%);
  color: var(--brand-alice);
  opacity: 0.09;
}

.auth__inner { position: relative; width: 100%; max-width: 360px; text-align: center; }

.auth__brand { margin-bottom: 30px; }
.auth__word {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.auth__script {
  font-family: var(--font-brand);
  font-size: 62px;
  font-weight: 500;
  line-height: 1.05;
  /* тот же глянец, что и в шапке, только крупнее */
  background-image: linear-gradient(168deg,
    var(--signature-on-dark-hi) 0%,
    color-mix(in srgb, var(--signature-on-dark-hi) 55%, var(--signature-on-dark)) 30%,
    var(--signature-on-dark) 54%,
    color-mix(in srgb, var(--signature-on-dark-lo) 60%, var(--signature-on-dark)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0.6px var(--signature-on-dark);
  paint-order: stroke fill;
  text-shadow:
    0 -0.8px 0 var(--signature-on-dark-hi),
    0 1.5px 0.5px var(--signature-on-dark-lo),
    0 5px 10px rgba(0, 0, 0, 0.6);
}
.auth__studio {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-alice) 72%, transparent);
}
.auth__rule {
  display: block;
  width: 46px; height: 2px;
  margin: 16px auto 12px;
  background: var(--signature-on-dark);
}
.auth__tagline {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--brand-alice) 68%, transparent);
}

.auth__form {
  display: grid;
  gap: 12px;
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(236, 244, 247, 0.07);
  border: 0.5px solid rgba(236, 244, 247, 0.16);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.9);
}
.auth__faceid {
  width: 100%;
  min-height: 50px;
  gap: 9px;
  background: rgba(236, 244, 247, 0.1);
  border: 0.5px solid rgba(236, 244, 247, 0.28);
  color: var(--brand-alice);
  font-weight: 500;
  margin-bottom: 4px;
}
.auth__faceid svg { width: 21px; height: 21px; }

.auth__label {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: color-mix(in srgb, var(--brand-alice) 62%, transparent);
}
.auth__code {
  width: 100%;
  min-height: 58px;
  padding: 10px 16px;
  border-radius: 15px;
  border: 0.5px solid rgba(236, 244, 247, 0.22);
  background: rgba(20, 24, 30, 0.45);
  color: var(--brand-alice);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth__code::placeholder { color: rgba(236, 244, 247, 0.35); letter-spacing: 0.3em; }
.auth__code:focus {
  outline: none;
  border-color: var(--signature-on-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signature-on-dark) 32%, transparent);
}
.auth .btn--primary {
  background: var(--brand-burgundy);
  color: #fff;
  border: 0;
  min-height: 50px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.auth .form__error {
  background: rgba(196, 19, 64, 0.22);
  color: #ffd7de;
  border: 0.5px solid rgba(255, 215, 222, 0.28);
}
.auth__hint {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--brand-alice) 55%, transparent);
}

/* ------------------------------------------- доступ только для просмотра */

/* Правило построено от обратного: скрыто всё, что меняет данные студии,
   а перечислено то немногое, что человеку с доступом на просмотр можно.
   Так новая кнопка на новом экране закрывается сама, без правки этого списка. */
.is-viewer .fab,
.is-viewer .quick,
.is-viewer [data-act]:not([data-act="logout"]):not([data-act="name"]):not([data-act="password"]):not([data-act="ok"]):not([data-act="cancel"]):not([data-act="submit"]),
.is-viewer [data-pay],
.is-viewer [data-pay-advance],
.is-viewer [data-pay-final],
.is-viewer [data-pay-salary],
.is-viewer [data-receive],
.is-viewer [data-edit-plan],
.is-viewer [data-edit-assignment],
.is-viewer [data-remove-category],
.is-viewer [data-status],
.is-viewer [data-stage],
.is-viewer [data-locked] { display: none !important; }

.viewer-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}

/* ------------------------------------------------- планшет и компьютер */

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .form__grid { grid-template-columns: repeat(2, 1fr); }
  .field--wide { grid-column: 1 / -1; }
  .sheet__panel {
    left: 50%; bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, 92vw);
    border-radius: 20px;
    max-height: 88svh;
  }
  .sheet__panel--wide { width: min(860px, 94vw); }
  @keyframes sheet-up { from { transform: translate(-50%, -48%); opacity: 0.6; } }
  .sheet__foot .btn { flex: 0 0 auto; min-width: 130px; }
}

@media (min-width: 960px) {
  .app { padding-bottom: 24px; padding-left: 220px; }
  .topbar { padding-left: 236px; }
  .viewport { min-height: calc(100dvh - var(--topbar-h)); }
  .tabbar {
    top: 0; right: auto; bottom: 0;
    width: 220px;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 2px;
    padding: 18px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
  }
  .tabbar__item {
    flex-direction: row; justify-content: flex-start;
    gap: 11px; height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 13.5px;
  }
  .tabbar__item.is-active { background: var(--accent-soft); }
  .tabbar::before {
    content: attr(data-brand);
    display: block;
    padding: 0 12px 16px;
    font-size: 15px; font-weight: 800; letter-spacing: -0.02em;
  }
  .fab { bottom: 26px; right: 26px; }
  .toast { left: auto; right: 26px; bottom: 96px; max-width: 360px; }
}

/* ------------------------------------------------------- поворот телефона */

/* Приложение свёрстано под вертикальный экран и должно таким и оставаться.
   iPhone не даёт закрепить ориентацию для веб-приложения, поэтому, когда
   телефон поворачивают, мы поворачиваем сам интерфейс на тот же угол
   в обратную сторону — картинка на экране остаётся на месте. */
.rotate-lock { display: none; }

@media (orientation: landscape) and (max-height: 540px) and (hover: none) and (pointer: coarse) {
  html, body {
    overflow: hidden;
    height: 100dvh;
    width: 100dvw;
  }

  /* Слои приложения разворачиваем целиком: и экран, и всплывающие
     карточки, и сообщения. Размер меняется местами — высота становится
     шириной макета. */
  #app, #sheet, #toast {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvh;
    height: 100dvw;
    transform-origin: 0 0;
  }

  :root[data-rotate="right"] #app,
  :root[data-rotate="right"] #sheet,
  :root[data-rotate="right"] #toast {
    transform: translate(100dvw, 0) rotate(90deg);
  }

  :root[data-rotate="left"] #app,
  :root[data-rotate="left"] #sheet,
  :root[data-rotate="left"] #toast {
    transform: translate(0, 100dvh) rotate(-90deg);
  }

  /* Вырез экрана в этом положении сбоку, поэтому отступ сверху не нужен. */
  #app { --topbar-h: 58px; }
  .topbar { padding-top: 0; }
  .brand { top: 0; height: 58px; }

  /* Прокручивается только содержимое: шапка и нижнее меню стоят на месте. */
  .viewport {
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: var(--tabbar);
    min-height: 0;
    overflow-y: auto;
    overflow-x: clip;
    -webkit-overflow-scrolling: touch;
  }
  .tabbar { padding-bottom: 0; height: var(--tabbar); }
  .fab { bottom: calc(var(--tabbar) + 14px); }
}

/* --------------------------------------------------------------- курс НБТ */

/* Курс стоит над главными цифрами: по нему пересчитывается всё,
   что вводят в сомони, поэтому он должен быть заметен сразу. */
.rate-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 0.5px solid var(--line);
  text-align: left;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.rate-bar:active { transform: scale(0.985); transition-duration: 0.06s; }
.rate-bar.is-busy { opacity: 0.6; }
.rate-bar--static:active { transform: none; }
.rate-bar__label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rate-bar__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rate-bar__note {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}


/* Кнопка выгрузки отчёта стоит над цифрами периода. */
.btn--block[data-report] { margin-bottom: 12px; }


/* Пояснение под главными цифрами: часть дохода приходит не деньгами. */
.hero__note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

/* Название компании кириллицей: рукописный шрифт знака его не умеет,
   поэтому показываем обычным шрифтом — крупно, плотно, фирменным цветом. */
.brand__name.is-plain {
  display: block;
  /* Между заголовком слева и кнопками справа — около 44% ширины экрана. */
  max-width: 44vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  -webkit-text-stroke: 0;
}
.auth__script.is-plain {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 0.62em;
}

/* Элементы только для того, кто смотрит без права правки. */
.viewer-only { display: none; }
.is-viewer .viewer-only { display: inline-flex; }

.form__preview { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13px; }

/* Логотип компании на экране входа (если он есть). SVG вставлен в страницу,
   поэтому подпись под знаком перекрашиваем в светлый — фон входа тёмный. */
.auth__logo {
  width: min(80vw, 360px);
  aspect-ratio: 1530 / 1020;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.auth__logo.is-ready { opacity: 1; transform: none; }
.auth__logo.is-kept { transition: none; }
.auth__logo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.auth__logo text { fill: #e8c88a; }
.auth__logo + .auth__tagline { margin-top: 14px; }

/* Название прописными с разрядкой — как в логотипе Amber. */
.brand__name.is-caps {
  display: block;
  /* Тень легче, чем у рукописного знака: у прописных она выглядела грязной. */
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
}
.auth__script.is-caps {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 34px;
}

/* Узкие телефоны (iPhone SE 1-го поколения, 320 px): таблицы и плитки
   не вылезают за край, длинные суммы не рвутся посередине. */
@media (max-width: 359px) {
  table.data { min-width: 0; font-size: 12px; }
  table.data th, table.data td { padding: 8px 4px; }
  table.data td:first-child { white-space: normal; }
  .quick { gap: 8px; }
  .quick__item { padding: 11px 10px; gap: 8px; font-size: 13px; min-width: 0; }
  .quick__icon { width: 30px; height: 30px; }
  .stat__value { font-size: 18px; overflow-wrap: normal; white-space: nowrap; }
  .brand__name.is-caps { font-size: 15px; letter-spacing: 0.22em; margin-right: -0.22em; }
  .brand__name.is-plain { max-width: 36vw; }
  .topbar__side { max-width: calc(50% - 54px); }
}
