/* Таогун · общие стили интерфейса специалиста (static/sino.css).
   Значения — только переменные из app/web/design.py: theme_css()
   подставляется в <style> base.html до этого файла. Цвет, кегль или
   радиус числом здесь — ошибка (docs/design/system.md).

   Часть 1 перенесена из <style> base.html без изменений, кроме
   области действия селекторов header/nav. Часть 2 — компоненты
   Design Platform v1. */

/* ===== Часть 1 — перенесено из base.html ===== */
/* Оформление направления «Рабочий инструмент».
   Цвета и размеры приходят переменными из app/web/design.py — здесь
   их не задают заново. Правила системы: docs/design/system.md. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 16px;
  padding-block: 0 32px;
  background: var(--bg);
  color: var(--text-colour);
  font: 400 var(--text)/var(--line) var(--font-body);
}

/* ===== Шапка ===== */

body > header {
  margin: 0 -16px 12px;
  padding: 14px 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  color: var(--heading);
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}

header .counts {
  margin-top: 2px;
  font-size: var(--text-sm);
  color: var(--muted);
}

header > nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* Нажимаемое — не меньше 48px по короткой стороне: подушечка пальца
   шире, чем кажется, а специалист жмёт одной рукой между клиентами. */
header > nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  border-radius: var(--radius);
}
header > nav a[aria-current="page"] {
  background: var(--note-bg);
  color: var(--note-text);
  font-weight: 600;
}

/* ===== Поиск ===== */

.search { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

.search input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 12px;
  font: inherit;
  color: var(--text-colour);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}

.search button {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

/* «Сбросить» — второстепенное действие: ссылка, а не кнопка, и
   отдельной строкой, а не вплотную к «Найти». Правило целиком —
   docs/design/system.md, «Второстепенное и разрушительное». */
.search .reset {
  flex-basis: 100%;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Подсказка под строкой поиска (#89, static/typeahead.js). Список
   лежит поверх содержимого, строки — во всю ширину и не ниже
   нажимаемого минимума: попасть пальцем с первого раза. */
.typeahead { position: relative; flex: 1 1 200px; min-width: 0; display: flex; }
.typeahead input { flex: 1 1 auto; }
.typeahead-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
}
.typeahead-list [role=option] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--tap);
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
}
.typeahead-list [role=option][aria-selected=true],
.typeahead-list [role=option]:hover { background: var(--note-bg); }
.typeahead-label { font-weight: 600; }
.typeahead-hint { font-size: var(--text-sm); color: var(--muted); }
.typeahead-empty {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-3);
  color: var(--muted);
}
.typeahead-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Карточка позиции ===== */

.card {
  margin: var(--gap) 0 0;
  padding: 12px var(--pad);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.name { font-weight: 600; }
.working { margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }

/* Строка применения — то, что прочитает клиент. Её сверяют чаще
   всего, поэтому она выделена подложкой, а не курсивом. */
.example {
  margin-top: var(--gap);
  padding: 8px 10px;
  font-size: 16px;
  background: var(--note-bg);
  color: var(--note-text);
  border-radius: var(--radius);
}

/* Статус несёт и цвет, и слово: цветом одним пользоваться нельзя —
   его не различает часть людей и не видно на солнце. */
.neutral, .warning, .note {
  margin-top: var(--gap);
  padding: 8px 10px;
  font-size: 16px;
  border-radius: var(--radius);
}
.neutral { background: var(--success-bg); color: var(--success-text); }
.warning { background: var(--warning-bg); color: var(--warning-text); }
.note    { background: var(--note-bg);    color: var(--note-text); }

.card.note {
  margin-top: var(--gap);
  padding: 10px 12px;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
}

.memo-body { margin-top: var(--gap); white-space: pre-wrap; }

/* ===== Вход специалиста ===== */

.signin { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }

.signin label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.signin input {
  min-height: var(--tap);
  padding: 0 12px;
  font: inherit;
  color: var(--text-colour);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}

/* Флажок — в строку с подписью, а не полем на всю ширину. */
.signin label.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-size: var(--text-base, inherit);
}
.signin label.check input { min-height: 0; width: 22px; height: 22px; padding: 0; }

.signin button {
  min-height: var(--tap);
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

/* ===== Рабочее место специалиста ===== */

/* Основное действие — сплошная кнопка на акценте, в единственном
   числе на экране. docs/design/system.md, «Второстепенное и
   разрушительное». */
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin: var(--gap) 0 0;
  padding: 0 18px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
}

/* Второстепенное действие рядом с основным: та же высота и место
   под палец, но контуром, а не заливкой — основное на экране одно.
   docs/design/system.md, «Второстепенное и разрушительное». */
.primary.secondary {
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
}

/* Главное действие главного экрана — крупнее обычной кнопки: на
   экране оно одно, и ради него экран открывают (#83). */
.primary.lead {
  min-height: calc(var(--tap) + 16px);
  font-size: var(--text-lg);
  gap: 12px;
}
/* Плюс — заметнее самой надписи: крупный знак в светлом круге
   (OWNER UX review 3, п. 2). Спокойно, без украшательства. */
.primary.lead .plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 26px; line-height: 1; font-weight: 500;
  /* Светлый круг с плюсом цвета действия — дружелюбный знак, а не
     тёмная «плашка» (владелец, #85). */
  background: var(--on-accent);
  color: var(--accent);
}

/* Пустой экран нового специалиста. Кнопка не прижата к шапке: на
   пустой странице ей нужно место, иначе она читается как часть
   заголовка. */
.start { margin-top: 24px; }
.start .primary { margin-top: 0; }

.hint {
  margin: 10px 2px 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Клиент в списке — целиком нажимаемый: попасть в имя одной рукой
   между клиентами труднее, чем кажется. */
a.card.client {
  display: block;
  color: inherit;
  text-decoration: none;
}

.when { white-space: nowrap; font-size: var(--text-sm); color: var(--muted); }

/* Дата и время рядом: на 375 px они умещаются в строку вдвоём и
   переносятся, когда нет. */
.pair { display: flex; flex-wrap: wrap; gap: var(--gap); }
.pair label { flex: 1 1 140px; }

.add-visit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--gap);
  padding: 12px var(--pad);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.add-visit input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 12px;
  font: inherit;
  color: var(--text-colour);
  background: var(--bg);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}

.add-visit label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.add-visit button {
  min-height: var(--tap);
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.section {
  margin: 24px 0 0;
  font-family: var(--font-heading);
  font-size: var(--text);
  font-weight: 700;
  color: var(--heading);
}

/* Записи дня (#93): обычная строка-раскрытие с шевроном, как в
   системных списках телефона, — без собственного календаря. */
.appointments { margin-top: 24px; }
.appointments summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  list-style: none;
  cursor: pointer;
}
.appointments summary::-webkit-details-marker { display: none; }
.appointments summary .section { margin: 0; }
/* Подпись группы строк (макет 09 «Профиль», cabinet-final.dc.html, #1197):
   15/700 приглушённым цветом над карточкой; 8 px до карточки, 18 px между
   группами. Первая подпись — сразу под шапкой раздела. */
.section--label { margin: 18px 0 8px; font-family: var(--font-body); font-size: var(--text-sm);
                  line-height: 1.2; color: var(--muted); }
main > .section--label:first-child { margin-top: 0; }
.appointments summary .when::after {
  content: "›";
  display: inline-block;
  margin-left: 10px;
  font-size: var(--text-lg);
  transition: transform var(--dur-fast) var(--ease);
}
.appointments[open] summary .when::after { transform: rotate(90deg); }

.daynav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); }
.daynav .step {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap);
  font-size: var(--text-lg); color: var(--accent); text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.daypick { flex: 1 1 140px; display: flex; gap: var(--gap); }
.daypick input {
  flex: 1 1 auto; min-width: 0; min-height: var(--tap); padding: 0 12px;
  font: inherit; color: var(--text-colour); background: var(--surface);
  border: 1px solid var(--control-border); border-radius: var(--radius);
}
.daypick button {
  min-height: var(--tap); padding: 0 14px; font: inherit;
  color: var(--accent); background: var(--surface);
  border: 1px solid var(--accent); border-radius: var(--radius);
}
.daynav .today {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-size: var(--text-sm); color: var(--accent); text-decoration: none;
}
/* Сделанная запись — тише остальных, но читается: статус словом и
   галочкой, фон не меняется. */
a.card.client.done { background: var(--bg); }
a.card.client.done .working { color: var(--success-text); }

/* «Выйти» — второстепенное действие: ссылкой, не кнопкой, и не
   рядом с рабочими элементами. docs/design/system.md. */
.signout { margin-top: 24px; }
.signout a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-1);
             font-size: var(--text-sm); color: var(--muted); text-decoration: none; border-radius: var(--radius); }

/* Текстовая кнопка выхода (админка). Кнопку-компонент `.primary`
   («Выйти» в профиле, #598) не трогает: иначе селектор сильнее
   `.primary` и сбивает ей отступы, кегль и подчёркивание (#646). */
