/* ==========================================================================
   CRM заказов (Захар) — общие стили.
   Вариант «А. Точный инструмент»: светлый почти-монохром, тонкие линии,
   главная кнопка чёрная, красный — только «зависло» и ошибки.
   Непрочитанное — чёрной заливкой (.count, .ocard__unread); красный счётчик
   допустим только на вкладке «Чаты» в таб-баре (и её копии в шапке десктопа).
   Эталон: docs/design/design-directions.html (левый телефон).
   Внешних ресурсов нет (CSP 'self'): шрифты в ../fonts, иконки — ../icons.svg.
   ========================================================================== */

/* ---------- Шрифты (OFL, см. static/fonts/OFL.txt) ---------- */
/* Onest — текст. Подмножества: кириллица, латиница, латиница-расширенная (там ₽). */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/onest-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/onest-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/onest-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/onest-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/onest-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/onest-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* JetBrains Mono — суммы, VIN, №, дни, время. */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Токены: светлая тема ---------- */
:root {
  color-scheme: light dark;

  --bg: #F6F6F3;             /* фон страницы */
  --surface: #FFFFFF;        /* карточки, поля, таб-бар */
  --surface-2: #FAFAF8;      /* наведение, вложенные блоки */
  --lane: #EEEEE9;           /* колонка канбана */
  --line: #E4E4DF;           /* тонкие линии */
  --line-strong: #D9D9D3;    /* рамка полей, ручка шторки */
  --text: #111317;
  --text-2: #5C6068;         /* вторичный */
  --muted: #6E7178;          /* приглушённый: 4,5:1 на фоне, 4,9:1 на белом (WCAG AA для 11–12 px) */
  --pill: #EFEFEA;           /* нейтральная пилюля */
  --pill-text: #3D4048;
  --primary: #111317;        /* главная кнопка — чёрная */
  --on-primary: #FFFFFF;
  --primary-hover: #2A2D33;
  --danger: #B42318;         /* ТОЛЬКО зависло / ошибка (+ счётчик вкладки «Чаты») */
  --danger-bg: #FDECEA;
  --on-danger: #FFFFFF;
  --seg-done: #111317;       /* «разметка»: пройденные деления */
  --seg-now: #8A8D93;        /* текущее деление (не зависло); графика, не текст — 3,3:1 на белом */
  --seg-on: #FFFFFF;         /* выбранный пункт сегмент-переключателя */
  --seg-on-shadow: 0 1px 2px rgba(17, 19, 23, .08);
  --seg-todo: #E4E4DF;       /* будущие деления */
  --placeholder: #ECECE6;    /* заглушка фото */
  --placeholder-ink: #A3A59F;
  --tabbar: #FFFFFF;
  --inverse: #111317;        /* тост */
  --on-inverse: #F6F6F3;
  --inverse-2: rgba(255, 255, 255, .12);
  --overlay: rgba(17, 19, 23, .32);
  --shadow-pop: 0 12px 32px rgba(17, 19, 23, .12), 0 2px 6px rgba(17, 19, 23, .06);
  --shadow-fab: 0 6px 18px rgba(17, 19, 23, .16);
  --focus: #111317;

  /* Отступы (шкала 4 px) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --gutter: 16px;

  /* Радиусы */
  --r-card: 16px;
  --r-btn: 12px;
  --r-field: 12px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* Линии: 0.5 px на ретине, 1 px на обычных экранах (браузер округлит) */
  --hair: .5px;

  /* Типографика: только 400 и 500 */
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-base: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 24px;

  /* Каркас */
  --tabbar-h: 64px;
  --topbar-h: 56px;
  --screen-max: 520px;
  --tap: 44px;               /* минимальная цель нажатия */
  --icon-stroke: 1.75;
}

/* ---------- Токены: тёмная тема (тот же монохром в инверсии, без золота) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1012;
    --surface: #17181B;
    --surface-2: #1B1C20;
    --lane: #141517;
    --line: #26282C;
    --line-strong: #33363B;
    --text: #F2F2F0;
    --text-2: #A9ABB1;
    --muted: #8E9097;
    --pill: #232529;
    --pill-text: #C9CBD0;
    --primary: #F2F2F0;
    --on-primary: #0F1012;
    --primary-hover: #FFFFFF;
    --danger: #FF6B5E;
    --danger-bg: #2B1715;
    --on-danger: #0F1012;
    --seg-done: #F2F2F0;
    --seg-now: #8E9097;
    --seg-todo: #2E3035;
    --seg-on: #3A3D43;         /* светлее дорожки #232529, иначе выбор выглядит «вдавленным» */
    --seg-on-shadow: inset 0 0 0 1px #55585F;
    --placeholder: #1E2023;
    --placeholder-ink: #5E6167;
    --tabbar: #141517;
    --inverse: #F2F2F0;
    --on-inverse: #0F1012;
    --inverse-2: rgba(15, 16, 18, .08);
    --overlay: rgba(0, 0, 0, .55);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .4);
    --shadow-fab: 0 6px 18px rgba(0, 0, 0, .45);
    --focus: #F2F2F0;
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4, b, strong { font-weight: 500; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--pill); }

/* Иконка из спрайта: <svg class="i"><use href=".../icons.svg#clock"/></svg> */
.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--icon-stroke);
  stroke-linecap: round; stroke-linejoin: round;
}
.i--16 { width: 16px; height: 16px; }
.i--18 { width: 18px; height: 18px; }
.i--20 { width: 20px; height: 20px; }
.i--24 { width: 24px; height: 24px; }
.i--28 { width: 28px; height: 28px; }

/* ---------- Утилиты ---------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.text-2 { color: var(--text-2); }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.w500 { font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.hstack { display: flex; align-items: center; gap: var(--s2); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.hl { color: var(--text); font-weight: 500; background: var(--pill); border-radius: 3px; box-shadow: 0 0 0 2px var(--pill); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot--danger { background: var(--danger); }   /* только «есть зависшие» */
/* Непрочитанное: чёрная пилюля с числом (в тёмной теме — светлая). Не красная. */
.count {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums;
}
@media (max-width: 1023.98px) { .only-desktop { display: none !important; } }
@media (min-width: 1024px) { .only-mobile { display: none !important; } }

/* ---------- Каркас экрана (телефон) ---------- */
.screen {
  position: relative;
  max-width: var(--screen-max);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--tabbar-h) + var(--s8) + env(safe-area-inset-bottom));
}
.screen--bare { padding-bottom: var(--s8); }                               /* без таб-бара */
.screen--action { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } /* с липкой панелью */

