/* =========================================================================
   Sfera — компоненты. Токены — в tokens.css. Каркас: сайдбар + контент;
   клиентский контур — светлая тема, операторский — data-theme="dark".
   ========================================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Заголовки — Fixel Display 600: жирный 700 в Display тяжелил шапки (№449) */
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 16px; margin: 28px 0 10px; }
h3 { font-size: 14.5px; margin: 0 0 8px; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
code { font-size: 0.92em; }
.num, td { font-variant-numeric: var(--nums); }
/* Число в таблице — вправо, как в файлах клиента; KPI-карточки и строки
   описания (.cards, dd) выравнивание не меняют. */
td.num, th.num { text-align: right; }

/* Фокус с клавиатуры — сплошное кольцо у всего интерактивного (WCAG 2.4.7,
   1.4.11: ≥ 3:1). На тёмном сайдбаре обеих тем — жёлтая искра. */
:where(a, button, summary, select, input, textarea, [tabindex], [role="button"]):focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.sidebar :focus-visible { outline-color: var(--accent-2); }
/* Скрыто глазами, доступно скринридеру и клавиатуре (поле файла, подписи). */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* «Перейти до змісту»: первая остановка Tab, видна только в фокусе. */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--link); font-weight: 600; box-shadow: var(--shadow-sm);
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* --- каркас ------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.content { flex: 1; min-width: 0; padding: 28px 40px calc(60px + var(--app-bottom)); }
/* Контент — на всю ширину до --page-max и по центру: раньше колонка 1240 px
   прижималась влево, справа оставалась пустота (AUDIT №393). */
.page { max-width: var(--page-max); margin: 0 auto; min-width: 0; }
/* Холст (приём Омнискора): свечение фирменной пары только в полях и шапке —
   карточки и панели непрозрачные (--bg-elevated). Альфы — токены темы. */
.app-canvas {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 50% 420px at 6% 0, var(--canvas-yellow), transparent 72%),
    radial-gradient(ellipse 60% 460px at 96% 0, var(--canvas-blue), transparent 74%);
  background-repeat: no-repeat;
}

/* --- сайдбар ------------------------------------------------------------ */
.sidebar {
  display: flex; flex-direction: column; flex-shrink: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: var(--sidebar-item);
  border-right: 1px solid var(--sidebar-edge);
  padding: 22px 0 0;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 20px 24px; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--sidebar-mark-bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-txt { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-head); font-size: 16px; font-weight: 600;
  color: var(--sidebar-item-active); letter-spacing: 0.16em;
}
.brand-tag {
  font-size: 10.5px; color: var(--accent-2);
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.brand-scope {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--sidebar-muted); border: 1px solid var(--sidebar-line-strong);
  border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px; border-left: 3px solid transparent;
  color: var(--sidebar-item); font-size: 14px; white-space: nowrap;
}
.nav a:hover { color: var(--sidebar-item-active); background: var(--sidebar-hover); }
.nav a.active {
  color: var(--sidebar-item-active); font-weight: 600;
  background: var(--sidebar-active-bg); border-left-color: var(--sidebar-active-mark);
}
.nav svg { flex-shrink: 0; }
/* Меню оператора секциями (AUDIT №454): подпись секции — обычным регистром
   мелким кеглем (правило «без капса», ux.md «Вид Sfera»), счётчик проблем —
   пилюля справа, «Ще» и «Демо» — свёрнутые <details>. */
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  flex: none; min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: var(--nums);
  color: var(--sidebar-danger); background: var(--sidebar-danger-soft);
}
.nav-section { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nav-section-title {
  margin: 0; padding: 4px 12px 4px 15px; font-size: 12px; font-weight: 600;
  color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-group { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 8px;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: ""; width: 6px; height: 6px; margin-left: 2px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform 160ms ease;
}
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-group > summary:hover { color: var(--sidebar-item-active); }
.nav-group[open] > a { margin-top: 2px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; }
.sidebar-user {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px 10px 10px; border-radius: 14px;
  background: var(--sidebar-chip); border: 1px solid var(--sidebar-line);
  transition: background 150ms ease, border-color 150ms ease;
}
.sidebar-user:hover { background: var(--sidebar-active-bg); border-color: var(--sidebar-line-strong); }
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: var(--sidebar-avatar); color: var(--sidebar-avatar-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 var(--sidebar-line-strong);
}
.sidebar-user .who { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.sidebar-user .who b { font-size: 13.5px; color: var(--sidebar-item-active); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who span { font-size: 11.5px; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .chevron { flex: none; color: var(--sidebar-muted); transition: transform 160ms ease; }
.user-menu[open] .sidebar-user .chevron { transform: rotate(180deg); }
.sidebar-status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px 14px; font-size: 11.5px; color: var(--sidebar-muted); white-space: nowrap; flex-wrap: wrap; row-gap: 2px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
/* ореол статуса — ровное кольцо мягкого тона, а не свечение (№449) */
.dot.ok { box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* --- шапка страницы ------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lede { margin: 2px 0 0; }
.lede { color: var(--text-muted); font-size: 13.5px; max-width: 78ch; }

/* --- карточки и KPI ------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 0 0 22px; }
.cards article {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.cards article > span {
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); order: -1;
}
.cards strong { font-family: var(--font-head); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: var(--nums); }
.good, .readiness.ready { color: var(--ok-text); }
.bad, .readiness.degraded { color: var(--danger-text); }

/* --- панели и таблицы ---------------------------------------------------- */
.panel {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 22px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; }
.tblwrap { position: relative; overflow-x: auto; }
/* область прокрутки фокусируется с клавиатуры (стрелки листают таблицу);
   кольцо внутрь — снаружи его обрезает overflow панели */
.tblwrap:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: transparent; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
/* подписи колонок — обычным регистром: капс мелким кеглем шумел (№449) */
thead th {
  color: var(--text-muted); font-size: 12.5px; font-weight: 500;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--accent-soft); }
td.num, th.num, td.nowrap, th.nowrap { white-space: nowrap; }
/* «Заявки»: пояснение под числом — своей строкой с переносом, шапка
   переносится — таблица влезает в 1280 без прокрутки (№455). */
.bids-table thead th { white-space: normal; }
.bids-table td small { display: block; white-space: normal; max-width: 24ch; margin-left: auto; }
td.wrap { white-space: normal; max-width: 440px; }
.cell-clip { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.muted { color: var(--text-muted); }
.details-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 22px; }
.details-list details { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; }
.details-list summary { cursor: pointer; font-weight: 500; }
.details-list details[open] summary { margin-bottom: 8px; }
.panel > .tblwrap:first-child table thead th { padding-top: 12px; }
.empty-state { color: var(--text-muted); padding: 14px 18px; margin: 0; }
/* таблица вне .panel получает свою рамку */
main > table, section > table, article > table {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; border-spacing: 0;
}

/* --- статусы и бейджи ---------------------------------------------------- */
.status, .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-sunken); color: var(--text-muted);
}
.status.valid, .status.ready, .status.succeeded, .badge.ok { color: var(--ok-text); background: var(--ok-soft); }
.status.pending, .status.running, .badge.warn { color: var(--warn-text); background: var(--warn-soft); }
.status.invalid, .status.failed, .badge.danger { color: var(--danger-text); background: var(--danger-soft); }
.tag {
  display: inline-flex; padding: 1px 7px; border-radius: 5px; white-space: nowrap;
  font-size: 10.5px; border: 1px solid var(--border-strong); color: var(--text-muted);
}

/* --- формы и кнопки ------------------------------------------------------ */
/* Расстояние между полями и кнопками даёт gap контейнера (.actions,
   .ui-filters, .inline-form…), а не margin-right у каждого поля. */
input, select, textarea, button, .button {
  font-family: inherit; font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text);
}
button, input[type="submit"], .button {
  color: var(--accent-text); font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: none;
  background: var(--button-bg); border: 1px solid var(--button-border);
  transition: background 140ms ease, border-color 140ms ease;
}
/* hover — цвет и рамка, без движения: масштаб кнопки дёргал соседей */
button:hover, input[type="submit"]:hover, .button:hover {
  color: var(--accent-text);
  background: var(--button-bg-hover); border-color: var(--accent);
}
button:disabled, input[type="submit"]:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: default; }
/* Элементы управления одной строки — одной высоты (№449): поле, select,
   кнопка (ссылка-кнопка, button_to, submit) — --control-h, текст по
   центру; сегментный переключатель — та же внешняя высота (components.css).
   :where — нулевая специфичность: компактные кнопки (шаг дня, карточка
   термина) задают своё и перебивают. */
:where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"], [type="range"], [type="color"]), select,
       .button, input[type="submit"], input[type="button"], button:not([class])) {
  min-height: var(--control-h); padding-top: 0; padding-bottom: 0;
}
:where(.button, button:not([class])) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* select — своя стрелка в цвет текста (currentColor) вместо системной в
   отдельной рамке; в режиме высокой контрастности фоновые картинки гаснут —
   там системный вид (блок forced-colors в конце файла). */