.signout button:not(.primary) {
  min-height: var(--tap);
  padding: 0 var(--space-1);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--muted);
  background: none;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Design Platform v1 — компоненты (02.10.2026).
   Классы, на которые опираются тесты и JS (`primary`, `primary lead`,
   `card`, `card client`, `appointments`, классы конструктора), —
   это и есть API компонентов: оформление меняется здесь, разметка и
   контракты шаблонов остаются. Каталог: docs/design/components.md.
   ===================================================================== */

:root {
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  --icon-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* ----- Foundations ----- */
body { display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1 0 auto; width: 100%; max-width: var(--content-max); margin: 0 auto; }
.icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none;
        stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 20px; height: 20px; }
.icon--xs { width: 16px; height: 16px; stroke-width: 2.25; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-mark { display: block; width: 26px; height: auto; margin-bottom: var(--space-2); }
/* Вход (экраны 01–03 редизайна 24.10.2026, cabinet-final.dc.html): знак 56 px,
   название 68 px, шаг 12 px, заголовок 22 px на 16 px ниже названия. */
.brand-signin { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin: var(--space-6) auto var(--space-4); }
.brand-signin img { display: block; height: auto; }
/* Название в SVG чёрное: в тёмной теме инвертируется, master-файл не трогаем. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-wordmark { filter: invert(1); } }
:root[data-theme="dark"] .brand-wordmark { filter: invert(1); }
.login-head { text-align: center; }
.login-head h1 { font-size: var(--text-signin-title); }
/* Отступы колонки входа по макету: знак на 40 px ниже шапки MAX, кнопка
   сервиса на 28 px ниже заголовка (12 + шаг 16). Экран ошибки 00 — свой. */
.login-head:not(.login-head--error) { padding-top: var(--space-4); padding-bottom: var(--space-4); }
/* 04 «Не удалось войти» / «другой MAX» (задача 1193): заголовок только для чтеца, плашка сразу под знаком. */
.login-head.login-head--state { padding-bottom: 0; }
.login-head > * { grid-column: 1 / -1 !important; }
.working, h1 { overflow-wrap: anywhere; }
/* Имена людей переносим только между словами: разрыв «Васильев\nна» на 375 px — дефект чтения. */
.name { overflow-wrap: normal; word-break: normal; }

/* ----- AppNav: BottomNav < 1024 px, TopNav ≥ 1024 px (одна разметка) -----
   Макрос стоит в DOM дважды (до шапки и после main), видим ровно один:
   порядок фокуса совпадает с видимым без flex order. */
.appnav.appnav--top { display: none; }
/* BottomNav по handoff #598 и редизайну 24.10.2026 (CHANGES «BottomNav»,
   #931): закреплена у нижнего края, вся колонка — цель касания, подпись
   12 px в одну строку, активный раздел — цвет link, жирный, полоска 32×3
   у верхнего края, без плашки. Контент резервирует высоту панели +
   safe-area (body.has-bottomnav). Нижний отступ — как в макете
   (reference/components.css): 6 px или safe-area, что больше, а не их
   сумма (#1084); панель 62 + 6 + 1 = 69 px. */
.appnav { position: fixed; inset: auto 0 0 0; z-index: 5;
          padding: 0 4px max(6px, env(safe-area-inset-bottom));
          background: var(--surface); border-top: 1px solid var(--border); }
.appnav__brand { display: none; }
/* Колонка не уже самого длинного слова: «рекомендации» на 360 px
   иначе обрезается по ширине, а не переносится (browser-приёмка #598). */
.appnav__links { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); gap: 4px;
                 max-width: var(--content-max); margin: 0 auto; }
.appnav__links a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
                   gap: 3px; min-height: 62px; padding-top: 9px; font-size: var(--text-nav); line-height: 16px;
                   color: var(--muted); text-align: center; text-decoration: none; border-radius: var(--radius); }
.appnav__links a::before { content: ""; position: absolute; top: 0; left: 50%; width: 32px; height: 3px;
                           margin-left: -16px; border-radius: 0 0 3px 3px; background: transparent; }
/* Одна строка у всех четырёх: пункты одной высоты, без переноса. */
.appnav__label { white-space: nowrap; max-width: 100%; }
.appnav__pill { display: flex; align-items: center; justify-content: center; }
.appnav__links a[aria-current="page"] { color: var(--link); font-weight: 700; }
.appnav__links a[aria-current="page"]::before { background: var(--accent); }
.appnav__links a[aria-current="page"] .icon { stroke-width: 2; }
/* Панель ~70 px; сверху ещё ~34 px воздуха, чтобы последняя запись
   списка не прилипала к панели (#589). */
body.has-bottomnav { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
/* MAX на Android (#1084): MAX сам ставит webview над системной панелью, а
   safe-area приходит ненулевой — отступ удваивался. Класс ставит
   static/max-inset.js; iPhone и обычный браузер — правила выше. */
.max-android .appnav { padding-bottom: 6px; }
.max-android body.has-bottomnav { padding-bottom: 104px; }
.max-android .tg-sheet__panel { padding-bottom: var(--space-3); }
.max-android .send-bar { padding-bottom: var(--space-3); }
.max-android .tg-toast { bottom: var(--space-4); }
@media (min-width: 1024px) {
  main { max-width: var(--content-max-wide); }
  .appnav.appnav--top { display: flex; }
  .appnav.appnav--bottom { display: none; }
  body.has-bottomnav { padding-bottom: 32px; }
  .max-android body.has-bottomnav { padding-bottom: 32px; }
  .appnav { position: sticky; top: 0; bottom: auto; margin: 0 -16px; padding: 0 var(--space-6);
            display: flex; align-items: center; gap: var(--space-6); min-height: 64px; border-top: 0; border-bottom: 1px solid var(--border); }
  .appnav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--heading); text-decoration: none; }
  .appnav__brand img { width: 30px; height: auto; }
  .appnav__links { display: flex; gap: var(--space-1); }
  .appnav__links a { flex-direction: row; min-height: var(--tap); padding: 0 14px; font-size: var(--text); color: var(--text-colour); border-radius: var(--radius); }
  .appnav__links a:hover { background: var(--note-bg); }
  .appnav__pill { display: none; }
  .appnav__links { max-width: none; margin: 0; }
  .appnav__links a::before { display: none; }
  .appnav__links a[aria-current="page"] { background: var(--accent-soft); }
}

/* ----- PageHeader (редизайн 24.10.2026, CHANGES «PageHeader», #931) -----
   Знак + заголовок в одну строку: знак над заголовком съедал ~50 px.
   Вариант Главной — знак крупнее, имя и полная дата строкой ниже. */
.page-head { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.page-head__mark { flex: none; width: 26px; height: auto; }
.page-head__title { margin: 0; font-family: var(--font-heading); font-size: var(--text-xl); font-weight: 700;
                    line-height: 1.2; color: var(--heading); }
.page-head--home { gap: var(--space-3); }
/* Длинное ФИО переносится между словами; слово шире колонки — по месту,
   иначе шапка выталкивает страницу вбок (375 px, «Константинопольская-»). */
.page-head__text { min-width: 0; }
.page-head .page-head__title { overflow-wrap: break-word; }
.page-head--home .page-head__mark { width: 36px; }
.page-head__date { margin: 0; font-size: var(--text-sm); color: var(--muted); }

/* ----- PrimaryButton / SecondaryButton / Lead / Destructive ----- */
.primary { gap: var(--space-2); width: 100%; border: 1px solid var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.primary:active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.primary.secondary:hover { background: var(--accent-soft); color: var(--accent); }
.primary.secondary:active { background: var(--accent-soft); color: var(--accent-soft-text); }
.primary:disabled, .primary[aria-disabled="true"] { color: var(--muted); background: var(--disabled-bg); border-color: var(--border); cursor: not-allowed; }
.primary[aria-busy="true"] { cursor: progress; }
.primary[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: sino-spin .8s linear infinite; }
@keyframes sino-spin { to { transform: rotate(1turn); } }
.primary.lead .plus { font-weight: 600; }
.primary.danger { color: var(--on-accent); background: var(--danger-strong); border-color: var(--danger-strong); width: auto; }
.link-action { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-1); font: inherit;
               font-size: var(--text-sm); color: var(--muted); background: none; border: 0; border-radius: var(--radius);
               text-decoration: none; cursor: pointer; }
/* Текстовое действие без постоянного подчёркивания (#586/#598): нажимаемость
   — цветом, подложкой при наведении/нажатии и видимым focus-visible. */
.link-action:hover { color: var(--accent); background: var(--note-bg); }
.link-action:active { color: var(--accent-soft-text); background: var(--accent-soft); }
.link-action--accent { color: var(--accent); }
.link-action--danger { color: var(--danger-text); }
/* Обратная связь специалиста (#840, п. 2): тихая строка под содержимым. */
/* Профиль (#932): строка обратной связи отдельной карточкой, «Выйти» —
   текстовая кнопка по центру, подтверждение — модальное окно. */
.profile-feedback { margin-top: 18px; }   /* gap между группами макета 09 (#1197) */
.signout--center { display: flex; justify-content: center; }
.signout button.signout__btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 var(--space-3);
                               font: 600 var(--text)/1.2 var(--font-body); color: var(--muted); }
.tg-confirm { width: min(100% - 2 * var(--pad), 360px); padding: var(--pad); border: 1px solid var(--border);
              border-radius: var(--radius-card); background: var(--surface); color: var(--text-colour); }