/* Шапка экрана верхнего уровня: «Заказы 34» + кнопки (как в эталоне) */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s5) 0 var(--s1); }
.pagehead__title { font-size: var(--fs-2xl); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.pagehead__count { font-family: var(--mono); font-size: var(--fs-md); color: var(--muted); margin-left: 2px; }
.pagehead__sub { font-size: var(--fs-md); color: var(--muted); margin-top: 2px; }
.pagehead__actions { display: flex; gap: var(--s2); flex: none; }

/* Шапка внутреннего экрана: «←  № 12  ⋯» */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--s1);
  height: var(--topbar-h);
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 calc(var(--gutter) - 6px);
  background: var(--bg);
  border-bottom: var(--hair) solid var(--line);
}
.topbar__title { flex: 1; min-width: 0; font-size: var(--fs-lg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title .mono { font-size: 16px; }
.topbar > .btn { margin-right: 6px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 var(--s4);
  border-radius: var(--r-btn);
  font-size: 14px; font-weight: 500; line-height: 1.2; text-align: center;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:active { transform: translateY(.5px); opacity: .92; }
.btn .i { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border: var(--hair) solid var(--line); }
.btn--secondary:hover { border-color: var(--line-strong); }
.btn--ghost { color: var(--text); }
.btn--ghost:hover { background: var(--pill); }
.btn--danger { background: var(--surface); color: var(--danger); border: var(--hair) solid var(--line); }
.btn--block { display: flex; width: 100%; }
.btn--grow { flex: 1; min-width: 0; }
.btn--lg { min-height: 52px; font-size: 16px; border-radius: 14px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn__label { overflow: hidden; text-overflow: ellipsis; }

/* Квадратная кнопка-иконка 44×44 (шапка, «⋯») */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tap); height: var(--tap);
  border-radius: var(--r-btn);
  background: var(--surface); color: var(--text);
  border: var(--hair) solid var(--line);
  position: relative;
}
.iconbtn .i { width: 20px; height: 20px; }
.iconbtn--ghost { background: transparent; border-color: transparent; }
.iconbtn--ghost:hover { background: var(--pill); }
.iconbtn--line { background: transparent; }           /* «⋯» рядом с главной кнопкой в карточке */
.iconbtn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.iconbtn__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary);
  font: 500 11px/18px var(--mono); text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.iconbtn--ghost .iconbtn__badge { top: 2px; right: 2px; }
/* Красный — только копия счётчика вкладки «Чаты» в шапке десктопа */
.iconbtn__badge--alert { background: var(--danger); color: var(--on-danger); box-shadow: 0 0 0 2px var(--surface); }

/* Плавающая «+» (чёрный скруглённый квадрат 54 px) */
.fab {
  position: fixed; z-index: 15;
  right: max(var(--gutter), calc(50vw - var(--screen-max) / 2 + var(--gutter)));
  bottom: calc(var(--tabbar-h) + var(--s4) + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
  box-shadow: var(--shadow-fab);
  transition: transform .2s, opacity .2s;
}
.fab .i { width: 26px; height: 26px; stroke-width: 2; }
/* «+» не должна лежать поверх «⋯» и дней на этапе:
   — app.js ставит .is-away при прокрутке вниз и снимает при прокрутке вверх (и у самого низа списка);
   — пока показан тост «Отменить» (body.has-toast), «+» спрятана, а не поднята над тостом:
     поднятая, она ложилась на кнопки карточек посреди экрана. */
.fab.is-away, .has-toast .fab { transform: translateY(calc(100% + var(--s4) + var(--tabbar-h))); opacity: 0; pointer-events: none; }
/* Экран с «+»: низ списка можно прокрутить выше неё (54 + 16 + 16 px над таб-баром) */
.screen--fab { padding-bottom: calc(var(--tabbar-h) + 54px + var(--s4) * 2 + env(safe-area-inset-bottom)); }

/* ---------- Таб-бар (телефон) ---------- */
.tabbar {
  position: fixed; z-index: 20; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center;
  background: var(--tabbar);
  border-top: var(--hair) solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__inner { display: flex; justify-content: space-around; width: 100%; max-width: var(--screen-max); height: var(--tabbar-h); }
.tab {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: var(--tap);
  font-size: var(--fs-xs); color: var(--muted);
}
.tab .i { width: 24px; height: 24px; }
.tab.is-active { color: var(--text); }
.tab__icon { position: relative; }
.tab__badge {
  position: absolute; top: -5px; left: 15px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--danger); color: var(--on-danger);
  font: 500 11px/18px var(--font); text-align: center;
  box-shadow: 0 0 0 2px var(--tabbar);
}

/* ---------- Верхнее меню (десктоп) ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s6);
  height: 60px; padding: 0 var(--s6);
  background: var(--surface);
  border-bottom: var(--hair) solid var(--line);
}
.topnav__brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.topnav__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.topnav__mark .i { width: 18px; height: 18px; }
.topnav__links { display: flex; gap: 2px; }
.topnav__link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--text-2); }
.topnav__link:hover { background: var(--pill); color: var(--text); }
.topnav__link.is-active { background: var(--pill); color: var(--text); font-weight: 500; }
.topnav__search { flex: 1; max-width: 380px; margin-left: auto; position: relative; }
.topnav__search .input { height: 40px; padding-left: 40px; font-size: 14px; background: var(--bg); border-color: var(--line); }
.topnav__search > .i { position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; color: var(--muted); }
.topnav__end { display: flex; align-items: center; gap: var(--s2); }
.kbd { position: absolute; right: 8px; top: 8px; height: 24px; min-width: 24px; padding: 0 6px; border-radius: 6px; border: var(--hair) solid var(--line-strong); background: var(--surface); font: 400 12px/23px var(--mono); color: var(--muted); text-align: center; }

/* ---------- Чипы (лента этапов) ---------- */
.chips {
  display: flex; gap: 6px;
  margin: 0 calc(var(--gutter) * -1);
  padding: var(--s3) var(--gutter) var(--s4);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.chips::-webkit-scrollbar { display: none; }
.chips--sticky { position: sticky; top: 0; z-index: 8; background: var(--bg); }
.chips--flush { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 13px;
  border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  border: var(--hair) solid var(--line);
  font-size: var(--fs-md); white-space: nowrap;
}
.chip::after { content: ""; position: absolute; inset: -5px 0; }       /* цель нажатия 44 px */
.chip.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip__n { font-variant-numeric: tabular-nums; }
.chip.is-active .chip__n { opacity: .8; }
.chip .dot { width: 6px; height: 6px; background: var(--danger); }
.chip .i { width: 16px; height: 16px; }
.chip--sep { margin-left: 6px; }

/* ---------- Подписи секций ---------- */
.section { margin-top: var(--s6); }
.section:first-child { margin-top: var(--s2); }
.section-label {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  margin: 0 2px var(--s2);
  font-size: var(--fs-sm); color: var(--muted);
}
.section-label a { color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.section-title { font-size: var(--fs-lg); font-weight: 500; margin: 0 2px var(--s3); }

/* ---------- Карточка ---------- */
.card {
  display: block;
  background: var(--surface);
  border: var(--hair) solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s4);
}
.card + .card { margin-top: 10px; }
.card--flush { padding: 0; overflow: hidden; }
.card__title { font-size: var(--fs-base); font-weight: 500; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 24px; margin-bottom: var(--s3); }
.card__head .btn--ghost { margin: -10px -10px -10px 0; padding: 0 10px; }
a.card:hover { border-color: var(--line-strong); }

/* Пилюля этапа с точкой */
.stage {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--pill); color: var(--pill-text);
  font-size: var(--fs-sm); white-space: nowrap;
}
.stage::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stage--stale { background: var(--danger-bg); color: var(--danger); }
.stage--final { background: transparent; color: var(--muted); border: var(--hair) solid var(--line); }
.stage--lg { height: 28px; padding: 0 12px; font-size: var(--fs-md); }

/* «Разметка» — 11 делений по 3 px */
.seg { display: flex; gap: 3px; margin: var(--s3) 0 14px; }
.seg i { flex: 1; height: 3px; border-radius: 2px; background: var(--seg-todo); display: block; }
.seg i.d { background: var(--seg-done); }
.seg i.c { background: var(--seg-now); }
.seg.is-stale i.c { background: var(--danger); }
.seg--thin { margin: var(--s2) 0; }
.seg--thin i { height: 2px; }

/* Дни на этапе: «12 дн. из 10» */
.days { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-md); color: var(--text-2); white-space: nowrap; }
.days .i { width: 16px; height: 16px; }
.days.is-stale { color: var(--danger); }

/* Деньги */
.k { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.money--sm { font-size: 14px; }
.money--lg { font-size: var(--fs-xl); }

/* Карточка заказа с обложкой (сотрудники): ФИО, машина, сумма договора, этап, дни.
   Вся карточка — ссылка: a.ocard__name растянута на карточку (::after), кнопки подняты над ней. */
.ocard, .kcard, .stock { position: relative; }
.ocard__name::after, .stock__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.ocard__actions, .kcard__grip { position: relative; z-index: 1; }
.ocard:hover, .stock:has(.stock__link):hover { border-color: var(--line-strong); }
.ocard__name:focus-visible, .stock__link:focus-visible { outline: none; }
.ocard:has(.ocard__name:focus-visible), .stock:has(.stock__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ocard__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 22px; }
.ocard__no { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.ocard__no span { font-family: var(--font); }
.ocard__name { display: block; margin-top: 6px; font-size: var(--fs-lg); font-weight: 500; line-height: 1.3; }
.ocard__car { margin-top: 2px; font-size: var(--fs-md); color: var(--text-2); }
.ocard__car .mono { font-size: 12.5px; white-space: nowrap; }
.ocard__meta { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.ocard__actions { display: flex; gap: var(--s2); margin-top: 14px; }
.ocard__actions--end { justify-content: flex-end; }   /* архив: «→ этап» нет, только «⋯» */
/* Непрочитанное на карточке — чёрная пилюля «💬 1»; красный остаётся только за «зависло» */
.ocard__unread {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 22px; padding: 0 8px 0 7px;
  border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
}
.ocard__unread .i { width: 14px; height: 14px; stroke-width: 2; }
.ocard__unread .mono { font-size: 12px; }

/* ---------- Списки строк ---------- */
.list { background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.list__row {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 60px; padding: var(--s3) var(--s4);
}
.list__row + .list__row { border-top: var(--hair) solid var(--line); }
a.list__row:hover { background: var(--surface-2); }
.list__main { flex: 1; min-width: 0; }
.list__title { font-size: var(--fs-base); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { margin-top: 2px; font-size: var(--fs-md); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__end { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.list__chev { color: var(--muted); width: 18px; height: 18px; }
.list__icon {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--r-sm);
  background: var(--pill); color: var(--pill-text);
  display: grid; place-items: center;
}
.list__icon .i { width: 20px; height: 20px; }
/* Строки с длинным текстом (служебный блок «Сегодня»): переносить, а не обрезать многоточием */
.list--wrap .list__title, .list--wrap .list__sub { white-space: normal; }

/* Счётчики «Активных · В пути · Таможня» */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.stat {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s3);
  min-height: 84px; padding: 12px 14px;
  background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-card);
}
.stat:hover { border-color: var(--line-strong); }
.stat__n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.stat__l { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--text-2); }

/* Определения «ключ — значение» */
.dl__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding: 11px 0; }
.dl__row + .dl__row { border-top: var(--hair) solid var(--line); }
.dl__k { font-size: 14px; color: var(--text-2); flex: none; }
.dl__v { font-size: 14px; text-align: right; min-width: 0; }
.dl__v a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* Сетка параметров (критерии заявки) */
.params { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: var(--hair) solid var(--line); }
.param { background: var(--surface); padding: 10px 12px; min-height: 60px; }
.param__k { font-size: var(--fs-sm); color: var(--muted); }
.param__v { margin-top: 2px; font-size: 14px; font-weight: 500; }

/* VIN: начало вторичным, последние 6 — жирно */
.vin { font-family: var(--mono); font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.vin__head { color: var(--text-2); }
.vin__tail { color: var(--text); font-weight: 500; }

/* Аватар-инициалы */
.ava {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  background: var(--pill); color: var(--pill-text);
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 500;
}
.ava--sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.ava--lg { width: 48px; height: 48px; font-size: 16px; }

/* ---------- Поля ---------- */
.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field__label { display: block; margin: 0 2px 6px; font-size: var(--fs-md); color: var(--text-2); }
.input {
  display: block; width: 100%;
  height: 50px; padding: 0 14px;
  border-radius: var(--r-field);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong);
  font-size: 16px;                     /* ≥16 px — иначе iOS увеличивает масштаб */
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--pill); }
.input--mono { font-family: var(--mono); letter-spacing: .02em; }
.input--error { border-color: var(--danger); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.input-wrap > .i ~ .input { padding-left: 44px; }
.input-wrap__end { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.input-wrap__end .iconbtn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-2); }
.input-wrap--end .input { padding-right: 52px; }
.field__hint { margin: 6px 2px 0; font-size: var(--fs-sm); color: var(--muted); }
.field__error { margin: 6px 2px 0; font-size: var(--fs-md); color: var(--danger); }

.searchbar { margin-top: var(--s3); }
.searchbar .input { height: 52px; }
.searchbar .input-wrap > .i { top: 16px; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* Сегмент-переключатель */
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--pill); }
.segmented__item {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 10px; border-radius: 10px;   /* цель нажатия 44 px (план §5.2) */
  font-size: 14px; color: var(--text-2); white-space: nowrap;
}
.segmented__item.is-active { background: var(--seg-on); color: var(--text); font-weight: 500; box-shadow: var(--seg-on-shadow); }
.segmented__n { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-2); }
.segmented__item .count { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
/* 4 варианта в одну строку и на 360 px (вид платежа) */
.segmented--4 .segmented__item { padding: 0 4px; font-size: 13.5px; }

/* ---------- Плашки ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  background: var(--surface); border: var(--hair) solid var(--line);
  font-size: 14px; line-height: 1.4;
}
.banner .i { width: 20px; height: 20px; margin-top: 0; flex: none; }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-size: inherit; font-weight: 500; }
.banner__text { color: var(--text-2); font-size: var(--fs-md); margin-top: 1px; }
.banner--danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.banner--danger .banner__text { color: var(--danger); opacity: .85; }
.banner--neutral { background: var(--pill); border-color: transparent; }
/* Место для плашек под шапкой (пульс обновляет его OOB); пустое — не занимает места */
.banners { display: grid; gap: var(--s2); margin-top: var(--s3); }
.banners:empty { display: none; }

/* ---------- Пустое состояние ---------- */
.empty { text-align: center; padding: var(--s10) var(--s4); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 18px; background: var(--pill); color: var(--pill-text); display: grid; place-items: center; }
.empty__icon .i { width: 26px; height: 26px; }
.empty__title { font-size: var(--fs-lg); font-weight: 500; }
.empty__text { margin-top: 4px; font-size: 14px; color: var(--text-2); }

/* ---------- Тост «№ 25 → Выкуп  [Отменить]» ---------- */
.toast {
  position: fixed; z-index: 30;
  left: 50%; transform: translateX(-50%);
  width: calc(min(100vw, var(--screen-max)) - var(--gutter) * 2);
  bottom: calc(var(--tabbar-h) + var(--s3) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: 6px 6px 6px 16px;
  border-radius: 14px;
  background: var(--inverse); color: var(--on-inverse);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  overflow: hidden;
}
.toast__text { flex: 1; min-width: 0; }
.toast__text .mono { font-size: 13px; }
.toast__action { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--inverse-2); color: var(--on-inverse); font-weight: 500; }
.toast__action .i { width: 18px; height: 18px; }
.toast__count { font-size: var(--fs-sm); opacity: .6; }
.toast__timer { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--on-inverse); opacity: .45; transform-origin: left; animation: toast-timer 30s linear forwards; }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast--bare { bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }

