/* Палитра и шрифт — из DESIGN.md, разделы 1–2. Страница ВСЕГДА тёмная: цвета темы Telegram (--tg-theme-*)
   и prefers-color-scheme не используются. Цвета-литералы допустимы ТОЛЬКО в этом блоке: это проверяет
   service/app/test_palette.py (значения сверяются с таблицей в DESIGN.md, контраст пар считается заново). */
:root {
  color-scheme: dark;
  --canvas: #0F1419;      /* фон страницы */
  --surface: #1A2129;     /* карточки, нижняя панель, кнопки на карте */
  --surface-2: #222B35;   /* карточка внутри карточки */
  --line: #28333E;        /* разделители и рамки, 1px */
  --text: #E8EDF2;        /* основной текст */
  --text-2: #9AA7B4;      /* подписи, вторичное */
  --accent: #6FA8FF;      /* активная вкладка, ссылки, метка «вы здесь» */
  --on-accent: #0F1419;   /* текст на акценте и на цветных значках (цвет фона, не белый) */
  --ok: #3DDC84;          /* заперта, хорошо */
  --warn: #FFD54A;        /* внимание */
  --bad: #FF7A6E;         /* тревога, плохое */
  --gutter: 16px;
  --tap: 48px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--canvas); color: var(--text);
  font: 500 16px/1.4 Manrope, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
button { font: inherit; }
/* Рамка фокуса для клавиатуры и экранных дикторов; при нажатии пальцем не появляется. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Значок (icons.js): цвет берёт у текста рядом, размер задаёт data-size. Смысл несёт слово или aria-label. */
.ic-wrap { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; line-height: 0; }
.ic { display: block; }
/* Нажатие — 200 мс, только transform (DESIGN.md §8); при prefers-reduced-motion движения нет. */
button { transition: transform .2s; }
button:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { button { transition: none; } button:active { transform: none; } }

/* ---- карта и плашки -------------------------------------------------------------------------------------------- */
/* Карта кончается там, где начинается нижняя панель (она заходит на карту на 24 px своими скруглёнными углами),
   поэтому центр карты = центр видимой части: метка машины стоит ровно по центру (правило 11, смещение 0 px). */
#map-wrap { position: relative; flex: 1 1 auto; min-height: 200px; background: var(--surface-2); }
#map { position: absolute; inset: 0 0 24px 0; background: var(--surface-2); }
/* Плашка на карте: 36 px, полукруглая, значок 16 px + короткий текст; не нажимается (DESIGN.md §3, §5). */
#pills { position: absolute; z-index: 1000; top: 16px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 8px;
  pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill .ic-wrap { color: var(--text-2); }
.pill.ok .ic-wrap { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.warn .ic-wrap { color: var(--warn); }
.pill.muted { color: var(--text-2); font-weight: 600; }
#maptype { position: absolute; top: 16px; right: 16px; z-index: 1001; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; }
/* Круглая кнопка на карте: 48 px, значок 22 px, у каждой aria-label (DESIGN.md §5). */
.fab { position: absolute; z-index: 1000; right: 16px; bottom: 40px; width: var(--tap); height: var(--tap);
  display: flex; align-items: center; justify-content: center; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.fab-2 { bottom: 96px; }
/* «Слои» — третья в колонке справа; вне вкладки «Место» остальных кнопок нет, и она встаёт на их место (класс fab-low ставит app.js). */
.fab-3 { bottom: 152px; }
.fab-3.fab-low { bottom: 40px; }
/* «Назад к поездкам» (4.З): круглая кнопка слева сверху на карте открытой поездки, как в макете; те же 48 px и токены, что у остальных. */
.fab-back { top: 16px; left: 16px; right: auto; bottom: auto; }
/* Страница всегда тёмная, схема меняется только у плиток карты. Тёмная схема (по умолчанию): плитки OSM светлые — инвертируем
   (класс dark-map ставит app.js), дороги остаются читаемыми. Светлая схема: класса нет — плитки как есть, инверсии нет. */
body.dark-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }

/* Метка «машина сейчас»: точка акцента с ореолом; серая, только когда нет связи (LiLogic.markTone). */
.me { position: relative; width: 44px; height: 44px; pointer-events: none; }
.me .halo { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); opacity: .22; }
.me .core { position: absolute; left: 10px; top: 10px; width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--text); }
.me.stale .halo { display: none; }
.me.stale .core { background: var(--text-2); }

