:root {
  --bg: var(--tg-theme-bg-color, #eef1f6);
  --text: var(--tg-theme-text-color, #0e1220);
  /* Не берём --hint/--link из tg-theme-* — в некоторых клиентах эти значения
     подобраны под нативную тёмную тему Telegram и на нашем светлом фоне
     превращаются в почти невидимый текст. Держим фиксированными.
     #5c6478 на полупрозрачных карточках (--glass-bg поверх --bg) давал
     всего ~2.3:1 контраста — заметно ниже минимума ≥4.5:1, текст сливался
     с фоном. Затемнили до устойчивого контраста во всех местах использования. */
  --hint: #454c60;
  /* --link — акцентный оранжевый, но использованный как ТЕКСТ/иконка (не фон).
     Чистый #ff6a00 на белом даёт ~2.7:1 контраста — плохо читается, поэтому
     для текста берём затемнённый бренд-оттенок; --accent остаётся ярким
     оранжевым для сплошных кнопок/градиентов, где текст поверх него белый. */
  --link: #c1440e;
  --button: var(--tg-theme-button-color, #ff6a00);
  --button-text: var(--tg-theme-button-text-color, #fff);
  /* Раньше почти белый (#e4e8f0) — на нейтральных чипах/плитках это читалось
     как дешёвый блёклый серый. Темнее и холоднее — глубокий сланец вместо
     пастели, премиальнее и без потери контраста текста поверх него. */
  --secondary-bg: var(--tg-theme-secondary-bg-color, #c3cadf);

  /* ── Палитра: базовый чёрный/белый (--bg/--text) + РОВНО 3 акцента ────────
     accent (оранжевый, бренд/основное действие), danger (красный,
     деструктивные/критичные), success (зелёный, успех). Раньше сюда же
     подмешивались синий/фиолетовый/жёлто-янтарный "по вкусу" под разные
     категории — премиум так не работает: лишние оттенки читаются как шум,
     а не как система. Всё, что раньше красили бы отдельным цветом
     "для разнообразия" (статусы, категории статистики, предупреждения),
     теперь либо нейтрально (--hint/--secondary-bg), либо использует один
     из этих трёх — какой семантически ближе. "Предупреждение" не заводит
     четвёртый (янтарный) цвет — это тот же accent, он и так читается как
     "внимание". */
  --accent: #ff6a00;
  --accent-2: #ff9500;
  --danger: #ff4d6a;
  --success: #22c58b;

  /* ── Типографика: РОВНО 3 размера текста на всё приложение ────────────────
     Акцент/иерархия — весом (font-weight) и цветом, а не пятым/шестым
     размером шрифта. sm — вспомогательный текст (подписи, метки, бейджи),
     md — обычный текст (тело, кнопки, большинство интерфейса),
     lg — крупные акцентные числа/заголовки (выручка, телефон клиента). */
  --fs-sm: 11px;
  --fs-md: 13.5px;
  --fs-lg: 19px;

  /* Подняли непрозрачность и объём стекла ещё раз — первая правка (0.78)
     была недостаточно выраженной, просило "прям как у Apple, прям
     выраженнее". Плотнее фон, чётче край, заметно более объёмная тень. */
  /* Прозрачнее, чем раньше (0.9) — стиль, а не только читаемость: теперь
     фоновые акцентные пятна (.blob) слегка проступают сквозь карточки, тем
     самым "жидким стеклом", а не плотной непрозрачной плашкой. Контраст
     текста при этом не страдает — сам текст всегда сплошной var(--text),
     прозрачен только фон карточки. */
  --glass-bg: rgba(255, 255, 255, 0.74);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  /* Не белый край (пропадал бы на белом фоне) — прохладный серый даёт
     видимый контур карточки, а внутренний блик сверху (glass-shadow'ом
     ниже) добавляет ту самую "стеклянную" объёмность. */
  --glass-border: rgba(160, 170, 200, 0.4);
  --glass-shadow: 0 18px 48px rgba(30, 40, 80, 0.16), 0 4px 10px rgba(30, 40, 80, 0.1), 0 1px 0 rgba(255, 130, 40, 0.08), inset 0 1.5px 0 rgba(255, 255, 255, 0.9);
  --sheet-bg: rgba(252, 253, 255, 0.98);
  --glass-sheen: rgba(255, 255, 255, 0.55);
  --glass-sheen-blend: normal;

  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
}

/* Без явного color-scheme мобильный WebView иногда рендерит НАТИВНЫЕ виджеты
   полей ввода (текст, каретка, автозаполнение) под системную тёмную тему,
   даже когда наша собственная CSS-тема светлая — текст в input становится
   белым на белом и не виден. Синхронизируем со своим текущим data-theme,
   а не с системным prefers-color-scheme. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

:root[data-theme="dark"] {
  --bg: #0b0d14;
  --text: #eef1f8;
  --hint: #8b92a8;
  --link: #ff9a4d;
  --glass-bg: rgba(40, 44, 64, 0.86);
  --glass-bg-strong: rgba(44, 48, 70, 0.94);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 140, 40, 0.06), inset 0 1.5px 0 rgba(255, 255, 255, 0.14);
  --sheet-bg: rgba(20, 22, 34, 0.99);
  --secondary-bg: rgba(255, 255, 255, 0.06);
  /* На тёмном фоне плоская полупрозрачность сама по себе не читается как
     стекло — нужен явный диагональный блик (screen, не normal: подсвечивает,
     не просто перекрашивает) поверх карточки, чтобы был тот самый "вау". */
  --glass-sheen: rgba(255, 255, 255, 0.16);
  --glass-sheen-blend: screen;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d14;
    --text: #eef1f8;
    --hint: #8b92a8;
    --link: #ff9a4d;
    --glass-bg: rgba(22, 24, 38, 0.72);
    --glass-bg-strong: rgba(26, 28, 44, 0.88);
    --glass-border: rgba(255, 255, 255, 0.22);
    --glass-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 140, 40, 0.06), inset 0 1.5px 0 rgba(255, 255, 255, 0.14);
    --sheet-bg: rgba(14, 15, 24, 0.99);
    --secondary-bg: rgba(255, 255, 255, 0.09);
    --glass-sheen: rgba(255, 255, 255, 0.16);
    --glass-sheen-blend: screen;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* На части мобильных WebView текст, который менеджер САМ печатает в поле,
   рендерится через -webkit-text-fill-color (не через обычный color) — если
   системная тема телефона тёмная, а наша светлая, получаются белые буквы на
   светлом фоне поля, хотя color: var(--text) уже стоит. -webkit-text-fill-
   color бьёт это переопределение по specificity, где бы он ни был задан
   плагином/UA-стилями, поэтому дублируем его явно везде, где есть поля ввода. */
input, textarea {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  /* iOS/WKWebView (в т.ч. Telegram на iPhone) автоматически зумит страницу
     при фокусе на поле с font-size < 16px — и не всегда аккуратно
     возвращает масштаб обратно, отсюда ощущение "само меняется масштаб и
     смещается". Раньше несколько полей (особенно компактные в Ролях) были
     мельче 16px — именно вкладка Управление и "плавала". Держим ЛЮБОЙ input
     не мельче 16px, вёрстку компактности делаем через padding, не через
     font-size. Это единственное системное исключение из "3 размеров" —
     технически вынужденное, не декоративное. */
  font-size: 16px !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  /* Noto Serif JP не покрывает кириллицу (только японский + базовая
     латиница) — русский текст в интерфейсе автоматически уходит в
     системный фолбэк ниже, латиница (например "Smolensk" в шапке) — в
     засечки Noto Serif JP. Смешанный вид — ожидаемое следствие выбора
     именно этого шрифта, не баг. */
  font-family: "Noto Serif JP", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Пока открыта любая модалка — блокируем скролл фона за ней (свайп внутри
   модалки не должен листать страницу позади). */
body:has(.modal-backdrop) {
  overflow: hidden;
  height: 100vh;
}

/* ── Декоративный фон: размытые пятна, только акцентным оттенком ─────────
   Раньше пятна брали success/warning/danger вперемешку — на премиальном
   монохроме с 3 акцентами фон должен быть тише, одного оттенка (accent),
   просто с разной плотностью/положением, а не радугой. */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.28;
}
:root[data-theme="dark"] .blob { opacity: 0.22; }
@media (prefers-color-scheme: dark) {
  .blob { opacity: 0.22; }
}
.blob-a {
  width: 260px; height: 260px;
  top: -80px; left: -60px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.blob-b {
  width: 220px; height: 220px;
  top: 180px; right: -70px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  opacity: 0.7;
}
.blob-c {
  width: 240px; height: 240px;
  bottom: 60px; left: -50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.55;
}

/* ── Шапка: жидкое стекло, узкая, вся поверхность переливается ───────────
   Раньше "переливалась" только тонкая полоска снизу — теперь весь фон
   шапки живой: диагональный градиент (accent → белый блик → accent-2)
   медленно "плывёт" по всей площади через background-position, поверх
   обычного стеклянного фона (mix-blend-mode подсвечивает, не перекрашивает
   — текст/иконки поверх остаются полностью читаемыми). */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 9px 16px 10px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 10%,
    rgba(255, 106, 0, 0.5) 30%,
    rgba(255, 255, 255, 0.65) 42%,
    rgba(255, 149, 0, 0.55) 52%,
    transparent 74%
  );
  background-size: 250% 250%;
  animation: topbar-sheen 8s ease-in-out infinite;
  mix-blend-mode: var(--glass-sheen-blend, normal);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] .topbar::before { opacity: 0.6; }
@media (prefers-color-scheme: dark) {
  .topbar::before { opacity: 0.6; }
}
@keyframes topbar-sheen {
  0%, 100% { background-position: 0% 15%; }
  50% { background-position: 100% 85%; }
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent-2) 50%, var(--accent) 65%, transparent);
  background-size: 250% 100%;
  animation: topbar-shimmer 7s linear infinite;
  opacity: 0.85;
}
@keyframes topbar-shimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}
.topbar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  cursor: pointer;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4), inset 0 1.5px 0 rgba(255, 255, 255, 0.4);
}
.topbar-icon svg { display: block; width: 16px; height: 16px; }
.topbar h1 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}
.topbar h1 .brand-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text);
  border-radius: 50%;
  transition: transform 0.12s ease, background 0.15s ease;
}
.bell-btn svg { width: 16px; height: 16px; }
.bell-btn:active { transform: scale(0.88); }
.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--danger), #ff2d55);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--glass-bg-strong), 0 3px 8px rgba(255, 45, 85, 0.5);
}