/* ---------- Шторка (снизу). В шаблонах — <dialog class="sheet">; в макетах — :target ---------- */
.sheet-layer { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; background: var(--overlay); }
.sheet-layer:target { display: flex; }
.sheet-layer__close { position: absolute; inset: 0; }
.sheet, dialog.sheet {
  position: relative;
  width: 100%; max-width: var(--screen-max);
  max-height: 90dvh; overflow-y: auto;
  margin: 0; padding: var(--s2) var(--gutter) calc(var(--s5) + env(safe-area-inset-bottom));
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop);
}
/* fixed, а не relative из .sheet: иначе открытая шторка встаёт у начала документа, и браузер, фокусируя её,
   прокручивает страницу наверх — открыл «+ Платёж» внизу карточки, закрыл — оказался в шапке (найдено в B8) */
dialog.sheet { position: fixed; margin: auto auto 0; }
dialog.sheet::backdrop { background: var(--overlay); }
.sheet__grip { width: 36px; height: 4px; margin: 0 auto var(--s3); border-radius: 2px; background: var(--line-strong); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.sheet__title { font-size: var(--fs-lg); font-weight: 500; }
.sheet__sub { font-size: var(--fs-md); color: var(--text-2); margin-top: 2px; }
.sheet__foot { display: flex; gap: var(--s2); margin-top: var(--s5); }

/* Шторка этапов */
.stagelist__item { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 4px; font-size: 15px; }
.stagelist__item + .stagelist__item { border-top: var(--hair) solid var(--line); }
.stagelist__n { width: 24px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); }
.stagelist__name { flex: 1; }
.stagelist__item.is-done { color: var(--text-2); }
.stagelist__item.is-current { font-weight: 500; }
.stagelist__item.is-next .stagelist__name { font-weight: 500; }
button.stagelist__item { width: 100%; text-align: left; }
button.stagelist__item:hover { background: var(--surface-2); }