/* Моя точка (задача 4.Б): светлое кольцо с тёмной серединой и подпись «Вы» — отличима от точки машины формой и словом,
   а не только цветом; цвета только токены, нового акцента нет. Центр значка = координата. */
.you { position: relative; width: 44px; height: 44px; pointer-events: none; }
.you .dot { position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--text); }
.you .lbl { position: absolute; left: 32px; top: 11px; height: 22px; padding: 0 8px; border-radius: 11px; line-height: 20px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 800; white-space: nowrap; }

/* ---- нижняя панель --------------------------------------------------------------------------------------------- */
/* Лист поверх карты: верхние углы 24 px, внутри 20 px. На вкладках без карты — обычный экран на фоне страницы. */
#panel { position: relative; z-index: 1100; flex: 0 1 auto; max-height: 46%; overflow-y: auto; margin-top: -24px;
  padding: 20px 20px 12px; background: var(--surface); border-radius: 24px 24px 0 0; }
body.nomap #map-wrap { display: none; }
body.nomap #panel { flex: 1 1 auto; max-height: none; margin-top: 0; border-radius: 0; background: var(--canvas); padding: 12px 16px 8px; }

/* шапка вкладки: название слева, «Обновить» справа */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 44px; }
.bar > :first-child { flex: 1 1 auto; margin: 0; }
.title { margin: 0 0 8px; font-size: 24px; line-height: 1.2; font-weight: 800; }
.icon-btn { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding: 0;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; }
button.busy { opacity: .5; }

/* крупное состояние (28 px, 800) и серая строка под ним */
.head { margin: 0 0 6px; font-size: 28px; line-height: 1.1; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.head .em { display: inline-flex; color: var(--text-2); }
.head.grey { color: var(--text-2); }
.head .em:empty { display: none; }      /* «Нет данных от службы»: пустой знак не держит отступ */
.place-note { margin: 0; color: var(--text-2); font-size: 14px; font-weight: 500; }
.state { margin-bottom: 4px; }
/* Шапка «Статуса» (4.З): в первой строке состояние и плашка замка (36 px), во второй серая строка и малым шрифтом свежесть,
   справа «Обновить» 44 px. Две строки вместо трёх; плашка замка и «Обновить» на тот же экран выше не лезут. */
.status-top { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; min-height: 36px; }
.status-top .head { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 24px; }      /* 28 px вместе с плашкой замка в 358 px не влезает: 241 + 108 > 358 */
.status-lock { flex: 0 0 auto; display: inline-flex; }
.status-sub { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; min-height: 44px; }
.status-sub-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.status-sub-text p { margin: 0; }
.status-fresh { font-size: 13px; font-weight: 500; color: var(--text-2); }

/* «Маршрут»: единственная главная кнопка экрана (DESIGN.md §5) — акцент, 48 px, значок 22 px и слово. Неактивная — серая. */
.route-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.btn-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 22px;
  border: 0; border-radius: 24px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 800; cursor: pointer; }
.btn-main:disabled { background: var(--surface-2); color: var(--text-2); cursor: default; }
.btn-main:disabled:active { transform: none; }
.route-note { font-size: 14px; font-weight: 600; color: var(--text-2); }
/* Строка про место телефона: высота занята всегда (пустая — пока ответа нет), панель и карта не прыгают при её появлении. */
.phone-line { margin: 10px 0 0; min-height: 20px; font-size: 14px; font-weight: 600; color: var(--text-2); }