/* Панель всегда тёмная (как шапка была раньше) — гарантированная
   читаемость в любой теме устройства. */
.notif-panel {
  position: fixed;
  top: 62px;
  right: 12px;
  left: 12px;
  max-width: 420px;
  margin-left: auto;
  z-index: 60;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #17181f 0%, #1d1810 60%, #2a1608 100%);
  border: 1px solid rgba(255, 140, 0, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: notifPanelIn 0.2s cubic-bezier(.2,.9,.3,1);
  overflow: hidden;
}
@keyframes notifPanelIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-panel-head {
  padding: 14px 16px;
  font-size: var(--fs-md);
  font-weight: 800;
  color: #f4f5f8;
  border-bottom: 1px solid rgba(255, 140, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-panel-head svg { color: #ff9a3d; filter: drop-shadow(0 2px 6px rgba(255,140,0,0.5)); }
.notif-panel-body {
  overflow-y: auto;
  padding: 8px;
}
.notif-swipe-item { margin-bottom: 6px; }
.notif-swipe-item:last-child { margin-bottom: 0; }
/* Фон ОБЯЗАН быть непрозрачным — иначе кнопка удаления снизу "просвечивает"
   ещё до свайпа (просто накладываются друг на друга по z-index). */
.notif-swipe-item .swipe-content { background: #1c1912; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.45;
  color: #f4f5f8;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}
/* Цвет по категории — только там, где это ДЕЙСТВИТЕЛЬНО success/error;
   "warning" и "info" — оба просто accent (оранжевый), не заводим для них
   отдельный янтарный оттенок ради "разнообразия". */
.notif-item.kind-success { background: rgba(34, 197, 139, 0.12); border-color: rgba(34, 197, 139, 0.22); border-left: 3px solid var(--success); }
.notif-item.kind-warning { background: rgba(255, 106, 0, 0.1); border-color: rgba(255, 106, 0, 0.2); border-left: 3px solid var(--accent); }
.notif-item.kind-error   { background: rgba(255, 77, 106, 0.12); border-color: rgba(255, 77, 106, 0.22); border-left: 3px solid var(--danger); }
.notif-item.kind-info    { background: rgba(255, 106, 0, 0.1); border-color: rgba(255, 106, 0, 0.2); border-left: 3px solid var(--accent); }
.notif-item.unread .notif-item-title::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 6px;
  vertical-align: middle;
}
.notif-item-content { min-width: 0; flex: 1; }
.notif-item-title { font-weight: 700; font-size: var(--fs-md); color: #f4f5f8; }
.notif-item-detail { font-size: var(--fs-sm); color: #c7cbdb; margin-top: 2px; font-weight: 500; }
.notif-item-time { font-size: var(--fs-sm); color: #b6bacb; margin-top: 5px; font-weight: 600; letter-spacing: 0.01em; }
.notif-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.notif-item-icon.kind-success { background: linear-gradient(135deg, var(--success), #16915f); color: #fff; }
.notif-item-icon.kind-warning { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.notif-item-icon.kind-error   { background: linear-gradient(135deg, var(--danger), #ff2d55); color: #fff; }
.notif-item-icon.kind-info    { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--text);
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  max-width: 150px;
  justify-self: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.status-pill:active { transform: scale(0.95); }
.status-pill span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hint);
  box-shadow: 0 0 0 3px var(--secondary-bg);
}
.status-dot.ok { background: var(--success); box-shadow: 0 0 10px rgba(34, 197, 139, 0.7); }
.status-dot.warn { background: var(--accent); box-shadow: 0 0 10px rgba(255, 106, 0, 0.7); animation: dotPulse 1.4s ease-in-out infinite; }
.status-dot.err { background: var(--danger); box-shadow: 0 0 10px rgba(255, 77, 106, 0.7); animation: dotPulse 1s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

/* ── Спейсер над нижним меню (реальный элемент потока, а не padding) ──── */
.bottom-spacer {
  height: calc(96px + env(safe-area-inset-bottom, 0px));
}

#view {
  padding: 14px 14px 40px;
  max-width: 640px;
  margin: 0 auto;
}
#view.view-fade {
  animation: viewFadeIn 0.28s cubic-bezier(.2,.8,.3,1);
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton-загрузка ─────────────────────────────────────────────────── */
.skeleton-card { pointer-events: none; }
.skeleton-line {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--secondary-bg) 25%,
    rgba(255, 106, 0, 0.14) 50%,
    var(--secondary-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Нижняя навигация ──────────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 30;
  display: flex;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  max-width: 640px;
  margin: 0 auto;
}

.tabbar-thumb {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,106,0,0.18), rgba(255,106,0,0.07));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

.tab-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--hint);
  padding: 8px 2px;
  border-radius: var(--radius-md);
  transition: color 0.25s ease, transform 0.15s ease;
}
.tab-btn:active { transform: scale(0.93); }
.tab-icon { display: flex; line-height: 1; }
.tab-icon svg { display: block; }
.tab-label { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.01em; }

.tab-btn.active { color: var(--link); }

/* ── Стеклянные карточки ───────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
/* Диагональный блик по верхнему краю — то самое "жидкое стекло": в тёмной
   теме обычная полупрозрачность на почти чёрном фоне сама по себе смотрится
   плоско, без явного блика эффект стекла почти не читается. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, var(--glass-sheen) 0%, transparent 38%);
  mix-blend-mode: var(--glass-sheen-blend, normal);
}

.field-group { margin-bottom: 10px; }
.field-group:last-of-type { margin-bottom: 0; }
/* Логин+пароль в один ряд вместо двух — карточка "Вход на сайт" иначе
   получалась заметно выше карточки "Менеджер" рядом, хотя обе показывают,
   по сути, одну строку данных + кнопку действия. */
.field-group-row {
  display: flex;
  gap: 8px;
}
.field-group-row .field-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.field-group-row .field-group input {
  padding: 8px 10px;
}
.field-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 2px 5px;
}
.field-group input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--secondary-bg);
  color: var(--text);
  outline: none;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.list-item-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--secondary-bg);
  color: var(--link);
}

.unit {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}

.addr {
  font-size: var(--fs-md);
  color: var(--text);
}

.meta {
  font-size: var(--fs-sm);
  color: var(--hint);
  margin-top: 2px;
}

/* ── Карточка самоката: компактная строка, без пустого центра ─────────── */
.scooter-card {
  padding: 10px 12px;
}
.scooter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.scooter-unit {
  flex-shrink: 0;
  font-weight: 800;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 106, 0, 0.25);
}
.scooter-addr-wrap {
  flex: 1;
  min-width: 0;
}
.scooter-addr-wrap .addr {
  font-weight: 600;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.scooter-addr-wrap .addr::-webkit-scrollbar { display: none; }
.scooter-side {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  padding: 8px 10px !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.swipe-actions button svg { display: block; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinning svg { animation: spin 0.7s linear infinite; }

/* ── Значки статуса: ok=success, crit=danger, low="внимание"=accent,
   остальное (rented/paused/unknown) — нейтральные, без своего цвета ─── */
.badge {
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  backdrop-filter: blur(6px);
  border: 1px solid transparent;
}
.badge.ok    { background: rgba(34, 197, 139, 0.18); color: #0e8a5c; border-color: rgba(34,197,139,0.3); }
.badge.low   { background: rgba(255, 106, 0, 0.16);  color: var(--link); border-color: rgba(255,106,0,0.3); }
.badge.crit  { background: rgba(255, 77, 106, 0.18);  color: #cc1d3f; border-color: rgba(255,77,106,0.3); }
.badge.unknown { background: var(--secondary-bg); color: var(--hint); }
.badge.paused { background: var(--secondary-bg); color: var(--text); border-color: var(--glass-border); }
.badge.rented { background: var(--secondary-bg); color: var(--text); border-color: var(--glass-border); }

:root[data-theme="dark"] .badge.ok   { color: #4be3ab; }
:root[data-theme="dark"] .badge.low  { color: #ff9a4d; }
:root[data-theme="dark"] .badge.crit { color: #ff7d92; }
@media (prefers-color-scheme: dark) {
  .badge.ok   { color: #4be3ab; }
  .badge.low  { color: #ff9a4d; }
  .badge.crit { color: #ff7d92; }
}

/* ── Кнопки (button.action и a.action — ссылки tel:/tg:/https: тоже) ────── */
.action {
  position: relative;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  /* Glossy inset-хайлайт сверху — тот же приём "жидкого стекла", что и у
     иконок-бейджей, применённый к сплошным кнопкам: не плоская заливка
     градиентом, а объёмная, будто подсвеченная сверху поверхность. */
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.35), inset 0 1.5px 0 rgba(255, 255, 255, 0.45), inset 0 -1.5px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
}
.action svg { display: block; flex-shrink: 0; }
.action:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.24), inset 0 1.5px 0 rgba(255, 255, 255, 0.3);
}
button.action:disabled {
  opacity: 0.55;
  transform: none;
}
.action.ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--link);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}
.action.fines-link {
  background: none;
  border: none;
  backdrop-filter: none;
  padding: 4px 0 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.action.danger {
  background: linear-gradient(135deg, var(--danger), #ff2d55);
  box-shadow: 0 4px 14px rgba(255, 77, 106, 0.3);
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ── Управление: ряд иконок-кнопок + статистика ──────────────────────────
   Иконки нейтральные (не разноцветные) — это навигация, не статусы; цвет
   тут не несёт смысла, поэтому монохром + акцент только у активного/hover. */
.mgmt-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.mgmt-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.mgmt-icon-btn:active { transform: scale(0.94); }
.mgmt-icon-btn svg {
  width: 19px;
  height: 19px;
  padding: 9px;
  box-sizing: content-box;
  border-radius: 13px;
  color: var(--link);
  background: var(--secondary-bg);
}
.mgmt-modal { max-height: 82vh; overflow-y: auto; }

/* ── Статистика: "жидкое стекло" hero-карточка выручки ────────────────────
   Крупный номер, градиентный бейдж-иконка одного (accent) оттенка и мягкое
   "сияние" позади карточки. Контраст текста поднят намеренно сильно
   (сплошной var(--text), не приглушённый hint). */
.stat-money-card {
  position: relative;
  /* overflow:visible раньше давал свечению выйти за скруглённый край, но
     заодно снимал обрезку с ::before (диагональный блик .card) — его
     острые прямоугольные углы становились видны ПОВЕРХ скруглённого угла
     карточки слева. Держим overflow:hidden, как у обычной .card — блик
     свечения просто не выходит за пределы, визуально почти незаметно, зато
     без артефакта угла. */
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.2), rgba(255, 149, 0, 0.08)), var(--glass-bg);
  border: 1px solid rgba(255, 106, 0, 0.35);
  padding: 18px 20px;
}
.stat-money-glow {
  position: absolute;
  top: -20%;
  right: -5%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(255, 149, 0, 0.35) 0%, transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}
:root[data-theme="dark"] .stat-money-glow { background: radial-gradient(circle, rgba(255, 149, 0, 0.28) 0%, transparent 70%); }
.stat-money-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-money-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.stat-money-value {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.stat-money-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--link);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

/* Заголовки под-разделов статистики — иконка нейтральная (нет больше
   "своего" цвета на категорию), вес держится жирным начертанием. */
.stat-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 4px 9px;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
}
.stat-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--link);
  background: var(--secondary-bg);
}

.stat-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.stat-rank-row + .stat-rank-row { border-top: 1px solid var(--glass-border); }
.stat-rank-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--link);
  background: var(--secondary-bg);
}
.stat-rank-body {
  flex: 1;
  min-width: 0;
}
.stat-rank-label {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}
.stat-rank-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--secondary-bg);
  overflow: hidden;
}
.stat-rank-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.stat-rank-count {
  flex-shrink: 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  min-width: 26px;
  text-align: center;
  padding: 3px 8px;
}
.stat-rank-count.ghost {
  color: var(--hint);
  background: transparent;
  border-color: transparent;
  padding: 3px 2px;
}

.section-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 4px 8px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 4px 8px;
}
.section-title-row .section-title { margin: 0; }

.empty {
  text-align: center;
  color: var(--hint);
  padding: 40px 16px;
  font-size: var(--fs-md);
}

.scan-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 4px 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 106, 0, 0.14);
  border: 1px solid rgba(255, 106, 0, 0.35);
  color: var(--link);
  font-size: var(--fs-md);
  font-weight: 600;
}
.scan-status-banner svg { flex-shrink: 0; animation: spin 1.2s linear infinite; }