/* ---------- Липкая панель действия (карточка заказа) ---------- */
.actionbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  background: var(--tabbar);
  border-top: var(--hair) solid var(--line);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
}
.actionbar__inner { display: flex; gap: var(--s2); width: 100%; max-width: calc(var(--screen-max) - var(--gutter) * 2); }
.actionbar .btn--primary { min-height: 52px; font-size: 15px; }
.actionbar .iconbtn { width: 52px; height: 52px; background: transparent; }

/* ---------- Карточка заказа ---------- */
.ohead { padding: var(--s5) 2px var(--s4); }
.ohead__car { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
.ohead__client { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin-top: 2px; font-size: var(--fs-base); color: var(--text-2); }
.ohead__client .i { width: 16px; height: 16px; }
/* Обложка: сумма договора крупно под заголовком (видят только сотрудники) */
.ohead__deal { margin-top: var(--s3); }
.ohead__deal .money { margin-top: 1px; }
.stagecard .seg { margin: 14px 0 12px; }
button.stagecard { display: block; width: 100%; text-align: left; }   /* этап — кнопка: тап открывает шторку */
button.stagecard:hover { border-color: var(--line-strong); }
.stagecard__note { display: block; margin-top: var(--s2); font-size: var(--fs-md); color: var(--text-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
a.thumb:hover img { opacity: .9; }
.prewrap { white-space: pre-line; }   /* заметки: переносы строк как ввели */
.ev__body, .dl__v, .pay__void { overflow-wrap: anywhere; }   /* длинная ссылка или слово не распирают карточку */
.stack > .card + .card { margin-top: 0; }
.param--wide { grid-column: 1 / -1; }
.ta-r { text-align: right; }
.comment-form { display: flex; gap: var(--s2); align-items: flex-end; padding-bottom: var(--s2); }
.comment-form .input { min-height: 48px; height: 48px; padding: 12px 14px; resize: none; }
.comment-form .iconbtn { width: 48px; height: 48px; }
.card .chips { margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4) var(--s3); }
.more-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: var(--s1); border-radius: 10px; font-size: 14px; color: var(--text-2); }
.more-link:hover { background: var(--pill); color: var(--text); }
.menu__item { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 4px; font-size: 16px; }
.menu__item + .menu__item { border-top: var(--hair) solid var(--line); }
.menu__item .i { color: var(--text-2); }
.menu__item--danger, .menu__item--danger .i { color: var(--danger); }
button.menu__item { width: 100%; text-align: left; }
.menu__item + form > .menu__item, form + .menu__item { border-top: var(--hair) solid var(--line); }

/* ---------- Форма заказа (B6) ---------- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.row2--narrow-first { grid-template-columns: minmax(84px, 1fr) 2fr; }      /* «Год» узкий, «Бюджет» шире */
.row2 > .field + .field { margin-top: 0; }
.row2 + .field, .field + .row2, .row2 + .row2 { margin-top: var(--s4); }
/* Выбор клиента — строки списка с настоящими radio */
.pick .list { margin-top: var(--s3); border-radius: 14px; }
.pick > .pick__warn:first-child { margin-top: var(--s3); }
.pick__row { min-height: 56px; cursor: pointer; }
.pick__row > input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
label.pick__row:has(> input:checked) { background: var(--surface-2); }
label.pick__row:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.pick__warn { display: flex; align-items: flex-start; gap: 6px; margin: 0 2px var(--s2); font-size: var(--fs-md); line-height: 1.4; color: var(--text); }
.pick__warn .i { flex: none; margin-top: 1px; color: var(--danger); }
.pick__warn a { text-decoration: underline; text-underline-offset: 3px; }
.vin-warn:not(:empty) { margin-top: var(--s2); }
.vin-warn + .row2, .vin-warn + .field { margin-top: var(--s4); }
.pick__row .list__title, .pick__row .list__sub { display: block; }   /* в <label> — строчные теги, делаем блочными */
.input--vin { text-transform: uppercase; }   /* как сохранится: сервер всё равно приводит к верхнему регистру */
.input--vin::placeholder { text-transform: none; }
/* «Ещё поля», «Уже в работе?» — свёрнутые части формы */
.orderform > .more { margin-top: var(--s3); padding: 0; }
.orderform > .section + .more { margin-top: var(--s6); }
.more > summary { display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 0 var(--s4); list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-card); }
.more__title { font-size: var(--fs-base); font-weight: 500; white-space: nowrap; }
.more > summary .k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more__chev { flex: none; color: var(--muted); transition: transform .15s; }
.more[open] .more__chev { transform: rotate(180deg); }
.more__body { padding: 0 var(--s4) var(--s4); }

