:root {
  --bg: #f4f5f7;
  --panel: rgba(255, 255, 255, 0.97);
  --text: #12161b;
  --muted: #5b6573;
  --line: rgba(18, 22, 27, 0.12);
  --accent: #d62f32;
  --blue: #2f6fed;
  --ok: #1f9d55;
  --btn: #eceff3;
  --btn-strong: #e1e5eb;
  --kind: #2b3341;          /* «Экипаж» и «Рейд»: спокойный графит, один оттенок */
  --kind-text: #ffffff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  --shadow-soft: 0 6px 18px rgba(16, 24, 40, 0.10), 0 1px 3px rgba(16, 24, 40, 0.08);
  --scrim: 243, 245, 248;   /* фон под шапкой: сплошной у края экрана, к карте растворяется */
  --panel-solid: #ffffff;
  --radius: 16px;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --panel: rgba(24, 29, 35, 0.97);
    --text: #eef1f4;
    --muted: #9aa5b1;
    --line: rgba(255, 255, 255, 0.12);
    --btn: #2a313a;
    --btn-strong: #353d48;
    --kind: #3a4454;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
    --scrim: 14, 20, 32;
    --panel-solid: #181d23;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: rgb(var(--scrim)); color: var(--text); overflow: hidden;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
#map { position: fixed; inset: 0; }

/* ---------- заставка ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50; background: #0e1420; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.splash.hide { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash-icon { position: relative; width: 96px; height: 96px; animation: splashIn 0.6s var(--spring) both; }
.splash-icon svg { position: relative; }
.glow { position: absolute; top: -10px; width: 90px; height: 90px; border-radius: 50%; filter: blur(18px); opacity: 0; }
.glow.red { left: -36px; background: #ff3b3f; animation: beacon 1.1s infinite; }
.glow.blue { right: -36px; background: #2f7bff; animation: beacon 1.1s infinite 0.55s; }
.splash .lamp-r { animation: lamp 1.1s infinite; }
.splash .lamp-b { animation: lamp 1.1s infinite 0.55s; }
.splash-name { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; animation: fadeUp 0.6s 0.15s ease both; }
.splash-name span { display: block; text-align: center; font-size: 15px; font-weight: 400; opacity: 0.6; margin-top: 2px; }
@keyframes beacon { 0%, 45% { opacity: 0.85; } 50%, 100% { opacity: 0; } }
@keyframes lamp { 0%, 45% { filter: brightness(1.35); } 50%, 100% { filter: brightness(0.7); } }
@keyframes splashIn { from { transform: scale(0.6) translateY(20px); opacity: 0; } }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } }

/* после заставки элементы въезжают на места */
.topbar, .bottom, .fab { transition: transform 0.5s var(--spring), opacity 0.4s ease; }
body:not(.ready) .topbar { transform: translateY(-24px); opacity: 0; }
body:not(.ready) .bottom { transform: translateY(30px); opacity: 0; }
body:not(.ready) .fab { opacity: 0; }

/* ---------- шапка: без плашки, растворяется в карте ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 14px 30px;
  background: linear-gradient(to bottom, rgba(var(--scrim), 0.97) 0%, rgba(var(--scrim), 0.9) 55%, rgba(var(--scrim), 0) 100%);
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.logo { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow-soft); }
.logo img { display: block; border-radius: 12px; }
@media (prefers-color-scheme: dark) {
  .logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), var(--shadow-soft); }
}
.beta {
  position: absolute; right: -9px; top: -6px; font-style: normal; font-size: 9.5px; font-weight: 700;
  background: #f08c00; color: #fff; padding: 1px 5px; border-radius: 6px; letter-spacing: 0.2px;
  box-shadow: 0 0 0 2px rgb(var(--scrim));
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.wordmark { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.1; white-space: nowrap; }
.wordmark span {
  background: linear-gradient(90deg, #e5383b 0%, #b0368f 50%, #2f6fed 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* точка — отдельный элемент с отступом под ореол, обрезается только текст */
.status {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0;
  background: transparent; padding: 2px 0 0 3px; color: var(--muted); font-size: 12.5px;
}
.status i {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.18);
}
.status span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.offline { color: #c77700; }
.status.offline i { background: #f08c00; box-shadow: 0 0 0 3px rgba(240, 140, 0, 0.2); }
.city-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 10px;
  border-radius: 19px; background: var(--panel); box-shadow: var(--shadow-soft);
  font-weight: 700; font-size: 15px; color: var(--text);
}
.city-chip svg { color: var(--accent); }
.city-chip .chev { color: var(--muted); margin-left: -1px; }
.round-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-soft);
  display: grid; place-items: center; color: var(--text);
}
.city-chip:active, .round-btn:active { transform: scale(0.95); }

/* ---------- кнопки на карте ---------- */
.fab-left { right: auto !important; left: 14px; }
/* «i» и «где я» по краям нижней панели — компактные, центр по высоте совпадает с «Маршрут | Отметить» */
.fab {
  position: fixed; right: 14px; bottom: calc(22px + var(--safe-b)); z-index: 5;
  width: 44px; height: 44px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-soft);
  display: grid; place-items: center;
}
.fab svg { width: 21px; height: 21px; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); z-index: 5;
  display: flex; justify-content: center; pointer-events: none;
}
body.sheet-open .bottom { transform: translateY(90px); opacity: 0; }
body.sheet-open .fab { opacity: 0; pointer-events: none; }
body.sheet-open .dock { pointer-events: none; }
.kind:active, .ok:active, .secondary:active, .close-btn:active { transform: scale(0.97); }