.tg-confirm::backdrop { background: color-mix(in srgb, var(--text-colour) 45%, transparent); }
.tg-confirm__title { margin: 0 0 var(--space-4); font-size: var(--text); font-weight: 700; }
.tg-confirm__actions { display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; }
.tg-confirm__actions > :last-child { justify-content: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); flex: none;
            padding: 0; color: var(--text-colour); background: none; border: 0; border-radius: var(--radius); text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--note-bg); }
.daynav .step { background: var(--surface); }
.daynav .step:hover { background: var(--accent-soft); }

/* ----- TopBar (шапка страницы) ----- */
body > header { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-1); align-items: center; }
body > header > :not(.back) { grid-column: 2; }
body > header > .back { grid-row: 1 / span 2; margin-left: calc(-1 * var(--space-3)); }
body > header .counts:empty { display: none; }
.home-head { background: none; border-bottom: 0; }
/* Главная (#598): знак и имя слева, дата справа в той же строке. */
.day-head { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-2); }
.day-head > .brand-mark { grid-column: 1; margin-bottom: 0; }
.day-head > h1 { grid-column: 2; grid-row: 1; }
.day-head > .counts { grid-column: 3; grid-row: 1; margin-top: 0; white-space: nowrap; }
/* Главная по редизайну 05 (#932): знак слева на две строки, имя и под
   ним полная дата («Суббота, 24 октября»). */
.tg-home-head { grid-template-columns: auto minmax(0, 1fr); }
.tg-home-head > .brand-mark { grid-row: 1 / span 2; width: 36px; }
.tg-home-head > h1 { font-weight: 700; overflow-wrap: anywhere; }
.tg-home-head > .counts { grid-column: 2; grid-row: 2; white-space: normal; }
/* Шапка раздела (макеты 07–09, 16 «Клиенты», аудит #1192): знак слева от
   заголовка в одну строку, на фоне страницы без полосы и границы; число
   раздела — справа от заголовка («Клиенты 356»). Размеры — как PageHeader. */
.section-head { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; min-height: 60px;
                margin-bottom: var(--space-2); padding-block: var(--space-1) 0; background: none; border-bottom: 0; }
.section-head > .brand-mark { grid-column: 1; grid-row: 1; margin-bottom: 0; }
.section-head > h1 { grid-column: 2; grid-row: 1; font-size: var(--text-xl); line-height: 1.2; overflow-wrap: break-word; }
.section-head > .counts { grid-column: 3; grid-row: 1; margin-top: 0; font-size: var(--text); max-width: 11em; text-align: end;
                          font-variant-numeric: tabular-nums; }
/* Шапка фокус-потока (макет 14·4 «Кому консультация», #1201): «‹» слева
   на две строки, заголовок крупно (24/700) и подпись под ним — на фоне
   страницы, без полосы и границы. */
.flow-head { padding-block: var(--space-2) 0; margin-bottom: var(--space-2); background: none; border-bottom: 0; }
.flow-head > h1 { font-size: var(--text-xl); line-height: 1.2; overflow-wrap: break-word; }
/* Главное действие закреплено внизу экрана (макет 14·4); распорка держит
   место, чтобы последняя строка не пряталась под ним. */
.action-dock { position: fixed; inset: auto 0 0 0; z-index: 4; padding: var(--space-3) max(16px, calc((100% - var(--content-max)) / 2))
               calc(var(--space-3) + env(safe-area-inset-bottom));
               background: var(--bg); border-top: 1px solid var(--border); }
.action-dock-space { height: 88px; }
.max-android .action-dock { padding-bottom: var(--space-3); }
/* Шапка второго уровня (макеты 14 client-card, 15 specialist-card, аудит
   #1192): «‹ Раздел» приглушённой строкой, ниже заголовок крупно (24/700),
   под ним подпись или метка статуса; на фоне страницы, без полосы. */
.sub-head { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-bottom: var(--space-4);
            padding-block: var(--space-1) 0; background: none; border-bottom: 0; }
body > header.sub-head > * { grid-column: 1; }
.sub-head > .back-link { justify-self: start; display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap);
                         padding-inline: var(--space-1) var(--space-2);
                         color: var(--muted); font-weight: 600; text-decoration: none; border-radius: var(--radius); }
.sub-head > .back-link:hover { background: var(--note-bg); }
.sub-head > h1 { margin-top: 0; font-size: var(--text-xl); line-height: 1.2; overflow-wrap: break-word; text-wrap: wrap; }
.sub-head > .counts { margin-top: 0; font-size: var(--text); }
/* Шапка записи админки (макеты 16 support-entry / feedback-entry, #1192):
   полоса как у карточки клиента — ‹, заголовок 17/700 (source
   admin-part2.dc.html) и подпись под ним, метка статуса справа по центру
   двух строк. */
.entry-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.entry-head > h1 { font-size: var(--text); line-height: 1.3; }
.entry-head > .entry-head__status { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin-left: var(--space-2); }
/* Плюс без круга (макет 05, #932; superseded: светлый круг, OWNER UX review 3, п. 2). */
#create-recommendation .plus { width: auto; height: auto; border-radius: 0; background: none; color: inherit; }
.tg-home-appts { display: flex; flex-direction: column; gap: var(--space-3); }
.signin-alt { color: var(--muted); font-size: var(--text-sm); }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); color: var(--muted); }
.signin input:focus-visible, .search input:focus-visible, .daypick input:focus-visible, .add-visit input:focus-visible,
.picker input[type=search]:focus-visible, textarea:focus-visible, #new-client input:focus-visible, input.manual:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field--error input, input[aria-invalid="true"] { border-color: var(--danger-text); box-shadow: 0 0 0 1px var(--danger-text); }
.field__error { display: flex; gap: 6px; align-items: flex-start; color: var(--danger-text); }

/* ----- Grouped list: соседние карточки — одна поверхность ----- */
.card { border-radius: var(--radius-card); }
.card:not(.note, .warning, .neutral) + .card:not(.note, .warning, .neutral) {
  margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.card:not(.note, .warning, .neutral):has(+ .card:not(.note, .warning, .neutral)) {
  border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ----- ClientRow / AppointmentRow ----- */
:is(a, button).card.client { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 10px var(--pad); }
:is(a, button).card.client:hover { background: var(--bg); }
/* Выбор клиента под записью (#172) — кнопка формы, та же строка. */
button.card.client { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
a.card.client > .row, a.card.client > .body { flex: 1; min-width: 0; }
a.card.client > .body { display: flex; flex-direction: column; }
a.card.client .time { width: 48px; flex: none; font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
a.card.client .chev { flex: none; display: flex; color: var(--muted); }
a.card.client.done { background: var(--surface); }
a.card.client.done .time { color: var(--muted); }
a.card.client.done .working { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: 600; }
/* Услуга записи под ФИО (#644): мельче и тише имени и у сделанной строки. */
a.card.client .working.service, .appointment-static .working.service { display: block; font-size: var(--text-sm); font-weight: 400; color: var(--muted); }
.appointment-static { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 10px var(--pad); }
.appointment-static > .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appointment-static .time { width: 48px; flex: none; font-size: var(--text-sm); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ----- MetricRow (админка, #409): строка grouped list, число справа ----- */
.card.metric { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 10px var(--pad);
               color: inherit; text-decoration: none; }
.card.metric > .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.metric__value { flex: none; font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card.metric .chev { flex: none; display: flex; color: var(--muted); }
a.card.metric:hover { background: var(--bg); }
.metric-groups > section > .section { margin-top: var(--space-6); }
/* Образец AppNav админки в /design-system: на месте, а не прилипшим. */
.ds-nav-preview .appnav.appnav--bottom { display: block; position: static; margin: var(--space-3) 0 0; }
/* Строка без перехода (div.card.client): та же раскладка, без hover. */
div.card.client { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 10px var(--pad); }
/* Со статусом (tag) — строки друг под другом, как у RecommendationRow. */
/* Со строкой meta (.working) — тоже: в одну строку с именем она
   наезжала на него на 360/390 (Профиль, Мои клиенты; #598). */
a.card.client:has(> .status-tag), a.card.client:has(> .working) { flex-direction: column; align-items: stretch; gap: 0; }
.card.client > .status-tag { margin-top: var(--space-1); }
/* Фильтр статуса и страницы списков админки — ссылки, состояние в адресе. */
.admin-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.admin-filter a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-3);
                  border: 1px solid var(--border); border-radius: var(--radius-sm); color: inherit; text-decoration: none; font-size: var(--text-sm); }
.admin-filter a[aria-current] { background: var(--accent-soft); color: var(--accent-soft-text); border-color: var(--accent-soft); font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); }
@media (min-width: 1024px) {
  .metric-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); align-items: start; }
}

/* ----- Status / EmptyState / InlineError ----- */
.status-tag { display: inline-flex; align-items: center; gap: var(--space-1); align-self: flex-start; padding: 2px var(--space-2);
              font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-sm); }
.status-tag--success { background: var(--success-bg); color: var(--success-text); }
.status-tag--note { background: var(--note-bg); color: var(--note-text); }
.status-tag--warning { background: var(--warning-bg); color: var(--warning-text); }
.done-link { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); color: var(--success-text); font-weight: 600; text-decoration: none; }
.action-link { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); color: var(--accent); font-weight: 600; text-decoration: none; }
.card.note, .card.warning { display: flex; gap: var(--space-2); align-items: flex-start; border-radius: var(--radius); }
.card.note { border: 0; }