/* ---------- Фото-заглушки и файлы ---------- */
.ph-stub {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--placeholder); color: var(--placeholder-ink);
  font-size: var(--fs-sm); text-align: center;
  overflow: hidden;
}
.ph-stub .i { width: 34px; height: 34px; stroke-width: 1.25; }
.ph-stub__cap { max-width: 80%; line-height: 1.3; }
.ph-stub__badge { position: absolute; left: 10px; top: 10px; }
.ph-stub__count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font: 400 11px/24px var(--mono); }
.ph-stub__count .i { width: 14px; height: 14px; stroke-width: 1.75; }

.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--placeholder); color: var(--placeholder-ink); display: grid; place-items: center; overflow: hidden; }
.thumb .i { width: 20px; height: 20px; stroke-width: 1.5; }
.thumb__cap { position: absolute; left: 6px; right: 6px; bottom: 5px; font-size: 10px; line-height: 1.2; color: var(--placeholder-ink); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb--more { background: var(--pill); color: var(--text-2); font: 500 15px/1 var(--mono); }

.file { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: 10px 0; }
.file + .file { border-top: var(--hair) solid var(--line); }
.file__icon { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); background: var(--pill); color: var(--pill-text); display: grid; place-items: center; }
.file__icon .i { width: 20px; height: 20px; }
.file__main { flex: 1; min-width: 0; }
.file__name { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { display: block; margin-top: 1px; font-size: var(--fs-sm); color: var(--muted); }
.file__meta .mono { font-size: 11.5px; }

/* ---------- Оплата ---------- */
/* Прогресс оплаты — <progress class="paybar" max="3450000" value="1200000"> (без inline-стилей: CSP) */
.paybar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; margin: var(--s3) 0; border: 0; border-radius: 3px; background: var(--seg-todo); color: var(--seg-done); overflow: hidden; }
.paybar::-webkit-progress-bar { background: var(--seg-todo); border-radius: 3px; }
.paybar::-webkit-progress-value { background: var(--seg-done); border-radius: 3px; }
.paybar::-moz-progress-bar { background: var(--seg-done); border-radius: 3px; }
.pay { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 8px 0; }
.pay + .pay { border-top: var(--hair) solid var(--line); }
.pay__main { flex: 1; min-width: 0; }
.pay__kind { font-size: 14px; }
.pay__date { font-size: var(--fs-sm); color: var(--muted); }
/* Аннулированный: «Аннулирован: Остаток» + причина; зачёркнута только сумма */
.pay.is-void .pay__kind { color: var(--text-2); }
.pay.is-void .money { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.pay__void { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Загрузка файлов (B7): «Фото и файлы» и очередь пачки под блоком «Файлы» (static/js/upload.js) ---------- */
.upload__pick { cursor: pointer; }
.upload__pick:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.upload__original { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 2px; padding: 0 2px; font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.upload__original input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.upq [hidden] { display: none !important; }   /* у .btn и .iconbtn свой display — атрибут hidden их не прятал бы */
.upq .card__head .iconbtn { margin: -10px -10px -10px 0; }
.upq__list { margin-top: var(--s1); }
.upq.is-done .upq__list { display: none; }   /* всё загрузилось: остаются счётчик и тип пачки (сменить — чипом) */
.upq.is-done .chips { padding-bottom: 0; }
.upq__row .file__icon { overflow: hidden; }
.upq__row .file__icon img { width: 100%; height: 100%; object-fit: cover; }
.upq__row .file__icon img:not([src]) { display: none; }
.upq__row .file__icon img[src] + .i { display: none; }
.upq__bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 3px; margin-top: 6px; border: 0; border-radius: 2px; background: var(--seg-todo); color: var(--seg-done); overflow: hidden; }
.upq__bar::-webkit-progress-bar { background: var(--seg-todo); border-radius: 2px; }
.upq__bar::-webkit-progress-value { background: var(--seg-done); border-radius: 2px; }
.upq__bar::-moz-progress-bar { background: var(--seg-done); border-radius: 2px; }
.upq__row.is-fail .file__meta { color: var(--danger); }
.upq__retry { flex: none; min-height: 44px; padding: 0 10px; font-size: var(--fs-md); }

/* ---------- Поиск и «Все заказы» (B9) ---------- */
.searchbar .input:placeholder-shown ~ .input-wrap__end { display: none; }   /* «×» — только когда в поле что-то есть */
.searchbar .input::-webkit-search-cancel-button { display: none; }          /* свой «×», системный не нужен */
.searchbar + .field__hint, #results > .field__hint:first-child { margin-top: var(--s2); }
/* Первый раздел результатов — первый ребёнок #results, но под полем, как в макете (не .section:first-child) */
#results > .section:first-child { margin-top: var(--s6); }
/* Список заказов: на телефоне — обложки карточек, от 1024 px — таблица во всю ширину экрана */
@media (min-width: 1024px) { .screen--wide { max-width: 1180px; padding-left: var(--s6); padding-right: var(--s6); } }
.pagehead__actions .segmented { flex: none; }
.pagehead__actions .segmented__item { min-height: 38px; padding: 0 14px; }
.otable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: var(--hair) solid var(--line); border-radius: var(--r-card); overflow: hidden; font-size: 14px; }
.otable th { padding: 10px 12px; text-align: left; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); border-bottom: var(--hair) solid var(--line); white-space: nowrap; }
.otable td { padding: 12px; border-bottom: var(--hair) solid var(--line); vertical-align: middle; }
.otable tbody tr:last-child td { border-bottom: 0; }
.otable__row { position: relative; }
.otable__row:hover td { background: var(--surface-2); }
.otable__row.is-stale td:first-child { box-shadow: inset 3px 0 0 var(--danger); }   /* как полоса слева у зависшей карточки */
.otable__no { color: var(--muted); white-space: nowrap; font-size: 13px; }
.otable__link { font-weight: 500; }
.otable__link::after { content: ""; position: absolute; inset: 0; }                 /* вся строка — ссылка на заказ */
.otable__link:focus-visible { outline: none; }
.otable__row:has(.otable__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.otable .days { font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s4); }