/* ── Поля ввода ────────────────────────────────────────────────────────── */
.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.add-form input {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.add-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}

/* ── Вкладка Долги ─────────────────────────────────────────────────────── */
.debts-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.debts-search-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 4px 4px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
}
.debts-search-row input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  padding: 8px 0;
}
.debts-search-row .icon-btn { border-radius: 50%; flex-shrink: 0; }

/* Сегмент-контрол с плавно скользящим "пилюлей"-выделением активного пункта */
.segmented {
  position: relative;
  display: flex;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--secondary-bg);
  border-radius: var(--radius-pill);
}
.segmented-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}
.segmented-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--hint);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 8px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.segmented-btn.active { color: #fff; }

.debts-stat-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 16px 12px;
  margin-bottom: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.debts-stat {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.debts-stat:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: var(--glass-border);
}
.debts-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-bottom: 3px;
  background: rgba(255, 106, 0, 0.22);
  color: var(--link);
}
.debts-stat.warn .debts-stat-icon { background: rgba(255, 106, 0, 0.25); color: var(--link); }
/* Значение — тем же цветом, что и остальные (не оранжевым), но с сильным
   пульсирующим свечением accent, чтобы бросалось в глаза в любой теме. */
.debts-stat.warn .debts-stat-value {
  color: var(--text);
  font-size: var(--fs-lg);
  animation: warnGlow 1.6s ease-in-out infinite;
}
@keyframes warnGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 106, 0, 0.75), 0 0 2px rgba(255, 106, 0, 0.9); }
  50%      { text-shadow: 0 0 22px rgba(255, 106, 0, 1), 0 0 8px rgba(255, 149, 0, 1); }
}
.debts-stat-value { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; }
.debts-stat-label { font-size: var(--fs-sm); color: var(--hint); text-transform: uppercase; letter-spacing: 0.03em; }
.debts-stat-bar > .action { flex-shrink: 0; align-self: center; }