/* ----- Disclosure (записи дня) ----- */
.appointments summary .when::after { content: ""; width: 20px; height: 20px; margin-left: var(--space-2); vertical-align: -4px;
  background: currentColor; -webkit-mask: var(--icon-chevron-right) center / contain no-repeat; mask: var(--icon-chevron-right) center / contain no-repeat; }

/* ----- Chip ----- */
.chip { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: var(--tap); min-height: var(--tap);
        padding: 0 14px; font: inherit; color: var(--text-colour); background: var(--surface); white-space: nowrap; flex: none;
        border: 1px solid var(--control-border); border-radius: var(--radius-pill); cursor: pointer; }
.chip:hover { background: var(--bg); }
/* Выбранное — мягкой подложкой: сплошной акцент только у главной кнопки экрана (02.10.2026). */
.chip[aria-pressed="true"] { color: var(--accent-soft-text); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.chip[aria-pressed="true"]::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.chip:disabled { color: var(--muted); background: var(--disabled-bg); border-color: var(--border); cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: var(--gap); margin: var(--space-2) 0; align-items: center; }
.chips .label { flex: 0 0 100%; font-size: var(--text-sm); color: var(--muted); }
/* Срок курса (редизайн 06, #1195): «5 дн · 10 дн · 20 дн · Другое» — одной
   строкой на 390 px, как в макете: чипы компактнее и со скруглением карточки. */
.chips.days { gap: var(--space-2); }
.chips.days > .chip { padding: 0 10px; border-radius: var(--radius); }

/* ----- RecommendationConstructor: CourseCard / PreparationRow / SendSummary -----
   Перенесено из локального <style> recommend_constructor.html (классы
   строит его JS). Жёсткие белый и зелёный цвета заменены токенами. */
.course { margin: var(--space-3) 0; padding: var(--space-3) var(--pad); background: var(--surface);
          border: 1px solid var(--border); border-radius: var(--radius-card); }
.course-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.course-head h2 { margin: 0; font-size: var(--text-lg); }
.chip.small { min-width: var(--tap); min-height: var(--tap); padding: 0; }
.chip.danger { color: var(--on-accent); background: var(--danger-strong); border-color: transparent; border-radius: var(--radius); }
.item { margin: 10px calc(-1 * var(--pad)) 0; padding: 0 var(--pad); border-top: 1px solid var(--border); }
.item-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: center; }
/* PreparationRow свёрнутой строкой (редизайн 06, #1195): название, схема,
   «N шт» справа; касание раскрывает редактор. */
.item-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex: 1; min-width: 0;
            width: 100%; min-height: var(--tap); padding: var(--space-3) 0; font: inherit; color: var(--text-colour);
            text-align: left; background: none; border: 0; cursor: pointer; }
.item-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-name { font-weight: 600; color: var(--text-colour); overflow-wrap: anywhere; }
.item-row__scheme { font-size: var(--text-sm); color: var(--muted); text-wrap: pretty; }
.item-row__packs { flex: none; font-size: var(--text-sm); color: var(--muted); }
.usage { margin: 2px 0 var(--space-2); font-size: var(--text); color: var(--text-colour); text-wrap: pretty; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 10px; }
.picker { margin-top: 10px; }
.picker .results .chip { text-align: left; border-radius: var(--radius); }
.preview .line { margin: var(--space-1) 0; }
#constructor .status { margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--muted); }
#constructor .error { padding: var(--space-2) var(--space-3); color: var(--danger-text); background: var(--danger-bg); border-radius: var(--radius-sm); }
.picker input[type=search], #constructor textarea, #new-client input, label.age input, input.manual {
  font: inherit; color: var(--text-colour); background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius); }
.picker input[type=search] { width: 100%; min-height: var(--tap); padding: 0 var(--space-3); }
#constructor textarea { width: 100%; min-height: 4.5em; padding: 10px var(--space-3); }
.manual { width: 5.5em; min-height: var(--tap); padding: 0 var(--space-2); }
.notes label { display: block; margin: var(--space-2) 0; }
button.disclosure { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: var(--tap);
  padding: 0 14px; margin-top: var(--space-3); font: inherit; font-weight: 600; color: var(--text-colour);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
button.disclosure .chevron { color: var(--muted); }
/* «Дополнительно» — тот же Disclosure, что «Жалобы» (редизайн 06, #1195). */
section.notes button.disclosure { min-height: 56px; font-size: var(--text-disclosure); }
section.notes button.disclosure .icon { color: var(--muted); transition: transform var(--dur-fast) var(--ease); }
section.notes button.disclosure[aria-expanded="true"] .icon { transform: rotate(180deg); }
/* SendSheet — шторка перед отправкой, вариант В (решение владельца 24.10,
   Refs 932; заменяет сводку 837). Нативный dialog у нижнего края, ручка,
   «Кому» + текст по курсам с прокруткой внутри; действия всегда видны.
   Затемнение — как у .tg-confirm. */
.tg-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: 88vh; margin: auto auto 0;
            padding: 0; border: 0; border-radius: var(--radius-card) var(--radius-card) 0 0;
            background: var(--surface); color: var(--text-colour); overflow: hidden; }
.tg-sheet::backdrop { background: color-mix(in srgb, var(--text-colour) 45%, transparent); }
.tg-sheet__panel { display: flex; flex-direction: column; max-height: 88vh;
                   padding: 0 16px calc(var(--space-3) + env(safe-area-inset-bottom)); }
.tg-sheet__grab { display: flex; justify-content: center; padding: var(--space-2) 0 var(--space-3); touch-action: none; cursor: grab; }
.tg-sheet__handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); }
.tg-sheet__eyebrow { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.tg-sheet__title { margin: 0 0 var(--space-2); font-size: var(--text-lg); overflow-wrap: anywhere; }
.tg-sheet__title:focus { outline: none; }
.tg-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tg-sheet__actions { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); }
.tg-sheet__actions > :last-child { justify-content: center; }
.tg-sheet--inline { position: static; margin: var(--space-3) 0; border: 1px solid var(--border); }
.tg-sheet--inline, .tg-sheet--inline .tg-sheet__panel { max-height: none; }
.summary-course { margin: var(--space-2) 0 var(--space-1); font-weight: 600; }
.summary-line { margin: var(--space-1) 0; overflow-wrap: anywhere; text-wrap: pretty; }
.summary-note { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--muted); }
.summary-note--error { color: var(--danger-text); }
.confirm-delete { margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius-card); background: var(--danger-bg); color: var(--danger-text); }
.link-danger { min-height: var(--tap); margin-top: 10px; padding: 0 var(--space-1); font: inherit; color: var(--danger-text);
               background: none; border: 0; border-radius: var(--radius); text-decoration: none; cursor: pointer; }
/* «+ Добавить позицию» — последняя строка курса, текстовая ссылка;
   «+ Добавить курс» — небольшая тонированная кнопка слева (редизайн 06, #1195). */
.add-item-row { margin: 0 calc(-1 * var(--pad)); padding: var(--space-2) var(--pad) 0; border-top: 1px solid var(--border); }
.add-item { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: 0 var(--space-1);
            font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; border-radius: var(--radius); cursor: pointer; }
.add-course { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap);
              margin: var(--space-1) 0 var(--space-3); padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
              font: inherit; font-weight: 600; color: var(--accent); text-align: left;
              background: var(--accent-soft); border: 0; border-radius: var(--radius); cursor: pointer; }
.add-item:hover { background: var(--accent-soft); }
.add-course:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }
.add-course .plus, .add-item .plus { font-size: 1.3em; font-weight: 400; line-height: 1; }
/* Конструктор, редизайн 06: «Возраст» рядом с телефоном в «Кому».
   «Отправить рекомендацию» с подсказкой — НЕ закреплена: стоит в конце
   формы сразу после «Кому» ([OWNER DECISION 2026-10-26
   constructor-send-button=inline], #1057; закреплённая закрывала форму). */
.phone-age { display: flex; gap: var(--space-3); align-items: flex-end; }
.phone-age > label.notes { flex: 1; min-width: 0; }
.phone-age > label.age { margin: var(--space-2) 0; }
#new-client .phone-age label.age input { width: 6em; }
.send-bar { position: static; margin: var(--space-4) 0 0; padding: 0 0 calc(var(--space-3) + env(safe-area-inset-bottom)); }
.send-bar .primary { width: 100%; margin: 0; }
.send-bar .status { margin: var(--space-2) 0 0; text-align: center; }
.packs-note { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.link-inline { min-height: var(--tap); padding: 0 var(--space-1); font: inherit; color: var(--accent); background: none; border: 0;
               border-radius: var(--radius); text-decoration: none; cursor: pointer; }
/* Без постоянного подчёркивания (#586 корр. 4.6, #646): как `.link-action`
   — цвет, подложка при наведении/нажатии, focus-visible из Foundations. */
.link-inline:hover, .link-danger:hover, .signout a:hover, .signout button:not(.primary):hover { background: var(--note-bg); }
.link-inline:active, .signout a:active, .signout button:not(.primary):active { color: var(--accent-soft-text); background: var(--accent-soft); }
.link-danger:active { background: var(--danger-bg); }
#new-client h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
#new-client label, label.age { display: block; margin: 10px 0 0; }
#new-client input, label.age input { display: block; width: 100%; min-height: var(--tap); margin-top: var(--space-1); padding: 0 10px; }
label.age input { width: 6em; }

/* ----- SearchField / TextArea / Disclosure / States (Design Platform v1.1) ----- */
.search[aria-busy="true"] button { cursor: progress; color: var(--muted); }
.textarea { width: 100%; min-height: calc(var(--tap) * 2); padding: 10px var(--space-3); font: inherit; color: var(--text-colour);
            background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius); resize: vertical; }