/* ---------- Лента событий ---------- */
.feed { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); padding: 14px 0; }
.ev + .ev { border-top: var(--hair) solid var(--line); }
.ev__icon { width: 28px; height: 28px; border-radius: 50%; background: var(--pill); color: var(--pill-text); display: grid; place-items: center; }
.ev__icon .i { width: 15px; height: 15px; stroke-width: 2; }
.ev__head { font-size: var(--fs-md); color: var(--text-2); line-height: 1.4; }
.ev__head b { color: var(--text); font-weight: 500; }
.ev__time { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.ev__time .mono { font-size: 11.5px; }
.ev__body { margin-top: 4px; font-size: var(--fs-base); line-height: 1.45; }
.ev__stages { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ev__stages .i { width: 14px; height: 14px; color: var(--muted); }
.ev .thumbs { margin-top: var(--s2); }

/* ---------- Чат ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding: var(--s2) 0; }
.chat__day { align-self: center; margin: var(--s3) 0 var(--s1); padding: 0 10px; height: 24px; line-height: 24px; border-radius: var(--r-pill); background: var(--pill); font-size: var(--fs-sm); color: var(--text-2); }
.msg { max-width: 82%; padding: 9px 12px 7px; border-radius: 18px; font-size: var(--fs-base); line-height: 1.4; }
.msg--in { align-self: flex-start; background: var(--surface); border: var(--hair) solid var(--line); border-bottom-left-radius: 6px; }
.msg--out { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.msg__meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px; opacity: .62; }
.msg__meta .mono { font-size: 11px; }
.msg__meta .i { width: 14px; height: 14px; }
.msg__photo { width: 220px; max-width: 100%; aspect-ratio: 4 / 3; margin: -3px -8px 6px; }
.msg--att { display: flex; align-items: center; gap: 10px; }
.msg__play { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--pill); color: var(--text); display: grid; place-items: center; }
.msg__play .i { width: 18px; height: 18px; }
.chat-status {
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: var(--hair) solid var(--line);
  font-size: var(--fs-md);
}
.chat-status__text { flex: 1; min-width: 0; }
.chat-status .btn { min-height: 36px; padding: 0 10px; font-size: var(--fs-md); position: relative; }
.chat-status .btn::after { content: ""; position: absolute; inset: -4px 0; }

.composer {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  background: var(--tabbar);
  border-top: var(--hair) solid var(--line);
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
}
.composer__inner { display: flex; align-items: flex-end; gap: 6px; width: 100%; max-width: calc(var(--screen-max) - var(--gutter) * 2); }
.composer .input { min-height: 44px; height: 44px; padding: 10px 14px; border-radius: 22px; resize: none; line-height: 1.4; background: var(--bg); border-color: var(--line); }
.composer .iconbtn { border: 0; background: transparent; color: var(--text-2); }
.composer .iconbtn--primary { background: var(--primary); color: var(--on-primary); border-radius: 50%; }

/* ---------- Карточка клиента ---------- */
.chead { display: flex; align-items: center; gap: 14px; padding: var(--s4) 2px var(--s4); }
.chead__name { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.chead__sub { margin-top: 3px; font-size: 14px; color: var(--text-2); }
.chead__sub .mono { font-size: 13.5px; }
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.qa__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 64px; padding: 8px 4px;
  border-radius: 14px; background: var(--surface); border: var(--hair) solid var(--line);
  font-size: var(--fs-md); color: var(--text); text-align: center;
}
.qa__btn:hover { border-color: var(--line-strong); }
.qa__btn .i { width: 22px; height: 22px; }
/* В 1а у клиента две быстрые кнопки («Позвонить», «Заказ»; «Выдать доступ» — клиентская часть), без телефона — одна */
.qa--2 { grid-template-columns: repeat(2, 1fr); }
.qa--1 { grid-template-columns: 1fr; }
.chead + .banner { margin-bottom: var(--s3); }
.banner__title a { text-decoration: underline; text-underline-offset: 3px; }
.notes { overflow-wrap: anywhere; }
#ctab > .ocard:first-of-type, #ctab > .empty { margin-top: var(--s3); }
.tabs-seg { margin: var(--s4) 0 var(--s2); }
.screen--chat { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ---------- Код доступа клиента ---------- */
.code {
  display: flex; justify-content: center; gap: 8px;
  padding: 18px 12px; border-radius: 14px;
  background: var(--bg); border: var(--hair) solid var(--line);
  font: 500 34px/1 var(--mono); letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.code__gap { width: 10px; }

/* ---------- Наличие ---------- */
.stock + .stock { margin-top: 10px; }
.stock__body { padding: 14px var(--s4) var(--s4); }
.stock__title { font-size: var(--fs-lg); font-weight: 500; line-height: 1.3; }
.stock__specs { margin-top: 2px; font-size: var(--fs-md); color: var(--text-2); }
.stock__specs .mono { font-size: 12.5px; }
.stock .ph-stub { border-radius: 0; aspect-ratio: 2 / 1; }
.stock--big .ph-stub { aspect-ratio: 16 / 10; }   /* клиентская витрина: фото крупнее */
.stock__hold { display: flex; align-items: center; gap: 6px; margin-top: var(--s2); font-size: var(--fs-md); color: var(--text); }
.stock__hold .i { width: 16px; height: 16px; }
.stock.is-sold .stock__title, .stock.is-sold .money, .stock.is-sold .stock__hold { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: var(--fs-sm); white-space: nowrap; box-shadow: 0 0 0 var(--hair) var(--line); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--hold { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.status--sold { color: var(--muted); }

/* ---------- Вход ---------- */
.auth { max-width: 400px; margin: 0 auto; min-height: 100dvh; padding: 0 var(--gutter) var(--s8); display: flex; flex-direction: column; }
.auth__top { padding: 64px 0 var(--s8); }
.auth__mark { width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; margin-bottom: var(--s6); }
.auth__mark .i { width: 26px; height: 26px; }
.auth__title { font-size: 28px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
.auth__sub { margin-top: 6px; font-size: 15px; color: var(--text-2); }
.auth__foot { margin-top: auto; padding-top: var(--s8); font-size: var(--fs-md); color: var(--muted); text-align: center; }

/* ---------- Канбан (десктоп) ---------- */
.board-head { display: flex; align-items: center; gap: var(--s4); padding: var(--s5) var(--s6) var(--s4); }
.board-head .pagehead__title { margin-right: var(--s2); }
.board-head .chips { margin: 0; padding: 0; overflow: visible; }
.board-head__end { margin-left: auto; display: flex; gap: var(--s2); align-items: center; }
.board { display: flex; gap: var(--s3); align-items: flex-start; padding: 0 0 var(--s6) var(--s6); overflow-x: auto; scroll-padding: 0 170px 0 var(--s6); }
.lane {
  flex: 0 0 256px;
  display: flex; flex-direction: column; gap: var(--s2);
  padding: 6px 6px var(--s2);
  border-radius: 18px;
  background: var(--lane);
}
.lane__head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px; min-height: 40px; }
.lane__name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane__n { font: 400 var(--fs-sm) var(--mono); color: var(--text-2); }       /* на фоне колонки --muted не дотягивает до 4,5:1 */
.lane__limit { margin-left: auto; font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
.lane__head .dot { background: var(--danger); }
.lane--collapsed { flex: 0 0 52px; align-items: center; padding: var(--s3) 0; min-height: 280px; cursor: pointer; }
.lane--collapsed:hover { background: var(--pill); }
.lane--collapsed .lane__v { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.lane--collapsed .lane__v b { color: var(--text); }
.lane__add { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 12px; color: var(--muted); font-size: 13px; }
.lane__add:hover { background: var(--pill); color: var(--text); }
.lane-drop { height: 64px; border-radius: 14px; border: 1.5px dashed var(--line-strong); }

.board__rail {
  position: sticky; right: 0; z-index: 2;
  display: flex; gap: var(--s3); align-self: stretch;
  margin-left: auto; padding: 0 var(--s6) 0 var(--s3);
  background: var(--bg);
  box-shadow: -14px 0 14px -14px rgba(17, 19, 23, .25);
}
.lane__more { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 12px; font-size: 13px; color: var(--text-2); }
.lane__more:hover { background: var(--pill); color: var(--text); }
.board-head .segmented { flex: none; }
.board-head .segmented__item { min-height: 34px; padding: 0 14px; }
.desk-page { min-height: 100dvh; }

.kcard { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 14px; padding: 12px 12px 12px; }
.kcard .ocard__name::after { border-radius: 14px; }
/* «Договора нет · бюджет до» в одну строку: подпись стоит над суммой, а дни — на уровне суммы, так что места хватает */
/* contain: inline-size — подпись не раздвигает колонку, а просто выходит вправо над днями */
.kcard .ocard__meta .k { white-space: nowrap; contain: inline-size; }
.kcard__grip { cursor: grab; }
.kcard:hover { border-color: var(--line-strong); }
.kcard .ocard__name { font-size: 15px; margin-top: 4px; }
.kcard .ocard__car { font-size: 12.5px; }
.kcard .seg { margin: 10px 0 10px; }
.kcard .money { font-size: 14px; }
.kcard .days { font-size: 12px; }
.kcard__grip { color: var(--muted); width: 16px; height: 16px; }
.kcard.is-dragging { box-shadow: var(--shadow-pop); transform: rotate(-1.5deg); border-color: var(--line-strong); }
/* Ручка — кнопка: потянуть — перенос в другую колонку, щёлкнуть — шторка этапов (и с клавиатуры) */
button.kcard__grip { display: grid; place-items: center; width: 28px; height: 28px; margin: -6px -6px -6px 0; border-radius: 8px; }
button.kcard__grip:hover { background: var(--pill); color: var(--text); }
button.kcard__grip .i { width: 16px; height: 16px; }
.kcard.is-ghost { opacity: .45; }                          /* место, куда встанет карточка */
.kcard.is-moving { opacity: .6; pointer-events: none; }    /* ждём ответа сервера */
/* Свёрнутые «Закрыт/Отменён» — тоже цель броска: карточку внутри не показываем, подсвечиваем колонку */
.lane--collapsed .kcard { display: none; }
.lane--collapsed:has(.kcard) { background: var(--pill); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.board .lane:not(.lane--collapsed) { min-height: 96px; }  /* в пустую колонку тоже есть куда бросить */
.desk-page .banners { margin: var(--s3) var(--s6) 0; }
@media (max-width: 1023.98px) {                             /* доска, открытая с планшета или телефона */
  .desk-page { padding-bottom: calc(var(--tabbar-h) + var(--s4) + env(safe-area-inset-bottom)); }
  .board-head { flex-wrap: wrap; gap: var(--s3); padding: var(--s4) var(--gutter) var(--s3); }
  .board-head__end { display: none; }
  .board { padding-left: var(--gutter); }
  .desk-page .banners { margin: var(--s3) var(--gutter) 0; }
}

/* ---------- Оглавление макетов ---------- */
.toc a.list__row { min-height: 64px; }
.toc a.list__title { display: block; }
.toc__states { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; }
.toc__states a { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--fs-md); color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* ==========================================================================
   Клиентская часть (zaimport.ru). Те же токены и компоненты, больше воздуха и фото.
   Клиент НЕ видит сумму договора, журнал и «зависло»: красный у клиента —
   только ошибки и счётчик вкладки «Чат» в таб-баре; непрочитанное в списках — .count.
   ========================================================================== */

/* Ссылка в тексте */
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--text); }
.auth__foot .link { display: inline-flex; align-items: center; min-height: var(--tap); }

/* Внутри <label class="field"> можно только строчные теги — делаем их блочными */
.field > span.input-wrap, .field > span.field__hint, .field > span.field__error { display: block; }
.menu__label { flex: 1; min-width: 0; }
.section-label.mt-4 { margin-top: var(--s4); }
.section-label.mt-6 { margin-top: var(--s6); }
.pagehead__lead { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--text-2); }

/* Строка бренда на публичных страницах */
.brandline { display: flex; align-items: center; gap: 10px; padding-top: var(--s5); font-size: 14px; font-weight: 500; }
.brandline__mark { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.brandline__mark .i { width: 18px; height: 18px; }
.brandline__sub { font-weight: 400; color: var(--muted); }

/* Выбор на настоящих radio/checkbox (без JS): чипы и сегменты */
.chip > input, .segmented__item > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.chip, label.segmented__item { cursor: pointer; }
.chip:has(> input:checked) { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.segmented__item:has(> input:checked) { background: var(--seg-on); color: var(--text); font-weight: 500; box-shadow: var(--seg-on-shadow); }
.chip:has(> input:focus-visible), .segmented__item:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chips--lg .chip { height: 40px; padding: 0 15px; font-size: 14px; }
.chips--lg .chip::after { inset: -2px 0; }
.chips--flush.chips--lg { gap: 8px; }
.segmented--lg .segmented__item { min-height: 44px; min-width: 0; padding: 0 6px; font-size: 15px; }
@media (max-width: 374.98px) { .segmented--lg .segmented__item { padding: 0 3px; font-size: 14px; } }   /* 4 варианта влезают и на 360 px */
.chip--select .i { color: var(--muted); margin-right: -3px; }
.chip.is-active .i { color: inherit; }

/* Поле-выбор (марка, модель) — открывает шторку */
.picker-wrap { position: relative; }
.picker {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 50px; padding: 0 14px;
  border-radius: var(--r-field);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong);
  font-size: 16px; text-align: left;
}
.picker__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__value.is-empty { color: var(--muted); }
.picker > .i { width: 20px; height: 20px; color: var(--muted); }
.picker.is-open { border-color: var(--text); box-shadow: 0 0 0 3px var(--pill); }
.picker.is-disabled { background: var(--surface-2); border-color: var(--line); color: var(--muted); pointer-events: none; }
.picker-wrap--clear .picker { padding-right: 52px; }
.picker__clear { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); }
.picker__clear:hover { background: var(--pill); }
.picker__clear .i { width: 18px; height: 18px; }

/* Диапазон «от — до» в одной рамке (мощность, год) */
.range {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-field);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.range:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px var(--pill); }
.range__part { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; height: 50px; padding: 0 14px; }
.range__part + .range__part { border-left: 1px solid var(--line); }
.range__pre, .range__unit { flex: none; font-size: 14px; color: var(--muted); }
.range__input {
  flex: 1; min-width: 0; width: 100%; height: 100%;
  padding: 0; border: 0; border-radius: 0; background: transparent; outline: none;
  font: 400 16px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.range__input::placeholder { color: var(--muted); font-family: var(--font); }
select.range__input { cursor: pointer; padding-right: 24px; }
.range__part > .i { position: absolute; right: 12px; top: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

/* Выпадающий список на всю ширину */
.select-wrap { position: relative; }
.select-wrap > select.input { -webkit-appearance: none; appearance: none; padding-right: 44px; cursor: pointer; }
.select-wrap > .i { position: absolute; right: 14px; top: 15px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }

/* Единица измерения в конце поля: «₽», «км» */
.input-wrap__unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--muted); pointer-events: none; }
.input-wrap--unit .input { padding-right: 40px; }

/* Галочка согласия */
.check { display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap); padding: 10px 2px; font-size: 14px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.check .link { color: var(--text); }
.check.is-error { color: var(--danger); }
.check.is-error input { outline: 1.5px solid var(--danger); outline-offset: 1px; border-radius: 4px; }

/* Недоступное поле (вход на паузе) */
.input:disabled { background: var(--surface-2); color: var(--text-2); border-color: var(--line); cursor: not-allowed; }

/* Подсказка в моноширинном поле — обычным шрифтом («Любая», «+7 900 …») */
.input--mono::placeholder { font-family: var(--font); letter-spacing: 0; }

/* Поле кода: 6 цифр моноширинным */
.input--code { font-family: var(--mono); font-size: 20px; letter-spacing: .35em; }
.input--code::placeholder { letter-spacing: .35em; }

/* Карточка «Мой заказ»: фото, этап словами, разметка, дата обновления */
.track .ph-stub { border-radius: 0; aspect-ratio: 16 / 10; }
.track__body { padding: var(--s4) var(--s4) var(--s4); }
.track__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 22px; }
.track__title { margin-top: 10px; font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
.track__text { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.track .seg { margin: var(--s4) 0 10px; }
.track__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font-size: var(--fs-md); color: var(--text-2); }
.track__meta .mono { font-size: 12.5px; }
.track__meta .i { width: 16px; height: 16px; }
.track__nophoto { display: flex; align-items: center; gap: 12px; padding: 14px var(--s4); background: var(--surface-2); border-bottom: var(--hair) solid var(--line); font-size: var(--fs-md); color: var(--text-2); }
.track__nophoto .i { width: 22px; height: 22px; color: var(--muted); }

/* Этапы заказа вертикально: пройденные — галочка, текущий — точка, будущие — пустые */
.steps { display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 24px 1fr auto; column-gap: 12px; padding: 8px 0; }
.step::before { content: ""; position: absolute; left: 11.25px; top: 34px; bottom: -8px; width: 1.5px; background: var(--line); }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--seg-done); }
.step__mark {
  width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--on-primary);
}
.step__mark .i { width: 14px; height: 14px; stroke-width: 2.5; }
.step.is-done .step__mark { background: var(--seg-done); border-color: var(--seg-done); }
.step.is-current .step__mark { border-color: var(--text); }
.step.is-current .step__mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.step__title { font-size: 15px; line-height: 26px; color: var(--muted); }
.step.is-done .step__title { color: var(--text-2); }
.step.is-current .step__title { color: var(--text); font-weight: 500; }
.step__date { font: 400 12px/26px var(--mono); color: var(--muted); white-space: nowrap; }
.step.is-current .step__date { color: var(--text-2); }
.step__text { grid-column: 2 / -1; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--text-2); }

/* Страница машины */
.gallery { margin: 0 calc(var(--gutter) * -1); }
.gallery > .ph-stub { border-radius: 0; aspect-ratio: 4 / 3; }
.gallery .ph-stub__badge { left: var(--gutter); top: 14px; }
.gallery .ph-stub__count { right: var(--gutter); bottom: 14px; }
.gallery__thumbs { display: flex; gap: 6px; padding: var(--s2) var(--gutter) 0; overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumbs .thumb { flex: 0 0 64px; }
.thumb.is-active { box-shadow: inset 0 0 0 2px var(--text); }
.carhead { padding: var(--s5) 2px 0; }
.carhead__title { font-size: 24px; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
.carhead__sub { margin-top: 4px; font-size: 15px; color: var(--text-2); }
.carhead__price { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); }
/* Что входит в цену — одна строка из данных машины, её пишет Захар («Растаможена, во Владивостоке») */
.price-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--text); }
.price-note .i { width: 16px; height: 16px; margin-top: 2px; color: var(--text-2); }
.carhead .price-note { font-size: 15px; }
.carhead .price-note .i { width: 18px; height: 18px; margin-top: 1px; }
.money--xl { font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.note__who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.note__name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.note__meta { font-size: var(--fs-sm); color: var(--muted); }
.note__text { font-size: 15px; line-height: 1.5; }

/* Чат клиента: шапка собеседника, цитата-машина в пузыре и над полем ввода */
.chathead { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.chathead__main { min-width: 0; }
.chathead__name { font-size: 16px; font-weight: 500; line-height: 1.2; }
.chathead__sub { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote {
  display: flex; align-items: center; gap: 10px;
  margin: -3px -6px 8px; padding: 6px 10px 6px 6px;
  border-radius: 12px;
  background: var(--inverse-2); color: inherit;
}
.msg--in .quote { background: var(--bg); }
.quote__thumb { width: 48px; height: 40px; flex: none; border-radius: 8px; background: var(--placeholder); color: var(--placeholder-ink); display: grid; place-items: center; }
.quote__thumb .i { width: 18px; height: 18px; stroke-width: 1.5; }
.quote__main { flex: 1; min-width: 0; }
.quote__k, .quote__title, .quote__price { display: block; }
.quote__k { font-size: 11px; line-height: 1.3; opacity: .7; }
.quote__title { font-size: 14px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote__price { font: 400 12px/1.3 var(--mono); font-variant-numeric: tabular-nums; opacity: .75; }
.composer--stack { flex-direction: column; align-items: center; gap: 8px; }
.composer__ctx { width: 100%; max-width: calc(var(--screen-max) - var(--gutter) * 2); }
.composer__ctx .quote { margin: 0; padding-right: 2px; background: var(--bg); border: var(--hair) solid var(--line); }
.composer__ctx .iconbtn { border: 0; background: transparent; color: var(--text-2); }
.chat__spacer { height: 64px; }   /* запас под карточку над полем ввода */

/* ---------- Движение: уважать «уменьшить анимацию» ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Только для статических макетов (docs/mockups): состояния без JS ----------
   <i class="mock-anchor mock-anchor--1" id="calm"></i> в начале <body>;
   .mock-main — показ по умолчанию, .mock-alt1 / .mock-alt2 — при #якоре 1 / 2.
   В шаблоны Django не переносить. */
.mock-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }
.mock-alt1, .mock-alt2 { display: none !important; }
body:has(.mock-anchor--1:target) .mock-alt1 { display: block !important; }
body:has(.mock-anchor--2:target) .mock-alt2 { display: block !important; }
body:has(.mock-anchor--1:target) .mock-main,
body:has(.mock-anchor--2:target) .mock-main { display: none !important; }
/* .mock-not1 — видно везде, кроме состояния 1 (например, форма скрыта после «Заявка отправлена») */
body:has(.mock-anchor--1:target) .mock-not1 { display: none !important; }
/* строчные элементы в состояниях остаются строчными */
body:has(.mock-anchor--1:target) span.mock-alt1,
body:has(.mock-anchor--2:target) span.mock-alt2 { display: inline !important; }
body:has(.mock-anchor--1:target) .status.mock-alt1 { display: inline-flex !important; }
body:has(.mock-anchor--1:target) .toast.mock-alt1 { display: flex !important; }