.debt-card { padding: 11px 14px; }
.debt-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.debt-amount-badge { flex-shrink: 0; font-size: var(--fs-sm); padding: 5px 11px; }

.debt-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.debt-unit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.debt-unit-badge svg { flex-shrink: 0; }
.addr-phone { color: var(--hint); font-size: var(--fs-sm); }
.debt-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--glass-border);
}
.debt-action-slot { flex: 1; display: flex; justify-content: center; }
.debt-action-slot button { width: 100%; padding: 7px 10px; font-size: var(--fs-sm); }

/* ── Группы дублей в антиабьюзе: карта vs устройство — различаем только
   иконкой/подписью, не цветом (оба нейтральный accent-контур) ──────────── */
.aa-group {
  border-radius: var(--radius-md);
  padding: 10px 8px 4px;
  margin: 10px 0;
  border: 1px solid rgba(255, 106, 0, 0.25);
  background: rgba(255, 106, 0, 0.07);
}
.aa-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
  margin: 2px 4px 8px;
  color: var(--text);
}
.aa-group-head svg { color: var(--link); }

/* ── Модалка (bottom sheet) ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, 0.38);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.18s ease;
}
.modal {
  background: var(--sheet-bg);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  width: 100%;
  max-width: 480px;
  border-radius: 22px 22px 0 0;
  padding: 10px 18px 22px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  animation: slideUp 0.22s cubic-bezier(.2,.9,.3,1);
}
.modal-handle {
  width: 100%;
  padding: 8px 0 14px;
  margin: -10px 0 0;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.modal-handle::before {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--hint);
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.modal-handle:active::before {
  opacity: 0.6;
  transform: scaleX(1.15);
}

/* ── Брендовые значки TG/VK (реальные бренд-цвета мессенджеров — не наш
   акцент, исключение осознанное: это чужая айдентика, не часть палитры) ── */
