:root {
  --bg: #1E0000;
  --bg-2: #2A0505;
  --primary: #860000;
  --primary-hi: #E0392F;   /* яркий оттенок основного цвета для свечения */
  --ink: #F6E9E7;
  --ink-2: #C9A19C;
  --ink-3: #8A5550;
  --line: rgba(246, 233, 231, 0.12);
  --line-2: rgba(246, 233, 231, 0.22);
  --panel: rgba(30, 0, 0, 0.78);
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); }
/* iOS не должен сам увеличивать шрифты при повороте — иначе ломается сетка */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.dim { color: var(--ink-3); }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-attrib { display: none; }

/* ---------- HUD overlay ---------- */
.hud-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 55% 50%, transparent 45%, rgba(30,0,0,0.55) 85%, rgba(30,0,0,0.85) 100%);
}
/* ---------- Loader ---------- */
.loader {
  position: fixed; z-index: 4; top: 16px; left: 50%; transform: translate(-50%, -8px);
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 10px; color: var(--ink-2); white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.loader.on { opacity: 1; transform: translate(-50%, 0); }
.loader i { position: relative; width: 90px; height: 2px; background: var(--line); overflow: hidden; }
.loader i::after { content: ''; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--primary-hi); box-shadow: 0 0 8px var(--primary-hi); animation: scan 1s ease-in-out infinite; }
@keyframes scan { from { left: -35%; } to { left: 100%; } }
@media (max-width: 760px) { .loader { top: auto; bottom: calc(62vh + 12px); } }

/* ---------- Panel ---------- */
.panel {
  position: fixed; z-index: 5; top: 16px; left: 16px; bottom: 16px; width: 360px;
  display: flex; flex-direction: column;
  background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.panel::before, .panel::after { /* уголки-скобки */
  content: ''; position: absolute; width: 12px; height: 12px; border: 1px solid var(--primary-hi); pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.brand { display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.logo { height: 36px; min-width: 36px; display: flex; align-items: center; }
.logo img { height: 26px; width: auto; display: block; }
.logo-ph { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; padding: 10px 10px; border: 1px dashed var(--line-2); color: var(--ink-3); }
.brand-meta { display: flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--ink-2); flex: 1; }
.brand-meta span:first-child { color: var(--primary-hi); }
/* кнопка сворачивания панели — на всех экранах */
.panel-toggle { display: grid; place-items: center; width: 36px; height: 36px; flex: none; background: none; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; }
.panel-toggle:hover { color: var(--ink); border-color: var(--primary-hi); }
.panel-toggle svg { transition: transform .25s; }
.panel { transition: bottom .25s; }
.panel.collapsed { bottom: auto; }
.panel.collapsed > :not(.brand) { display: none !important; }
.panel.collapsed .brand { border-bottom: 0; }
.panel.collapsed .panel-toggle svg { transform: rotate(180deg); }

.panel-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--line-2); }

.route-form { position: relative; display: flex; flex-direction: column; gap: 8px; }
.field { position: relative; }
.field-tag {
  position: absolute; left: 0; top: 0; bottom: 0; width: 40px; display: grid; place-items: center;
  font-size: 12px; color: var(--primary-hi); border-right: 1px solid var(--line);
}
.field input {
  width: 100%; height: 46px; padding: 0 44px 0 52px;
  background: rgba(246,233,231,0.03); border: 1px solid var(--line); color: var(--ink);
  font: 400 14px var(--sans); outline: none; border-radius: 0;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--primary-hi); background: rgba(134,0,0,0.12); }
.swap {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink-2);
}
.swap:hover { color: var(--ink); border-color: var(--primary-hi); }

