:root {
  --bg: #0f1220;
  --panel: #1a1e2e;
  --panel2: #232941;
  --text: #e8eaf2;
  --muted: #9aa3b8;
  --accent: #f9a825;
  --accent2: #ffd54f;
  --ok: #43a047;
  --danger: #e53935;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

/* ---------- Каркас ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--panel);
  border-bottom: 1px solid #2c3350; position: sticky; top: 0; z-index: 1000;
}
.topbar .logo { font-weight: 800; color: var(--accent); font-size: 18px; }
.topbar .who { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; }
.tab {
  flex: 1; min-width: 90px; padding: 10px 8px; text-align: center;
  background: var(--panel); color: var(--muted); border: 1px solid #2c3350;
  border-radius: var(--radius); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.tab.active { background: var(--accent); color: #10131f; border-color: var(--accent); }
.page { display: none; padding: 0 12px 90px; }
.page.active { display: block; }

.card {
  background: var(--panel); border: 1px solid #2c3350;
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card h3 { font-size: 15px; margin-bottom: 10px; color: var(--accent2); }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Селектор языка в шапке */
.lang-select {
  background: var(--panel, #1a1e2e);
  color: var(--text, #fff);
  border: 1px solid #3a4056;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

/* Подписи ОТКУДА / КУДА в карточке заказа — маленькие, не перегружают интерфейс */
.addr-label {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.06em;
  color: var(--accent2, #8ab4ff);
  opacity: 0.85;
  min-width: 52px;
  text-transform: uppercase;
}

/* Точка назначения: адрес может быть длинным — переносим по словам, не ломая карточку */
.addr-block { overflow-wrap: anywhere; }

/* Второстепенная кнопка отмены: без оранжевой заливки, не конкурирует с основными действиями */
.btn.btn-cancel-soft {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted, #9aa3b5);
}

/* ---------- Кнопки (геометрия и цвета — как в Android-приложении) ---------- */
/* Основная кнопка: заливка accent, высота 52dp, скругление-пилюля, тёмный текст (btnPrimary) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; min-height: 52px;
  border: none; border-radius: 26px;
  background: var(--accent); color: #1a1e2e; font-weight: 700; font-size: 16px;
  width: auto;
}
.btn:active { filter: brightness(.92); transform: scale(.98); }
/* Второстепенная кнопка: bg_btn_secondary (#272C3B, рамка 1dp #3A4052, радиус 24dp) */
.btn.secondary {
  background: #272c3b; color: #f3f4f6; border: 1px solid #3a4052; font-weight: 500;
}
.btn.secondary:active { background: #323850; border-color: #4a5168; }
.btn.danger { background: var(--danger); color: #fff; }
/* Кнопка «Разблокировать» в админ-таблицах (была без стиля — исправлено) */
.btn.ok { background: var(--ok); color: #fff; }
/* Главное действие — на всю ширину карточки: как btnPrimary в Android-макете (match_parent, 52dp) */
.btn.block { width: 100%; margin-top: 10px; }
/* Компактные кнопки карточек (13sp, как в Android) */
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 13px; border-radius: 22px; }
/* Ряд второстепенных кнопок: делят ширину поровну — как weight=1 в Android (btnCall/btnChat/btnGoogle) */
#activeOrder .row .btn { flex: 1 1 auto; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Формы ---------- */
label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=email], textarea, select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: var(--panel2); color: var(--text); border: 1px solid #2c3350;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

/* ---------- Карта ---------- */
#map { height: 52vh; min-height: 300px; border-radius: var(--radius); margin-bottom: 12px; z-index: 1; position: relative; }
/* Режим выбора точки: курсор-прицел и мягкая рамка внутри карты (без сдвига макета) */
.picking #map { cursor: crosshair; box-shadow: inset 0 0 0 2px rgba(249, 168, 37, .55); }
.driver-icon { font-size: 22px; display: flex; align-items: center; justify-content: center; }
.leaflet-popup-content { color: #111; font-size: 13px; }

/* ---------- Контролы карты: +/−, «показать маршрут», «моё местоположение» ---------- */
/* Геометрия и цвета — как в Android: 48dp, радиус 12dp, фон #1A1E2E (94%), иконки #8AB4F8 */
#mapControls {
  position: absolute; right: 10px; bottom: 30px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.mc-group {
  width: 48px; border-radius: 12px; overflow: hidden;
  background: rgba(26, 30, 46, .94); border: 1px solid #3a4368;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.mc-btn {
  width: 48px; height: 48px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 30, 46, .94); border: 1px solid #3a4368; border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35); color: var(--text);
}
.mc-group .mc-btn { border: none; border-radius: 0; box-shadow: none; background: transparent; }
.mc-btn:active { background: #3a4368; border-color: #4a5480; }
.mc-text { font-size: 26px; font-weight: 700; line-height: 1; padding-bottom: 4px; }
.mc-sep { height: 1px; background: #3a4368; }
.mc-icon svg { display: block; }

/* ---------- Маркеры в стиле Google Maps ---------- */
/* Булавка (точка посадки/назначения) */
.gm-pin { display: flex; align-items: flex-end; justify-content: center; }
.gm-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
/* Булавка с цветной плашкой-подписью над ней («Место посадки» / «Место назначения») */
.gm-pin-wrap {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.gm-label {
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 9px; white-space: nowrap;
  margin-bottom: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
/* Жёлтая машина (вид сверху) — водитель */
.gm-car svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
/* Значок такси — PNG (car-taxi-top.png). Плавный поворот по курсу движения. */
.gm-car img.gm-car-img {
  display: block; transform-origin: 50% 50%;
  transition: transform .35s ease-out;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45));
  will-change: transform;
}

/* ---------- Списки/таблицы ---------- */
.order-card { border-left: 4px solid var(--accent); }
/* Лента свободных заказов: карточка кликабельна — тап выбирает заказ и строит маршрут на карте */
#availableList .order-card { cursor: pointer; }
#availableList .order-card.avail { border-left-color: var(--ok); }
/* Выбранный тапом заказ: рамка акцентом + светлее фон (как подсветка карточки на Android) */
.order-card.sel {
  border: 3px solid var(--accent2);
  background: var(--panel2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge.searching { background: #7b1fa2; color: #fff; }
.badge.scheduled { background: #5e35b1; color: #fff; }
.badge.expired { background: var(--danger); color: #fff; }
.badge.accepted, .badge.arrived { background: #1565c0; color: #fff; }
.badge.in_progress { background: #00838f; color: #fff; }
.badge.completed { background: var(--ok); color: #fff; }
.badge.cancelled { background: #6d6d6d; color: #fff; }
.badge.online { background: var(--ok); color: #fff; }
.badge.offline { background: #555; color: #ccc; }
.badge.blocked { background: var(--danger); color: #fff; }

/* Счётчик на вкладке (например, нерассмотренные жалобы у админа) */
.tab-badge {
  display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
  vertical-align: 1px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #2c3350; vertical-align: top; }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid #2c3350; border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 22px; font-weight: 800; color: var(--accent2); }
.stat .t { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Таймлайн статуса поездки (страница пассажира) ---------- */
/* Наглядно показывает, на каком шаге сейчас заказ: заказ → принят → на месте → в пути → завершено */
.trip-timeline {
  background: var(--panel); border: 1px solid #2c3350; border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px;
}
.tl-step { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.tl-step::before {
  content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: #2c3350;
}
.tl-step:first-child::before { top: 50%; }
.tl-step:last-child::before { bottom: 50%; }
.tl-step .tl-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #3a4368; flex: 0 0 auto;
  position: relative; z-index: 1;
}
.tl-step .tl-text { font-size: 13.5px; color: var(--muted); }
.tl-step.done .tl-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(67, 160, 71, .18); }
.tl-step.done .tl-text { color: var(--text); }
.tl-step.cur .tl-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(249, 168, 37, .22); }
.tl-step.cur .tl-text { color: var(--accent2); font-weight: 700; }

/* ---------- Прочее ---------- */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: #2c3350; border: 1px solid #3a4368; padding: 12px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.4); animation: fadein .2s; }
.toast.error { border-color: var(--danger); }
.toast.ok { border-color: var(--ok); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--panel); border: 1px solid #2c3350; border-radius: 16px; padding: 18px; width: min(94vw, 440px); max-height: 85vh; overflow-y: auto; }

.stars { display: flex; gap: 6px; font-size: 34px; cursor: pointer; user-select: none; }
.stars span { color: #3a4368; }
.stars span.on { color: var(--accent); }

.suggests { background: var(--panel2); border: 1px solid #2c3350; border-radius: 10px; overflow: hidden; margin-top: 4px; }
.suggests div { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #2c3350; cursor: pointer; }
.suggests div:hover { background: #2c3350; }

.switch { position: relative; width: 58px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knob { position: absolute; inset: 0; background: var(--panel2); border: 1px solid #2c3350; border-radius: 30px; transition: .2s; }
.switch .knob::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #9aa3b8; border-radius: 50%; transition: .2s; }
.switch input:checked + .knob { background: var(--ok); border-color: var(--ok); }
.switch input:checked + .knob::before { transform: translateX(28px); background: #fff; }

/* ---------- Чат ---------- */
.chat-unread {
  display: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  background: var(--danger); color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #2c3350; }
/* Имя собеседника в шапке чата (чтобы сразу было понятно, с кем переписка) */
.chat-peer { flex: 1; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { display: flex; align-items: flex-end; gap: 6px; }
/* Свои сообщения — справа, собеседника — слева (с аватаром и подписью) */
.chat-msg.mine { justify-content: flex-end; }
.chat-msg.theirs { justify-content: flex-start; }
.chat-ava {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--panel2); border: 1px solid #3a4368;
}
.chat-bubble {
  max-width: 78%; padding: 8px 11px; border-radius: 14px;
  background: var(--panel2); border: 1px solid #3a4368; font-size: 14px;
}
/* Кто именно написал: «Вы» у своих, имя собеседника у остальных */
.chat-who { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; margin-bottom: 4px; color: var(--muted); }
.chat-msg.mine .chat-bubble { background: #3d3320; border-color: var(--accent); }
.chat-msg.mine .chat-who { color: #e6c87c; }
/* Выбранное фото до отправки: превью + подсказка + «убрать» */
.chat-pending:empty { display: none; }
.chat-pending { padding: 8px 12px 0; }
.chat-attach {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid #3a4368; border-radius: 12px; padding: 8px;
}
.chat-attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.chat-attach-info { flex: 1; display: flex; flex-direction: column; font-size: 12.5px; }
.chat-attach-info b { color: var(--accent2); }
.chat-attach-info span { color: var(--muted); font-size: 11.5px; }
.chat-bubble .chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble .chat-time { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; }

/* ============================================================
   Своя позиция на карте: синяя точка пассажира и метка «пассажир здесь» у водителя
   ============================================================ */
/* Как в Google Картах: белое кольцо, синий центр, мягкая тень. Пассажир видит только себя */
.me-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: #1E88E5; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  position: relative;
}
/* Передача позиции включена — точка зелёная с пульсацией: «водитель меня видит» */
.me-dot.sharing { background: #34A853; }
.me-dot.sharing::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid rgba(52, 168, 83, .55);
  animation: mePulse 1.8s ease-out infinite;
}
@keyframes mePulse {
  0% { transform: scale(.7); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
/* Кнопка «Показать водителю, где я», когда передача включена */
.btn.sharing {
  background: linear-gradient(135deg, #2e7d32, #34A853);
  color: #fff; border-color: #2e7d32; font-weight: 700;
}

/* ============================================================
   Финансы (админка): KPI, денежный поток, риск-карточки
   ============================================================ */
/* Плитки финансов повторяют KPI дашборда — единый визуальный язык */
.fin-kpi { margin-bottom: 0; }

/* Полоса денежного потока: жёлтая часть — комиссия платформы, зелёная — водителям */
.fin-bar {
  display: flex; height: 34px; border-radius: 10px; overflow: hidden;
  border: 1px solid #2c3350; background: var(--panel2); margin: 4px 0 10px;
}
.fin-bar-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #10131f; min-width: 2px;
  transition: width .35s ease;
}
.fin-bar-commission { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.fin-bar-net { background: linear-gradient(90deg, #2e7d32, var(--ok)); color: #fff; }

.fin-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.fin-legend b { color: var(--text); }
.fin-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fin-dot-c { background: var(--accent); }
.fin-dot-n { background: var(--ok); }

/* Наличные: принято и «ещё собрать» — два крупных показателя рядом */
.fin-cash { display: flex; gap: 10px; flex-wrap: wrap; }
.fin-cash-item {
  flex: 1; min-width: 150px; padding: 11px 14px; border-radius: 12px;
  background: var(--panel2); border: 1px solid #2c3350;
  display: flex; flex-direction: column; gap: 3px;
}
.fin-cash-item b { font-size: 19px; font-weight: 800; }

/* Карточка «требует внимания»: аватар, имя, деньги и «флаги» нарушений */
.fin-risk {
  border: 1px solid #2c3350; border-left: 4px solid var(--danger);
  border-radius: var(--radius); padding: 12px 14px; margin: 8px 0;
  background: var(--panel);
}
.fin-risk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-risk-who { display: flex; flex-direction: column; min-width: 0; }
.fin-risk-who .muted { font-size: 12px; }
.fin-risk-money { margin-left: auto; text-align: right; font-size: 13px; }
.fin-risk-flags { margin-top: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
.chat-bubble .chat-photo { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; cursor: pointer; margin-bottom: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #2c3350; }
.chat-input-row input[type=text] { flex: 1; }

/* ---------- Страница входа ---------- */
.auth-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: min(94vw, 400px); }
.auth-box .logo-big { text-align: center; font-size: 40px; margin-bottom: 6px; }
.auth-box h1 { text-align: center; font-size: 22px; margin-bottom: 18px; color: var(--accent); }


/* ============================================================
   Админ-панель (public/admin.html): KPI, фильтры, таблицы
   ============================================================ */
/* Индикатор автоматического обновления в шапке (клик — обновить сейчас) */
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: livepulse 2.2s infinite; }
.live.error .live-dot { background: var(--danger); animation: none; }
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(67, 160, 71, .45); }
  70% { box-shadow: 0 0 0 8px rgba(67, 160, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(67, 160, 71, 0); }
}

.sec { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--accent2); }
.sec:first-child { margin-top: 2px; }

/* KPI-карточки: иконка, крупное значение, подпись */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.kpi { display: flex; gap: 11px; align-items: center; background: var(--panel); border: 1px solid #2c3350; border-radius: var(--radius); padding: 12px; }
.kpi-ic { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--panel2); }
.kpi-v { font-size: 20px; font-weight: 800; line-height: 1.1; }
.kpi-t { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi-hint { opacity: .75; }
.kpi.ok .kpi-v { color: #7ed993; }
.kpi.ok .kpi-ic { background: rgba(67, 160, 71, .16); }
.kpi.warn .kpi-v { color: var(--accent2); }
.kpi.warn .kpi-ic { background: rgba(249, 168, 37, .14); }
.kpi.bad .kpi-v { color: #ff8a80; }
.kpi.bad .kpi-ic { background: rgba(229, 57, 53, .14); }

/* Шапка карточки: заголовок + пояснение справа */
.card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.card-head .muted { margin-left: auto; font-size: 12px; }

/* Чипы: фильтры заказов и сводки */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--panel); color: var(--muted); border: 1px solid #2c3350; }
button.chip { cursor: pointer; }
button.chip:active { filter: brightness(1.15); }
.chip.active { background: var(--accent); color: #10131f; border-color: var(--accent); }
.chip b { font-weight: 800; }
.chip.ok { border-color: rgba(67, 160, 71, .55); }
.chip.bad { border-color: rgba(229, 57, 53, .55); }
/* Чип избранного места: иконка по смыслу + название; тап — шит «Откуда/Куда».
   Кнопка (не span), поэтому кликается целиком — раньше промах по крестику удалял место */
.chip.place-chip {
  cursor: pointer; padding: 8px 13px 8px 10px; gap: 7px;
  background: var(--panel2, var(--panel)); border-color: #3a4368;
}
.chip.place-chip b { font-weight: 700; color: var(--text); }
.chip.place-chip .place-ic { font-size: 14px; line-height: 1; }
.chip.place-chip:hover { border-color: var(--accent); }

/* Шапка блока избранного: заголовок и подсказка */
.places-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.places-title { font-size: 13px; font-weight: 700; color: var(--accent2); }
.places-hint { margin-left: auto; font-size: 11.5px; }

/* ---------- Капельки в полях «Откуда/Куда» ---------- */
/* Значок-капелька слева внутри input — тот же стиль, что у булавок на карте */
.inp-pin { position: relative; }
.inp-pin .pin-ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  display: inline-flex; pointer-events: none; opacity: .95;
}
.inp-pin input { padding-left: 36px; }

/* ---------- Выбор точки «капелькой» в центре карты ---------- */
/* Капелька прибита к центру экрана: двигаем карту — выбираем место.
   Отдельного окна нет — адрес пишется в поле «Откуда/Куда», подтверждение рядом с полем. */
.pick-pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  z-index: 1100; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35));
  animation: pickdrop .35s ease-out;
}
.pick-pin::after {
  content: ''; display: block; width: 12px; height: 4px; margin: -2px auto 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.35), transparent 70%);
}
@keyframes pickdrop { from { transform: translate(-50%, -135%); opacity: 0; } }

/* Кнопки «Готово / Отмена» в строке поля — видны только в режиме выбора точки:
   обычные кнопки строки на это время скрыты, поэтому строка остаётся лаконичной */
.pick-actions { display: none; align-items: center; gap: 8px; }
.pick-actions.on { display: inline-flex; }
.pick-actions .pick-x {
  padding: 6px 12px; font-weight: 700; font-size: 14px; line-height: 1.2; color: var(--muted);
}
.pick-actions .pick-x:hover { color: var(--danger); border-color: var(--danger); }
/* Поле адреса во время выбора: подсветка — видно, что адрес «прилипает» к капельке */
.inp-pin.picking input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 168, 37, .14);
  background: var(--panel2);
}

/* ---------- Язык: пикер с флагами стран ---------- */
/* Кнопка «флаг + код» и меню с тремя языками; флаги — инлайн-SVG, видны везде */
.lang-picker { position: relative; display: inline-block; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel2, #232941); color: var(--text);
  border: 1px solid #3a4056; border-radius: 8px; padding: 5px 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.lang-btn:hover { border-color: #4a5480; }
.lang-flag { display: inline-flex; width: 21px; height: 14px; border-radius: 2px; overflow: hidden; flex: 0 0 auto; }
.lang-flag svg { width: 100%; height: 100%; display: block; }
.lang-caret { font-style: normal; font-size: 10px; color: var(--muted); }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 2600;
  min-width: 168px; padding: 6px; border-radius: 12px;
  background: var(--panel); border: 1px solid #3a4368; box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.lang-picker.open .lang-menu { display: block; }
.lang-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: none; border-radius: 9px; background: transparent;
  color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
.lang-item:hover { background: var(--panel2); }
.lang-item.active { background: rgba(249, 168, 37, .16); }
.lang-check { margin-left: auto; font-style: normal; color: var(--accent); font-weight: 700; }
/* Пикер на странице входа: по центру над логотипом */
.auth-lang { display: flex; justify-content: center; margin-bottom: 10px; }

/* Ячейки таблиц: аватар, звёзды, адреса */
.u-cell { display: flex; align-items: center; gap: 9px; }
.ava { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid #3a4368; font-size: 11px; font-weight: 800; color: var(--accent2); }
.stars-sm { color: var(--accent); letter-spacing: 1px; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.addr-cell { min-width: 230px; }
.addr { display: flex; gap: 6px; align-items: flex-start; }
.addr .pin { flex: 0 0 auto; }
tr.row-active td { background: rgba(249, 168, 37, .055); }

/* Бейджи ролей пользователей */
.badge.role-passenger { background: #2c3350; color: #c7cde0; }
.badge.role-driver { background: #1565c0; color: #fff; }
.badge.role-admin { background: #6a4fc7; color: #fff; }

/* Отзывы: сводка с распределением оценок */
.rev-head { display: grid; grid-template-columns: auto auto 1fr; gap: 16px; align-items: center; }
.rev-big { font-size: 42px; font-weight: 800; color: var(--accent2); line-height: 1; }
.rev-star { font-size: 22px; margin-left: 2px; }
.rev-meta { font-size: 13px; }
.rev-bars { display: flex; flex-direction: column; gap: 5px; min-width: 180px; }
.rev-bar { display: grid; grid-template-columns: 30px 1fr 26px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.rev-bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); min-width: 2px; }
.rev-bar b { text-align: right; }
.rev-card { margin-bottom: 10px; }
.rev-text { margin-top: 8px; font-size: 14px; color: var(--text); }

/* ---------- Профиль пассажира: шапка с аватаром и контактами ---------- */
.profile-card { position: relative; overflow: hidden; }
.profile-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 70px;
  background: linear-gradient(135deg, rgba(249, 168, 37, .18), rgba(255, 213, 79, .04) 55%, transparent);
  pointer-events: none;
}
.profile-head { position: relative; display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 60px; height: 60px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #ff8a00);
  color: #10131f; font-size: 26px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(249, 168, 37, .30);
}
.profile-meta { min-width: 0; }
.p-name { font-size: 18px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.p-rows { position: relative; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.p-row { display: flex; align-items: center; gap: 10px; font-size: 14px; overflow-wrap: anywhere; }
.p-row .p-ic {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px solid #2c3350; font-size: 16px;
}

@media (max-width: 640px) {
  .live { display: none; }
  .rev-head { grid-template-columns: 1fr; gap: 10px; }
  .rev-bars { min-width: 0; }
}


/* ==========================================================================
   Пассажир: нижний лист «Куда поедем?» — тёмный карточный UI (как в приложении).
   Всё скоупится по body.pg: страницы водителя и админа эти правила не затрагивают.
   ========================================================================== */
body.pg {
  /* Палитра: глубокий индиго + один тёплый акцент (жёлтый) только на главном действии */
  --pg-bg: #0d1330;
  --pg-sheet: #141c3d;
  --pg-sheet-2: #182144;
  --pg-row: #1d2750;
  --pg-row-hi: #232f60;
  --pg-line: #2b3568;
  --pg-text: #eef1fb;
  --pg-muted: #8d97c0;
  --pg-yellow: #ffc531;
  --pg-teal: #23c8b6;
  --pg-coral: #f8706f;
  /* Общие переменные приложения перекрашиваем в палитру листа: существующие
     компоненты (чипы, бейджи, модалки) автоматически попадают в тот же стиль */
  --accent: var(--pg-yellow);
  --accent2: #ffd45e;
  --panel: var(--pg-sheet);
  --panel2: var(--pg-sheet-2);
  --text: var(--pg-text);
  --muted: var(--pg-muted);
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  color-scheme: dark;
  background: radial-gradient(120% 55% at 50% 0%, #1b2a5e 0%, transparent 60%), var(--pg-bg);
  color: var(--pg-text);
  font-variant-numeric: tabular-nums;
}
/* Тап без задержки двойного зума + понятная рамка фокуса для клавиатуры */
body.pg button, body.pg label.switch, body.pg .chip { touch-action: manipulation; }
body.pg :focus-visible { outline: 2px solid var(--pg-yellow); outline-offset: 2px; border-radius: 6px; }
body.pg .topbar { flex: 0 0 auto; padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: transparent; border-bottom: 0; position: static; }
body.pg .topbar .logo { font-size: 16px; }
body.pg .topbar .btn.small { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }

/* ---------- Нижняя навигация: «Заказать / История / Профиль» ---------- */
body.pg .tabs {
  order: 2; flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  padding: 2px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  background: #0a0f28; border-top: 1px solid #1b2450; overflow: visible;
}
body.pg .tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; padding: 7px 4px 5px; position: relative;
  background: transparent; border: 0; border-radius: 12px;
  color: #7d88b4; font-family: inherit; font-size: 11px; font-weight: 700;
  transition: color .18s ease, background .18s ease;
}
body.pg .tab-ic { width: 24px; height: 24px; }
body.pg .tab-ic svg { width: 100%; height: 100%; display: block; }
body.pg .tab.active { background: transparent; color: var(--pg-yellow); }
body.pg .tab.active::before {
  content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--pg-yellow); box-shadow: 0 0 12px rgba(255, 197, 49, .55);
}
body.pg .tab.active .tab-ic { filter: drop-shadow(0 0 8px rgba(255, 197, 49, .35)); }
body.pg .tab:active { background: rgba(255, 255, 255, .05); }

/* ---------- Каркас страниц ---------- */
body.pg .page { padding: 0; }
body.pg #page-order.page.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
body.pg #page-history.page.active, body.pg #page-profile.page.active {
  display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 14px 18px;
}
/* Карта занимает всё свободное место; лист «наезжает» на её нижний край скруглением */
body.pg #map { flex: 1 1 auto; height: auto; min-height: 170px; margin: 0 0 -20px; border-radius: 0; }
body.pg .map-chip {
  position: absolute; left: 12px; top: 12px; z-index: 1100;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 11px; border-radius: 999px;
  background: rgba(13, 19, 48, .82); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .09); color: #dfe5ff;
  font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
body.pg .map-chip .mc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pg-teal);
  box-shadow: 0 0 0 3px rgba(35, 200, 182, .22); animation: pgPulse 2.2s ease-in-out infinite;
}
body.pg #mapControls { bottom: 34px; }
/* Копирайт карты — тише и выше нижнего листа, чтобы не спорил с кнопками */
body.pg .leaflet-bottom { bottom: 22px; }
body.pg .leaflet-control-attribution {
  font-size: 9.5px; padding: 1px 5px; background: rgba(13, 19, 48, .72);
  color: #9aa5cc; border-radius: 6px;
}
body.pg .leaflet-control-attribution a { color: #b9c4ec; }
body.pg .mc-btn, body.pg .mc-group { background: rgba(20, 28, 61, .93); border-color: var(--pg-line); border-radius: 14px; }

/* ---------- Нижний лист ---------- */
body.pg .sheet {
  position: relative; z-index: 2; flex: 0 0 auto; margin: 0;
  padding: 8px 16px 14px;
  background: linear-gradient(180deg, var(--pg-sheet) 0%, #111838 100%);
  border: 0; border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 40px rgba(4, 8, 26, .55);
  max-height: 76dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  animation: pgSheetUp .42s cubic-bezier(.2, .8, .25, 1) both;
}
body.pg .sheet-grab { width: 46px; height: 5px; border-radius: 3px; margin: 2px auto 10px; background: #33407a; }
body.pg .sheet-head { margin-bottom: 12px; }
body.pg .sheet-title { font-size: 23px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin-bottom: 2px; text-wrap: balance; }
body.pg .sheet-sub { font-size: 13.5px; color: var(--pg-muted); }


/* ---------- Маршрут: «Откуда» / «Куда» + действия справа ---------- */
body.pg .rt-grid { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: stretch; }
body.pg .rt-rows { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.pg .rt-row-wrap { position: relative; min-width: 0; }
/* Точки маршрута соединяет пунктир — как в навигационных приложениях */
body.pg .rt-rows .rt-row-wrap:first-child::after {
  content: ''; position: absolute; left: 30px; top: 52px; height: 22px; width: 2px; z-index: 1;
  background-image: linear-gradient(#4a5da8 0 3px, transparent 3px 6px);
  background-size: 2px 6px; background-repeat: repeat-y;
}
body.pg .rt-row {
  display: flex; align-items: center; gap: 11px;
  min-height: 54px; padding: 7px 10px;
  background: var(--pg-row); border: 1px solid var(--pg-line); border-radius: 18px;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
body.pg .rt-row:focus-within { border-color: #4152a0; background: var(--pg-row-hi); }
body.pg .rt-ic { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
body.pg .rt-ic-from { background: var(--pg-teal); }
body.pg .rt-ic-from::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
body.pg .rt-ic-to { background: var(--pg-coral); }
body.pg .rt-ic-to svg { width: 18px; height: 18px; display: block; }
body.pg .rt-body { flex: 1 1 auto; min-width: 0; }
body.pg .rt-label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--pg-muted); margin-bottom: 1px;
}
body.pg .rt-row input[type=text] {
  width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--pg-text); font-size: 14.5px; font-weight: 600;
}
body.pg .rt-row input[type=text]::placeholder { color: #6b76a6; font-weight: 500; font-size: 14px; }
body.pg .rt-row input[type=text]:focus { outline: none; border: 0; }
body.pg .rt-chev {
  flex: 0 0 auto; width: 8px; height: 8px; margin-left: 2px;
  border-right: 2px solid #5d68a0; border-bottom: 2px solid #5d68a0;
  transform: rotate(-45deg); transition: border-color .18s ease;
}
body.pg .rt-row:hover .rt-chev { border-color: var(--pg-yellow); }
/* Режим выбора точки: шеврон уступает место кнопкам «Готово/Отмена», строка подсвечена */
body.pg .rt-row-wrap.picking-row .rt-chev { display: none; }
body.pg .rt-row-wrap.picking-row .rt-row { border-color: var(--pg-yellow); box-shadow: 0 0 0 3px rgba(255, 197, 49, .16); }
body.pg .rt-row .pick-actions { margin-left: auto; }
body.pg .rt-row .pick-actions .btn.small { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
body.pg .rt-row .pick-x { background: transparent; border-color: #46527f; color: var(--pg-muted); }
body.pg .rt-hint { display: block; font-size: 11.5px; color: var(--pg-muted); padding: 5px 4px 0 46px; }
body.pg .rt-hint:empty { display: none; }
/* Подсказки адресов: список под строкой */
body.pg .suggests { margin-top: 6px; background: var(--pg-sheet-2); border: 1px solid var(--pg-line); border-radius: 14px; }
body.pg .suggests div { padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--pg-line); }
body.pg .suggests div:last-child { border-bottom: 0; }
body.pg .suggests div:hover { background: var(--pg-row); }


/* Кнопки справа от строк: «Моё местоположение» и «Выбрать на карте» */
body.pg .rt-side { display: flex; flex-direction: column; gap: 10px; }
body.pg .side-btn {
  flex: 1 1 0; display: flex; align-items: center; gap: 6px;
  min-height: 54px; padding: 8px 7px; overflow: hidden;
  background: var(--pg-row); border: 1px solid var(--pg-line); border-radius: 18px;
  color: var(--pg-text); font-family: inherit; font-size: 10.5px; font-weight: 700;
  line-height: 1.25; text-align: left;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
body.pg .side-btn:active { background: var(--pg-row-hi); transform: scale(.97); }
body.pg .side-btn .side-ic { flex: 0 0 auto; width: 18px; height: 18px; color: #bac5ec; }
body.pg .side-btn .side-ic svg { width: 100%; height: 100%; display: block; }
/* Длинные названия («Моё местоположение») переносятся, а не вылезают из кнопки */
body.pg .side-btn .side-tx { min-width: 0; overflow-wrap: break-word; hyphens: auto; }

/* ---------- Избранное: чипы + «＋ В избранное» ---------- */
body.pg #placesBlock { margin-top: 12px; }
/* Чипы всегда в одну строку: длинный список прокручивается по горизонтали,
   лист не растёт в высоту (места на карте остаётся больше) */
body.pg .chips {
  display: flex; flex-wrap: nowrap; gap: 7px; margin: 0;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 1px;
}
body.pg .chips::-webkit-scrollbar { display: none; width: 0; height: 0; }
body.pg .chips-inline { display: flex; flex-wrap: nowrap; gap: 8px; }
body.pg .chip {
  flex: 0 0 auto; white-space: nowrap;
  gap: 7px; padding: 10px 13px; border-radius: 15px; font-size: 13px; font-weight: 700;
  background: var(--pg-row); color: var(--pg-text); border: 1px solid var(--pg-line);
}
body.pg .chip:active { background: var(--pg-row-hi); }
body.pg .chip.place-chip { background: var(--pg-row); border-color: var(--pg-line); }
body.pg .chip.place-chip::before { content: '★'; color: var(--pg-yellow); font-size: 14px; line-height: 1; }
body.pg .chip.place-chip b { color: #fff; font-weight: 700; }
body.pg .chip.place-chip .place-ic { font-size: 15px; }
body.pg .chip.place-chip:hover { border-color: var(--pg-yellow); }
body.pg .chip.add-chip { color: #cdd6f5; }
body.pg .chip.add-chip .add-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8b96c4;
  color: #dbe2fa; font-size: 13px; line-height: 1;
}


/* ---------- «На потом»: планирование поездки ---------- */
body.pg .sched {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 14px;
  background: var(--pg-row); border: 1px solid var(--pg-line); border-radius: 18px;
}
body.pg .sched-ic { flex: 0 0 auto; width: 26px; height: 26px; color: #a9b5e2; }
body.pg .sched-ic svg { width: 100%; height: 100%; display: block; }
body.pg .sched-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
body.pg .sched-title { font-size: 15px; font-weight: 700; color: #fff; }
body.pg .sched-sub { font-size: 12.5px; color: var(--pg-muted); }
/* Переключатель: настоящий чекбокс (мышь и клавиатура), поверх — дорожка с ползунком */
body.pg .switch { position: relative; flex: 0 0 auto; width: 52px; height: 30px; cursor: pointer; }
body.pg .switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
body.pg .sw-track { position: absolute; inset: 0; border-radius: 999px; background: #2c3768; transition: background .2s ease; }
body.pg .sw-track::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: #eef1fb; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .22s cubic-bezier(.3, .9, .3, 1.2), background .2s ease;
}
body.pg .switch input:checked + .sw-track { background: var(--pg-yellow); }
body.pg .switch input:checked + .sw-track::after { transform: translateX(22px); background: #1a1405; }
body.pg .switch input:focus-visible + .sw-track { box-shadow: 0 0 0 3px rgba(255, 197, 49, .3); }
body.pg #schedAt {
  width: 100%; margin-top: 10px; padding: 11px 12px; border-radius: 14px;
  background: var(--pg-sheet-2); color: var(--pg-text); border: 1px solid var(--pg-line); font-size: 14px;
}
body.pg #schedAt:focus { outline: none; border-color: var(--pg-yellow); }
body.pg .sched-hint { margin-top: 8px; font-size: 12px; }

/* ---------- Стоимость и главная кнопка ---------- */
body.pg .est-row { text-align: center; margin: 9px 0 8px; min-height: 18px; }
body.pg .est-row .muted { font-size: 13px; }
body.pg .cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 14px 18px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ffd34f 0%, #f7b62c 100%);
  color: #201703; font-family: inherit; font-size: 17.5px; font-weight: 800; letter-spacing: -.01em;
  box-shadow: 0 12px 26px -8px rgba(255, 197, 49, .55), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
body.pg .cta:active { transform: scale(.985); filter: brightness(.97); }
body.pg .cta .cta-ic { font-size: 21px; line-height: 1; }
body.pg .cta .cta-ar { font-size: 19px; font-weight: 700; transition: transform .2s ease; }
body.pg .cta:hover .cta-ar { transform: translateX(4px); }
body.pg .cta:disabled { opacity: .5; box-shadow: none; }


/* ---------- Активный заказ: карточка под картой в той же палитре ---------- */
body.pg #activeOrder { flex: 0 0 auto; max-height: 72dvh; overflow-y: auto; padding: 14px 16px 16px; }
body.pg #activeOrder .card { background: var(--pg-sheet); border: 1px solid var(--pg-line); border-radius: 22px; padding: 16px; }
body.pg #activeOrder .card h3 { color: var(--pg-yellow); font-size: 16px; }
body.pg #activeOrder .btn.secondary { background: var(--pg-row); border-color: var(--pg-line); }

/* ---------- Модалки и шиты в палитре листа ---------- */
body.pg .modal-bg { overscroll-behavior: contain; }
body.pg .modal { background: var(--pg-sheet); border: 1px solid var(--pg-line); border-radius: 22px; overscroll-behavior: contain; }
body.pg .modal h3 { color: #fff; }
body.pg .modal .btn.secondary { background: var(--pg-row); border-color: var(--pg-line); }
body.pg #placeApplyModal .btn { min-height: 46px; border-radius: 16px; font-weight: 700; }
body.pg .apply-pickup { background: var(--pg-teal); color: #042420; }
body.pg .apply-dest { background: var(--pg-coral); color: #2b0708; }
body.pg .chat-head { background: var(--pg-sheet-2); border-bottom: 1px solid var(--pg-line); }
body.pg .chat-list { background: var(--pg-sheet); }
body.pg .chat-input-row { background: var(--pg-sheet); border-top: 1px solid var(--pg-line); }

/* ---------- Появление элементов: лёгкая «лестница», не отвлекая от карты ---------- */
@keyframes pgSheetUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pgFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pgPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
body.pg .sheet-head, body.pg .rt-grid, body.pg #placesBlock,
body.pg .sched, body.pg .est-row, body.pg .cta {
  animation: pgFadeUp .5s cubic-bezier(.2, .8, .25, 1) both;
}
body.pg .sheet-head { animation-delay: .04s; }
body.pg .rt-grid { animation-delay: .09s; }
body.pg #placesBlock { animation-delay: .14s; }
body.pg .sched { animation-delay: .19s; }
body.pg .est-row { animation-delay: .22s; }
body.pg .cta { animation-delay: .26s; }

/* ---------- Узкие и низкие экраны ---------- */
@media (max-width: 372px) {
  body.pg .rt-grid { grid-template-columns: 1fr 124px; }
  body.pg .sheet-title { font-size: 21px; }
  body.pg .side-btn { font-size: 10px; gap: 6px; padding: 8px 6px; }
  body.pg .side-btn .side-ic { width: 16px; height: 16px; }
  body.pg .chip { padding: 10px 12px; font-size: 12.5px; }
}
@media (max-height: 640px) {
  /* Короткий экран: карта и лист делят высоту, лист не прокручивается сам по себе */
  body.pg .sheet { max-height: 64dvh; padding: 6px 14px 10px; }
  body.pg .sheet-grab { display: none; }
  body.pg #map { min-height: 130px; }
  body.pg .sheet-title { font-size: 20px; }
  body.pg .sheet-sub { display: none; }
  body.pg .rt-row, body.pg .side-btn { min-height: 50px; }
  body.pg .est-row { margin: 5px 0; min-height: 0; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  body.pg .sheet, body.pg .sheet-head, body.pg .rt-grid, body.pg #placesBlock,
  body.pg .sched, body.pg .est-row, body.pg .cta, body.pg .map-chip .mc-dot,
  body.pg .sw-track::after, body.pg .cta .cta-ar, body.pg .tab {
    animation: none !important; transition: none !important;
  }
}