.brand-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}
.brand-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.brand-badge svg { position: relative; z-index: 1; display: block; }
.brand-badge.tg { background: linear-gradient(135deg, #4fc3f7, #1e88c7 60%, #1467a0); }
.brand-badge.vk { background: linear-gradient(135deg, #6d95e0, #4a76a8 60%, #33578a); }

/* ── Плитки процессов в панели статуса (side-by-side) ──────────────────── */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.control-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: border-color 0.25s ease, transform 0.15s ease;
}
.control-tile.running { border-color: rgba(34, 197, 139, 0.35); }
.control-tile.stopped { border-color: rgba(255, 77, 106, 0.3); }
.control-tile-badge { width: 34px; height: 34px; border-radius: 11px; font-size: var(--fs-sm); margin-bottom: 2px; }
.control-tile-label { font-weight: 700; font-size: var(--fs-md); line-height: 1.25; }
.control-tile-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  color: var(--hint);
}
.control-tile-btn { width: 100%; margin-top: 6px; }

/* ── Hero-баннер общего статуса в панели «Автозавершение» ─────────────── */
.control-modal { padding-left: 0; padding-right: 0; }
.control-modal > *:not(.modal-handle) { padding-left: 18px; padding-right: 18px; }
.control-hero {
  text-align: center;
  padding: 22px 18px 20px;
  margin-bottom: 14px;
  border-radius: 0;
  transition: background 0.3s ease;
}
.control-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.12);
}
.control-hero-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; }
.control-hero-sub { font-size: var(--fs-md); color: var(--hint); margin-top: 4px; }