.suggest { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: #170000; border: 1px solid var(--line-2); border-top: 0; display: none; max-height: 280px; overflow-y: auto; }
.suggest.open { display: block; }
.suggest li { padding: 10px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.suggest li:first-child { border-top: 0; }
.suggest li:hover, .suggest li.kb { background: rgba(134,0,0,0.25); }
.suggest .s-name { font-size: 14px; }
.suggest .s-sub { font: 400 10px var(--mono); letter-spacing: .05em; color: var(--ink-3); text-transform: uppercase; margin-top: 3px; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.mode { background: none; border: 0; border-left: 1px solid var(--line); padding: 10px 0; cursor: pointer; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.mode:first-child { border-left: 0; }
.mode:hover { color: var(--ink); }
.mode.active { background: var(--primary); color: var(--ink); }

.routes { display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: 10.5px; line-height: 1.6; color: var(--ink-3); margin: 4px 0; text-transform: none; letter-spacing: .02em; }
.route-card {
  position: relative; padding: 14px 16px; border: 1px solid var(--line); cursor: pointer; background: rgba(246,233,231,0.02);
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
}
.route-card:hover { border-color: var(--line-2); }
.route-card.active { border-color: var(--primary-hi); background: rgba(134,0,0,0.18); }
.route-card.active::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--primary-hi); box-shadow: 0 0 12px var(--primary-hi); }
.rc-time { font: 300 30px/1 var(--sans); letter-spacing: -0.01em; }
.rc-time small { font-size: 14px; color: var(--ink-2); margin-left: 4px; }
.rc-dist { font: 400 12px var(--mono); color: var(--ink-2); }
.rc-tag { grid-column: 1 / -1; font: 400 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.route-card.active .rc-tag { color: var(--primary-hi); }
.loading { font: 400 11px var(--mono); color: var(--ink-3); letter-spacing: .1em; }
.loading::after { content: '_'; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.panel-foot { display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--ink-3); }
#status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: var(--primary-hi); box-shadow: 0 0 8px var(--primary-hi); vertical-align: 1px; }

/* ---------- HUD blocks ---------- */
/* три одинаковых блока: одна ширина, одна высота, по три строки */
.hud-top { position: fixed; z-index: 4; top: 16px; right: 16px; display: grid; grid-template-columns: repeat(3, 136px); gap: 8px; font-size: 11px; }
.hud-block { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); min-width: 0; }
.hud-block > span, .hud-block > a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-block .val { color: var(--ink); }
.hud-bottom { position: fixed; z-index: 4; left: 392px; bottom: 16px; display: flex; gap: 18px; align-items: center; font-size: 10.5px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.hud-bottom .bar { width: 80px; height: 2px; background: var(--line); position: relative; }
.hud-bottom .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary-hi); box-shadow: 0 0 6px var(--primary-hi); }

.controls { position: fixed; z-index: 4; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); backdrop-filter: blur(10px); font-size: 11px; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn.active { color: var(--ink); border-color: var(--primary-hi); background: rgba(134,0,0,0.35); }
.icon-btn:focus-visible { outline: 1px solid var(--primary-hi); outline-offset: 2px; }
.icon-btn:focus:not(:focus-visible) { outline: none; }

/* ---------- Card ---------- */
.card { position: fixed; z-index: 6; width: 260px; background: var(--panel); border: 1px solid var(--line-2); backdrop-filter: blur(14px); padding: 12px 14px 14px; transform: translate(-50%, calc(-100% - 22px)); }
.card::after { content: ''; position: absolute; left: 50%; bottom: -22px; width: 1px; height: 22px; background: var(--ink-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--primary-hi); }
.x { background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0; }
.x:hover { color: var(--ink); }
.card-title { font-size: 16px; margin: 6px 0 2px; line-height: 1.3; }
.card-sub { font-size: 10px; color: var(--ink-3); text-transform: none; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.btn { height: 34px; border: 1px solid var(--primary-hi); background: var(--primary); cursor: pointer; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.btn:hover { background: #a00a06; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink-2); }

/* ---------- Map markers ---------- */
.mk-a { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 14px var(--primary-hi); background: rgba(30,0,0,.6); }
.mk-a::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.mk-b { width: 26px; height: 26px; position: relative; }
.mk-b::before { content: ''; position: absolute; inset: 3px; border: 1.5px solid var(--ink); transform: rotate(45deg); background: rgba(30,0,0,.7); box-shadow: 0 0 16px var(--primary-hi); }
.mk-b::after { content: ''; position: absolute; left: 9px; top: 9px; width: 8px; height: 8px; background: var(--primary-hi); transform: rotate(45deg); }
.mk-label { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 500 10px var(--mono); letter-spacing: .1em; color: var(--ink); text-shadow: 0 0 6px var(--bg); }

.callout { width: max-content; white-space: nowrap; font: 400 10px var(--mono); letter-spacing: .08em; color: var(--ink-2); padding: 5px 9px; position: relative; background: rgba(30,0,0,.75); cursor: pointer; }
.callout::before, .callout::after { content: ''; position: absolute; top: 0; bottom: 0; width: 5px; border: 1px solid var(--ink-3); }
.callout::before { left: 0; border-right: 0; }
.callout::after { right: 0; border-left: 0; }
.callout b { color: var(--ink); font-weight: 500; font-size: 12px; margin-left: 4px; }
.callout.main { color: var(--ink); }
.callout.main::before, .callout.main::after { border-color: var(--primary-hi); }


.me { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--primary-hi); box-shadow: 0 0 0 6px rgba(224,57,47,.25), 0 0 18px var(--primary-hi); position: relative; }
.me-tag { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); white-space: nowrap; font-size: 10px; padding: 4px 8px;
  background: rgba(30,0,0,.9); border: 1px solid var(--line-2); color: var(--ink); }
.icon-btn.busy svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 40; left: 50%; top: 64px; transform: translate(-50%, -8px); max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px;
  background: rgba(23,0,0,.95); border: 1px solid var(--line-2); color: var(--ink); font-size: 11px; line-height: 1.5; text-transform: none; letter-spacing: .03em;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Планшеты и узкие окна (761–1180) ---------- */
/* панель 360px + три HUD-блока + нижний HUD с координатами не помещаются — убираем второстепенное */
@media (max-width: 1180px) {
  .hud-bottom > div:nth-child(-n+2) { display: none; }            /* LAT / LON */
}
@media (max-width: 1100px) {
  .hud-top { grid-template-columns: repeat(2, 128px); }
  .hud-top .hud-block:last-child { display: none; }                /* «ГОРОД ТАШКЕНТ» — статичная подпись */
  .nav { grid-template-columns: 1fr; grid-template-areas: "turn" "stats" "prog" "act"; }
  .nav-turn { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-stats { grid-template-columns: repeat(4, 1fr); }
  .nav-stats div { border-left: 1px solid var(--line) !important; }
  .nav-stats div:first-child { border-left: 0 !important; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .hud-bottom { display: none; }
  .nav { right: 64px; }
}

/* ---------- Mobile ---------- */
/* --sheet-h — фактическая высота нижней панели (ставит app.js), по ней выравниваются кнопки и индикатор */
@media (max-width: 760px) {
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; max-height: 62dvh; border-left: 0; border-right: 0; border-bottom: 0; }
  .panel.collapsed .panel-body, .panel.collapsed .panel-foot { display: none; }
  .panel.collapsed .panel-toggle svg { transform: rotate(180deg); }
  .panel-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .brand { padding: 12px 16px; }
  .panel-body { padding: 14px 16px; }
  .hud-bottom { display: none; }
  .hud-top { top: calc(12px + env(safe-area-inset-top)); left: 12px; right: auto; grid-template-columns: 120px; }
  .controls { top: auto; right: 12px; bottom: calc(var(--sheet-h, 62vh) + 12px); }
  #zIn, #zOut { display: none; }                                    /* на телефоне масштаб — жестом */
  .loader { bottom: calc(var(--sheet-h, 62vh) + 12px); }
  .card { width: min(230px, calc(100vw - 24px)); }
  .toast { top: calc(12px + env(safe-area-inset-top)); }
}
/* телефон боком: экран низкий — панель сбоку, как на компьютере, HUD времени убираем */
@media (max-width: 760px) and (max-height: 500px), (max-height: 500px) and (max-width: 1000px) {
  .panel { top: 8px; left: 8px; bottom: 8px; right: auto; width: min(320px, 46vw); max-height: none; border: 1px solid var(--line); }
  .panel.collapsed { bottom: auto; }
  .brand { padding: 10px 14px; }
  .panel-body { padding: 12px 14px; }
  .hud-top, .hud-bottom { display: none; }
  .controls { top: 8px; bottom: auto; right: 8px; }
  #zIn, #zOut { display: none; }
  .loader { top: 8px; bottom: auto; left: calc(50% + 160px); }
  .nav { left: calc(min(320px, 46vw) + 16px); right: 56px; bottom: 8px; }
  body.navigating .panel { display: none; }
  body.navigating .nav { left: 8px; }
}

/* ---------- Tabs ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 12px 0; cursor: pointer; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); position: relative; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary-hi); box-shadow: 0 0 10px var(--primary-hi); }
.panel-body[hidden] { display: none; }
#tab-places { gap: 12px; }

/* ---------- Places: filters ---------- */
.field.search .field-tag { color: var(--ink-3); }
.field.search input { padding-right: 12px; text-overflow: ellipsis; }
.field.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.filter-row { display: flex; gap: 8px; align-items: stretch; }
/* Своё выпадающее меню (вместо системного select) */
.dd { flex: 1; position: relative; min-width: 0; }
.dd-btn { width: 100%; height: 40px; display: flex; align-items: center; padding: 0; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: rgba(246,233,231,0.03); color: var(--ink); }
.dd-btn:hover { border-color: var(--line-2); }
.dd.open .dd-btn, .dd-btn:focus-visible { border-color: var(--primary-hi); background: rgba(134,0,0,0.12); outline: none; }
.dd-tag { font-size: 9.5px; color: var(--ink-3); padding: 0 10px 0 12px; border-right: 1px solid var(--line); height: 100%; display: grid; place-items: center; }
.dd-val { flex: 1; min-width: 0; padding: 0 10px 0 12px; font: 400 13px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-chev { margin-right: 12px; color: var(--ink-2); transition: transform .2s; flex: none; }
.dd.open .dd-chev { transform: rotate(180deg); color: var(--primary-hi); }
.dd-list { list-style: none; margin: 0; padding: 4px 0; position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 340px; overflow-y: auto; background: #170000; border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .16s, transform .16s; outline: none; }
.dd.open .dd-list { opacity: 1; transform: none; pointer-events: auto; }
.dd-list::before { content: ''; position: absolute; top: -1px; left: -1px; width: 10px; height: 10px; border-top: 1px solid var(--primary-hi); border-left: 1px solid var(--primary-hi); }
.dd-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; cursor: pointer; font-size: 13px; color: var(--ink-2); position: relative; }
.dd-opt .n { margin-left: auto; font: 400 10px var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.dd-opt.hl { background: rgba(134,0,0,0.28); color: var(--ink); }
.dd-opt.on { color: var(--ink); }
.dd-opt.on::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--primary-hi); box-shadow: 0 0 8px var(--primary-hi); }
.dd-opt.on .n { color: var(--primary-hi); }
.dd-opt.zero { opacity: .45; }
.dd-sep { height: 1px; background: var(--line); margin: 4px 0; }
.reset { height: auto; padding: 0 12px; }

/* minmax(0, 1fr) — колонки строго равные: длинное слово («Супермаркеты») не раздвигает свою колонку */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 3px 7px; min-width: 0; cursor: pointer; background: rgba(246,233,231,0.02); border: 1px solid var(--line); color: var(--ink-2); position: relative; }
.cat svg { width: 18px; height: 18px; flex: none; }
/* название в одну строку, без переносов по слогам; если совсем не влезает — многоточие */
.cat .c-name { font: 400 10px/1.2 var(--sans); text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat .c-n { font: 400 9px var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.cat:hover { border-color: var(--line-2); color: var(--ink); }
.cat.on { border-color: var(--primary-hi); background: rgba(134,0,0,0.35); color: var(--ink); }
.cat.on .c-n { color: var(--ink-2); }
.cat.on::before { content: ''; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: var(--primary-hi); box-shadow: 0 0 8px var(--primary-hi); }
.cat.empty { opacity: .35; }

.results-head { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-3); padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.results-head b { color: var(--primary-hi); font-weight: 500; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.res { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.res:hover, .res.sel { background: rgba(134,0,0,0.2); }
.res .r-ico { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--ink-2); }
.res .r-ico svg { width: 16px; height: 16px; }
.res .r-name { font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .r-sub { font: 400 10px var(--mono); color: var(--ink-3); letter-spacing: .03em; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res .r-sub em { font-style: normal; color: var(--primary-hi); }
.more { margin: 10px 0 4px; width: 100%; }
.empty-msg { font: 400 11px/1.6 var(--mono); color: var(--ink-3); padding: 14px 0; }

.card-info { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.card-info:empty { display: none; }
.card-info a { color: var(--ink); text-decoration: none; }
.card-info a:hover { color: var(--primary-hi); }

.osm { color: var(--ink-3); text-decoration: none; font-size: 9.5px; }
.osm:hover { color: var(--ink); }

/* ---------- Единые полосы прокрутки ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(246,233,231,0.22) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(246,233,231,0.18); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hi); }

/* подсказки адресов — в том же стиле, что и меню районов */
.suggest { top: calc(100% + 4px); border-top: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0,0,0,.6); padding: 4px 0; }
.suggest li { border-top: 0; padding: 9px 14px; }
.suggest li:hover, .suggest li.kb { background: rgba(134,0,0,0.28); }

/* меню районов: без полосы прокрутки (прокрутка колесом и клавишами остаётся) */
.dd-list { max-height: min(560px, calc(100vh - 220px)); scrollbar-width: none; }
.dd-list::-webkit-scrollbar { display: none; }

/* ---------- Кнопка «Поехали» ---------- */
.btn.go { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; font-size: 12px; letter-spacing: .16em;
  background: var(--primary); border-color: var(--primary-hi); box-shadow: 0 0 18px rgba(224,57,47,.35); }
.btn.go:hover { background: #A30E09; box-shadow: 0 0 26px rgba(224,57,47,.55); }

/* ---------- Панель навигации ---------- */
.nav { position: fixed; z-index: 7; left: 392px; right: 72px; bottom: 16px; max-width: 760px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: grid; grid-template-columns: 1.15fr 1fr; grid-template-areas: "turn stats" "prog prog" "act act"; }
.nav[hidden] { display: none; }
.nav::before, .nav::after { content: ''; position: absolute; width: 12px; height: 12px; border: 1px solid var(--primary-hi); pointer-events: none; }
.nav::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.nav::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.nav-turn { grid-area: turn; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-right: 1px solid var(--line); position: relative; }
.nav-arrow { width: 52px; height: 52px; flex: none; display: grid; place-items: center; background: var(--primary); border: 1px solid var(--primary-hi);
  color: var(--ink); box-shadow: 0 0 18px rgba(224,57,47,.45); }
.nav-arrow svg { width: 30px; height: 30px; transition: transform .3s; }
.nav-turn-txt { min-width: 0; }
.nav-dist { font: 300 26px/1 var(--sans); letter-spacing: -.01em; }
.nav-instr { font-size: 14px; margin-top: 4px; color: var(--ink); }
.nav-street { font-size: 10px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: .03em; }
.nav-src { position: absolute; top: 8px; right: 10px; font-size: 9px; padding: 2px 6px; border: 1px solid var(--line-2); color: var(--ink-2); }
.nav-src.gps { border-color: var(--primary-hi); color: var(--primary-hi); }

.nav-stats { grid-area: stats; display: grid; grid-template-columns: repeat(2, 1fr); }
.nav-stats div { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nav-stats div:nth-child(odd) { border-left: 0; }
.nav-stats span { font-size: 9px; color: var(--ink-3); }
.nav-stats b { font: 400 18px/1 var(--sans); }
.nav-stats small { font-size: 11px; color: var(--ink-2); margin-left: 3px; }

.nav-progress { grid-area: prog; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.nav-bar { flex: 1; height: 3px; background: var(--line); position: relative; }
.nav-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--primary-hi); box-shadow: 0 0 10px var(--primary-hi); }
.nav-progress span { font-size: 10px; color: var(--ink-2); white-space: nowrap; }

.nav-actions { grid-area: act; display: flex; gap: 6px; padding: 0 16px 14px; align-items: center; }
.nav-actions .btn { padding: 0 16px; }
.nav-actions .btn[hidden] { display: none; }
.nav-actions #navStop { margin-left: auto; }
.nav-speeds { display: flex; border: 1px solid var(--line); }
.nav-speeds[hidden] { display: none; }
.nav-speeds button { background: none; border: 0; border-left: 1px solid var(--line); color: var(--ink-3); font: 500 11px var(--mono); padding: 0 11px; height: 32px; cursor: pointer; }
.nav-speeds button:first-child { border-left: 0; }
.nav-speeds button.on { background: rgba(134,0,0,.45); color: var(--ink); }
.nav.done .nav-arrow { background: var(--ink); color: var(--bg); }

body.navigating .hud-bottom { display: none; }

/* машина */
.car { width: 44px; height: 44px; position: relative; }
.car svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(224,57,47,.9)); }
.car-pulse { position: absolute; inset: -10px; border-radius: 50%; border: 1px solid var(--primary-hi); animation: carPulse 1.8s ease-out infinite; }
@keyframes carPulse { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }

@media (max-width: 760px) {
  .nav { left: 8px; right: 8px; bottom: 8px; grid-template-columns: 1fr; grid-template-areas: "turn" "stats" "prog" "act"; }
  .nav-turn { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-stats { grid-template-columns: repeat(4, 1fr); }
  .nav-stats div { border-left: 1px solid var(--line) !important; padding: 8px 10px; }
  .nav-stats div:first-child { border-left: 0 !important; }
  .nav-stats b { font-size: 15px; }
  body.navigating .panel { display: none; }
}

/* кнопки под маршрутом — одинакового размера и типографики */
.routes .btn { height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.routes .btn.go { margin-top: 4px; }
.routes .btn.go svg { width: 14px; height: 14px; }

/* ---------- Окно «Начало поездки» ---------- */
.ask { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(10,0,0,.55); backdrop-filter: blur(3px); }
.ask[hidden] { display: none; }
.ask-card { position: relative; width: min(400px, 100%); padding: 22px 22px 20px; background: #170000; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.ask-card::before, .ask-card::after { content: ''; position: absolute; width: 12px; height: 12px; border: 1px solid var(--primary-hi); }
.ask-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ask-card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.ask-card .x { position: absolute; top: 12px; right: 14px; }
.ask-tag { font-size: 10px; color: var(--primary-hi); }
.ask-title { font-size: 19px; margin: 8px 0 6px; }
.ask-sub { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.ask-actions .btn { height: 44px; font-size: 11.5px; letter-spacing: .12em; }

/* ---------- Настройки: стиль карты и освещение ---------- */
.hud-vignette { background: radial-gradient(ellipse at 55% 50%, transparent 45%, rgba(var(--vig, 30,0,0),0.55) 85%, rgba(var(--vig, 30,0,0),0.85) 100%); }
.set-card { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.set-sec { font-size: 9.5px; color: var(--ink-3); margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 9px; cursor: pointer; text-align: left;
  background: rgba(246,233,231,0.02); border: 1px solid var(--line); color: var(--ink-2); position: relative; min-width: 0; }
.theme:hover { border-color: var(--line-2); color: var(--ink); }
.theme.on { border-color: var(--primary-hi); color: var(--ink); background: rgba(134,0,0,0.22); }
.theme.on::before { content: ''; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: var(--primary-hi); box-shadow: 0 0 8px var(--primary-hi); }
.theme:focus-visible, .switch:focus-visible { outline: 1px solid var(--primary-hi); outline-offset: 2px; }
.theme-prev { position: relative; display: block; height: 54px; overflow: hidden; border: 1px solid var(--line); }
.theme-prev i { position: absolute; bottom: 0; }
.theme-prev b { position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; }
.theme-name { font-size: 13px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-note { font-size: 9px; color: var(--ink-3); padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row { display: flex; align-items: center; gap: 12px; }
.set-txt { flex: 1; min-width: 0; }
.set-name { font-size: 14px; }
.set-hint { font-size: 11.5px; line-height: 1.45; color: var(--ink-3); margin-top: 3px; }
.set-state { font-size: 10px; color: var(--ink-3); width: 34px; text-align: right; }
.switch { position: relative; width: 46px; height: 24px; flex: none; cursor: pointer; background: rgba(246,233,231,0.04); border: 1px solid var(--line-2); padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--ink-3); transition: transform .2s, background .2s, box-shadow .2s; }
.switch[aria-checked="true"] { background: var(--primary); border-color: var(--primary-hi); }
.switch[aria-checked="true"] i { transform: translateX(22px); background: var(--ink); box-shadow: 0 0 10px var(--primary-hi); }
.switch[aria-checked="true"] + .set-state, .set-row:has(.switch[aria-checked="true"]) .set-state { color: var(--primary-hi); }
@media (max-width: 380px) { .themes { grid-template-columns: 1fr; } .theme { flex-direction: row; align-items: center; } .theme-prev { width: 72px; height: 40px; flex: none; } .theme-note { margin-left: auto; } }

/* ---------- Аккаунт в HUD ---------- */
.hud-block.user #userName { text-transform: none; letter-spacing: .02em; }
.link { background: none; border: 0; padding: 0; align-self: flex-start; cursor: pointer; font-size: 11px; line-height: inherit; color: var(--primary-hi); }
.link:hover { color: var(--ink); }
.link[hidden] { display: none; }
.user-name { color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name:hover { color: var(--primary-hi); }
@media (max-width: 760px) { .hud-block.user { display: none; } }

/* панель свёрнута — нижняя полоса с координатами (LAT/LON/ZOOM/PITCH) плавно скрывается */
.hud-bottom { transition: opacity .2s, visibility .2s; }
.panel.collapsed ~ .hud-bottom { opacity: 0; visibility: hidden; pointer-events: none; }