/* Загрузка — форма будущего содержимого, а не слово без конца (DESIGN.md §6). Фоновых анимаций нет. */
.skel { display: flex; flex-direction: column; gap: 10px; }
.skel i { display: block; height: 16px; border-radius: 8px; background: var(--surface); }
.skel i + i { width: 60%; }

/* плитка: одна крупная цифра, серая подпись под ней (DESIGN.md §5) */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; }
.tiles .note { grid-column: 1 / -1; }
.tile { background: var(--surface-2); border-radius: 16px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; min-height: 56px; }
.tile .n { font-size: 22px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.tile .c { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* строки со значком: «События» (журнал: время слева, событие справа) и прочие списки */
.lines { list-style: none; margin: 0 0 8px; padding: 0; }
.lines li { display: flex; gap: 12px; align-items: center; padding: 10px 0; font-size: 15px; font-weight: 600; }
.lines li + li { border-top: 1px solid var(--line); }
.lines li .em { flex: 0 0 22px; display: inline-flex; justify-content: center; color: var(--text-2); }
.lines li .tx { flex: 1 1 auto; }
/* строка-тревога: жирный шрифт + свой цвет + слово; не один цвет */
.lines li.warn { color: var(--warn); font-weight: 700; }
.lines li.warn .em { color: var(--warn); }
/* «Журнал»: время слева, событие справа (DESIGN.md §5) */
.lines li .time { flex: 0 0 48px; color: var(--text-2); font-size: 14px; font-weight: 600; }
#tab-events .lines { background: var(--surface); border-radius: 20px; padding: 4px 16px; }
#tab-events .lines:empty { display: none; }
.lines li.skel-line { height: 20px; padding: 0; margin: 12px 0; border-radius: 10px; background: var(--surface-2); }
.lines li.skel-line + li { border-top: 0; }
.warnline { margin: 0 0 12px; padding: 10px 16px; border-radius: 16px; background: var(--surface); color: var(--warn); font-weight: 600; font-size: 14px; }
/* «Последнее известное» при обрыве (задача 4.Е): отдельный СЕРЫЙ блок — это прошлое, а не нынешнее состояние.
   Весь текст --text-2 на --surface (6,62), рамка пунктиром --line: отличается от карточек свежих данных не только цветом. */
.last-known { margin: 0 0 12px; padding: 12px 16px 4px; border-radius: 20px; background: var(--surface); color: var(--text-2);
  border: 1px dashed var(--line); }
.last-known .lk-title { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 13px; font-weight: 700; }
.last-known .lines { margin: 0; }
.last-known .lines li { padding: 8px 0; font-size: 14px; font-weight: 600; }

.seg { display: inline-flex; background: var(--surface); border-radius: 24px; padding: 2px; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 0 16px; font-size: 14px; font-weight: 700;
  border-radius: 22px; min-height: 44px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 800; }

.status { margin: 4px 0; font-weight: 600; font-size: 16px; }
.note { margin: 2px 0 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--text-2); text-align: center; }
.empty p { margin: 0; font-size: 15px; font-weight: 600; }

/* полоса тревоги: цвет + слово + значок, не один цвет */
#alerts { padding: 10px var(--gutter); background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--warn); font-weight: 700; font-size: 14px; }
#alerts div { display: flex; gap: 10px; align-items: center; padding: 2px 0; }
#alerts div > span:first-child { display: inline-flex; }
#alerts[hidden] { display: none; }

/* дни: кнопки-капсулы 44 px; выбранный — акцент */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; border: 0; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700;
  border-radius: 22px; padding: 0 16px; min-height: 44px; cursor: pointer; }
.chips button.on { background: var(--accent); color: var(--on-accent); font-weight: 800; }