/* ── Окно связи с клиентом (клик по карточке самоката) ────────────────── */
.contact-modal { padding-top: 4px; }
.contact-hero {
  text-align: center;
  padding: 8px 12px 22px;
  margin-bottom: 4px;
}
.contact-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(255,106,0,0.22), rgba(255,149,0,0.1));
  color: var(--link);
  box-shadow: 0 0 0 1px var(--glass-border), 0 8px 20px rgba(255,106,0,0.18);
}
.contact-hero-title { font-size: var(--fs-sm); font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: 0.04em; }
.contact-hero-phone { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.01em; color: var(--text); margin-top: 6px; }
.contact-hero-sub { font-size: var(--fs-md); color: var(--text); margin-top: 6px; font-weight: 600; }

.control-hero.ok {
  background: radial-gradient(circle at 50% 0%, rgba(34,197,139,0.28), rgba(34,197,139,0.02) 70%);
}
.control-hero.ok .control-hero-icon { background: rgba(14,138,92,0.16); color: #0e8a5c; box-shadow: 0 0 24px rgba(14,138,92,0.3); }
.control-hero.warn {
  background: radial-gradient(circle at 50% 0%, rgba(255,106,0,0.28), rgba(255,106,0,0.02) 70%);
}
.control-hero.warn .control-hero-icon { background: rgba(193,68,14,0.16); color: var(--link); box-shadow: 0 0 24px rgba(193,68,14,0.3); }
.control-hero.err {
  background: radial-gradient(circle at 50% 0%, rgba(255,77,106,0.28), rgba(255,77,106,0.02) 70%);
}
.control-hero.err .control-hero-icon { background: rgba(204,29,63,0.16); color: #cc1d3f; box-shadow: 0 0 24px rgba(204,29,63,0.3); }

:root[data-theme="dark"] .control-hero.ok .control-hero-icon { background: rgba(255,255,255,0.12); color: #4be3ab; box-shadow: 0 0 24px rgba(34,197,139,0.45); }
:root[data-theme="dark"] .control-hero.warn .control-hero-icon { background: rgba(255,255,255,0.12); color: #ff9a4d; box-shadow: 0 0 24px rgba(255,106,0,0.45); }
:root[data-theme="dark"] .control-hero.err .control-hero-icon { background: rgba(255,255,255,0.12); color: #ff7d92; box-shadow: 0 0 24px rgba(255,77,106,0.45); }
@media (prefers-color-scheme: dark) {
  .control-hero.ok .control-hero-icon { background: rgba(255,255,255,0.12); color: #4be3ab; box-shadow: 0 0 24px rgba(34,197,139,0.45); }
  .control-hero.warn .control-hero-icon { background: rgba(255,255,255,0.12); color: #ff9a4d; box-shadow: 0 0 24px rgba(255,106,0,0.45); }
  .control-hero.err .control-hero-icon { background: rgba(255,255,255,0.12); color: #ff7d92; box-shadow: 0 0 24px rgba(255,77,106,0.45); }
}

/* ── Swipe-to-delete ───────────────────────────────────────────────────── */
.swipe-item {
  position: relative;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.swipe-item .card { margin-bottom: 0; }
.swipe-actions {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 76px;
  display: flex;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  overflow: hidden;
  z-index: 0;
}
/* Пока свайп открыт — действия ДОЛЖНЫ быть кликабельнее контента, иначе
   контент (z-index:1) перехватывает тапы по кнопке (тот самый баг с
   "крестик не с первого раза"). Когда закрыто — наоборот, контент сверху
   и прячет кнопку до свайпа. */
.swipe-item.swiped-open .swipe-actions { z-index: 2; }
.swipe-actions button {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: linear-gradient(135deg, var(--danger), #ff2d55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Не всякое действие под свайпом — удаление; "Завершить"/"Прошлая парковка"
   не деструктивны, красный тут вводил бы в заблуждение. */
.swipe-actions button[data-finish-unit],
.swipe-actions button[data-prev-addr] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  justify-content: center;
}
.swipe-content {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  touch-action: pan-y;
  will-change: transform;
}
.swipe-content .card {
  /* Обычная стеклянная полупрозрачность .card + backdrop-filter:blur здесь
     буквально просвечивает — под карточкой лежит скрытая кнопка свайпа
     (красная/оранжевая), и blur подмешивает её цвет сквозь стекло, даже
     когда свайп закрыт. Тут фон должен быть полностью непрозрачным. */
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-md);
  margin-bottom: 0;
}
.modal h3 {
  margin: 0 0 4px;
  font-size: var(--fs-md);
  font-weight: 700;
}
.modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  margin: 10px 0;
  outline: none;
}
.modal input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18);
}
.modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Уведомление ───────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--sheet-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 12px 20px;
  /* Пилюля (радиус 999px) ломается на длинном/многострочном тексте —
     превращается в кривой овал с текстом внахлёст на закруглениях.
     Обычное скругление держит форму при любой длине сообщения. */
  border-radius: var(--radius-lg);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.45;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
  width: max-content;
  max-width: min(85vw, 360px);
  text-align: left;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: linear-gradient(135deg, var(--success), #1aa876); color: #fff; border-color: transparent; }
.toast.error { background: linear-gradient(135deg, var(--danger), #ff2d55); color: #fff; border-color: transparent; }
.toast.info { background: linear-gradient(135deg, #2a2d3a, #14151b); color: #fff; border-color: transparent; }

/* ── Просмотр логов trips/vk_trips ─────────────────────────────────────── */
.log-modal { max-height: 80vh; display: flex; flex-direction: column; }
.log-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.log-view {
  margin: 0;
  flex: 1;
  min-height: 200px;
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0b0d14;
  color: #d8dce6;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: var(--fs-sm);
  line-height: 1.5;
  border: 1px solid var(--glass-border);
}