/* ---------- булавка: кончик точно в центре карты ---------- */
.pin { display: none; }
body.reporting .pin, body.picking .pin, body.carpick .pin { display: block; position: fixed; left: 50%; top: 50%; z-index: 3; pointer-events: none; }
.pin-icon {
  position: absolute; left: -20px; top: -51px; transform-origin: 50% 100%;
  transition: transform 0.18s ease-out; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
  animation: pinDrop 0.5s var(--spring);
}
.pin-shadow {
  position: absolute; left: -6px; top: -2px; width: 12px; height: 4px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); transition: transform 0.18s ease-out, opacity 0.18s;
}
body.moving .pin-icon { transform: translateY(-14px); }
body.moving .pin-shadow { transform: scale(1.7); opacity: 0.5; }
body.dropping .pin-icon { transform: scale(1.15, 0.8); transition-duration: 0.12s; }
@keyframes pinDrop {
  0% { transform: translateY(-70px); opacity: 0; }
  60% { transform: translateY(4px) scale(1.05, 0.92); opacity: 1; }
  100% { transform: none; }
}

/* вспышка мигалки там, где поставили метку */
.flash { position: relative; width: 0; height: 0; pointer-events: none; }
.flash i, .flash b { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.flash i { width: 30px; height: 30px; border: 3px solid #e5383b; animation: ring 1.2s ease-out forwards; }
.flash i + i { border-color: #2f6fed; animation-delay: 0.25s; opacity: 0; }
.flash b { width: 14px; height: 14px; background: #fff; animation: spark 0.6s ease-out forwards; }
@keyframes ring { 0% { width: 20px; height: 20px; opacity: 1; } 100% { width: 130px; height: 130px; opacity: 0; } }
@keyframes spark { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); } }

/* ---------- нижние шторки ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--panel); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
  padding: 20px 16px calc(14px + var(--safe-b)); max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(105%); transition: transform 0.38s var(--spring);
  --peek: 112px;
}
.sheet.open { transform: none; }
.sheet.peek, .sheet.collapsed { transform: translateY(calc(100% - var(--peek) - var(--safe-b))); }
/* свёрнута вручную: полоска-подсказка «потяни вверх» */
.sheet.collapsed::before {
  content: ""; display: block; width: 40px; height: 5px; margin: -10px auto 9px; border-radius: 3px;
  background: var(--muted); opacity: 0.45;
}
.sheet.collapsed { cursor: pointer; }
.sheet.dragging { transition: none; }
.sheet[hidden] { display: none; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.lead { margin: 0 0 4px; font-weight: 600; }
.meta { margin: 0 0 14px; color: var(--muted); }
.address { margin: 0 0 12px; font-weight: 600; min-height: 1.4em; color: var(--text); }
.address:empty { display: none; }
#reportPanel .address { color: var(--accent); }
.note { margin: 6px 0 4px; color: var(--muted); font-size: 14px; }
.note a { color: var(--blue); }
.small { margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.small:empty { display: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.kind {
  min-height: 96px; border-radius: 14px; background: var(--kind); color: var(--kind-text); padding: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform 0.12s;
}
.kind .cars { color: #ffffff; margin-bottom: 4px; }
.kind b { font-size: 18px; }
.kind small { font-size: 12px; opacity: 0.75; }
/* эвакуатор: широкая кнопка второй строкой, жёлтая окантовка — как у метки на карте */
.kind-tow { width: 100%; min-height: 64px; margin-top: 10px; flex-direction: row; gap: 14px; box-shadow: inset 0 0 0 2px #ffc53d; }
.kind-tow span { display: flex; flex-direction: column; align-items: flex-start; }
.kind-tow .cars { margin: 0; }
.link-btn { display: block; margin: 10px auto 0; background: none; color: var(--blue); font-size: 14.5px; font-weight: 600; padding: 6px 10px; }
.steps-plain { margin: 6px 0 4px; padding-left: 20px; line-height: 1.45; }
.steps-plain li { margin-bottom: 8px; }
.ok, .secondary { min-height: 58px; border-radius: 14px; font-size: 18px; font-weight: 700; }
.ok { background: var(--ok); color: #fff; }
.secondary { background: var(--btn-strong); }
.close-btn {
  display: block; width: 100%; height: 52px; margin-top: 12px; border-radius: 14px;
  background: var(--btn); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 16px;
}

/* правила и доверие */
.rules-sheet { max-height: 88vh; }
.rules section { margin: 14px 0 6px; }
.rules h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 17px; }
.rules .num {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #e5383b, #2f6fed); color: #fff; font-size: 14px;
}
.rules p { margin: 0 0 8px; color: var(--text); font-size: 15px; line-height: 1.45; }
.trust-list, .rules-list { margin: 4px 0 10px; padding: 0; list-style: none; font-size: 15px; }
.trust-list li { display: flex; gap: 10px; padding: 5px 0; }
.trust-list b { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 15px; }
.trust-list .up b { background: rgba(31, 157, 85, 0.15); color: var(--ok); }
.trust-list .down b { background: rgba(229, 56, 59, 0.13); color: var(--accent); }
.rules-list li { position: relative; padding: 5px 0 5px 20px; }
.rules-list li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.page .rules p, .page .rules li { font-size: 16px; }
.primary-btn {
  display: block; width: 100%; height: 54px; margin-top: 14px; border-radius: 14px;
  background: var(--kind); color: #fff; font-weight: 700; font-size: 17px;
}
.level[hidden] { display: none; }
.level .badge { flex: none; padding: 3px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: #fff; background: #7b8794; }
.level.member .badge { background: var(--ok); }
.level.trusted .badge { background: linear-gradient(90deg, #e5383b, #2f6fed); }
.level.low .badge { background: #f08c00; }

/* обратный отсчёт метки */
.life { margin: -4px 0 14px; }
.life[hidden] { display: none; }
.life-text { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.life-text b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.life-bar { height: 6px; border-radius: 3px; background: var(--btn); overflow: hidden; }
.life-bar i { display: block; height: 100%; width: 100%; border-radius: 3px; background: linear-gradient(90deg, #e5383b, #2f6fed); transition: width 1s linear; }
.life-bar i.low { background: #f08c00; }
.life-left { margin-top: 6px; font-size: 13px; color: var(--muted); }

.search { position: relative; margin-bottom: 12px; }
.search input {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px;
  background: var(--bg); color: var(--text); font-size: 16px;
}
.search ul { list-style: none; margin: 6px 0 0; padding: 0; }
.search li button { width: 100%; text-align: left; background: transparent; padding: 12px 6px; border-bottom: 1px solid var(--line); }

.city-list { list-style: none; margin: 10px 0 6px; padding: 0; }
.city-list button {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 6px; background: transparent; border-bottom: 1px solid var(--line); font-size: 18px; text-align: left;
}
.city-list button i { font-style: normal; color: var(--accent); font-weight: 700; visibility: hidden; }
.city-list button.current { font-weight: 700; }
.city-list button.current i { visibility: visible; }

.links { display: flex; flex-direction: column; margin: 10px 0 8px; }
.links a, .links button {
  background: transparent; text-align: left; font-size: 16px; color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.chat-link {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(229, 56, 59, 0.1), rgba(47, 111, 237, 0.12)); color: var(--text);
  text-decoration: none; font-weight: 600;
}
.chat-link[hidden] { display: none; }
.chat-link svg { color: var(--blue); flex: none; }

.user-dot {
  width: 18px; height: 18px; border-radius: 50%; background: #2f80ed; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(47, 128, 237, 0.25);
}

.toast {
  position: fixed; left: 16px; right: 16px; top: calc(68px + var(--safe-t)); z-index: 10;
  background: #12161b; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-10px) scale(0.98); transition: opacity 0.25s, transform 0.3s var(--spring); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- текстовые страницы ---------- */
.page { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; overflow: auto; height: 100%; }
body.text { overflow: auto; }
.page a { color: var(--accent); }
.page h1 { font-size: 26px; }
.page h2 { font-size: 19px; margin-top: 28px; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; }

/* ---------- меню: блоки с разделителями ---------- */
.menu-block { border-top: 1px solid var(--line); padding: 14px 0 6px; margin-top: 10px; }
.menu-block h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.menu-block[hidden] { display: none; }
.menu-block.links { margin-top: 10px; padding-top: 4px; }
.links a:last-child { border-bottom: 0; }

.level { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }

/* шкала доверия 0–100: мало 0–10, новичок 10–35, участник 35–70, доверенный 70–100 */
.scale { margin: 4px 2px 8px; }
.scale-track {
  position: relative; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #f08c00 0 10%, #9aa5b1 10% 35%, #1f9d55 35% 70%, #e5383b 70%, #2f6fed 100%);
}
.scale-track::after {   /* тонкие разделители между зонами */
  content: ""; position: absolute; inset: 0; border-radius: 5px;
  background: linear-gradient(90deg, transparent calc(10% - 1px), var(--panel) calc(10% - 1px) calc(10% + 1px), transparent calc(10% + 1px) calc(35% - 1px), var(--panel) calc(35% - 1px) calc(35% + 1px), transparent calc(35% + 1px) calc(70% - 1px), var(--panel) calc(70% - 1px) calc(70% + 1px), transparent calc(70% + 1px));
}
.scale-marker {
  position: absolute; top: 50%; left: 0; z-index: 1; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--text); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: left 0.8s var(--spring);
}
.scale-zones { display: flex; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.scale-zones span { text-align: center; white-space: nowrap; }
.scale-nums { position: relative; height: 14px; font-size: 10.5px; color: var(--muted); opacity: 0.8; }
.scale-nums span { position: absolute; transform: translateX(-50%); }
.scale-nums span:first-child { transform: none; }
.scale-nums span:last-child { transform: translateX(-100%); }

/* легенда с образцами меток */
.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14.5px; }
.legend-list b { font-weight: 600; }
.mk {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center;
  font-style: normal; font-size: 7.5px; font-weight: 700; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.mk.fresh { background: #e5383b; box-shadow: 0 0 0 4px rgba(229, 56, 59, 0.25), 0 0 0 4px rgba(47, 111, 237, 0.25); animation: mkBeacon 1.4s infinite; }
.mk.mid { background: #f08c00; }
.mk.old { background: #7b8794; }
.mk.probation { background: rgba(229, 56, 59, 0.45); border-color: #e5383b; font-size: 12px; }
.mk.raid { width: 40px; height: 40px; margin: 0 -2px; font-size: 8px; }
.mk.tow { border-color: #ffc53d; }
@keyframes mkBeacon { 0%, 49% { box-shadow: 0 0 0 5px rgba(229, 56, 59, 0.35); } 50%, 100% { box-shadow: 0 0 0 5px rgba(47, 111, 237, 0.35); } }

.note.tiny { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.note.tiny:empty { display: none; }
.soft-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin: 8px 0 4px;
  border-radius: 12px; background: var(--btn); color: var(--text); font-weight: 600;
}
.soft-btn[hidden] { display: none; }

/* ---------- поддержка ---------- */
#supText {
  width: 100%; min-height: 110px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; resize: vertical;
}
.attach-btn { cursor: pointer; }
.sup-preview { position: relative; display: inline-block; margin: 8px 0 2px; }
.sup-preview[hidden] { display: none; }
.sup-preview img { display: block; max-height: 160px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.sup-preview button {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--text); color: var(--panel); font-size: 18px; line-height: 1;
}
#supSend:disabled { opacity: 0.6; }
.tickets { list-style: none; margin: 0; padding: 0; }
.tickets li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.tickets li:last-child { border-bottom: 0; }
.tickets .t-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.tickets .t-status.answered { color: var(--ok); font-weight: 700; }
.tickets .t-reply { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(31, 157, 85, 0.1); }
.tickets .t-reply b { display: block; font-size: 12.5px; color: var(--ok); margin-bottom: 2px; }
.new-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); vertical-align: 2px; margin-left: 4px; }
.new-dot[hidden] { display: none; }
.round-btn { position: relative; }
.round-btn .new-dot { position: absolute; top: 4px; right: 4px; margin: 0; box-shadow: 0 0 0 2px var(--panel); }

/* ---------- установка на телефон ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 4px 0 14px; border-radius: 12px; background: var(--btn); }
.tabs button { flex: 1; height: 38px; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-soft); }
[data-panel][hidden] { display: none; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0 10px 30px; counter-increment: st; }
.steps li::before {
  content: counter(st); position: absolute; left: 0; top: 50%; margin-top: -11px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #e5383b, #2f6fed);
}
.steps li + li::after { content: ""; position: absolute; left: 10px; top: -10px; height: 18px; border-left: 2px dotted var(--line); }
.step-ico {
  flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--btn); color: var(--blue);
}
.step-ico.app { background: transparent; }
.step-ico.app img { width: 44px; height: 44px; border-radius: 11px; box-shadow: var(--shadow-soft); }
.steps b { display: block; font-size: 15.5px; }
.steps small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.note.warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(240, 140, 0, 0.12); color: var(--text); font-size: 13.5px; }

.promo {
  position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); z-index: 6;
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px;
  background: var(--panel); box-shadow: var(--shadow); animation: promoIn 0.45s var(--spring);
}
.promo[hidden] { display: none; }
.promo img { border-radius: 10px; flex: none; }
.promo div { flex: 1; min-width: 0; }
.promo b { display: block; font-size: 15px; }
.promo small { display: block; font-size: 12.5px; color: var(--muted); }
.promo-btn { flex: none; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--kind); color: #fff; font-weight: 600; }
a.promo-btn { display: inline-flex; align-items: center; text-decoration: none; color: #fff; }
.promo svg { flex: none; }
/* благодарность: кнопка отдельной строкой — на узком телефоне текст не сжимается в столбик */
.promo-donate { flex-wrap: wrap; row-gap: 10px; }
.promo-donate a.promo-btn { order: 5; flex: 1 1 100%; justify-content: center; height: 40px; }
.promo-x { flex: none; width: 30px; height: 30px; border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
body.sheet-open .promo { display: none; }
@keyframes promoIn { from { transform: translateY(30px); opacity: 0; } }

/* ---------- нижняя панель: «Маршрут» | «Отметить» ---------- */
.dock {
  max-width: calc(100vw - 132px);    /* не заезжает на «i» и «где я» (44 px + отступы с каждой стороны) */
  pointer-events: auto; display: flex; align-items: center; height: 52px; padding: 0 3px; border-radius: 26px;
  background: var(--panel); box-shadow: var(--shadow-soft);
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border-radius: 22px; min-width: 0;
  background: transparent; color: var(--text); font-size: 15.5px; font-weight: 600; white-space: nowrap;
}
.dock-btn:active { background: var(--btn); transform: scale(0.97); }
.dock-btn.active { color: var(--blue); }
.dock-btn.active span { font-variant-numeric: tabular-nums; }
.dock-btn.alarm { color: var(--accent); }
.dock-btn.alarm::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: -2px; }
.dock-btn span { overflow: hidden; text-overflow: ellipsis; }
.dock-sep { width: 1px; height: 24px; background: var(--line); }
@media (max-width: 380px) { .dock-btn { padding: 0 8px; gap: 5px; font-size: 14.5px; } .dock-btn svg { transform: scale(0.9); } }
body.picking .bottom, body.picking .fab, body.picking .promo { opacity: 0; pointer-events: none; }

/* выбор точки на карте */
.pick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; padding: 16px 16px calc(14px + var(--safe-b));
  background: var(--panel); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
  animation: promoIn 0.35s var(--spring);
}
.pick-bar[hidden] { display: none; }
.pick-bar .row { align-items: stretch; }
.pick-bar .close-btn, .pick-bar .primary-btn { margin-top: 0; height: 52px; }
.pick-bar .close-btn { flex: 0 0 34%; }

/* форма маршрута */
.rt-fields { position: relative; margin: 10px 0 8px; padding-right: 46px; }
.rt-field { position: relative; display: flex; align-items: center; margin-bottom: 8px; }
.rt-field input {
  flex: 1; height: 48px; padding: 0 44px 0 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 16px; min-width: 0;
}
.rt-field input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.rt-dot {
  position: absolute; left: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 12px; font-weight: 800; color: #fff;
}
.rt-dot.a { background: #1f9d55; } .rt-dot.b { background: var(--accent); }
.rt-pick {
  position: absolute; right: 4px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: transparent; color: var(--accent);
}
.rt-swap {
  position: absolute; right: 0; top: 30px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--btn); color: var(--text);
}
.rt-quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rt-quick .note { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--btn); color: var(--text); font-size: 14px; font-weight: 600;
}
.chip svg { color: var(--blue); }
.rt-suggest { list-style: none; margin: 0 0 6px; padding: 0; }
.rt-suggest button { width: 100%; text-align: left; background: transparent; padding: 12px 6px; border-bottom: 1px solid var(--line); }
#rtGo:disabled { opacity: 0.6; }

/* результат */
.rt-cards { display: flex; flex-direction: column; gap: 8px; }
.rt-card {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: var(--btn); border: 2px solid transparent;
}
.rt-card.on { border-color: var(--blue); background: rgba(47, 111, 237, 0.09); }
.rt-card .rt-line { flex: none; width: 6px; align-self: stretch; border-radius: 3px; background: #7b8794; }
.rt-card.on .rt-line { background: #2f6fed; }
.rt-card .rt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.rt-card b { display: block; font-size: 16px; }
.rt-card .rt-time { font-size: 22px; font-weight: 800; white-space: nowrap; }
.rt-card .rt-time small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.rt-badge { display: inline-block; align-self: flex-start; line-height: 1.4; margin-top: 3px; padding: 2px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
.rt-badge.good { background: rgba(31, 157, 85, 0.15); color: var(--ok); }
.rt-badge.bad { background: rgba(229, 56, 59, 0.14); color: var(--accent); }
.rebuild { background: rgba(229, 56, 59, 0.12); color: var(--accent); }
#routeResult { max-height: 54vh; }   /* маршрут на карте должен остаться виден */
a.soft-btn { text-decoration: none; }
.open-hint { margin: 14px 0 6px; }
.open-in .soft-btn { margin: 0; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.brand-dot.ya { background: #fc3f1d; }
.brand-dot.dg { background: #19aa1e; }

.end-marker {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 14px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.end-marker.a { background: #1f9d55; } .end-marker.b { background: var(--accent); }

/* карта не запустилась — объяснение вместо пустоты */
.map-error {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px));
  padding: 20px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); text-align: center;
}
.map-error b { display: block; font-size: 17px; margin-bottom: 8px; }
.map-error p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
@media (min-width: 960px) { .map-error { left: calc(50% + var(--side-off) / 2); } }

/* ================= ПК: левая панель + карта ================= */
/* на телефоне панели нет — её содержимое ведёт себя как раньше (шапка сверху, плитки и список скрыты) */
.side { display: contents; }
.side-tiles, .side-list { display: none; }

@media (min-width: 960px) {
  :root { --side-w: 400px; --side-off: 432px; }   /* ширина панели и сколько она занимает слева с отступами */
  /* панель и шторки на ПК — всегда тёмные, в цветах логотипа (у нас «командный пульт», а не светлый каталог) */
  .side, .sheet, .pick-bar, .fab, .maplibregl-ctrl-group {
    color-scheme: dark;
    --panel: rgba(16, 22, 34, 0.96); --panel-solid: #111827; --text: #eef1f6; --muted: #93a0b4;
    --line: rgba(255, 255, 255, 0.09); --btn: #1c2535; --btn-strong: #263043; --bg: #172030; --kind: #2d3a52;
    color: var(--text);
  }
  .maplibregl-ctrl-group { background: var(--panel-solid) !important; }
  .maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
  .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
  .side { border: 1px solid rgba(255, 255, 255, 0.06); }
  .side .logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }

  .side {
    position: fixed; left: 16px; top: 16px; bottom: 16px; width: var(--side-w); z-index: 5;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--panel); border-radius: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }
  .topbar {
    position: static; padding: 16px 16px 10px; background: none; pointer-events: auto;
  }
  body:not(.ready) .topbar { transform: none; opacity: 1; }
  body:not(.ready) .side { transform: translateX(-30px); opacity: 0; }
  .side { transition: transform 0.5s var(--spring), opacity 0.4s ease; }
  .topbar .round-btn { display: none; }      /* меню — плиткой */
  .city-chip { box-shadow: none; background: var(--btn); color: var(--text); }

  /* действия: две крупные «Маршрут» / «Отметить», под ними ряд маленьких */
  .side-tiles {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 16px 16px;
    border-bottom: 1px solid var(--line);
  }
  .tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    height: 58px; border-radius: 12px; background: var(--btn); color: var(--muted);
    font-size: 11.5px; font-weight: 600; transition: background 0.15s, color 0.15s, transform 0.12s;
  }
  .tile:hover { background: var(--btn-strong); color: var(--text); }
  .tile:active { transform: scale(0.97); }
  .tile svg { color: currentColor; width: 20px; height: 20px; }
  .tile[data-act="route"], .tile[data-act="report"] {
    grid-column: span 2; flex-direction: row; gap: 10px; height: 54px; font-size: 15.5px; color: #fff;
  }
  .tile[data-act="route"] { background: linear-gradient(135deg, #2f6fed, #2453b8); }
  .tile[data-act="report"] { background: linear-gradient(135deg, #e5383b, #b5252a); }
  .tile[data-act="report"]:first-child { grid-column: span 4; }   /* маршрутов в городе нет */
  .tile[data-act="route"]:hover, .tile[data-act="report"]:hover { filter: brightness(1.08); color: #fff; }
  .tile[data-act="route"] svg, .tile[data-act="route"] svg * { stroke: #fff !important; }
  .tile[data-act="report"] svg path { fill: #fff; }
  .tile[data-act="report"] svg circle { fill: #b5252a; }
  /* «Моя машина» — своей строкой под двумя крупными, маленькие плитки остаются ровным рядом */
  .tile-car { grid-column: span 4; flex-direction: row; gap: 10px; height: 44px; font-size: 14px; color: var(--text); }
  .tile-car svg { width: 30px; height: 17px; }
  .tile-car-on { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: #2f6fed; padding: 2px 8px; border-radius: 8px; }
  .fab-car { display: none !important; }        /* на ПК — плитка; круглая кнопка налезала на масштаб */
  .tile.active { box-shadow: 0 0 0 2px #fff inset; }
  .tile.alarm { box-shadow: 0 0 0 2px #ffb4b5 inset; }
  .tile .new-dot { position: absolute; top: 7px; right: 9px; margin: 0; }

  .side-list { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px 10px 6px 16px; }
  .side-list h4 {
    margin: 0 6px 10px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted);
  }
  .side-list h4 span {
    display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 6px; border-radius: 10px; text-align: center;
    background: linear-gradient(90deg, #e5383b, #2f6fed); color: #fff; letter-spacing: 0;
  }
  .side-list h4 span:empty { display: none; }
  /* строки с цветной полосой слева: свежая — мигалка, до часа — оранжевая, давно — серая, новичок — пунктир */
  .mark-list { list-style: none; margin: 0; padding: 0 6px 10px 0; overflow-y: auto; flex: 1; }
  .mark-list button {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px 11px 18px;
    border-radius: 12px; background: transparent; text-align: left; transition: background 0.15s;
  }
  .mark-list li + li button { margin-top: 2px; }
  .mark-list button:hover { background: var(--btn); }
  .mark-list button::before {
    content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: #7b8794;
  }
  .mark-list .age-fresh::before { background: linear-gradient(180deg, #e5383b, #2f6fed); }
  .mark-list .age-mid::before { background: #f08c00; }
  .mark-list .age-probation::before { background: repeating-linear-gradient(180deg, #e5383b 0 4px, transparent 4px 7px); }
  .mark-list .ml-text { flex: 1; min-width: 0; }
  .mark-list .ml-text b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mark-list small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
  .mark-list .ml-time { flex: none; text-align: right; }
  .mark-list .ml-time b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
  .mark-list .age-fresh .ml-time b { color: #ff5a5d; }
  .list-empty { margin: 30px 0; text-align: center; color: var(--muted); line-height: 1.5; }
  .list-empty[hidden] { display: none; }

  /* шторки открываются в панели, а не снизу; при движении карты не приседают */
  .sheet {
    left: 16px; right: auto; top: 16px; bottom: 16px; width: var(--side-w); z-index: 8;
    background: rgb(var(--scrim)); background: var(--panel-solid);   /* непрозрачная: под ней список меток */
    max-height: none !important; border-radius: 22px; box-shadow: var(--shadow); padding: 20px 18px 16px;
    transform: translateX(calc(-100% - 40px));
  }
  .sheet.open, .sheet.peek, .sheet.collapsed { transform: none; }
  .sheet.collapsed::before { display: none; }

  /* кнопки на карте: справа внизу столбиком; нижняя панель и «i» — в плитках */
  .bottom, .fab-left, .promo { display: none !important; }
  .fab { right: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 16px; }
  body.sheet-open .fab { opacity: 1; pointer-events: auto; }
  .maplibregl-ctrl-bottom-right { right: 6px; bottom: 76px; }
  .maplibregl-ctrl-group { border-radius: 14px !important; box-shadow: var(--shadow-soft) !important; overflow: hidden; }
  .maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }

  /* булавка — в центре видимой карты (правее панели) */
  body.reporting .pin, body.picking .pin, body.carpick .pin { left: calc(50% + var(--side-off) / 2); }
  .pick-bar { left: 16px; right: auto; bottom: 16px; width: var(--side-w); border-radius: 22px; }

  .toast { left: calc(var(--side-off) + 16px); right: auto; top: 16px; width: min(460px, calc(100% - var(--side-off) - 32px)); }
}
@media (max-width: 959px) {
  .maplibregl-ctrl-group { display: none; }   /* на телефоне масштаб пальцами */
}

/* ---------- благодарность автору ---------- */
.thanks-top { margin: 10px 0 4px; }
.thanks-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none;
  color: var(--text); background: linear-gradient(90deg, rgba(229, 56, 59, 0.12), rgba(229, 56, 59, 0.04));
  border: 1px solid rgba(229, 56, 59, 0.25);
}
.thanks-link b { display: block; font-size: 16px; }
.thanks-link small { display: block; font-size: 13px; color: var(--muted); }
.thanks-link svg { flex: none; animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.12); } 80% { transform: scale(0.98); } 90% { transform: scale(1.08); } }

.donate { max-width: 460px; margin: 0 auto; }
.donate-hero { text-align: center; margin: 8px 0 18px; }
.donate-hero h1 { margin: 10px 0 8px; }
.donate-hero p { color: var(--muted); margin: 0; line-height: 1.5; }
.donate-ico { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px;
  background: rgba(229, 56, 59, 0.1); }
.donate-ico svg { animation: heartbeat 2.4s ease-in-out infinite; }
.donate-form h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.amount {
  height: 50px; border-radius: 12px; background: var(--btn); color: var(--text); font-weight: 700; font-size: 15px;
  border: 2px solid transparent; transition: transform 0.12s;
}
.amount:active { transform: scale(0.96); }
.amount.on { border-color: var(--accent); background: rgba(229, 56, 59, 0.08); color: var(--accent); }
@media (max-width: 420px) { .amounts { grid-template-columns: repeat(3, 1fr); } }
.own-sum { position: relative; display: block; margin-top: 10px; }
.own-sum span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.own-sum input {
  width: 100%; height: 50px; padding: 0 40px 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 17px; font-weight: 600;
}
.own-sum i { position: absolute; right: 16px; bottom: 14px; font-style: normal; font-weight: 700; color: var(--muted); }
.pay-types { display: flex; flex-direction: column; gap: 8px; }
.pay-types label {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--btn); cursor: pointer;
}
.pay-types input { width: 18px; height: 18px; accent-color: var(--accent); }
.donate-go { margin-top: 18px; background: linear-gradient(135deg, #e5383b, #b5252a); }
.donate-go:disabled { opacity: 0.55; }
.donate-legal-box {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; text-align: left; font-size: 14px; line-height: 1.45;
  color: var(--text) !important; background: var(--btn);
}
.donate-legal-box b { display: block; margin-bottom: 2px; }
.donate-legal { margin-top: 12px !important; }
.donate-back { display: grid; place-items: center; text-decoration: none; margin-top: 20px; }

/* ---------- выбор города при первом входе ---------- */
body.choose { overflow: auto; background: linear-gradient(160deg, #0e1420 0%, #1a2440 60%, #26193a 100%); color: #eef1f6; }
.choose-box { max-width: 440px; margin: 0 auto; padding: calc(40px + var(--safe-t)) 20px 40px; }
.choose-logo { display: flex; align-items: center; gap: 14px; animation: splashIn 0.6s var(--spring) both; }
.choose-logo img { border-radius: 16px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.4); }
.choose-logo .wordmark { font-size: 28px; color: #fff; }
.choose h1 { font-size: 30px; margin: 34px 0 6px; }
.choose-sub { margin: 0 0 22px; color: #a3aec0; }
.guess {
  padding: 14px 16px 16px; margin-bottom: 18px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #e5383b, #2f6fed);
  box-shadow: 0 10px 30px rgba(47, 111, 237, 0.35); animation: fadeUp 0.5s 0.15s ease both;
}
.guess[hidden] { display: none; }
.guess-q { display: block; font-size: 14px; opacity: 0.85; margin-bottom: 8px; }
.guess-list { display: flex; flex-wrap: wrap; gap: 8px; }
.guess-list a {
  padding: 9px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.18); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 17px; border: 1px solid rgba(255, 255, 255, 0.3);
}
.guess-list a:hover { background: rgba(255, 255, 255, 0.28); }
.choose-group[hidden] { display: none; }
.choose-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: #8e9ab0; margin: 22px 0 10px; }
.soon-list { color: #a3aec0; line-height: 1.7; margin: 0 0 6px; }
.choose-group.soon .note { text-align: left; }
.city-search {
  width: 100%; height: 48px; padding: 0 14px; margin-bottom: 10px; border-radius: 12px; font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); color: #fff;
}
.choose-list { list-style: none; margin: 0 0 14px; padding: 0; }
.choose-list li[hidden] { display: none; }
.choose-list a {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px; margin-bottom: 8px; border-radius: 14px;
  text-decoration: none; color: #eef1f6; font-size: 17px; font-weight: 600;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); transition: background 0.15s;
}
.choose-list a:hover { background: rgba(255, 255, 255, 0.11); }
.choose-list svg { color: #ff5a5d; }
.choose .note { color: #8e9ab0; text-align: center; }

/* текст о городе в «О карте» */
.seo-city { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.seo-city h1 { font-size: 20px; margin: 0 0 6px; }
.seo-city h2 { font-size: 15px; margin: 12px 0 6px; }
.seo-city p, .seo-city li { font-size: 14px; color: var(--muted); line-height: 1.45; }
.seo-city ul { margin: 0; padding-left: 18px; }

.share-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 8px 0 4px; padding: 12px 14px; border-radius: 14px;
  background: rgba(47, 111, 237, 0.08); border: 1px solid rgba(47, 111, 237, 0.25); color: var(--text); text-align: left;
}
.share-btn svg { color: var(--blue); flex: none; }
.share-btn b { display: block; font-size: 16px; }
.share-btn small { display: block; font-size: 13px; color: var(--muted); }
.city-list .city-group {
  padding: 16px 6px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted);
}
.city-soon { margin-top: 14px; }
.city-soon[hidden] { display: none; }
.city-soon h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.city-soon p { margin: 0 0 4px; color: var(--muted); line-height: 1.6; }

/* шапка на телефоне: длинные названия городов (Новосибирск, Петропавловск-Камчатский) не наезжают на название */
@media (max-width: 959px) {
  /* место делится по приоритету: название сайта и города целиком, статусу — что осталось
     (не помещается — app.js пишет коротко «↻ только что») */
  .brand { flex: 1 1 0; min-width: auto; }
  .brand-text { flex: 1 1 0; max-width: none; min-width: auto; }
  .topbar .status { width: 0; min-width: 100%; }   /* статус не раздвигает шапку, а занимает остаток */
  .topbar .city-chip { margin-left: auto; }
  .wordmark { font-size: 19px; }
  .city-chip { flex: 0 1 auto; min-width: 0; max-width: 46vw; padding: 0 10px; gap: 4px; font-size: 14.5px; }
  .city-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .city-chip svg:first-child { flex: none; }
}
@media (max-width: 400px) {
  .city-chip svg:first-child { display: none; }   /* без значка — больше места названию */
}

/* текстовые страницы: шапка с логотипом, кнопки — белый текст */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text) !important; }
.page-brand img { border-radius: 10px; }
.page-brand .wordmark { font-size: 19px; }
.page-head .back { margin: 0; font-weight: 600; }
.page a.primary-btn, .page a.primary-btn:visited { color: #fff; }
.page .donate-back { background: linear-gradient(135deg, #e5383b, #b5252a); }

/* ПК: выбор города — отдельной строкой под названием (длинные названия не теснят статус) */
@media (min-width: 960px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar .brand { flex: 1 1 100%; }
  .topbar .brand-text { max-width: none; }
  .topbar .city-chip { order: 3; flex: 1 1 100%; max-width: none; justify-content: flex-start; height: 40px; padding: 0 14px; margin-left: 0; }
  .topbar .city-chip span { flex: 1; text-align: left; }
}
/* страница выбора города на широком экране — города сеткой */
@media (min-width: 760px) {
  .choose-box { max-width: 860px; }
  .choose-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .choose-list a { margin-bottom: 0; }
  .guess, .city-search { max-width: 520px; }
}

.page-foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.page-foot a { color: var(--muted) !important; }

/* «Моя машина» (тест в Сочи) */
.fab-car { bottom: calc(22px + 44px + 12px + var(--safe-b)); color: var(--text); }
.fab-car svg { width: 26px; height: 14px; }
.car-on { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #2f6fed;
  box-shadow: 0 0 0 2px var(--panel); }
.car-dot { cursor: pointer; touch-action: none; width: 38px; height: 38px; border-radius: 50%; background: #2f6fed; color: #fff; display: grid; place-items: center;
  border: 3px solid #fff; box-shadow: 0 2px 10px rgba(47, 111, 237, 0.55); }
.test-tag { font-size: 12px; font-weight: 700; vertical-align: middle; background: #f08c00; color: #fff; padding: 2px 7px;
  border-radius: 7px; letter-spacing: 0.3px; }
.label { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips-row button { flex: 1; min-width: 70px; height: 40px; border-radius: 12px; background: var(--btn-strong); font-weight: 600; }
.chips-row button.on { background: #2f6fed; color: #fff; }
#carGo { width: 100%; }
#carSheet .lead { font-weight: 400; color: var(--muted); }   /* один акцент в шторке — адрес машины */
.car-link { margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(47, 111, 237, 0.1); }
.car-link p { margin: 0 0 10px; }
.tg-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; background: #2aabee !important; color: #fff !important; }
body.carpick .fab, body.carpick .bottom { opacity: 0; pointer-events: none; }