select:not([multiple], [size]) {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
/* вторичные кнопки: контрастная рамка и белая плашка — «Скасувати
   підтвердження» и «Внести правки» на светлой теме сливались с фоном (12.09) */
.button.secondary, button.secondary, button.btn-secondary {
  color: var(--text); background: var(--bg-elevated); border-color: var(--border-strong);
  box-shadow: var(--shadow-sm); font-weight: 600;
}
.button.secondary:hover, button.secondary:hover, button.btn-secondary:hover { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent); }
label { font-size: 12.5px; color: var(--text-muted); }
.field-help { color: var(--text-muted); font-size: 12.5px; max-width: 78ch; }
/* ошибка формы (валидация модели) — текстом и цветом */
.error { color: var(--danger-text); font-weight: 600; margin: 0 0 10px; }
/* сырой текст ошибки прогона/загрузки у оператора */
.error-panel { background: var(--danger-soft); color: var(--danger-text); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 22px; }
.error-panel h2 { margin: 0 0 8px; }
.error-panel pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.inline-form p { margin: 0; }

/* --- уведомления ---------------------------------------------------------- */
.notice, .alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 18px;
  border: 1px solid var(--border); font-size: 13.5px;
}
.notice { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.alert { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
section.alert { background: var(--warn-soft); color: var(--warn-text); }
/* Верхняя панель оператора (shared/_topbar, docs/web/ux.md, «Навигация оператора»):
   слева возврат, справа — «ви бачите як клієнт», сегмент «Оператор | Клієнт» и
   переключатель обленерго. Одна строка высотой --control-h над шапкой экрана. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: -6px 0 18px; min-height: var(--control-h); }
.topbar-left { min-width: 0; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-left: auto; }
.topbar .ops-back { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.topbar .ops-back:hover { color: var(--link-hover); }
.topbar-peek { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.mode-switch .ui-seg { flex-wrap: nowrap; }

/* Переключатель обленерго (shared/_switcher; образец — Омнискор): кнопка с плиткой
   и именем, панель карточек. Без JS — сам <details>; switcher_controller.js — Esc, стрелки. */
.switcher { position: relative; }
.switcher > summary { list-style: none; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher-button {
  display: inline-flex; align-items: center; gap: 8px; height: var(--control-h); padding: 0 14px 0 10px; cursor: pointer;
  border-radius: 11px; background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.switcher-button:hover { border-color: var(--border-input); }
.switcher-button > svg { color: var(--text-muted); transition: transform 160ms ease; }
.switcher[open] > .switcher-button > svg { transform: rotate(180deg); }
.switcher-name { max-width: 16em; overflow: hidden; text-overflow: ellipsis; }
.switcher-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(40rem, calc(100vw - 2rem));
  display: grid; gap: 14px; padding: 20px; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
}
.switcher-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.switcher-title { margin: 0; font-size: 18px; }
.switcher-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); max-width: 46ch; }
.switcher-actions { display: flex; align-items: center; gap: 8px; }
.switcher-close { display: none; }
.switcher-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.switcher-group { margin: 2px 0 -4px; font-size: 13px; font-weight: 600; color: var(--text-muted); font-family: var(--font); }
.switcher-card {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--text); background: var(--bg-elevated);
}
.switcher-card:hover { color: var(--text); border-color: var(--border-input); background: var(--bg-sunken); }
.switcher-card.is-current { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.switcher-card > svg { flex: none; margin-left: auto; color: var(--link); }
.switcher-card-text { display: grid; gap: 2px; min-width: 0; }
.switcher-card-text b { font-size: 14.5px; font-weight: 600; }
.switcher-status { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.switcher-dot { flex: none; width: 7px; height: 7px; margin-top: 0.4em; border-radius: 50%; background: var(--chart-muted); }
.switcher-status.tone-ok .switcher-dot { background: var(--ok); }
.switcher-status.tone-warn .switcher-dot { background: var(--warn); }
.switcher-status.tone-danger .switcher-dot { background: var(--danger); }
.switcher-status.tone-info .switcher-dot { background: var(--accent); }
.switcher.is-phone { display: none; }
/* плитка обленерго: буква в цвете тенанта (тон — по id, SwitcherHelper#tenant_tile) */
.tenant-tile {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  font-family: var(--font-head); font-size: 17px; font-weight: 600; background: var(--tile-bg); color: var(--tile-fg);
}
.tenant-tile.is-small { width: 24px; height: 24px; border-radius: 7px; font-size: 12.5px; }
.tile-tone-1 { --tile-bg: var(--tile-1-bg); --tile-fg: var(--tile-1-fg); }
.tile-tone-2 { --tile-bg: var(--tile-2-bg); --tile-fg: var(--tile-2-fg); }
.tile-tone-3 { --tile-bg: var(--tile-3-bg); --tile-fg: var(--tile-3-fg); }
.tile-tone-4 { --tile-bg: var(--tile-4-bg); --tile-fg: var(--tile-4-fg); }
.tile-tone-demo { --tile-bg: var(--bg-sunken); --tile-fg: var(--text-muted); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* «Налаштування» (docs/web/ux.md, «Налаштування») */
.settings-dl { display: grid; gap: 10px; margin: 0; }
.settings-dl > div { display: grid; grid-template-columns: minmax(150px, 2fr) 3fr; gap: 4px 16px; align-items: baseline; }
.settings-dl dt { color: var(--text-muted); font-size: 13.5px; }
.settings-dl dd { margin: 0; font-size: 14px; }
.settings-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.settings-percent-form { display: grid; gap: 6px; justify-items: start; }
.ui-filters.settings-percent-inline { margin: 0; }
.percent-input { width: 8em; }
.settings-history > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: 4px 0; }
.settings-history[open] > summary { margin-bottom: 10px; }
.theme-switch.is-page { max-width: 420px; margin: 0; background: var(--bg-sunken); border: 1px solid var(--border); }
.theme-switch.is-page button { color: var(--text-muted); }
.theme-switch.is-page button:hover { color: var(--text); background: var(--accent-soft); }
.theme-switch.is-page button[aria-pressed="true"] { color: var(--text); background: var(--bg-elevated); box-shadow: var(--shadow-sm); }
section.alert ul { margin: 6px 0 0; padding-left: 18px; }
/* Метка демо-тенанта (№421): ненавязчиво, но на каждом скриншоте —
   пунктирная плашка в одну строку над контентом. */
.demo-badge {
  margin: 0 0 14px; padding: 5px 12px; font-size: 12px; line-height: 1.4; border-radius: 999px;
  display: inline-flex; gap: 8px; flex-wrap: wrap; max-width: 100%;
  background: var(--accent-soft); color: var(--text-muted); border: 1px dashed var(--border-strong);
}
.demo-badge b { color: var(--text); font-weight: 700; letter-spacing: .02em; }

/* --- разное --------------------------------------------------------------- */
.leaderboards { display: flex; flex-direction: column; gap: 0; margin-bottom: 22px; }
/* табло — те же панели, что и остальные таблицы; подзаголовок в шапке
   панели, а не голый <article> без рамки (12.09) */
.leaderboard .panel-head.stack { flex-direction: column; align-items: flex-start; gap: 4px; }
.leaderboard .panel-head .field-help { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 10px;
  border: 2px solid transparent; background-clip: padding-box;
}
/* --- адаптив: планшет и телефон — общий блок в конце файла ---------------- */

/* --- переключатель темы (в сайдбаре, на тёмном фоне) ---------------------- */
.theme-switch {
  display: flex; align-items: center; gap: 2px; margin: 0 12px 14px; padding: 4px;
  border-radius: 999px; background: var(--sidebar-chip);
}
.theme-switch button {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; margin: 0; padding: 0 11px; border: none; border-radius: 999px;
  background: transparent; color: var(--sidebar-muted); font-size: 13px; font-weight: 500; box-shadow: none;
  transition: background 150ms ease, color 150ms ease;
}
.theme-switch button span { display: none; }
.theme-switch button:hover { color: var(--sidebar-item-active); background: var(--sidebar-hover); border: none; }
.theme-switch button[aria-pressed="true"] {
  flex: 1 1 auto; padding: 0 14px; color: var(--sidebar-item-active);
  background: var(--sidebar-chip-active); box-shadow: 0 1px 3px var(--sidebar-shadow);
}
.theme-switch button[aria-pressed="true"] span { display: inline; }
.theme-switch button:focus-visible { outline-offset: 1px; }
.theme-switch svg { flex: none; width: 16px; height: 16px; }

/* --- меню пользователя ---------------------------------------------------- */
.user-menu { position: relative; margin: 0 12px; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-pop {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--sidebar-pop); border: 1px solid var(--sidebar-line-strong);
  border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px var(--sidebar-shadow); z-index: 20;
}
.menu-item {
  display: flex; width: 100%; align-items: center; gap: 9px;
  padding: 8px 10px; margin: 0; border: none; border-radius: 7px;
  background: transparent; color: var(--sidebar-item-active); font-size: 13px;
  box-shadow: none; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--sidebar-active-bg); color: var(--sidebar-item-active); }
.menu-item.danger { color: var(--sidebar-danger); }
.menu-item.danger:hover { background: var(--sidebar-danger-soft); color: var(--sidebar-danger); }
.user-menu form { margin: 0; }

/* --- dropzone ------------------------------------------------------------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  background: var(--bg-elevated); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius); padding: 44px 20px; margin-bottom: 12px; position: relative;
  transition: border-color 0.15s, background 0.15s; cursor: pointer;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-size: 16px; font-weight: 600; }
.dropzone-hint { font-size: 12.5px; color: var(--text-muted); }
/* Поле файла скрыто глазами (.visually-hidden), но в порядке Tab: фокус
   поля рисуется на кнопке-подписи рядом, Enter/Space открывают выбор. */
.dropzone input[type="file"]:focus-visible + .dropzone-pick { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.dropzone-pick { display: inline-flex; }
.dropzone-file { font-size: 13px; color: var(--link); font-weight: 600; }
.dropzone-error { font-size: 13px; color: var(--danger-text); font-weight: 600; }
/* кнопка отправки — вне зоны: внутри её клик открывал выбор файла (№238) */
.dropzone-actions { margin-bottom: 20px; }

/* --- заявка дня ----------------------------------------------------------- */
.bid-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bid-bar { height: 7px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.bid-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* --- логин -------------------------------------------------------------------
   Сцена всегда тёмная (две ЛЭП на весь экран, импульсы по проводам — canvas,
   power_lines_controller.js),
   карточка — по теме пользователя: светлая плашка или тёмное стекло. */
.auth-body { background: #070d26; }
.auth-stage {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(61, 114, 255, 0.22), transparent 60%),
    radial-gradient(900px 520px at 10% 110%, rgba(255, 213, 0, 0.07), transparent 60%),
    linear-gradient(180deg, #0f1a48 0%, #0a1233 55%, #070d26 100%);
}
/* сетка точек — тот же грид, что в знаке Make AI Energy; гаснет к краям */
.auth-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(170, 196, 255, 0.16) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
}
.auth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.auth-main {
  /* виньетка за карточкой: провода проходят за ней и не спорят с текстом */
  background: radial-gradient(ellipse 600px 520px at 50% 50%, rgba(7, 13, 38, 0.72), rgba(7, 13, 38, 0.3) 55%, transparent 78%);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 32px 16px;
}
.auth-card {
  width: 100%; max-width: 400px; padding: 30px 30px 28px;
  display: flex; flex-direction: column; gap: 18px;
  color: var(--text); background: rgba(255, 255, 255, 0.985);
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(3, 8, 30, 0.75), 0 0 0 1px rgba(31, 91, 255, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  animation: auth-rise 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
[data-theme="dark"] .auth-card {
  background: rgba(16, 27, 61, 0.68); border-color: rgba(150, 180, 255, 0.14);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* правило мобильной шапки кабинета прячет подпись — на входе она нужна */
.auth-card .brand { padding: 0; }
.auth-card .brand-tag { display: block; }
.auth-card .brand-name { color: var(--brand-navy); }
.auth-card .brand-tag { color: #8a6d00; }
[data-theme="dark"] .auth-card .brand-name { color: #ffffff; }
[data-theme="dark"] .auth-card .brand-tag { color: var(--accent-2); }
.auth-head { display: flex; flex-direction: column; gap: 4px; }
.auth-title { font-size: 22px; margin: 0; }
.auth-subtitle { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field label { display: block; margin-bottom: 6px; font-weight: 500; }
.auth-card input.auth-input {
  width: 100%; padding: 11px 13px; font-size: 14px; border-radius: 11px;
  background: var(--bg); border: 1px solid var(--border-input);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
[data-theme="dark"] .auth-card input.auth-input { background: rgba(5, 13, 36, 0.55); }
.auth-card input.auth-input::placeholder { color: var(--text-faint); }
.auth-card input.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-card input.auth-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
/* Автозаполнение браузера (Chrome/Safari) красило поле в светло-голубое с
   тёмным текстом — на тёмной карточке это бросалось в глаза первым. Фон
   перекрываем тенью внутрь в цвет поля, текст — цветом темы. */
.auth-card input.auth-input:-webkit-autofill,
.auth-card input.auth-input:-webkit-autofill:hover,
.auth-card input.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 600000s 0s, color 600000s 0s;
}
[data-theme="dark"] .auth-card input.auth-input:-webkit-autofill,
[data-theme="dark"] .auth-card input.auth-input:-webkit-autofill:hover,
[data-theme="dark"] .auth-card input.auth-input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #0b1531 inset;
}
.auth-card input.auth-input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px var(--bg) inset, 0 0 0 4px var(--accent-soft); }
[data-theme="dark"] .auth-card input.auth-input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px #0b1531 inset, 0 0 0 4px var(--accent-soft); }
/* Ошибка входа: один короткий «нет» карточкой и красная рамка полей */
.auth-card.auth-card--error { animation: auth-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
.auth-card--error input.auth-input { border-color: var(--danger-text); }
@keyframes auth-shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); }
}
.auth-card input.auth-submit:disabled { opacity: 0.78; cursor: progress; }
.auth-help { margin: 2px 0 0; text-align: center; font-size: 12.5px; color: var(--text-faint); }
.auth-password { position: relative; }
.auth-password input.auth-input { padding-right: 46px; }
.auth-card button.auth-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-muted);
}
.auth-card button.auth-eye:hover { background: var(--accent-soft); color: var(--link); }
.auth-card button.auth-eye:focus-visible { outline-offset: 1px; }
.auth-eye .auth-eye-slash { opacity: 0; transition: opacity 140ms ease; }
.auth-eye[aria-pressed="true"] .auth-eye-slash { opacity: 1; }
/* Белый текст ≥ 4,5:1 к каждой точке градиента, и на hover тоже: раньше
   верх #2f6bff давал 4,5, а hover #4a7fff — 3,6. Hover темнее, без подъёма.
   Синий — акцент #1f5bff (№449). */
.auth-card input.auth-submit {
  width: 100%; margin: 4px 0 0; padding: 12px 16px; font-size: 14.5px; font-weight: 600; border-radius: 11px;
  color: #ffffff; border: 1px solid transparent;
  background: linear-gradient(180deg, #2a64ff, #1f5bff);
  box-shadow: 0 10px 24px -10px rgba(31, 91, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.auth-card input.auth-submit:hover {
  color: #ffffff; border-color: transparent;
  background: linear-gradient(180deg, #1d55f0, #1747c8);
  box-shadow: 0 14px 30px -10px rgba(31, 91, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.auth-card .alert, .auth-card .notice { margin: 0; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* --- ряды действий -------------------------------------------------------- */
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }

/* --- табло ----------------------------------------------------------------- */
/* фильтры экранов — компонент .ui-filters (components.css) */
.panel-head .ui-filters { margin: 0; justify-content: flex-end; }
.sparkline { width: 100%; height: 72px; display: block; }
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 28px; margin: 0;
}
.detail-grid dt { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 3px; }
.detail-grid dd { margin: 0; }

/* Контекстная помощь: наведение, клавиатура и касание; обе темы. */
.help-tip { display: inline-flex; vertical-align: middle; margin-inline-start: 3px; }
button.help-tip-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; min-width: 15px; padding: 0; border-radius: 50%; border: 1px solid var(--text-muted); background: transparent; color: var(--text-muted); font: 600 10px/1 var(--font); box-shadow: none; cursor: help; text-transform: none; }
/* Кружок 15 px, а цель касания — 25 px (WCAG 2.5.8: ≥ 24 px) */
button.help-tip-button::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
button.help-tip-button:hover, button.help-tip-button:focus-visible { color: var(--link); border-color: var(--link); background: var(--bg); }
.help-tip-bubble { position: fixed; z-index: 10000; width: max-content; max-width: min(390px, calc(100vw - 24px)); max-height: min(420px, calc(100vh - 24px)); overflow: auto; padding: 16px 18px; background: var(--bg); color: var(--text); border: 1px solid var(--text-muted); border-radius: 12px; box-shadow: 0 8px 32px #0004; font: 400 14px/1.6 var(--font); white-space: normal; text-transform: none; letter-spacing: normal; text-align: left; }
.help-tip-bubble[hidden] { display: none; }
.context-note { padding: 12px 16px; border-left: 3px solid var(--accent); margin: 16px 0; color: var(--text-muted); }
.spark-values { display: flex; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 12px; }

.help-tip-button::before { content: "?"; }
.note-badge { margin-inline-start: 0; }
.has-note { cursor: help; }
.has-note:focus-visible { border-radius: 999px; }
.sidebar-status-text { color: var(--sidebar-muted); }
.sidebar-status .dot.bad + .num + .sidebar-status-text { color: var(--sidebar-danger); }

/* Подпись и пояснение остаются одним элементом даже внутри flex-формы. */
.help-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.help-label > .help-tip { flex: 0 0 auto; margin-inline-start: 0; }
/* заголовок с «?» переносится: nowrap растягивал страницу на телефоне
   («Завантаження щоденного файлу» — 402 px при 375) */
h1 .help-label, h2 .help-label { white-space: normal; }
.weather-capture-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 20px; }
/* Пометки суток (№283): та же строка формы, поля подписаны */
.day-mark-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 20px; }
.day-mark-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.day-mark-form input[type="number"] { width: 5.5em; }
.day-mark-form .grow { flex: 1 1 260px; min-width: 0; }
/* text_field с maxlength: 300 получает size="300" — 2,7 тыс. px на телефоне */
.day-mark-form .grow input { width: 100%; min-width: 0; }
.day-mark-form .flash { flex-basis: 100%; }

.cards .help-label { max-width: 100%; white-space: normal; }

/* --- артефакты прогона и соседние статусы -------------------------------- */
.artifact-list { display: flex; flex-direction: column; gap: 8px; }
.artifact-list article {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.artifact-list article strong { min-width: 90px; }
.artifact-list article span { color: var(--text-muted); flex: 1; }
.status-group { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status + .status { margin-left: 6px; }
.status-group .status + .status { margin-left: 0; }
/* графики — charts.css; печать — print.css */

/* --- клиентский блок «сегодня» ------------------------------------------- */
.today-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.today-step { display: flex; gap: 12px; align-items: flex-start; }
.today-mark { flex: none; border-radius: 50%; }
.panel-head form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.panel-head form select { flex: 1 1 260px; min-width: 0; max-width: 560px; overflow: hidden; text-overflow: ellipsis; }
.panel-head form input[type="date"] { flex: none; }
.panel-head form input[type="submit"] { flex: none; }
.panel-head form .help-tip { margin-right: 4px; flex: none; }

/* длинные хеши и коды не растягивают сетку */
.detail-grid code, td code, code.digest { word-break: break-all; overflow-wrap: anywhere; }

.nav-toggle { display: none; }
/* шапка и нижняя панель телефона — только < 1024 px (блок ниже) */
.mobile-head, .tabbar { display: none; }

.bid-usage { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.bid-usage form { margin: 0; }
td .bid-usage { margin: 6px 0 0; }

/* --- состояние дня клиента (Client::DayStatus, docs/web/ux.md) ------------
   Заголовок состояния, причина, одна главная кнопка и отсчёт — первым
   экраном; статус не только цветом: знак в кружке и сам текст заголовка. */
.day-icon { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 14px; font-weight: 700; color: var(--bg-elevated); background: var(--accent); }
.day-icon::before { content: "…"; }
.day-ready .day-icon, .day-submitted .day-icon, .day-compared .day-icon { background: var(--ok-text); }
.day-ready .day-icon::before, .day-submitted .day-icon::before, .day-compared .day-icon::before { content: "✓"; }
.day-no_bid .day-icon, .day-file_rejected .day-icon, .day-file_failed .day-icon, .day-blocked .day-icon { background: var(--danger-text); }
.day-stale .day-icon, .day-resubmit .day-icon { background: var(--warn-text); }
.day-no_bid .day-icon::before, .day-file_rejected .day-icon::before, .day-file_failed .day-icon::before,
.day-blocked .day-icon::before, .day-stale .day-icon::before, .day-resubmit .day-icon::before { content: "!"; }
.day-awaiting_file .day-icon::before, .day-concealed .day-icon::before { content: "↑"; }
.day-contact { margin: 0 0 6px; font-weight: 600; }
.day-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0 14px; }
.day-actions .button { margin: 0; }
/* отсчёт до срока — пилюля рядом с главной кнопкой (№449); тон ожидания, текст ≥ 4,5:1 */
.day-countdown {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn-text); font-size: 13px; font-weight: 600; font-variant-numeric: var(--nums-tick);
}
.today-step form { margin: 0; }
.bid-badges { margin: 0 0 14px; }
/* «Сьогодні» — одна карточка дня (вид, выбранный владельцем 29.10, №449): подпись
   «Стан заявки на», заголовок со значком, строка пояснения, линия шагов, действие
   шага под шагом, внизу объём и кнопки. Левая полоса — тон состояния. */
.today { gap: 6px; }
.today .day-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.today .day-title { display: flex; gap: 10px; align-items: center; margin: 2px 0 2px; font-size: 19px; }
.today .day-text { margin: 0; font-size: 15px; line-height: 1.45; max-width: 96ch; }
.today .day-note { margin: 0; font-size: 14px; line-height: 1.45; max-width: 96ch; }
.today.day-no_bid, .today.day-file_rejected, .today.day-file_failed, .today.day-blocked { border-left: 4px solid var(--danger-text); }
.today.day-stale, .today.day-resubmit { border-left: 4px solid var(--warn-text); }
.today.day-ready, .today.day-submitted, .today.day-compared { border-left: 4px solid var(--ok-text); }
.today .today-steps { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.today-phases { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.today-phase-fact { display: flex; gap: 12px; align-items: flex-start; }
.today-phase-fact > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Этапы дня — степпер (№449): знак сверху — ✓ пройдено, кольцо с точкой —
   текущий шаг (у «перевіряємо/рахуємо» — тоном ожидания), пустой круг —
   впереди, «!» — сбой, «–» — пропущен (довідка после закрытия подачи);
   линия к следующему этапу, после пройденного — зелёная; подпись, время и
   действие шага — под знаком. Состояние шага — DayStatus, вид — только здесь. */
.today-phases > li { position: relative; flex-direction: column; align-items: stretch; gap: 10px; padding-right: 18px; min-width: 0; }
.today-phases > li > .today-mark { align-self: flex-start; }
.today-phases > li:not(:last-child)::after {
  content: ""; position: absolute; top: 11px; left: 34px; right: 10px; height: 2px; border-radius: 1px; background: var(--border);
}
.today-phases > li.done:not(:last-child)::after { background: var(--ok-text); }
.today-phases > li > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.today-phases .today-mark {
  position: relative; z-index: 1; width: 24px; height: 24px; margin: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; line-height: 1; color: var(--bg-elevated);
  background: var(--bg-elevated); box-shadow: inset 0 0 0 2px var(--border-strong);
}
.today-phases .today-step.done .today-mark { background: var(--ok-text); box-shadow: none; }
.today-phases .today-step.done .today-mark::before { content: "✓"; }
.today-phases .today-step.todo.is-current .today-mark { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
.today-phases .today-step.todo.is-current .today-mark::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.today-phases .today-step.pending .today-mark { box-shadow: inset 0 0 0 2px var(--warn-text), 0 0 0 4px var(--warn-soft); }
.today-phases .today-step.pending .today-mark::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn-text); }
.today-phases .today-step.blocked .today-mark { background: var(--danger-text); box-shadow: none; }
.today-phases .today-step.blocked .today-mark::before { content: "!"; }
.today-phases .today-step.skip .today-mark { background: var(--bg-sunken); color: var(--text-muted); }
.today-phases .today-step.skip .today-mark::before { content: "–"; }
.today-phases b { color: var(--text); font-size: 14px; font-weight: 600; }
.today-phases li > div > span { color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }
.today-phases .is-future b { color: var(--text-muted); }
/* действие шага — сразу под его текстом: кнопка и отсчёт до срока этого шага */
.today-step-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.today-step-actions:empty { display: none; }
.today-step-actions .button, .today-step .today-step-actions form .button { margin: 0; }
.today-countdown { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.today-countdown .day-countdown { min-height: 26px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
.today-countdown-at { font-size: 12.5px; font-variant-numeric: var(--nums); }
/* низ карточки: объём крупно и кнопки */
.today-bottom { display: grid; gap: 10px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.today-bottom .today-volume { margin: 0; }
.today-bottom .day-actions { margin: 4px 0 0; }
.today-bottom .day-actions > .button { display: inline-flex; align-items: center; gap: 8px; }
.today-bottom .day-actions:empty { display: none; }
.today-act-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.today-volume { margin: 14px 0 0; }
.today-volume-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.today-volume-value { margin: 2px 0; }
.today-volume-value b { font-size: 40px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; font-family: var(--font-head); font-variant-numeric: var(--nums); }
.today-volume-value span { color: var(--text-muted); }
.today-volume-note { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.today-board { margin-top: 0; }
/* «Чому така заявка?»: итог разницы с заявкой на сегодня, график «в какие часы», ниже — причины (№449) */
.today-why .why-delta { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr); gap: 12px 28px; align-items: start;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.today-why .why-delta .ui-tile-value { margin: 4px 0 2px; }
.today-why .uic { --uic-h: 120px; --uic-h-narrow: 140px; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.why-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.why-tiles li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); border: 1px solid var(--border); }
.why-tiles li > div { display: grid; gap: 4px; min-width: 0; }
.why-tiles b { font-size: 14px; }
.why-tiles span { color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }
.why-icon { flex: none; margin-top: 1px; color: var(--accent-text); }
.why-tiles li.why-outage { background: var(--warn-soft); border-color: var(--warn); }
.why-tiles li.why-outage b, .why-tiles li.why-outage .why-icon { color: var(--warn-text); }
.why-tiles li.why-outage span { color: var(--text); }
.yesterday .uic { --uic-h: 130px; --uic-h-narrow: 130px; }
.today-uo { margin: 4px 0 0; font-size: 13.5px; color: var(--text-muted); }
.today-uo b { font-weight: 600; }
.uo-under { color: var(--warn-text); }
.uo-over { color: var(--accent-text); }
.today-cost-box { margin: 4px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-sunken); font-size: 13.5px; line-height: 1.45; }
.ui-tile-aside { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.spark-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; font-size: 12.5px; color: var(--text-muted); }
.spark-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; background: var(--chart-s1); }
.spark-legend i.is-high { background: var(--chart-s2); }
.spark-legend i.is-muted { background: var(--chart-muted); }
.vs-bars { display: grid; gap: 8px; margin: 4px 0 0; }
.vs-bars > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.vs-bars dt { font-size: 13.5px; color: var(--text-muted); }
.vs-bars dd { display: flex; align-items: center; gap: 10px; margin: 0; }
.vs-bars dd b { min-width: 52px; text-align: right; font-size: 13.5px; }
.vs-bar { flex: 1 1 auto; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.vs-bar i { display: block; height: 100%; border-radius: 3px; background: var(--chart-s1); }
.vs-bar.is-mi i { background: var(--chart-s2); }
/* «Результати» на каркасе (№401) */
.results-emergency { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.day-detail-charts { margin: 8px 0 0; }
.day-detail-sub { margin: 14px 0 6px; font-size: 14px; }
.ui-grid > .results-day-detail { grid-row: span 2; }
/* лишняя высота разбора — во вторую строку: итог и часы справа стоят вплотную через gap */
.results-row { grid-template-rows: min-content 1fr; }
.results-insight { margin: 10px 0 0; font-size: 13.5px; color: var(--text-muted); max-width: 90ch; }
.day-hours-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; font-variant-numeric: var(--nums); }
.top-hours { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
/* «Варіант з вашим відсотком» (№458): три колонки помещаются в 375 — название варианта
   переносится, а не уводит цену похибки в горизонтальную прокрутку. */
#results-hybrid .ui-table th, #results-hybrid .ui-table td { white-space: normal; padding: 6px 10px; }
#results-hybrid .ui-table td.num { white-space: nowrap; }
.top-hours li > span { color: var(--text-muted); }
.top-hours li > b { float: right; font-variant-numeric: var(--nums); }
.ui-table tr.is-muted th, .ui-table tr.is-muted td { color: var(--text-muted); }
.today-details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; color: var(--link); }
.today-details[open] > summary { margin-bottom: 12px; }

.empty-panel { padding: 40px; text-align: center; }
.empty-panel h2 { margin-top: 0; }
.empty-panel .lede { margin: 0 auto; }
.adjustment-note { margin-bottom: 16px; }
td.strong { font-weight: 500; }
.bid-grid-wide { grid-template-columns: 1fr; }
.profile-col { width: 30%; }
/* Липкая первая колонка (номер часа): при горизонтальной прокрутке на
   телефоне час не уезжает из вида. */
.sticky-first tbody th { font-weight: 400; }
.sticky-first th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-elevated); }

/* --- вкладки экрана (бывшие пункты меню «Заявки» и «Історія») ------------ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--link); text-decoration: none; font-weight: 500; }
.tab:hover { color: var(--link-hover); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.period-group { margin: 0 0 16px; }

/* --- адаптив: планшет и телефон ---------------------------------------------
   ОДИН блок на 900 px и один на 480 px, в конце файла: раньше их было четыре,
   и часть правил молча перебивалась базовыми, стоявшими ниже (форма в шапке
   панели, фильтры, сетка паспорта). */
/* подтверждение необратимого — components.css (.confirm-dialog) */
.button.danger, button.danger, input.danger { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-text); font-weight: 600; }
/* шапка «Контуру»: заявка, файл, погода, отсчёт — текст под числом */
.ops-head article p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.ops-head strong { font-size: 18px; }
td.wrap { min-width: 240px; }
/* длинная фраза в бейдже (паспорт прогона) переносится, а не обрезается */
.badge.badge-wrap { white-space: normal; max-width: 100%; }
.reason-lines { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.reason-lines li { overflow-wrap: anywhere; }
.pager { display: flex; gap: 10px; align-items: center; margin: 0 0 22px; flex-wrap: wrap; }


/* --- оболочка телефона и планшета (< 1024 px, docs/web/ux.md, «На телефоне») --
   Сайдбар — шапка (знак или «←», название экрана) и выезжающее меню;
   внизу — панель из пяти мест (shared/_tabbar). Высота панели с safe-area —
   --app-bottom на html: на неё сдвинуты отступ страницы и всё закреплённое
   внизу. Раскладка контента — блоки 900 и 480 ниже. */
@media (max-width: 1023px) {
  html:has(.tabbar) { --app-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .app { flex-direction: column; }
  /* сайдбар — компактная верхняя панель: марка и кнопка меню; навигация и
     подвал раскрываются панелью слева (menu_controller.js) */
  .sidebar {
    position: sticky; top: 0; z-index: 30; height: auto; width: 100%; overflow: visible;
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 56px;
    padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
    box-shadow: 0 2px 10px var(--sidebar-shadow);
    border-right: 0; border-bottom: 1px solid var(--sidebar-edge);
  }
  /* закрытое меню — шапка: знак (или «←») и название экрана; бренд-текст — в меню */
  .brand { padding: 0 4px 0 0; gap: 8px; flex: none; }
  .brand-tag, .brand-scope { display: none; }
  .brand-name { font-size: 15px; }
  .sidebar:not(.is-open) .brand-txt, .sidebar:not(.is-open):has(.mobile-back) .brand { display: none; }
  .brand .brand-mark { width: 36px; height: 36px; }
  .sidebar:not(.is-open) .brand { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: 0 0 0 auto; padding: 0;
    background: var(--sidebar-chip); border: 1px solid var(--sidebar-line-strong);
    border-radius: 10px; color: var(--sidebar-item-active); box-shadow: none;
  }
  .nav-toggle .nav-toggle-close, .sidebar.is-open .nav-toggle .nav-toggle-open { display: none; }
  .sidebar.is-open .nav-toggle .nav-toggle-close { display: block; }
  .sidebar .nav, .sidebar-foot, .sidebar-status { display: none; }
  /* открытое меню — панель слева во всю высоту с затемнением (как на omniscore) */
  .sidebar.is-open {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 320px); height: 100vh; height: 100dvh;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0;
    padding: max(16px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-y: auto; z-index: 40;
    box-shadow: 8px 0 32px var(--sidebar-shadow);
    animation: drawer-in 180ms ease-out;
  }
  .sidebar.is-open::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--backdrop); z-index: -1;
  }
  /* затемнение (::before, z-index −1) ложилось и на саму панель — её фон
     рисуется под ним; панель — своим фоном поверх затемнения, содержимое — над ним */
  .sidebar.is-open::after {
    content: ""; position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 320px);
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); z-index: -1; pointer-events: none;
  }
  .sidebar.is-open .brand { padding: 0 6px 18px; }
  .sidebar.is-open .brand-tag { display: block; }
  .sidebar.is-open .nav-toggle { display: inline-flex; position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; margin: 0; }
  .sidebar.is-open .mobile-head { display: none; }
  .sidebar.is-open .nav, .sidebar.is-open .sidebar-foot {
    display: flex; flex-direction: column; width: 100%; overflow: visible; padding: 4px 0; gap: 4px;
  }
  .sidebar.is-open .nav a { padding: 12px 10px; font-size: 15px; border-radius: 9px; white-space: normal; box-shadow: none; }
  .sidebar.is-open .nav a.active { background: var(--sidebar-active-bg); border-left: 3px solid var(--sidebar-active-mark); }
  .sidebar.is-open .sidebar-foot { margin-top: auto; border-top: 1px solid var(--sidebar-line); padding-top: 10px; }
  .sidebar.is-open .user-menu-pop { position: static; margin-top: 6px; }
  @keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

  .mobile-head { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; }
  .mobile-back {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    margin-left: -6px; border-radius: 10px; color: var(--sidebar-item-active);
  }
  .mobile-back:hover { color: var(--sidebar-item-active); background: var(--sidebar-hover); }
  .mobile-head-text { display: flex; flex-direction: column; min-width: 0; }
  .mobile-head-title {
    font-family: var(--font-head); font-size: 16px; font-weight: 600; line-height: 1.25;
    color: var(--sidebar-item-active); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-head-sub { font-size: 12px; line-height: 1.3; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* возврат и переключатель — в шапке телефона; в верхней панели остаётся сегмент режима */
  .topbar { margin: 0 0 14px; }
  .topbar .ops-back, .switcher.is-wide { display: none; }
  .topbar:not(:has(.mode-switch)) { display: none; }
  .topbar-right { margin-left: 0; }
  /* переключатель в шапке телефона: плитка и имя; панель — листом снизу поверх затемнения */
  .switcher.is-phone { display: block; flex: none; margin-left: auto; position: static; }
  .switcher.is-phone .switcher-button {
    height: 44px; padding: 0 10px 0 8px; gap: 6px; background: var(--sidebar-chip); border-color: var(--sidebar-line-strong);
    color: var(--sidebar-item-active); box-shadow: none; font-size: 13.5px;
  }
  .switcher.is-phone .switcher-button > svg { color: var(--sidebar-muted); }
  .switcher.is-phone .switcher-name { max-width: 8.5em; }
  .switcher.is-phone[open]::before { content: ""; position: fixed; inset: 0; z-index: 49; background: var(--backdrop); }
  .switcher.is-phone .switcher-pop {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: min(85dvh, 640px); overflow-y: auto;
    padding: 18px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-radius: 18px 18px 0 0; border-width: 1px 0 0; color: var(--text); animation: sheet-in 180ms ease-out;
  }
  .switcher.is-phone .switcher-head { padding-right: 40px; }
  .switcher.is-phone .switcher-close {
    display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 8px;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text-muted); box-shadow: none;
  }
  .switcher.is-phone .switcher-cards { grid-template-columns: 1fr; }
  /* переключатель темы на странице «Налаштування»: касание ≥ 44 × 44 (ui_check TAP) */
  .theme-switch.is-page button { min-width: 44px; min-height: 44px; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

  /* касание ≥ 44 × 44 (ux.md «На телефоне», ui_check TAP). Три приёма, вид не
     меняется: (а) текстовая ссылка без класса и термин — невидимые поля по
     вертикали с таким же отрицательным margin (у строчного элемента поля не
     двигают строки, у блочного их гасит margin); (б) знак или плашка со своим
     фоном («?», бейдж, чип, статус, сегмент, пилюля похибки) — прозрачный
     ::after до 44 px: поля раздули бы фон (ревью №461); (в) в ячейке таблицы
     ни (а), ни (б): выступ за ячейку последней строки листал бы обёртку
     с overflow по вертикали — там цель сама не ниже 44 (inline-flex). */
  .page a:not([class], .ui-seg > a, .wape-cell a), .page button.term, .term-card a:not([class]) { padding-block: 15px; margin-block: -15px; }
  .page a[class]:not(.button, .tab, .uic-pnum, .uic-col-link, .dropdown-pop a), .page .has-note, .page .wape-cell a { position: relative; }
  .page a[class]:not(.button, .tab, .uic-pnum, .uic-col-link, .dropdown-pop a)::after, .page .has-note::after, .page .wape-cell a::after {
    content: ""; position: absolute; inset-block: min(0px, calc((100% - 44px) / 2));
    inset-inline: min(0px, calc((100% - 44px) / 2));
  }
  .page :is(td, th) :is(a:not([class], .wape-cell a), button.term) {
    display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding-block: 0; margin-block: 0; vertical-align: middle;
  }
  .page td.num a:not([class]) { justify-content: flex-end; }
  /* поле ::after у плашки в последней строке выступало бы за обёртку: таблица
     листается только по горизонтали (кроме «Показати дані» с max-height) */
  .ui-table-wrap:not(.uic-data .ui-table-wrap), .tblwrap { overflow-y: hidden; }
  /* обрезанное имя (ui_clip) прячет лишнее (overflow: hidden) — ::after не
     поймал бы касание; цель — строкой высотой 44 */
  .page .ui-clip.has-note::after { content: none; }
  .page :is(td, th) .ui-clip.has-note { line-height: 44px; }
  .page .vs-bars dt button.term { display: inline-block; min-width: 44px; }
  .page summary, .tab, .ui-field-check { min-height: 44px; align-content: center; }
  .tab { display: inline-flex; align-items: center; }
  button.help-tip-button::after { inset: -14.5px; }
  /* поле мельче 16 px — iOS приближает страницу при фокусе (ui_check FONT) */
  .page input:not([type=checkbox]):not([type=radio]), .page select, .page textarea,
  dialog input:not([type=checkbox]):not([type=radio]), dialog select, dialog textarea { font-size: 16px; }
  .ui-field-check label { display: inline-flex; align-items: center; min-height: 44px; }
  .dropdown-pop a { display: flex; align-items: center; min-height: 44px; }
  .ui-seg > a, .ui-seg > button { position: relative; min-width: 44px; justify-content: center; }
  .ui-seg > a::after, .ui-seg > button::after { content: ""; position: absolute; inset: -4px 0; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    height: var(--app-bottom); padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left));
    background: var(--bg-elevated); border-top: 1px solid var(--border);
  }
  .tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 44px;
    margin: 0; padding: 4px 2px; border: 0; border-radius: 0; background: none; box-shadow: none;
    color: var(--text-muted); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item:hover { color: var(--text); background: none; border: 0; }
  .tabbar-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; }
  .tabbar-item.is-active { color: var(--text); }
  .tabbar-item.is-active .tabbar-icon { color: var(--link); background: var(--accent-soft); }
  .tabbar-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; line-height: 1.2; }
  .tabbar-item.is-active .tabbar-label { font-weight: 600; }
  .tabbar-count {
    position: absolute; top: -3px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--danger-solid); color: #ffffff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    font-variant-numeric: var(--nums);
  }
}
@media (max-width: 900px) {
  .ui-grid > .results-day-detail { grid-row: auto; }
  .results-row { grid-template-rows: none; }
  .content { padding: 18px 16px calc(44px + var(--app-bottom)); }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
  .page-head h1 { font-size: 24px; }
  .page-head > div:last-child { flex-wrap: wrap; }
  .panel-head { flex-wrap: wrap; }
  .panel-head form { flex-basis: 100%; }
  .panel-head form select { flex: 1 1 100%; max-width: 100%; }
  .panel-head form .help-tip { order: 2; }
  /* нативное поле даты игнорирует flex-basis — ширина жёстко */
  .panel-head form input[type="date"] { order: 3; flex: 0 0 136px; width: 136px; min-width: 0; padding-left: 8px; padding-right: 4px; font-size: 13px; }
  /* кнопка не сжимается до обрезки текста («Запустити канд…», №433): не влезла — строкой ниже */
  .panel-head form input[type="submit"] { order: 4; flex: 1 1 auto; padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .panel-head.stack { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards article { padding: 12px 14px; }
  .cards .num { font-size: 20px; }
  .detail-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .bid-grid { grid-template-columns: 1fr; }
  .today-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  .today-phases > li::after { display: none; }
  .today .day-title { font-size: 17px; }
  .today .day-text { font-size: 14.5px; }
  .today-why .why-delta { grid-template-columns: 1fr; }
  .why-tiles { grid-template-columns: 1fr; }
  .today-volume-value b { font-size: 28px; }
  .profile-col { display: none; }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  /* «Результати»: пометки доби (аварійна, 25 год) — под датой, липкая колонка узкая */
  .results-day { white-space: normal; min-width: 92px; }
  /* на телефоне степпер — вертикальный: знак слева, линия вниз к следующему этапу */
  .today-phases { grid-template-columns: 1fr; gap: 0; }
  .today-phases > li { flex-direction: row; gap: 12px; padding: 0 0 16px; }
  .today-phases > li:not(:last-child)::after { display: block; top: 30px; bottom: 4px; left: 11px; right: auto; width: 2px; height: auto; }
  /* главная кнопка дня — первой в низу карточки, над объёмом: ближе к шагам,
     без липкой копии (ux.md «На телефоне»); кнопки — во всю ширину */
  .today-bottom > .day-actions { order: -1; margin: 0; }
  .today-bottom .day-actions > .button, .today-bottom .day-actions > form, .today-bottom .day-actions > form .button { width: 100%; justify-content: center; }
  .content { padding: 14px 16px calc(40px + var(--app-bottom)); }
  .page-head h1 { font-size: 22px; }
  th, td { padding: 8px 10px; }
  .auth-card { padding: 24px 20px 22px; border-radius: 16px; }
  /* карточка ниже верхнего края: сверху небо с проводами, снизу сцена */
  .auth-main { justify-content: flex-start; padding-top: max(48px, 20dvh); }
  /* меньше 16px — iOS увеличивает страницу при фокусе на поле */
  .auth-card input.auth-input { font-size: 16px; }
}

/* --- высокая контрастность: системный select со своей стрелкой ---------- */
@media (forced-colors: active) {
  select:not([multiple], [size]) { appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 12px; }
}

/* --- меньше движения — везде (WCAG 2.3.3, docs/web/ux.md, принцип 9) ------
   Анимации входа, встряска ошибки, выезд меню и переходы — мгновенно;
   импульсы по проводам на входе гасит сам power_lines_controller.js. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}