.date { display: block; margin: 14px 0 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.date input { display: block; margin-top: 6px; width: 100%; max-width: 100%; min-width: 0; -webkit-appearance: none; appearance: none;
  font: inherit; padding: 10px 14px; min-height: 44px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }

/* карточка поездки (макет «Поездки»): время и «км · длительность», маршрут, две коробки энергии, расход ≈ */
.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list li button { width: 100%; text-align: left; border: 0; border-radius: 20px; margin-bottom: 10px;
  background: var(--surface); color: var(--text); padding: 16px; min-height: 64px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; }
.list li button.on { outline: 2px solid var(--accent); }
.row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.row1 .time { font-size: 20px; font-weight: 800; white-space: nowrap; }
.row1 .meta { font-size: 15px; font-weight: 700; color: var(--text-2); }
.route { font-size: 14px; font-weight: 500; color: var(--text-2); }
.boxes { display: flex; gap: 8px; }
.box { flex: 1 1 0; min-width: 0; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.boxes.plain .box { background: var(--surface-2); }
.box .bv { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; white-space: nowrap; }
.box .bv .ic-wrap { color: var(--text-2); }
.box .bd { font-size: 13px; font-weight: 600; color: var(--text-2); }
.box .bw { font-size: 15px; font-weight: 800; }      /* «не менялась» / «не менялся» — слово вместо крупного нуля */
.box.unknown .bv { color: var(--text-2); }
.per100 { font-size: 13px; font-weight: 600; color: var(--text-2); }
/* стоянка между поездками: серая строка между карточками, не нажимается */
.list li.parking { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; margin-bottom: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-2); }
.skel-card { height: 76px; border-radius: 20px; background: var(--surface); margin-bottom: 10px; }
body.nomap .skel i { background: var(--surface-2); }

/* «Итог за день» и график месяца: карточка 20 px на фоне страницы */
.chart-card { background: var(--surface); border-radius: 20px; padding: 12px 16px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.chart-card:empty { display: none; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chart-head .lab { font-size: 13px; font-weight: 600; color: var(--text-2); }
.chart-head .tot { display: inline-flex; align-items: baseline; gap: 4px; }
.chart-head .n { font-size: 24px; font-weight: 800; white-space: nowrap; }
.chart-head .u { font-size: 14px; font-weight: 700; color: var(--text-2); }
.chart-card .note { margin: 0; font-size: 12px; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .axis { stroke: var(--line); stroke-width: 1; }
.chart-svg .bar { fill: var(--text-2); }
.chart-svg .bar.today { fill: var(--accent); }
.chart-svg text { font: 600 12px Manrope, system-ui, sans-serif; fill: var(--text-2); }

/* «Статус»: плашки, большая карточка энергии, плитки 2×N (макет «Статус») */
.status-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.status-pills:empty { display: none; }
.energy { background: var(--surface); border-radius: 24px; padding: 14px 16px; display: flex; gap: 16px; }
.energy .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.energy .sep { flex: 0 0 1px; background: var(--line); }
.energy .lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.energy .big { display: flex; align-items: baseline; gap: 6px; }
.energy .big .n { font-size: 44px; line-height: 1; font-weight: 800; white-space: nowrap; }
.energy .big.small .n { font-size: 32px; }
.energy .big .u { font-size: 16px; font-weight: 700; color: var(--text-2); }
.energy .track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.energy .track i { display: block; height: 10px; border-radius: 5px; background: var(--accent); }
.energy .cap { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.charge { display: flex; align-items: center; gap: 8px; margin: 6px 4px 0; font-size: 14px; font-weight: 700; color: var(--text); }
.charge .ic-wrap { color: var(--ok); }
/* Плитки «Статуса» — высота по содержимому (4.З): пустой строки подписи нет, фиксированной высоты нет. */
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.stile { background: var(--surface); border-radius: 20px; padding: 10px 12px; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
/* значение и серая строка — в одну строку, если помещаются («61,7 км · 4 поездки»); длинная подпись уходит под значение */
.stile .bot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.stile.skel { background: var(--surface); }
.stile .lab { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.stile .val { display: flex; align-items: baseline; gap: 6px; min-height: 28px; }
.stile .v { font-size: 26px; line-height: 1.1; font-weight: 800; white-space: nowrap; }
.stile .v.word { font-size: 20px; }
.stile .v.long { font-size: 22px; }
.stile .u { font-size: 15px; font-weight: 700; color: var(--text-2); }
.stile .val .ic-wrap { align-self: center; }
.stile.ok .val .ic-wrap { color: var(--ok); }
.stile.warn .val .ic-wrap, .stile.warn .sub { color: var(--warn); }
.stile.muted .v { color: var(--text-2); }
.stile .sub { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.stile .sub:empty { display: none; }

/* энергия открытой поездки: две плитки на вложенной карточке (макет «Открытая поездка») */
.etiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; }
.etile { background: var(--surface-2); border-radius: 16px; padding: 8px 12px; display: flex; flex-direction: column; gap: 1px; }
.etile .lab { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.etile .val { display: flex; align-items: baseline; gap: 4px; }
.etile .v { font-size: 22px; line-height: 1.15; font-weight: 800; white-space: nowrap; }
.etile .v.word { font-size: 17px; line-height: 1.4; }      /* «не менялась» — слово, мельче числа */
.etile .u { font-size: 14px; font-weight: 700; color: var(--text-2); }
.etile .sub { font-size: 12px; font-weight: 600; color: var(--text-2); }
#trip-energy .note { margin: 0 0 2px; font-size: 12px; }
.etile.unknown .v { color: var(--text-2); }

/* Открытая поездка (4.З): панель короче, карта занимает не меньше половины экрана 390×844 */
#trip-view { margin: -4px 0 -4px; }
#trip-title { margin: 0 0 2px; }
#trip-addr { margin: 0 0 6px; line-height: 1.3; }
#slider { width: 100%; margin: 2px 0 0; height: 28px; accent-color: var(--accent); }
/* подпись ползунка и границы цвета трека — в одной строке (4.З): подпись слева, границы справа */
.slider-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; }
#slider-label { margin: 0; min-height: 1.4em; font-size: 14px; font-weight: 600; color: var(--text); }      /* высота панели не прыгает — карта не дёргается */
#slider::-webkit-slider-thumb { height: 28px; width: 28px; }
#slider::-moz-range-thumb { height: 28px; width: 28px; }
/* подпись цвета трека словами (DESIGN.md §9: цвет — не единственный носитель смысла) */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend .dot.ok { background: var(--ok); }
.legend .dot.warn { background: var(--warn); }
.legend .dot.bad { background: var(--bad); }

/* «Настройки» (задача 5.10): раздел — серая подпись; параметр — карточка 20 px: подпись и значение в строку, под ними
   откуда значение и когда менялось, подсказка, поле 44 px + «Сохранить», границы, ошибка словами, «Вернуть как было».
   Главной (акцентной) кнопки на экране нет: «Сохранить» — вторичная, «Вернуть как было» — ссылка (DESIGN.md §5). */
.sgroup { margin: 16px 4px 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.sgroup:first-child { margin-top: 4px; }
.scard { background: var(--surface); border-radius: 20px; padding: 12px 16px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.scard.broken { border: 1px dashed var(--warn); }
/* длинное значение («12.10.2027 (примерно)») уходит под подпись, а не сжимает её в столбик по слову */
.stop { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.slab { flex: 1 1 150px; font-size: 15px; font-weight: 600; min-width: 0; }
.sval { flex: 0 0 auto; font-size: 20px; font-weight: 800; white-space: nowrap; }
.ssub, .shint, .sbounds { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.shint { font-size: 12px; }
.sproblem { margin: 2px 0; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; font-weight: 700; color: var(--warn); }
.sedit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sfield { flex: 0 1 auto; min-width: 0; width: 120px; min-height: 44px; padding: 0 12px; font: inherit; font-weight: 700;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
select.sfield { width: 160px; }
input.sfield[type="date"] { width: 170px; -webkit-appearance: none; appearance: none; }
.sunit { font-size: 15px; font-weight: 700; color: var(--text-2); }
.sapprox { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--text); }
.sapprox input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.btn-2 { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-2:disabled, .btn-link:disabled { opacity: .5; cursor: default; }
.btn-link { align-self: flex-start; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--accent);
  font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; }
.serr { margin: 0; font-size: 13px; font-weight: 700; color: var(--bad); }
.snote { margin: 0 0 10px; padding: 10px 16px; border-radius: 16px; background: var(--surface); color: var(--ok); font-weight: 700; font-size: 14px; }
.stitle { margin: 0; font-size: 17px; font-weight: 700; }
.slog { margin: 0; }
.slog li { align-items: flex-start; font-size: 14px; }
.slog li .time { flex: 0 0 96px; font-size: 13px; }
#tab-settings .skel-card { height: 120px; }

/* ошибка: причина словами и «Повторить» (DESIGN.md §6) */
#banner { display: flex; gap: 10px; align-items: center; padding: 10px var(--gutter);
  background: var(--bad); color: var(--on-accent); font-weight: 600; }
#banner[hidden] { display: none; }
#banner-text { flex: 1 1 auto; }
#banner button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--on-accent); background: transparent;
  color: var(--on-accent); font-weight: 700; border-radius: 22px; padding: 0 14px; min-height: 44px; cursor: pointer; }

/* нижняя панель: пять вкладок (с 5.10 — «Настройки»), значок 24 px и подпись 12 px; активная — акцент */
#bottom { flex: 0 0 auto; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); position: relative; z-index: 1200; }
#bottom button { flex: 1 1 0; min-height: 64px; border: 0; background: transparent; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 0 2px; cursor: pointer; }
#bottom button.on { color: var(--accent); font-weight: 700; }
#bottom button:active { background: var(--surface-2); }

.seg button[hidden] { display: none; }
/* стрелка направления на треке: заливка цветом фона, обводка текстом (как в макете) */
.arrow { display: block; width: 16px; height: 16px; }
.arrow svg { fill: var(--canvas); stroke: var(--text); }
.ab { width: 28px; height: 28px; border-radius: 14px; background: var(--canvas); color: var(--text);
  font-size: 13px; font-weight: 800; text-align: center; line-height: 24px; border: 2px solid var(--text); }
.leaflet-div-icon { background: transparent; border: 0; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-bar { border: 1px solid var(--line); box-shadow: none; border-radius: 22px; overflow: hidden; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; background: var(--surface); color: var(--text); border-bottom-color: var(--line); }
.leaflet-bar a:first-child, .leaflet-bar a:last-child { border-radius: 0; }
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--surface-2); color: var(--text); }
.leaflet-bar a.leaflet-disabled { background: var(--surface); color: var(--text-2); }
.leaflet-bottom.leaflet-left .leaflet-control { margin-left: 16px; margin-bottom: 16px; }
/* подпись источника карты и всплывашки Leaflet по умолчанию белые — перекрашиваем */
.leaflet-container .leaflet-control-attribution { background: var(--surface); color: var(--text-2); }
.leaflet-control-attribution a { color: var(--accent); }
.leaflet-tooltip { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; font-weight: 600; }
.leaflet-tooltip .ic-wrap { vertical-align: -2px; color: var(--text-2); }
.leaflet-tooltip-top:before { border-top-color: var(--surface); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--surface); }
.leaflet-tooltip-left:before { border-left-color: var(--surface); }
.leaflet-tooltip-right:before { border-right-color: var(--surface); }

/* ---- без качания вбок (2026-10-13, жалоба владельца: «страница шатается») --------------------------------------- */
/* Страница двигается только вверх-вниз; вбок едет лишь ряд дней. Что бы ни выпирало за край, экран не качается. */
html, body { overflow-x: hidden; overscroll-behavior: none; }
#panel { overflow-x: hidden; overscroll-behavior-x: none; touch-action: pan-y; min-width: 0; }
#tab-trips, #trips-list-view { min-width: 0; max-width: 100%; }
.chips { max-width: 100%; overscroll-behavior-x: contain; touch-action: pan-x; }
/* Поле даты на iPhone игнорирует width и выпирает за край шире остальных кнопок — прижимаем и выравниваем текст. */
.date input::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.date input::-webkit-datetime-edit { padding: 0; }