.textarea:disabled { color: var(--muted); background: var(--disabled-bg); border-color: var(--border); }
.field--error .textarea { border-color: var(--danger-text); box-shadow: 0 0 0 1px var(--danger-text); }
.field__hint { font-size: var(--text-xs); color: var(--muted); }
.disclosure { margin: var(--space-3) 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.disclosure > summary { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: 0 14px;
                        font-size: var(--text-disclosure); font-weight: 600; cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
/* Подпись тянется по классу, а не по :first-child: с иконкой слева
   (замок на экране 01) первым ребёнком идёт svg, и шеврон уезжал от
   правого края (ревью PR #1064, задача 1055). */
.disclosure__label { flex: 1; min-width: 0; }
.disclosure__meta { font-size: var(--text-sm); font-weight: 400; color: var(--muted); }
.disclosure > summary .icon { color: var(--muted); transition: transform var(--dur-fast) var(--ease); }
.disclosure[open] > summary .icon { transform: rotate(180deg); }
/* Иконка слева от подписи (замок у «Войти по телефону и паролю», экран 01,
   задача 1055): цвет текста, не поворачивается. */
.disclosure > summary .disclosure__icon, .disclosure[open] > summary .disclosure__icon { color: var(--text-colour); transform: none; }
.disclosure > summary:has(> .disclosure__icon) { gap: var(--space-3); padding-left: 16px; }
.disclosure__body { padding: 0 14px var(--space-3); }
/* Карточка пароля на входе (#1193): в MAX закрытая — «Войти по телефону и
   паролю» (01), раскрытая — «По телефону и паролю», поля без видимых
   подписей и «Забыли пароль? Продолжите с MAX» (02). В браузере — всегда
   «Войти по телефону и паролю», подписи видны (01 browser-password-open).
   MAX отмечает `data-login-shell="max"`: сервер или static/login-variant.js. */
.login-pw__open, .login-pw__max { display: none; }
[data-login-shell="max"][open] .login-pw__open { display: inline; }
[data-login-shell="max"][open] .login-pw__closed { display: none; }
[data-login-shell="max"] .login-pw__max { display: inline; }
[data-login-shell="max"] .tg-field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Quiet (#826): второстепенная подсказка на редкий случай — без рамки и
   подложки, приглушённым мелким текстом; нажимаемость — цветом и подложкой
   при наведении/нажатии, как у `.link-action`, без подчёркивания. */
.disclosure--quiet { margin: var(--space-2) 0; background: none; border: 0; }
.disclosure--quiet > summary { min-height: var(--tap); padding: 0 var(--space-1); font-size: var(--text-sm); font-weight: 400; color: var(--muted);
                               border-radius: var(--radius); }
.disclosure--quiet > summary:hover { color: var(--accent); background: var(--note-bg); }
.disclosure--quiet > summary:active { color: var(--accent-soft-text); background: var(--accent-soft); }
.disclosure--quiet .disclosure__body { padding: 0 var(--space-1) var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.disclosure--quiet .disclosure__body p { margin: 0 0 var(--space-1); }
.state { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; padding: var(--space-4) var(--pad);
         border-radius: var(--radius-card); background: var(--note-bg); color: var(--note-text); }
.state p { margin: 0; }
.state__title { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.state__text { font-size: var(--text-sm); }
.state--error { background: var(--danger-bg); color: var(--danger-text); }
.state--done { background: var(--success-bg); color: var(--success-text); }
.state--loading { flex-direction: row; align-items: center; background: none; color: var(--muted); }
/* EmptyState (редизайн 24.10.2026, CHANGES «EmptyState», #931): иконка в
   плашке + заголовок + подсказка, пунктирная рамка вместо серой плашки. */
.state--empty { flex-direction: row; align-items: center; gap: var(--pad); padding: var(--space-4);
                background: none; color: var(--text-colour); border: 1px dashed var(--border); }
.state__icon { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
               border-radius: var(--radius); background: var(--note-bg); color: var(--muted); }
.state__body { display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-start; min-width: 0; }
.state--empty .state__text { color: var(--muted); line-height: 1.4; }
.state--empty .primary { margin-top: var(--space-1); }
/* DeliveryStatus: та же метка статуса, иконка обязательна (ui.delivery_status). */
.delivery-status { white-space: nowrap; }
.spinner { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: sino-spin .8s linear infinite; }
.state .primary { width: auto; }
a.card.client.rec .status-tag { margin-top: var(--space-1); }
@media (prefers-reduced-motion: reduce) { .spinner, .primary[aria-busy="true"]::before { animation-duration: 2.4s; } .disclosure > summary .icon { transition: none; } }

/* ----- /design-system: раскладка витрины ----- */
.ds-section { margin-top: var(--space-6); }
.ds-frames { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; }
.ds-frame { flex: none; max-width: 100%; padding: var(--space-4); background: var(--bg); border: 1px dashed var(--control-border); border-radius: var(--radius-card); }
.ds-frame--320 { width: 320px; } .ds-frame--375 { width: 375px; } .ds-frame--393 { width: 393px; } .ds-frame--wide { width: min(100%, 960px); }
.ds-frame.theme-dark { color: var(--text-colour); background: var(--bg); }
.ds-states { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: center; }
.ds-states > span { font-size: var(--text-xs); color: var(--muted); }
/* /design-system: место под открытый список подсказки (#1065). */
.ds-typeahead-open { padding-bottom: 136px; }
.ds-typeahead-open--empty { padding-bottom: 64px; }
.ds-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.ds-icons li { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--muted); }
.ds-icons .icon { color: var(--text-colour); }

/* Вложение обратной связи в админке (#840, п. 4): плеер и изображение на всю ширину карточки. */
.feedback-media { display: block; width: 100%; max-width: 100%; margin-top: var(--gap); }
img.feedback-media { height: auto; border-radius: var(--radius-card); }
.feedback-transcript { margin-top: var(--gap); }

/* ----- Единые действия (#905, дизайн владельца 23.10.2026) -----
   Эталон: design/reference/web/max-login-error/ (TZ.md, часть A).
   Три вида действий + notice; каталог — docs/design/components.md,
   «Действия». Цвета — только роли design.py (--link, --warning-*). */

/* Ссылки по умолчанию — цвет text.accent в обеих темах, никакого
   синего браузерного. Подчёркивание — только у ссылок внутри текста.
   :where — нулевая специфичность: любой компонент со своим цветом
   (меню, строки, кнопки) сильнее и не меняет вид под курсором. */
:where(a) { color: var(--link); text-underline-offset: 3px; }
:where(a:hover) { color: var(--accent-pressed); }
.tg-prose a { text-decoration: underline; }

:where(.tg-btn, .tg-row, .tg-text-btn):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 1. Основная кнопка — одна на экран. 52 px — макет владельца. */
.tg-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; min-height: 52px;
          padding: 0 var(--space-6); border: 0; border-radius: var(--radius); font: 600 var(--text)/1.2 var(--font-body);
          text-decoration: none; cursor: pointer; }
.tg-btn--primary, .tg-btn--primary:hover, .tg-btn--primary:visited { color: var(--on-accent); }
.tg-btn--primary { background: var(--accent); }
.tg-btn--primary:hover { background: var(--accent-hover); }
.tg-btn--primary:active { background: var(--accent-pressed); }
.tg-btn[disabled], .tg-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; cursor: not-allowed; }
.tg-btn[aria-busy="true"] { pointer-events: none; cursor: progress; }
.tg-btn[aria-busy="true"]::before { content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: sino-spin .8s linear infinite; }
.tg-btn .icon { width: 20px; height: 20px; }

/* 2. Строки-переходы в одной карточке. */
.tg-rows { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.tg-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--pad);
          color: var(--text-colour); text-decoration: none; }
.tg-row + .tg-row { border-top: 1px solid var(--border); }
/* Карточка обрезает содержимое (overflow) — кольцо фокуса строки внутрь. */
.tg-rows .tg-row:focus-visible { outline-offset: -3px; border-radius: var(--radius-card); }
.tg-row:hover { background: var(--note-bg); color: var(--text-colour); }
/* «Продолжить рекомендацию» под главным действием (задача 1022, шаг 4). */
#resume-draft { margin-top: var(--space-3); }
.tg-row:active { background: var(--border); }
.tg-row--static:hover, .tg-row--static:active { background: none; }
/* Строка-кнопка в POST-форме (выбор клиента записи, макет 14·4, задача 1201):
   вид как у ссылки-строки, разделитель — между формами. */
.tg-row-form { margin: 0; }
button.tg-row { width: 100%; font: inherit; text-align: left; background: none; border: 0; border-radius: 0; cursor: pointer; }
.tg-row-form + .tg-row-form > .tg-row { border-top: 1px solid var(--border); }
.tg-row__icon { display: flex; color: var(--text-colour); }
.tg-row__icon .icon { width: 22px; height: 22px; }
.tg-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-row__title { font-size: var(--text); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tg-row__hint { font-size: var(--text-xs); line-height: 1.35; color: var(--muted); }
.tg-row__chev { display: flex; color: var(--muted); }
.tg-row__chev .icon { width: 20px; height: 20px; }
/* issue 1172: существующие способы входа в одной карточке профиля. */
.profile-sign-in .tg-row__icon { color: var(--muted); }
.profile-sign-in__provider { width: 26px; height: 26px; object-fit: contain; flex: none; }
.profile-sign-in + .tg-notice--info { margin-top: var(--space-4); }
.profile-sign-in + .tg-notice--info .tg-notice__icon { color: var(--muted); }
/* ClientRow (редизайн 24.10.2026, TZ-common §4): имя 17/600 с переносом, вторая строка 14 muted, без инициалов. */
.tg-row.tg-client { padding-top: var(--space-3); padding-bottom: var(--space-3); }
/* «Все клиенты · N» — переход цветом ссылки, не красная кнопка. */
.tg-row--more, .tg-row--more:hover { color: var(--link); }
.tg-row--more .tg-row__chev { color: var(--link); }
.tg-row--more .tg-row__aside { font-weight: 400; }
.tg-row__count { font-variant-numeric: tabular-nums; }
/* AppointmentRow (редизайн 24.10.2026, TZ-common §4, задача 931): время · имя · услуга · статус · ›.
   Время 17/700 (своего кегля 16 в шкале нет), не сжимается; строка по верху — длинное ФИО переносится. */
.tg-row.tg-appt, .tg-row.tg-rec { align-items: flex-start; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.tg-appt__time { flex: none; min-width: 3em; font-size: var(--text); font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tg-row.tg-appt .tg-row__chev, .tg-row.tg-rec .tg-row__chev { align-self: center; }
/* RecommendationRow: имя и время в одной строке, время справа не сжимается, имя переносится без наезда. */
.tg-rec__head { display: flex; align-items: baseline; gap: var(--space-2); }
.tg-rec__head .tg-row__title { flex: 1; min-width: 0; }
.tg-rec__time { flex: none; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-row__text > .status-tag { align-self: flex-start; margin-top: var(--space-1); }
/* ProductRow (screens/10-catalog, задача 1062): фото 52 на белой плашке, название и цена в строку,
   метка органа в рамке 12/600 + действие одной строкой с многоточием. */
/* Отступы строки по макету (catalog.dc.html: padding 10px 12px 10px 10px) — строка 73 px; токена 10 px в шкале нет. */
.tg-row.tg-product { align-items: flex-start; padding: 10px 12px 10px 10px; }
.tg-product__photo { flex: none; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface-media); }
.tg-product__photo img { opacity: .3; }
.tg-product__photo--image { overflow: hidden; }
.tg-product__photo--image img { opacity: 1; width: 100%; height: 100%; object-fit: cover; }
.tg-product__head { display: flex; align-items: baseline; gap: var(--space-2); }
.tg-product__head .tg-row__title { flex: 1; min-width: 0; }
.tg-product__price { flex: none; font-size: var(--text); font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tg-product__tcm { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin-top: var(--space-1); }
.tg-product__label { flex: none; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px;
  font-size: var(--text-tag); font-weight: 600; line-height: 1.35; color: var(--muted); }
.tg-product__line { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: var(--text-sm); color: var(--text-colour); }
/* SearchField → Notice: зазор 12 px, как на макете 10-catalog (до правки поле почти касалось плашки). */
.tg-search + .tg-notice { margin-top: var(--space-3); }
/* Подпись группы по дате: «Сегодня · 2». */
.tg-group-label { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
.tg-group-label:first-child { margin-top: 0; }

/* 3. Текстовая кнопка — второстепенное действие, без подчёркивания. */
.tg-text-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 10px; border: 0;
               border-radius: var(--radius); background: var(--accent-soft); color: var(--link);
               font: 600 var(--text-sm)/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.tg-text-btn:hover { color: var(--accent-pressed); filter: brightness(.97); }
/* issue 1172: строка-кнопка входа в карточке профиля — не сжимается. */
.profile-sign-in .tg-text-btn { flex: none; white-space: nowrap; }
.tg-text-btn--plain { background: transparent; }
.tg-text-btn--plain:hover { background: var(--accent-soft); filter: none; }
.tg-text-btn[disabled], .tg-text-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
/* «Забыли пароль?»: в браузере по центру под «Войти» (01 browser-password-open,
   login-browser.dc.html `align-self:center`), в MAX — слева (02).
   После базового `.tg-text-btn`: первое совпадение селектора — сама кнопка. */
[data-login-password]:not([data-login-shell="max"]) form > .tg-text-btn { align-self: center; }

/* Notice warning — статус передаётся иконкой и заголовком, не только цветом. */
.tg-notice { display: flex; gap: var(--space-3); padding: var(--pad); border-radius: var(--radius-card); }
.tg-notice--warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.tg-notice__icon { flex: none; display: flex; padding-top: 1px; color: var(--warning-icon); }
.tg-notice__icon .icon { width: 22px; height: 22px; }
.tg-notice__title { display: block; font-size: var(--text); font-weight: 700; color: var(--text-colour); }
.tg-notice__body { display: block; font-size: var(--text-sm); line-height: 1.45; color: var(--text-colour); }
/* Редизайн 24.10.2026, шаг 2/4 (TZ-common §2/§5/§6, reference/components.css). */
/* SecondaryButton: второе действие, нейтральное — surface2 + рамка control. */
.tg-btn--secondary, .tg-btn--secondary:visited { background: var(--surface-2); color: var(--text-colour); border: 1px solid var(--control-border); }
.tg-btn--secondary:hover { background: var(--border); color: var(--text-colour); }
.tg-btn--secondary:active { background: var(--border); }
/* ProviderButton «Продолжить с MAX»: surface2 без рамки, 56 px, радиус 12, знак 26. */
.tg-btn--provider, .tg-btn--provider:visited { min-height: 56px; border: 0; border-radius: var(--radius-provider);
  background: var(--surface-2); color: var(--text-colour); }
.tg-btn--provider:hover { background: var(--border); color: var(--text-colour); }
.tg-btn--provider:active { background: var(--border); }
.tg-btn--provider img { flex: none; width: 26px; height: 26px; border-radius: var(--radius-sm); }
/* Знак «Я» — в круге (TZ.md экрана 01, браузер п. 4); знак MAX остаётся скруглённым квадратом. */
.tg-btn--provider img[src$="/yandex-ya.svg"] { border-radius: 50%; }
/* Notice info: нейтральная подсказка следующего шага. */
.tg-notice--info { background: var(--surface-2); }
.tg-notice--info .tg-notice__icon { color: var(--text-colour); }
/* InlineError под полем. */
.tg-inline-error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--text-xs); line-height: 1.4; color: var(--warning-icon); }
.tg-inline-error .icon { flex: none; margin-top: 1px; }
/* Поле 52 px и SearchField / поле с кнопкой внутри (TZ-common §5,
   reference/components.css «Field»). Лупа слева — без кнопки «Найти»;
   кнопка внутри — 44×44 у правого края, иконка `--muted`. */
.tg-field { display: flex; flex-direction: column; gap: 6px; }
.tg-field__label { font-size: var(--text-xs); color: var(--muted); }
.tg-input { width: 100%; min-width: 0; min-height: 52px; padding: 0 14px; font: 400 var(--text)/1.2 var(--font-body); color: var(--text-colour);
            background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius); }
.tg-input::placeholder { color: var(--muted); opacity: 1; }
.tg-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.tg-input[aria-invalid="true"] { border-color: var(--warning-icon); }
.tg-input::-webkit-search-decoration { -webkit-appearance: none; }
.tg-input-wrap { position: relative; display: flex; align-items: center; }
.tg-input-wrap > .tg-input { flex: 1; }
/* typeahead.js оборачивает поле в .typeahead (поиск клиентов, 932):
   отступ под лупу и ширина — и для обёрнутого поля. */
.tg-input-wrap > .typeahead { flex: 1; }
.tg-input-wrap--lead > .icon { position: absolute; left: 14px; z-index: 1; width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.tg-input-wrap--lead > .tg-input,
.tg-input-wrap--lead > .typeahead > .tg-input { padding-left: 46px; }
.tg-input-wrap--action > .tg-input { padding-right: 52px; }
.tg-input-wrap__btn { position: absolute; right: 4px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
                      padding: 0; color: var(--muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.tg-input-wrap__btn:hover { color: var(--text-colour); background: var(--note-bg); }
.tg-input-wrap__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.tg-input-wrap__btn .icon { width: 22px; height: 22px; }
/* «Кому» конструктора (макет 06, issue 1058): «Телефон» с иконкой «Выбрать
   из контактов» внутри поля и узкий «Возраст» — одной строкой; пояснение
   о контактах и выбор номера — строкой ниже во всю ширину. Сетка, а не
   flex: блок выбора контакта стоит в разметке между полями и раньше
   сжимал телефон до рамки. */
#new-client .phone-age { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: end; }
#new-client .phone-age > label.notes { grid-column: 1; grid-row: 1; }
#new-client .phone-age > label.age { grid-column: 2; grid-row: 1; }
/* «Возраст» — две-три цифры: узкое поле, как в макете (~87 px из 390). */
#new-client .phone-age > label.age input { width: 5em; }
#new-client .phone-age > .contact-picker { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
#new-client .tg-input-wrap--action { margin-top: var(--space-1); }
#new-client .tg-input-wrap--action > input { margin-top: 0; padding-right: 52px; }
#new-client .tg-input-wrap--action > .tg-input-wrap__btn { color: var(--accent); }
.contact-picker--inline .hint { margin: 0; font-size: var(--text-xs); }
.contact-picker--inline .status:empty, .contact-picker--inline .chips[hidden] { display: none; }
.tg-search[aria-busy="true"] .tg-input-wrap--lead > .icon { animation: tg-pulse 1.2s ease-in-out infinite; }

/* DaySwitcher (редизайн 24.10.2026, CHANGES «Главная», reference/components.css):
   заголовок дня + «‹ 24 окт ›»; дата — подложка surface2, не сжимается;
   заголовок 17/700 (эталонные 19 px с «‹ 24 окт ›» не помещаются в 343 px,
   а нового кегля нет — Design Platform v1);
   нативный календарь — прозрачным полем поверх подписи. */
.tg-day-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.tg-day-head__row { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); align-self: stretch; }
.tg-day-head__title { flex: 1; min-width: 0; margin: 0; font-family: var(--font-heading); font-size: var(--text); font-weight: 700;
                      line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading); }
.tg-day { flex: none; display: flex; align-items: center; gap: 2px; }
.tg-day__arrow { display: flex; align-items: center; justify-content: center; width: 44px; height: var(--tap);
                 color: var(--muted); border-radius: var(--radius); text-decoration: none; }
.tg-day__arrow:hover { color: var(--text-colour); background: var(--note-bg); }
.tg-day__arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.tg-day__pick { display: flex; margin: 0; }
.tg-day__date { position: relative; display: flex; align-items: center; min-height: var(--tap); padding: 0 10px;
                border-radius: var(--radius); background: var(--surface-2); color: var(--text-colour);
                font: 600 var(--text-sm)/1.2 var(--font-body); white-space: nowrap; cursor: pointer; }
.tg-day__date:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.tg-day__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }

/* Экран «Не получилось войти» в MAX (задача 906, TZ.md, часть B):
   колонка с шагом 20 px, «Вы специалист?» прижато к низу. */
.login-head--error h1, .login-head--state h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-head--error { padding-bottom: 12px; }
/* 00 по макету (задача 1193): знак на 41 px от верха, между знаком и словесным знаком 15 px, до плашки 25 px. */
.login-head--error .brand-signin { margin: 27px auto 0; gap: 15px; }
.login-head--error .brand-signin img:first-child { width: 64px; }
.login-head--error .brand-wordmark { width: 72px; }
/* Вход специалиста в MAX (редизайн 24.10.2026, экраны 01/02/04, задача 933). */
.max-sign-in { display: flex; flex-direction: column; gap: var(--space-3); }
.max-sign-in form { display: flex; flex-direction: column; gap: var(--space-2); }
.max-sign-in .disclosure { margin: 0; }
.max-sign-in .disclosure__body form { gap: var(--space-3); }
/* Экран 04 «Не удалось войти» (задача 1193): одна текстовая кнопка по центру под формой. */
.login-state__alt { margin: 0; text-align: center; }
.max-sign-in__note { margin: 0; text-align: center; font-size: var(--text-sm); color: var(--muted); }
/* Экраны 04 (задача 1193): плашка, главная кнопка и строка поддержки — через 16 px, как в макете. */
.max-sign-in--state { gap: var(--space-4); }
/* Экран 03 «Новый кабинет · имя» (редизайн 24.10.2026, задача 933): плашка
   номера, поле с подсказкой под подписью, «Создать кабинет» прижата к низу. */
main:has(> .new-cabinet) { display: flex; flex-direction: column; }
.new-cabinet { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-4); }
.new-cabinet .state { margin: 0; }
.new-cabinet .state__title { font-size: var(--text-sm); }
.new-cabinet .state__value { font-weight: 400; }
.new-cabinet__form { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--space-2); }
.new-cabinet__form .tg-field__label { font-size: var(--text); font-weight: 700; color: inherit; }
.new-cabinet__form .tg-field .hint { margin: 0; }
.new-cabinet__form .tg-btn--primary { margin-top: auto; }
.new-cabinet__form .consent-note { text-align: center; }
/* ConsentNote (задача 1055) — по reference/legal.css (.tg-consent-note): 13 px,
   приглушённо, по центру, 10 px под кнопкой; ссылки акцентом без
   подчёркивания — подчёркивание только при hover/focus. */
.hint.consent-note { margin: 10px 0 0; padding: 0 8px; font-size: var(--text-note); line-height: 1.45; color: var(--muted); text-align: center; text-wrap: balance; }
.consent-note a { color: var(--link); font-weight: 500; text-decoration: none; }
.consent-note a:hover, .consent-note a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.max-sign-in__provider { display: flex; flex-direction: column; gap: var(--space-2); }
.max-sign-in__provider[hidden] { display: none; }
/* Браузер (задача 1087): MAX и Яндекс ID — две одинаковые ProviderButton 17/600,
   между ними --space-3 (gap блока --space-2 + --space-1). */
.max-sign-in__provider .tg-btn--provider + .tg-btn--provider { margin-top: var(--space-1); }
/* Браузер: от согласия до «или» --space-6 (TZ.md экрана 01, п. 7) — gap
   колонки --space-3 + ещё --space-3; MAX-вариант не меняется. */
.max-sign-in__provider--browser:not([hidden]) + .tg-or,
.max-sign-in__provider--browser:not([hidden]) + [data-login-variant] > .tg-or { margin-top: var(--space-3); }
.max-sign-in__provider .consent-note, .max-sign-in form .consent-note { margin-top: 0; }
.tg-or { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-size: var(--text-xs); color: var(--muted); }
.tg-or::before, .tg-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
main:has(> .max-error) { display: flex; flex-direction: column; }
/* Нижнее поле экрана — только 24 px самого блока (TZ.md 00: padding 40/16/24), без общих 32 px body (задача 1193). */
body:has(> main > .max-error) { padding-bottom: 0; }
.max-error { flex: 1 0 auto; display: flex; flex-direction: column; gap: 20px; padding-bottom: var(--space-6); }
.max-error__foot { margin: auto 0 0; display: flex; align-items: center; justify-content: center; gap: 4px;
                   font-size: var(--text-sm); color: var(--muted); }

/* ----- Движение (редизайн владельца 24.10.2026, TZ-common §8, задача 931) -----
   Эталон: design/reference/web/redesign-2026-10-24/reference/motion.css,
   образец поведения — source/motion-samples.dc.html. Только opacity,
   transform, background-color; длительности — токены design.py
   (--dur-press / --dur-fast / --dur-base, --ease). prefers-reduced-motion
   выключает всё правилом выше («* { animation: none; transition: none }»). */

/* 1. Отклик на нажатие: кнопки, строки, chips. */
.tg-btn, .tg-row, .tg-text-btn, .chip, .primary, .card.client {
  transition: background-color var(--dur-press) var(--ease), transform var(--dur-press) var(--ease);
}
.tg-btn:active, .primary:active { transform: scale(.98); }

/* 2. Раскрытие Disclosure («Войти по телефону и паролю», «Дополнительно»):
   плавно на месте — строка grid 0fr→1fr + opacity, стрелка поворачивается
   (правило `.disclosure[open] > summary .icon` выше). Анимация только на
   открытие: нативный details закрывается сразу. overflow скрыт лишь пока
   идёт анимация, чтобы фокус-рамка содержимого не обрезалась. */
.disclosure__reveal { display: grid; grid-template-rows: 1fr; }
.disclosure__reveal > .disclosure__body { min-height: 0; }
.disclosure[open] > .disclosure__reveal { animation: tg-reveal var(--dur-fast) var(--ease); }
@keyframes tg-reveal {
  from { grid-template-rows: 0fr; opacity: 0; overflow: hidden; }
  to { grid-template-rows: 1fr; opacity: 1; overflow: hidden; }
}

/* 3. Загрузка на кнопке: aria-busy + текст «Входим…» / «Отправляем…»;
   повторное нажатие заблокировано (pointer-events у .tg-btn выше). */
.tg-btn[aria-busy="true"] { opacity: .85; }

/* 4. Скелетон списка — той же высоты, что настоящая строка; показывать,
   только если ответ дольше 300 мс. Данные появляются .tg-appear. */
.tg-skel-row { display: flex; flex-direction: column; justify-content: center; gap: var(--space-2); min-height: 56px; padding: var(--space-2) var(--pad); }
.tg-skel-row + .tg-skel-row { border-top: 1px solid var(--border); }
.tg-skel { display: block; border-radius: var(--radius-sm); background: var(--border); animation: tg-pulse 1.2s ease-in-out infinite; }
.tg-skel--title { height: 14px; width: 60%; }
.tg-skel--hint { height: 12px; width: 35%; opacity: .7; }
@keyframes tg-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.tg-appear { animation: tg-in var(--dur-fast) var(--ease) both; }
@keyframes tg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 5. Подтверждение отправки: статус с рисующейся галочкой + toast. */
.tg-status--appear { animation: tg-in var(--dur-base) var(--ease) both; }
/* Свойства обводки наследуются в клон <use> спрайта. */
.icon.tg-check-draw { stroke-dasharray: 24; animation: tg-check var(--dur-base) var(--dur-press) var(--ease) both; }
@keyframes tg-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.tg-toast { position: fixed; z-index: 20; left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
            max-width: var(--content-max); margin: 0 auto; padding: var(--space-3) 14px; border-radius: var(--radius);
            background: var(--text-colour); color: var(--surface); font-weight: 600; animation: tg-in var(--dur-fast) var(--ease) both; }
/* Внутри витрины /design-system toast показан на месте, а не поверх страницы. */
.tg-toast--inline { position: static; }

/* 6. Нижняя навигация и переходы между экранами — без анимации (намеренно). */
.appnav, .appnav * { transition: none; animation: none; }

/* Шаг страницы результатов поиска — форма POST (задача 106): форма не
   добавляет своего блока, кнопка стоит в строке .pager как ссылка. */
.pager__step { display: contents; }
/* «Восстановить доступ» (экран 14-specialist-other №7, задача 933): подпись
   под заголовком по центру, «Вспомнили пароль? Войти» прижато к низу. */
main:has(> .recover) { display: flex; flex-direction: column; }
.recover { flex: 1 0 auto; }
.recover__lead { margin: calc(-1 * var(--space-3)) 0 var(--space-2); text-align: center; color: var(--muted); }
.recover__back { margin: auto 0 0; padding-top: var(--space-4); text-align: center; }
.recover__back .tg-text-btn { color: var(--muted); }

/* ----- Обзор админки (screens/15-admin, 1-overview, issue 1202) -----
   Чипы периода 40 px / 14 600 без галочки (admin-part1.dc.html: min-height 40px,
   padding 0 14px); «Требует внимания» — строки 52 px со счётчиком 26×24;
   MetricTile 2×2 (padding 12px 14px, радиус 12, число 24/700). */
.admin-period { flex-wrap: nowrap; gap: var(--space-2); margin: 0 0 var(--space-4); align-items: flex-start; }
.admin-period > .chip, .admin-period__custom > summary.chip { min-height: 40px; padding: 0 14px; font-size: var(--text-xs);
  font-weight: 600; background: transparent; border-color: var(--border); text-decoration: none; color: var(--text-colour); }
.admin-period__custom > summary.chip { list-style: none; }
.admin-period__custom > summary.chip::-webkit-details-marker { display: none; }
.admin-period > .chip[aria-current="true"], .admin-period__custom[data-current="true"] > summary.chip {
  color: var(--link); background: var(--accent-soft); border-color: var(--link); }
.admin-period__custom[open] { flex: 1 0 100%; }
.admin-period:has(.admin-period__custom[open]) { flex-wrap: wrap; }
.admin-period__custom form { margin-top: var(--space-2); }
.admin-attention + .tg-group-label { margin-top: var(--space-4); }
.admin-period + .tg-group-label { margin-top: 0; }
.admin-attention .tg-row { min-height: 52px; padding: 6px var(--pad); }
/* ----- Специалисты админки (screens/15-admin, 2-specialists, issue 1202) -----
   Чипы статуса одной строкой с прокруткой, 40 px / 14 600, число у «Ждут
   решения» цветом предупреждения; строка 64 px: имя 16/600 и метка в одну
   строку, вторая строка 13 приглушённым с обрезкой, дата 13 справа, ›. */
.admin-status { flex-wrap: nowrap; gap: var(--space-2); margin: 0 0 var(--space-3); overflow-x: auto; scrollbar-width: none; }
.admin-status::-webkit-scrollbar { display: none; }
.admin-status > .chip { flex: none; min-height: 40px; padding: 0 14px; gap: 6px; font-size: var(--text-xs); font-weight: 600;
  background: transparent; border-color: var(--border); text-decoration: none; color: var(--text-colour); }
.admin-status > .chip[aria-current="true"] { color: var(--link); background: var(--accent-soft); border-color: var(--link); }
.admin-status__count { color: var(--warning-text); }
a.card.client.spec-row { flex-direction: row; align-items: center; gap: var(--space-3); min-height: 64px; }
.spec-row > .body { flex: 1; min-width: 0; gap: 3px; }
.spec-row__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.spec-row__head > .name { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-row__head > .status-tag { flex: none; align-self: center; }
/* Метка в строке — словом без галочки, как в макете; слово остаётся. */
.spec-row__head > .status-tag > .icon { display: none; }
.spec-row > .body > .working { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Дата переносится, а не отнимает место у имени (как в макете: «заявка 22 / окт»). */
.spec-row > .when { flex: 0 1 auto; max-width: 5.5em; white-space: normal; font-size: var(--text-xs); }
.admin-more { display: flex; justify-content: center; margin-top: var(--space-3); }
.admin-attention .tg-row__title { font-size: var(--text-disclosure); }
.admin-count { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px;
  padding: 0 var(--space-2); border-radius: var(--radius-card); font-size: var(--text-note); font-weight: 700;
  font-variant-numeric: tabular-nums; }
.admin-count--warning { background: var(--warning-bg); color: var(--warning-text); }
.admin-count--danger { background: var(--danger-bg); color: var(--danger-text); }
.admin-count--note { background: var(--note-bg); color: var(--note-text); }
.admin-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.admin-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--space-3) var(--pad);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-provider); }
.admin-tile__value { font-size: var(--text-xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.admin-tile__label { font-size: var(--text-xs); font-weight: 600; }
.admin-tile__hint { font-size: var(--text-tag); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-all { margin: var(--space-2) 0 0 -10px; font-size: var(--text-sm); font-weight: 600; color: var(--link); background: transparent; }

/* ----- «Связи» админки (screens/16-admin-part2, 5-integrations, задача 1203) -----
   admin-part2.dc.html: разделы через 16 px, подпись группы → карточка 8 px; строки
   min-height 60, padding 8px 14px, имя 16/600, вторая строка 14 muted; метка статуса
   12/700, padding 2px 8px, радиус 6 (токена 6 в шкале нет), без галочки;
   warning-плашка — padding 12px 14px, иконка 20, текст 14/1.45, рамка цвета фона. */
.admin-int { display: flex; flex-direction: column; gap: var(--space-4); }
.admin-int section { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-int .tg-group-label { margin: 0; font-size: var(--text-sm); }
.admin-int .tg-row { min-height: 60px; gap: 10px; padding: var(--space-2) var(--pad); }
.admin-int .tg-row:has(> .tg-row__icon) { gap: var(--space-3); }
.admin-int .tg-row__title { font-size: var(--text-disclosure); }
.admin-int .tg-row__hint { font-size: var(--text-xs); line-height: var(--line); }
.admin-int__tag { flex: none; align-self: center; padding: 2px var(--space-2); border-radius: 6px;
  font-size: var(--text-tag); font-weight: 700; }
.admin-int__warning { gap: 10px; padding: var(--space-3) var(--pad); border-color: var(--warning-bg); }
.admin-int__warning .tg-notice__icon .icon { width: 20px; height: 20px; }
.admin-int__warning .tg-notice__body { font-size: var(--text-xs); line-height: 1.45; }
.admin-int .tg-row__chev .icon { width: 16px; height: 16px; }

/* ----- Карточка клиента, макет 14 · 1 (задача 1201) ----- */
/* Мягкая кнопка: ghost-подложка, текст link, 48 px. */
.tg-btn--tinted, .tg-btn--tinted:visited { min-height: 48px; background: var(--accent-soft); color: var(--link); }
.tg-btn--tinted:hover { color: var(--accent-pressed); filter: brightness(.97); }
.tg-btn--tinted .icon { width: 20px; height: 20px; }
.consult-label { margin: var(--space-4) 0 var(--space-2); }
/* Консультации — строки в одной карточке, разделитель между строками. */
.consult-rows { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.consult-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.consult-row + .consult-row { border-top: 1px solid var(--border); }
.consult-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.consult-row__when { font-size: 17px; font-weight: 600; }
.consult-row__meta { font-size: var(--text-sm); color: var(--muted); }
.consult-row__tag { display: inline-flex; flex: none; padding: 2px 8px; border-radius: 6px; background: var(--note-bg);
                    color: var(--text-colour); font-size: 13px; font-weight: 700; }
.consult-row__text { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.consult-row__action { align-self: flex-start; min-height: 40px; margin-left: -10px; padding: 0 10px; border-radius: var(--radius); gap: 6px; font-size: 15px; }
/* Disclosure в две строки: подпись + meta под ней. */
.disclosure--stacked > summary { min-height: 56px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.disclosure__stack { display: flex; flex-direction: column; font-size: 16px; }
.disclosure--stacked { margin-top: var(--space-4); border-radius: 14px; }
