/* ============================================================
   To'q ko'k "dashboard" premium mavzu - ASOSIY (default) ko'rinish.
   Namunadagi xavfsizlik-nazorat panellari uslubiga moslashtirilgan:
   chuqur navy fon, shishasimon (glassmorphism) panellar, yorqin
   cyan/ko'k urg'u va yumshoq "porlash" (glow) effektlari.
   ============================================================ */
:root,
:root[data-theme="dark"] {
  --bg: #070c18;
  --bg-deep: #050912;
  --panel-bg: rgba(17, 26, 48, 0.82);
  --panel-bg-solid: #101a30;
  --panel-bg-soft: rgba(24, 35, 62, 0.6);
  --border: rgba(90, 130, 200, 0.16);
  --border-strong: rgba(90, 130, 200, 0.3);
  --text: #eaf1ff;
  --muted: #8ea3c8;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-dark: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-grad: linear-gradient(135deg, #3b82f6, #22d3ee);
  --accent-glow: 0 0 0 1px rgba(59, 130, 246, 0.4), 0 4px 20px rgba(34, 211, 238, 0.28);
  --danger: #f43f5e;
  --ok: #22c55e;
  --radius: 12px;
  --radius-lg: 16px;
  --panel-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
  --scrollbar-thumb: rgba(90, 130, 200, 0.35);
  color-scheme: dark;
}

/* Yorug' variant - ixtiyoriy (kun/tun tugmasi orqali) */
:root[data-theme="light"] {
  --bg: #eef2f8;
  --bg-deep: #e4eaf3;
  --panel-bg: #ffffff;
  --panel-bg-solid: #ffffff;
  --panel-bg-soft: #f6f8fc;
  --border: #e2e7f0;
  --border-strong: #d3dae6;
  --text: #14203a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #0891b2;
  --accent-dark: #1d4ed8;
  --accent-soft: #e8f0fe;
  --accent-grad: linear-gradient(135deg, #3b82f6, #0891b2);
  --accent-glow: 0 0 0 1px rgba(37, 99, 235, 0.25), 0 4px 16px rgba(37, 99, 235, 0.18);
  --danger: #dc2626;
  --ok: #16a34a;
  --panel-shadow: 3px 0 24px rgba(20, 24, 32, 0.06);
  --card-shadow: 0 1px 2px rgba(20, 24, 32, 0.05);
  --card-shadow-hover: 0 6px 18px rgba(30, 34, 48, 0.1);
  --scrollbar-thumb: #cbd5e1;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 108% 0%, rgba(34, 211, 238, 0.1), transparent 55%),
    var(--bg-deep);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(59, 130, 246, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 108% 0%, rgba(8, 145, 178, 0.06), transparent 55%),
    var(--bg-deep);
}

/* Ingichka, zamonaviy scrollbar - panel va ro'yxatlar uchun */
#panel, #stats-panel, .district-list, .mahalla-list, .saved-list, .suggestions, .region-dropdown {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
#panel::-webkit-scrollbar, #stats-panel::-webkit-scrollbar, .district-list::-webkit-scrollbar, .mahalla-list::-webkit-scrollbar,
.saved-list::-webkit-scrollbar, .suggestions::-webkit-scrollbar, .region-dropdown::-webkit-scrollbar {
  width: 7px;
}
#panel::-webkit-scrollbar-thumb, #stats-panel::-webkit-scrollbar-thumb, .district-list::-webkit-scrollbar-thumb, .mahalla-list::-webkit-scrollbar-thumb,
.saved-list::-webkit-scrollbar-thumb, .suggestions::-webkit-scrollbar-thumb, .region-dropdown::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}
#panel::-webkit-scrollbar-track, #stats-panel::-webkit-scrollbar-track, .district-list::-webkit-scrollbar-track, .mahalla-list::-webkit-scrollbar-track,
.saved-list::-webkit-scrollbar-track, .suggestions::-webkit-scrollbar-track, .region-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

body,
#panel,
input[type="text"],
.btn,
.coord-icon-btn,
.map-round-btn,
.map-3d-btn,
.district-item,
.mahalla-item,
.saved-item,
.active-place,
.status,
.candidate-item,
.suggestions,
.suggestion-item,
.region-dropdown {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#workspace {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---------------------------------------------------------------------
   Yuqori panel (topbar) - namunadagi "xavfsizlik/nazorat/tahlil"
   boshqaruv paneli uslubida: brend, bo'lim yorliqlari, til, bildirishnoma
   va foydalanuvchi. Yorliq/til/bildirishnoma - dekorativ (bu lokal, bir
   foydalanuvchili xarita ilovasi); kecha/kunduz tugmasi esa ishlaydi.
   --------------------------------------------------------------------- */
#topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(20, 30, 56, 0.96), rgba(13, 20, 40, 0.96));
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  z-index: 30;
}
:root[data-theme="light"] #topbar {
  background: linear-gradient(180deg, #ffffff, #f6f8fc);
  box-shadow: 0 4px 16px rgba(20, 24, 32, 0.06);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.topbar-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.topbar-titles strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-titles span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav-item {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.topnav-item:hover { color: var(--text); background: var(--accent-soft); }
.topnav-item.active {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 3px 12px rgba(34, 211, 238, 0.28);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.topbar-icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
#topbar-theme .ti-sun { display: none; }
#topbar-theme.is-night .ti-moon { display: none; }
#topbar-theme.is-night .ti-sun { display: block; color: #fbbf24; }
.topbar-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--panel-bg-solid);
}
.topbar-lang {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
}
.topbar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 600;
}

#panel {
  width: 340px;
  min-width: 340px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  padding: 18px;
  overflow-y: auto;
  box-shadow: var(--panel-shadow);
}
/* Chap "Koordinata" paneli: header'dagi "Koordinata" tugmasi ochadi/yopadi;
   yopiqda chapga suriladi va xarita butun kenglikni egallaydi (keng ekranda;
   telefonda panel - hamburger tugmali alohida menyu) */
@media (min-width: 861px) {
  #panel {
    flex-shrink: 0;
    transition: margin-left 0.3s ease, visibility 0s;
  }
  #workspace.coords-closed #panel {
    margin-left: -340px;
    visibility: hidden;
    transition: margin-left 0.3s ease, visibility 0s linear 0.3s;
  }
}
@media (min-width: 861px) and (max-width: 1024px) {
  #workspace.coords-closed #panel { margin-left: -300px; }
}
/* ma'lumot/model mualliflari - xarita ustida emas, panel tagida kichik qator */
/* tarmoqdagi boshqa kompyuterlar ochadigan joriy manzil (bosilsa nusxalanadi) */
.panel-lan {
  margin-top: 22px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}
.panel-lan-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.panel-lan-list button {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: ui-monospace, Consolas, monospace;
  text-align: left;
  cursor: pointer;
}
.panel-lan-list button:hover { background: rgba(127, 127, 127, 0.12); }
.panel-lan-list button.main { font-weight: 700; }
.panel-lan-list button.copied::after { content: "  - nusxalandi"; font-family: inherit; font-weight: 400; color: var(--muted); }
.panel-credits {
  margin-top: 22px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.75;
}

/* ---------------------------------------------------------------------
   O'ng "tahlil paneli" - xaritada ayni damda ko'rinayotgan hudud bo'yicha
   HAQIQIY (lokal .pbf'dan hisoblangan) ma'lumot: obyekt sanoqlari, POI
   turlari bo'yicha doiraviy (donut) va binolar qavatlari bo'yicha ustunli
   (bar) grafik. Barcha grafiklar - inline SVG, internet/kutubxonasiz.
   --------------------------------------------------------------------- */
/* Foydalanuvchi talabi: panel standart holatda YOPIQ (xarita to'liq
   kenglikda), header'dagi "Tahlil" tugmasi bilan ochiladi/yopiladi - o'ngdan
   silliq sirg'alib chiqadi (xarita kengligi ham silliq o'zgaradi). */
#stats-panel {
  width: 340px;
  min-width: 340px;
  flex-shrink: 0;
  background: var(--panel-bg);
  border-left: 1px solid var(--border);
  padding: 18px;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.28);
  margin-right: -341px;
  visibility: hidden;
  transition: margin-right 0.3s ease, visibility 0s linear 0.3s;
}
#workspace.stats-open #stats-panel {
  margin-right: 0;
  visibility: visible;
  transition: margin-right 0.3s ease, visibility 0s;
}
.stats-head { position: relative; margin-bottom: 16px; padding-right: 36px; }
.stats-close {
  position: absolute;
  top: -2px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel-bg-soft);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.stats-close:hover { color: var(--text); border-color: var(--border-strong); }
.stats-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stats-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}
.stats-empty {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-bg-soft);
}

.viewport-hint[hidden] { display: none; }
.viewport-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  margin-bottom: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-bg-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.viewport-hint-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.viewport-hint-ico svg { width: 15px; height: 15px; }

.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 13px 13px 12px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(160deg, var(--panel-bg-soft), var(--panel-bg));
  overflow: hidden;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.stat-card:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover, var(--card-shadow));
}
.stat-card:active { transform: translateY(0); }
.stat-card::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--muted);
  border-top: 1.6px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}
.stat-card:hover::after { opacity: 0.9; transform: rotate(45deg) translate(1px, -1px); }
.stat-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: #fff;
  box-shadow: 0 4px 10px -3px var(--stat-ico-glow, transparent);
}
.stat-ico svg { width: 17px; height: 17px; }
.si-build { background: linear-gradient(145deg, #60a5fa, #3b82f6); --stat-ico-glow: rgba(59,130,246,0.55); }
.si-poi { background: linear-gradient(145deg, #f472b6, #ec4899); --stat-ico-glow: rgba(236,72,153,0.55); }
.si-road { background: linear-gradient(145deg, #fbbf24, #f59e0b); --stat-ico-glow: rgba(245,158,11,0.5); }
.si-stad { background: linear-gradient(145deg, #4ade80, #22c55e); --stat-ico-glow: rgba(34,197,94,0.5); }
.stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-cap {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.chart-block {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg-soft);
}
.chart-block h3 {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.chart-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}
.chart-note {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* Ro'yxat "batafsil" (aniq turlar bo'yicha, ko'p qatorli) bo'lsa - doira
   yuqorida (markazda), to'liq kenglikdagi ro'yxat pastda, alohida ustun
   qilib joylashtiriladi (aks holda kichik doira baland ro'yxat yonida
   g'alati "muallaq" ko'rinar edi). */
.donut-wrap:has(.chart-legend-detailed) {
  flex-direction: column;
  align-items: stretch;
}
.donut-wrap:has(.chart-legend-detailed) .donut-svg {
  margin: 0 auto 4px;
}
.donut-svg {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
}
.donut-total {
  font-size: 24px;
  font-weight: 800;
  fill: var(--text);
  text-anchor: middle;
}
.donut-cap {
  font-size: 9px;
  fill: var(--muted);
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.chart-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
}
/* "Obyektlar turi bo'yicha" ANIQ tur ro'yxati - har bir qator o'z rangli,
   ikonkali doirachasi bilan (Yandex/2GIS uslubidagi obyekt belgilariga
   o'xshab) - shunda "nimalar bor" bir qarashda, chiroyli tarzda ko'rinadi. */
.chart-legend-detailed {
  max-height: 320px;
  overflow-y: auto;
  gap: 3px;
  padding-right: 2px;
}
.legend-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px var(--panel-bg-soft);
}
.legend-icon svg {
  width: 11px;
  height: 11px;
}
.legend-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.legend-val {
  font-weight: 700;
  color: var(--text);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
}
.bar-row:last-of-type { margin-bottom: 0; }
.bar-label {
  width: 42px;
  flex-shrink: 0;
  color: var(--muted);
  text-align: right;
}
.bar-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent-grad);
  min-width: 2px;
  transition: width 0.35s ease;
}
.bar-val {
  width: 34px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text);
}

.place-stats {
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), transparent);
}
.place-stats-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.place-stats-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-2, var(--accent)), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px -3px var(--accent-soft-strong, rgba(59,130,246,0.5));
}
.place-stats-ico svg { width: 19px; height: 19px; }
.place-stats-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.place-stats-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.place-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ps-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 10px 9px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-bg-soft);
  min-width: 0;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.ps-box:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow);
  border-color: var(--border-strong);
}
.ps-box-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--ps-box-color, var(--accent));
  background: var(--ps-box-color-soft, var(--accent-soft));
}
.ps-box-ico svg { width: 13px; height: 13px; }
/* Har bir katakcha o'z rangida - butun kartochka rang-barang, "premium"
   ko'rinishi uchun (Yandex/2GIS statistikasi uslubidagi kabi). */
.place-stats-grid .ps-box:nth-child(1) { --ps-box-color: #0ea5e9; --ps-box-color-soft: rgba(14,165,233,0.14); }
.place-stats-grid .ps-box:nth-child(2) { --ps-box-color: #3b82f6; --ps-box-color-soft: rgba(59,130,246,0.14); }
.place-stats-grid .ps-box:nth-child(3) { --ps-box-color: #ec4899; --ps-box-color-soft: rgba(236,72,153,0.14); }
.place-stats-grid .ps-box:nth-child(4) { --ps-box-color: #f59e0b; --ps-box-color-soft: rgba(245,158,11,0.14); }
.place-stats-grid .ps-box:nth-child(5) { --ps-box-color: #a855f7; --ps-box-color-soft: rgba(168,85,247,0.14); }
.place-stats-grid .ps-box:nth-child(6) { --ps-box-color: #22c55e; --ps-box-color-soft: rgba(34,197,94,0.14); }
.ps-box-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ps-box-cap {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --- Bosiladigan diagramma qatorlari (legenda / ustun) --- */
.legend-row[data-drill],
.bar-row[data-drill] {
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 5px;
  margin: -3px -5px;
  transition: background 0.13s;
}
.legend-row[data-drill]:hover,
.bar-row[data-drill]:hover {
  background: var(--accent-soft);
}

/* --- "Drill-down" (batafsil ro'yxat) ko'rinishi --- */
.stats-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.stats-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel-bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.stats-detail-back:hover { border-color: var(--border-strong); background: var(--accent-soft); }
.stats-detail-titles { display: flex; flex-direction: column; min-width: 0; }
.stats-detail-titles strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-detail-titles span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drill-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drill-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg-soft);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s, transform 0.1s;
}
.drill-item:hover { border-color: var(--border-strong); background: var(--accent-soft); transform: translateX(2px); }
.drill-item:active { transform: translateX(0); }
.drill-item-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.drill-item-body { flex: 1; min-width: 0; }
.drill-item-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drill-item-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drill-item-chevron { flex-shrink: 0; color: var(--muted); opacity: 0.55; }
.drill-note {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 4px 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

#map-wrap {
  position: relative;
  flex: 1;
  height: 100%;
}

#map {
  position: absolute;
  inset: 0;
}

/* Nafis "vignette" - xarita chekkalarini bir oz xiralashtirib, markazga
   e'tiborni jamlaydigan, "premium" atlas ko'rinishi uchun chuqurlik hissi
   beruvchi effekt. Bosilishi mumkin bo'lgan hech narsani to'smaydi. */
#map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(15, 17, 23, 0.07) 100%);
}
:root[data-theme="dark"] #map-wrap::after {
  background: radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.4) 100%);
}

/* ---------------------------------------------------------------------
   Responsiv (planshet/telefon) - katta ekranda panel doim ko'rinadi;
   kichikroq ekranlarda torayadi; telefonda esa xarita to'liq ekranni
   egallaydi, panel esa yon tarafdan sirg'alib chiqadigan menyuga aylanadi
   (hamburger tugmasi orqali ochiladi/yopiladi).
   --------------------------------------------------------------------- */

.panel-toggle-btn {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.panel-toggle-btn .btn-icon { width: 20px; height: 20px; }

.panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.panel-backdrop.open {
  display: block;
  opacity: 1;
}

/* O'rtacha kenglikda (noutbuk) tahlil paneli xaritani toraytirmaydi -
   ochilganda xarita ustida o'ng tomondan suzib chiqadi. */
@media (max-width: 1360px) {
  #stats-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin-right: 0;
    transform: translateX(105%);
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }
  #workspace.stats-open #stats-panel {
    transform: translateX(0);
    transition: transform 0.3s ease, visibility 0s;
  }
}

@media (max-width: 1024px) {
  #panel {
    width: 300px;
    min-width: 300px;
  }
  .topbar-titles span { display: none; }
}

@media (max-width: 860px) {
  .topbar-nav { display: none; }
}

@media (max-width: 680px) {
  .panel-toggle-btn { display: flex; }
  #topbar { gap: 12px; padding: 0 12px; }
  .topbar-user-name { display: none; }
  .topbar-lang { display: none; }

  #panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 86%;
    max-width: 360px;
    min-width: 0;
    z-index: 50;
    padding-top: 64px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
  }
  #panel.open {
    transform: translateX(0);
  }
}

.map-controls-row {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
}

.map-3d-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(20, 24, 32, 0.14);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.map-3d-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(20, 24, 32, 0.2); }
.map-3d-btn .btn-icon { width: 15px; height: 15px; }
.map-3d-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.map-round-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(20, 24, 32, 0.14);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.map-round-btn:hover {
  box-shadow: 0 5px 16px rgba(20, 24, 32, 0.2);
  transform: translateY(-1px);
}
.map-round-btn:active {
  transform: scale(0.92);
}
.map-round-btn .icon-sun { display: none; }
/* fasl tugmasi: qishda qor parchasi (havorang), yozda yaproq (yashil) */
#btn-season .icon-winter { display: none; }
#btn-season.winter .icon-winter { display: block; color: #38bdf8; }
#btn-season.winter .icon-summer { display: none; }
#btn-season:not(.winter) .icon-summer { color: #22c55e; }
/* transport harakati tugmasi (icons/traffic-car.png): yoniq - oq fonda qora
   mashina, ko'k hoshiya; o'chiq - xira kulrang mashina, ustidan qizil chiziq */
#btn-traffic {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: hidden;
}
#btn-traffic img {
  display: block;
  width: 34px;
  height: auto;
  pointer-events: none;
  filter: grayscale(1) opacity(0.45);
  transition: filter 0.2s, transform 0.2s;
}
:root[data-theme="dark"] #btn-traffic:not(.on) img { filter: grayscale(1) invert(0.88) opacity(0.5); }
#btn-traffic:not(.on)::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: #e5484d;
  transform: rotate(-35deg);
}
#btn-traffic.on,
:root[data-theme="dark"] #btn-traffic.on {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
#btn-traffic.on img { filter: none; }
#btn-traffic.on:hover img { transform: translateX(1px); }
.map-round-btn.active .icon-moon { display: none; }
.map-round-btn.active .icon-sun { display: block; color: #fbbf24; }
:root[data-theme="dark"] .map-3d-btn:not(.active),
:root[data-theme="dark"] .map-round-btn:not(.active) {
  border-color: rgba(255, 255, 255, 0.08);
}
/* Metro xaritasi tugmasi: o'chiq - kulrang ikonka, yoniq - qizil
   (Toshkent metropoliteni rangi) va oq fon ustida */
.metro-map-btn {
  width: 40px;
  height: 40px;
  color: #4a4d52;
}
:root[data-theme="dark"] .metro-map-btn { color: #b9c0cc; }
/* poyezd tanasi va relslar - tunnel rangiga qarama-qarshi (kunduzi oq) */
.metro-map-btn .mi { fill: #ffffff; }
.metro-map-btn .mis { stroke: #ffffff; }
:root[data-theme="dark"] .metro-map-btn:not(.active) .mi { fill: #1b2130; }
:root[data-theme="dark"] .metro-map-btn:not(.active) .mis { stroke: #1b2130; }
.metro-map-btn.active,
:root[data-theme="dark"] .metro-map-btn.active {
  color: #d71920;
  background: #ffffff;
  border-color: rgba(215, 25, 32, 0.55);
  box-shadow: 0 4px 14px rgba(215, 25, 32, 0.35);
}

.nearby-wrap {
  position: relative;
}
.nearby-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--panel-bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 10px;
  z-index: 1000;
}
.nearby-panel.hidden { display: none; }
.nearby-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.nearby-categories.hidden { display: none; }
.nearby-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.nearby-cat-btn:hover { background: var(--accent-soft); }
.nearby-cat-btn:active { transform: scale(0.95); }
.nearby-cat-btn .nearby-cat-ico {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nearby-results {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.nearby-results.hidden { display: none; }
.nearby-results-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px 8px;
}
.nearby-results-back:hover { color: var(--text); }
.nearby-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.nearby-result-item:hover { background: var(--accent-soft); }
.nearby-result-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nearby-result-dist {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}
.nearby-empty {
  padding: 14px 6px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.buildings-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(28, 32, 39, 0.82);
  color: #fff;
  font-size: 12.5px;
  pointer-events: none;
}
.buildings-hint.hidden { display: none; }

/* Yandex Maps uslubida - yorliqlar qattiq "quti" fonisiz, to'g'ridan-to'g'ri
   xarita ustida, atrofida oq "halo" (kontur) bilan o'qiladigan qilib
   chiziladi. Bu ancha yengil, "toza" va zamonaviy ko'rinish beradi. */
/* bino nomi/raqami yorliqlari - binoning tomiga "yopishgan" (app.js:
   positionBuildingLabels har kadrda joyini beradi) */
.blabel-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* bino orqasida qolgan ko'cha sathidagi belgi (tupik, bekat, metro...) */
.maplibregl-marker.label-occluded,
.maplibregl-marker.label-yield {
  visibility: hidden;
}
.blabel {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transition: opacity 0.18s ease;
}
.housenumber-label {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: #44403c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
  pointer-events: none;
  user-select: none;
}

.object-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 200px;
  pointer-events: none;
  user-select: none;
}
.object-label-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, 0.35);
  font-size: 9.5px;
  line-height: 1;
  flex-shrink: 0;
}
/* Brend belgisi - qisqa nomli "pill" (KFC, NBU, SQB, CH₄ ...) */
.object-label-icon.brand-pill {
  width: auto;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 9px;
  box-sizing: border-box;
}
.brand-pill-txt {
  font: 800 8.5px/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
/* Logotip uslubidagi brend belgilari (Feed Up, LOOOK, Axmad Oltin Jo'ja,
   Apexbank, Food City) - kattaroq, logotip ranglari va shakli bilan */
.object-label-icon.brand-logo {
  height: 19px;
  padding: 0 5px;
  gap: 2px;
  border-radius: 6px;
  white-space: nowrap;
}
.brand-logo .bb-feed { font: 900 10px/1 "Segoe UI", Arial, sans-serif; color: #ffc928; letter-spacing: -0.02em; }
.brand-logo .bb-up {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ee2524;
  color: #fff;
  font: 900 8px/1 "Segoe UI", Arial, sans-serif;
}
.brand-logo .bb-look { font: italic 900 10px/1 "Segoe UI", Arial, sans-serif; color: #ffd21a; letter-spacing: 0.01em; }
.brand-logo .bb-axmad-box { width: 7px; height: 9px; background: #ffd21a; border-radius: 1px; }
.brand-logo .bb-axmad { font: 900 9.5px/1 "Segoe UI", Arial, sans-serif; color: #101418; letter-spacing: 0.03em; }
.brand-logo .bb-apex { font: 800 9.5px/1 "Segoe UI", Arial, sans-serif; color: #141414; letter-spacing: 0.04em; }
.brand-logo .bb-apex-mark { width: 10px; height: 10px; }
.brand-logo .bb-fc-mark { width: 13px; height: 10px; }
.brand-logo .bb-fc { font: 900 8.5px/1 "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.01em; }
/* oq fonli logotiplar (Beeline, Ucell, Uztelecom, Uzmobile, Apex, Uzpost) -
   kechasi ham xarita fonidan ajralib tursin */
.object-label-icon.brand-logo[style*="#ffffff"] { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.35); }
.brand-logo .bb-mark { width: 13px; height: 13px; flex: none; }
.brand-logo svg[viewBox="0 0 22 14"].bb-mark { width: 17px; height: 11px; }
.brand-logo .bb-light { font: 900 9px/1 "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.02em; }
.brand-logo .bb-dark { font: 900 9.5px/1 "Segoe UI", Arial, sans-serif; color: #111; }
.brand-logo .bb-uzum { font: 800 9.5px/1 "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.01em; }
.brand-logo .bb-ucell { font: 800 10px/1 "Segoe UI", Arial, sans-serif; color: #6a2c91; }
.brand-logo .bb-uzmob { font: 900 8.5px/1 "Segoe UI", Arial, sans-serif; color: #1ba1e2; letter-spacing: 0.02em; }
.brand-logo .bb-uztel { font: 900 8px/1 "Segoe UI", Arial, sans-serif; color: #3d6596; letter-spacing: 0.02em; }
.brand-logo .bb-uzpost { font: italic 900 9px/1 "Segoe UI", Arial, sans-serif; color: #1b3f99; }
.brand-logo .bb-iiv { font: 900 9px/1 Georgia, "Times New Roman", serif; color: #e2b93b; letter-spacing: 0.06em; }
.brand-logo .bb-vip-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border: 1.3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  color: #fff;
  font: 800 6px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: -0.06em;
}
.brand-logo .bb-vip { font: 900 8.5px/1 "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.04em; }
.brand-logo .bb-zor { font: 900 10px/1 "Segoe UI", Arial, sans-serif; color: #ffc21a; letter-spacing: -0.02em; }
.brand-logo .bb-zor-tv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border: 1.4px solid #ffc21a;
  border-radius: 50%;
  box-sizing: border-box;
  color: #ffc21a;
  font: 800 5.5px/1 "Segoe UI", Arial, sans-serif;
}
.brand-logo .bb-my {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e30613;
  color: #fff;
  font: 900 6.5px/1 "Segoe UI", Arial, sans-serif;
}
.brand-logo .bb-five { font: 900 12px/1 "Segoe UI", Arial, sans-serif; color: #fff; text-shadow: 0 0 1px rgba(0, 0, 0, 0.25); }
/* banklar */
.brand-logo .bb-xalq { font: 700 10px/1 Georgia, "Times New Roman", serif; color: #0b5a5c; letter-spacing: -0.01em; }
.brand-logo .bb-agro { font: 900 9px/1 Georgia, "Times New Roman", serif; color: #1fba55; letter-spacing: 0.02em; }
.brand-logo .bb-tbc { font: 900 8.5px/1 "Segoe UI", Arial, sans-serif; color: #120f2d; letter-spacing: 0.04em; }
.brand-logo .bb-ofb { font: 700 10.5px/1 Georgia, "Times New Roman", serif; color: #404b74; letter-spacing: 0.02em; }
.brand-logo .bb-sqb { font: 900 10px/1 "Segoe UI", Arial, sans-serif; color: #00355f; letter-spacing: 0.02em; }
.brand-logo .bb-turon {
  font: 700 9.5px/1 Georgia, "Times New Roman", serif;
  color: #033a73;
  padding-bottom: 1px;
  border-bottom: 1px solid #033a73;
}
.brand-logo .bb-kapital { font: 900 8px/1 "Segoe UI", Arial, sans-serif; color: #222; letter-spacing: 0.03em; }
.brand-logo .bb-asaka { font-size: 9.5px; font-weight: 800; letter-spacing: 0; }
/* supermarketlar */
.brand-logo .bb-havas { font: 900 9.5px/1 "Arial Black", "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.04em; }
.object-label-icon.brand-logo[style*="#356b2f"] { box-shadow: 0 0 0 1.5px #ffe000, 0 0 0 2.8px #e8601c, 0 1px 4px rgba(0, 0, 0, 0.4); }
.brand-logo .bb-makro { display: inline-flex; flex-direction: column; line-height: 1; margin-left: 1px; }
.brand-logo .bb-makro b { font: 900 10px/0.95 "Segoe UI", Arial, sans-serif; color: #e31e24; letter-spacing: -0.01em; }
.brand-logo .bb-makro i { font: 800 5.6px/1 "Segoe UI", Arial, sans-serif; color: #3c3486; font-style: normal; }
.brand-logo .bb-olma { font: 900 11.5px/1 "Segoe UI", Arial, sans-serif; color: #ef3e33; letter-spacing: -0.02em; display: inline-flex; align-items: flex-end; }
.brand-logo .bb-olma-o { position: relative; display: inline-block; }
.brand-logo .bb-olma-o svg { position: absolute; left: 1px; top: -4px; width: 6px; height: 5px; }
.brand-logo .bb-universal { font: 800 9.5px/1 "Segoe UI", Arial, sans-serif; color: #0f2a4d; letter-spacing: -0.01em; }
/* dorixona tarmoqlari */
/* OXY: yozuv ustidan o'tgan ko'k yoy (asl logotipdagidek) */
.brand-logo .bb-oxy {
  font: 900 10px/1 "Arial Black", "Segoe UI", Arial, sans-serif;
  color: #21409a;
  letter-spacing: -0.03em;
  padding: 3px 3px 0;
  border-top: 1.7px solid #21409a;
  border-left: 1.7px solid #21409a;
  border-right: 1.7px solid #21409a;
  border-radius: 50% 50% 0 0 / 90% 90% 0 0;
  margin-top: 2px;
}
.brand-logo .bb-oxy-med { font: 900 8px/1 "Segoe UI", Arial, sans-serif; color: #e11d24; margin-left: 1px; align-self: flex-end; margin-bottom: 2px; }
.brand-logo .bb-grand { font: 600 8.5px/1 "Segoe UI", Arial, sans-serif; color: #1e4fa3; letter-spacing: 0.05em; }
.brand-logo .bb-shams { display: inline-flex; flex-direction: column; line-height: 1; }
.brand-logo .bb-shams b { font: 900 8px/1 "Segoe UI", Arial, sans-serif; color: #1d3f94; letter-spacing: 0.02em; }
.brand-logo .bb-shams i { font: 900 5.5px/1 "Segoe UI", Arial, sans-serif; color: #d92b2b; font-style: normal; letter-spacing: 0.02em; }
/* Max Way - binafsha fonda sariq qo'lyozma yozuv + oq "#FAST FOOD" */
.brand-logo .bb-maxway {
  font: italic 700 11.5px/1 "Segoe Script", "Segoe Print", "Brush Script MT", cursive;
  color: #f7b52a;
  letter-spacing: -0.02em;
  text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.25);
}
.brand-logo .bb-maxway-ff { font: 900 5.5px/1 "Segoe UI", Arial, sans-serif; color: #fff; letter-spacing: 0.04em; margin-left: 1px; align-self: flex-end; margin-bottom: 4px; }
/* kuryer xizmatlari va oshxonalar */
.brand-logo .bb-bts { font: italic 900 11px/1 "Arial Black", "Segoe UI", Arial, sans-serif; color: #ec6922; letter-spacing: -0.03em; }
.brand-logo .bb-emu {
  font: 800 10.5px/1 "Segoe UI", Arial, sans-serif;
  color: #8a3795;
  letter-spacing: 0.04em;
  padding-bottom: 1px;
  border-bottom: 1.5px solid #ec7a1f;
}
.brand-logo .bb-leaf { width: 8px; height: 13px; margin-right: -1px; }
.brand-logo .bb-nomdor { font: 700 10px/1 "Segoe Print", "Comic Sans MS", "Segoe UI", sans-serif; color: #6b2a86; letter-spacing: 0.02em; }
/* logotipli brend yorlig'i eshik/kirish belgilari ostida qolib ketmasin */
.object-label:has(.brand-logo) { z-index: 2; }
/* to'q rangli brend nomlari kechasi och rangda (--nc) */
:root[data-theme="dark"] .object-label-text[style*="--nc"] { color: var(--nc) !important; }
.object-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
  color: #292524;
  text-shadow:
    -1.5px 0 2px #fff, 1.5px 0 2px #fff, 0 -1.5px 2px #fff, 0 1.5px 2px #fff,
    -1px -1px 2px #fff, 1px -1px 2px #fff, -1px 1px 2px #fff, 1px 1px 2px #fff;
}

/* Kecha rejimida qora fonda oq "halo" o'qilmaydi - shu uchun yorliqlar
   qorong'i xaritaga mos ravishda teskarilanadi. */
:root[data-theme="dark"] .housenumber-label {
  background: rgba(28, 30, 38, 0.92);
  color: #e5e6ea;
  border-color: rgba(255, 255, 255, 0.14);
}
:root[data-theme="dark"] .object-label-text {
  text-shadow:
    -1.5px 0 2px #12141a, 1.5px 0 2px #12141a, 0 -1.5px 2px #12141a, 0 1.5px 2px #12141a,
    -1px -1px 2px #12141a, 1px -1px 2px #12141a, -1px 1px 2px #12141a, 1px 1px 2px #12141a;
}
:root[data-theme="dark"] .object-label-text:not([style]) {
  color: #eceef3;
}

/* Tupik (davomi yo'q) ko'cha belgisi - "yo'l shu yerda tugaydi" degan
   xalqaro yo'l belgisiga o'xshash sariq nishoncha ustida "T" belgisi, yoniga
   esa (ko'cha nomi bo'lsa - nomi bilan) doim ko'rinadigan yorliq. */
.deadend-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  user-select: none;
}
.deadend-pin-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, 0.35);
}
.deadend-pin-label {
  background: rgba(255, 255, 255, 0.92);
  color: #44403c;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
:root[data-theme="dark"] .deadend-pin-icon {
  box-shadow: 0 0 0 2px #101218, 0 1px 3px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .deadend-pin-label {
  background: rgba(28, 30, 38, 0.92);
  color: #e5e6ea;
  border-color: rgba(255, 255, 255, 0.14);
}


/* Avtobus bekati belgisi - xalqaro yo'l belgisiga o'xshab (ko'k to'rtburchak
   + ichida oq panel + qora avtobus siluveti) chizilgan, portret nisbatda
   (haqiqiy yo'l belgisi kabi). Yaqinlashtirib qaralganda ham aniq va
   yaqqol ko'rinishi uchun soyasi va oq halqasi kuchliroq qilingan. */
.busstop-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 26px;
  padding: 2.5px;
  border-radius: 5px;
  background: #0b57d0;
  box-shadow: 0 0 0 1.4px #fff, 0 2px 6px rgba(0, 0, 0, 0.45);
}
.busstop-sign-panel {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
:root[data-theme="dark"] .busstop-sign {
  box-shadow: 0 0 0 1.4px #101218, 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Metro bekati belgisi - Toshkent metropoliteni belgisiga o'xshab (rangli
   kvadrat + oq "M" harfi). Rang bekat qaysi liniyaga tegishli ekanini
   bildiradi (qizil/ko'k/yashil liniya). */
.metro-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #d81f26;
  box-shadow: 0 0 0 1.6px #fff, 0 2px 7px rgba(0, 0, 0, 0.5);
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  line-height: 1;
}
:root[data-theme="dark"] .metro-sign {
  box-shadow: 0 0 0 1.6px #101218, 0 2px 8px rgba(0, 0, 0, 0.65);
}
/* O'tish bekati - ulangan liniyaning rangli doirachasi (sxemadagi ikki halqa) */
.metro-sign { position: relative; }
.metro-transfer {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, 0.45);
}
/* metro kirish ustunidagidek: pushti-qizil "M" (ichida oq hoshiya) va ko'k
   polosada oq katta harfli bekat nomi; liniya rangi - chap chetdagi chiziq */
.metro-sign {
  background: linear-gradient(180deg, #f0284f, #d6123f) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 0 1.5px #fff, 0 2px 7px rgba(0, 0, 0, 0.5) !important;
}
.metro-sign-m {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1.2px solid rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  box-sizing: border-box;
}
.metro-sign-m svg { width: 13px; height: 13px; }
.metro-sign-label {
  background: linear-gradient(180deg, #2aa3e0, #1580c8);
  color: #fff;
  font: 800 10.5px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
:root[data-theme="dark"] .metro-sign-label {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Ustuvorlik yo'l belgilari (STOP / Yo'l bering) - chorraxa oldida
   haqiqiy OSM belgisi turgan nuqtada, xalqaro yo'l belgisiga o'xshab. */
.sign-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
}

.crossing-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
}
/* Tungi (to'q navy) fonda oq chegara o'zi yetarli kontrast bermaydi -
   shu sabab kechasi belgi atrofiga yumshoq oq "halo" qo'shiladi; kunduzi
   (och fon) esa unga hojat yo'q, oddiy soya yetarli. */
:root[data-theme="dark"] .crossing-pin {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
:root[data-theme="light"] .crossing-pin {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

/* Bino kirish yo'lagi (podъezd/eshik) belgisi - yaqin zoomda, "3D"
   tugmasidan mustaqil ravishda 2D'da ham chiqadi. */
.entrance-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 17px;
  flex-shrink: 0;
  filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  user-select: none;
}
/* Asosiy bo'lmagan (xizmat, chiqish va h.k.) kirishlar biroz xiraroq -
   shunda haqiqiy bosh kirish birinchi ko'zga tashlanadi. */
.entrance-pin--secondary {
  opacity: 0.68;
  transform: scale(0.88);
}
:root[data-theme="dark"] .entrance-pin {
  filter: drop-shadow(0 0 2.5px rgba(255, 255, 255, 0.5)) drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.65));
}
:root[data-theme="light"] .entrance-pin {
  filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.4));
}

/* Butun mamlakat ko'rinishidagi viloyat nomlari - "atlas" uslubida, keng
   harf oralig'i bilan, xarita to'g'ridan-to'g'ri ustida (quti/fonsiz). */
.region-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #3949ab;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  text-shadow:
    -2px 0 3px #fff, 2px 0 3px #fff, 0 -2px 3px #fff, 0 2px 3px #fff,
    -1.5px -1.5px 3px #fff, 1.5px -1.5px 3px #fff, -1.5px 1.5px 3px #fff, 1.5px 1.5px 3px #fff,
    0 0 5px #fff;
}
:root[data-theme="dark"] .region-label {
  color: #93a5fd;
  text-shadow:
    -2px 0 3px #101218, 2px 0 3px #101218, 0 -2px 3px #101218, 0 2px 3px #101218,
    -1.5px -1.5px 3px #101218, 1.5px -1.5px 3px #101218, -1.5px 1.5px 3px #101218, 1.5px 1.5px 3px #101218,
    0 0 5px #101218;
}

/* Tuman nomlari xaritada - chap paneldagi raqamli ro'yxat bilan bir xil
   nishoncha (badge), panel <-> xarita orasida aniq vizual bog'liqlik
   yaratadi. Nishoncha - indigo gradient, oq halqa va soya bilan; matn -
   qalin, oq halo bilan, to'g'ridan-to'g'ri xarita ustida. */
.district-map-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  user-select: none;
}
.district-map-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(67, 56, 202, 0.55);
}
.district-map-text {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #2f2a25;
  white-space: nowrap;
  text-shadow:
    -2px 0 3px #fff, 2px 0 3px #fff, 0 -2px 3px #fff, 0 2px 3px #fff,
    -1.5px -1.5px 3px #fff, 1.5px -1.5px 3px #fff, -1.5px 1.5px 3px #fff, 1.5px 1.5px 3px #fff,
    0 0 5px #fff;
}
:root[data-theme="dark"] .district-map-badge {
  box-shadow: 0 0 0 2.5px #101218, 0 2px 8px rgba(129, 140, 248, 0.6);
}
:root[data-theme="dark"] .district-map-text {
  color: #f1efec;
  text-shadow:
    -2px 0 3px #101218, 2px 0 3px #101218, 0 -2px 3px #101218, 0 2px 3px #101218,
    -1.5px -1.5px 3px #101218, 1.5px -1.5px 3px #101218, -1.5px 1.5px 3px #101218, 1.5px 1.5px 3px #101218,
    0 0 5px #101218;
}

/* Ko'cha nomi yorliqlari - rastr plitka o'rnini bosuvchi vektor yo'l
   qatlamida matn bo'lmagani uchun, ko'cha chizig'iga mos burchak bilan
   (JS orqali) aylantirilgan holda chiqariladi. */
.road-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #33302c;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  text-shadow:
    -2px 0 2.5px #fff, 2px 0 2.5px #fff, 0 -2px 2.5px #fff, 0 2px 2.5px #fff,
    -1.5px -1.5px 2.5px #fff, 1.5px -1.5px 2.5px #fff, -1.5px 1.5px 2.5px #fff, 1.5px 1.5px 2.5px #fff,
    0 0 4px #fff;
}
:root[data-theme="dark"] .road-label {
  color: #f1efec;
  text-shadow:
    -2px 0 2.5px #12141a, 2px 0 2.5px #12141a, 0 -2px 2.5px #12141a, 0 2px 2.5px #12141a,
    -1.5px -1.5px 2.5px #12141a, 1.5px -1.5px 2.5px #12141a, -1.5px 1.5px 2.5px #12141a, 1.5px 1.5px 2.5px #12141a,
    0 0 4px #12141a;
}

h1 {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.block:last-child { border-bottom: none; }

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg-soft);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel-bg);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
input[type="text"]::placeholder {
  color: var(--muted);
  opacity: 0.62;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.coord-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.coord-row input[type="text"] {
  margin-bottom: 0;
}

.coord-btn-row {
  display: flex;
  gap: 8px;
}
.coord-icon-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.coord-icon-btn:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }
.coord-icon-btn:active { transform: translateY(0); }
.coord-icon-btn.primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}
.coord-icon-btn.primary:hover { filter: brightness(1.08); box-shadow: 0 5px 14px rgba(79, 70, 229, 0.4); }
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.my-location-btn {
  width: 100%;
  margin-top: 8px;
}
.my-location-btn.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.autocomplete { position: relative; }

.suggestions {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  right: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.suggestions.hidden { display: none; }

.suggestion-item {
  padding: 9px 11px;
  cursor: pointer;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--accent-soft); }
.suggestion-item .sub { color: var(--muted); font-size: 12px; }

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn {
  flex: 1;
  padding: 10px 10px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 5px 14px rgba(79, 70, 229, 0.4); }

.active-place {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.active-place.hidden { display: none; }
.active-place button {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.district-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.district-list.hidden { display: none; }

.region-dropdown {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  right: 0;
  margin-top: 0;
  padding: 6px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 1000;
}
.region-dropdown.hidden { display: none; }

.district-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.district-item:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }
.district-item.active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .district-item.active {
    background: #3f1d1d;
    border-color: #dc2626;
    color: #fca5a5;
  }
}
:root[data-theme="dark"] .district-item.active {
  background: #3f1d1d;
  border-color: #dc2626;
  color: #fca5a5;
}

.district-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.district-item.active .district-number {
  background: #dc2626;
}

.btn-clear {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.btn-clear:hover { background: var(--bg); color: var(--text); }
.btn-clear.hidden { display: none; }

.mahalla-section {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.mahalla-section.hidden { display: none; }

.mahalla-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
}
.mahalla-list.region-dropdown {
  margin-top: 0;
}

.mahalla-item {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.mahalla-item:hover { background: var(--bg); }
.mahalla-item.active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .mahalla-item.active {
    background: #3f1d1d;
    border-color: #dc2626;
    color: #fca5a5;
  }
}
:root[data-theme="dark"] .mahalla-item.active {
  background: #3f1d1d;
  border-color: #dc2626;
  color: #fca5a5;
}
.mahalla-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.mahalla-item.active .mahalla-number {
  background: #dc2626;
}
.mahalla-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.status {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
}
.status.hidden { display: none; }
.status.ok { color: #16a34a; }
.status.err { color: var(--danger); }

.candidates {
  margin-top: 8px;
}
.candidates.hidden { display: none; }
.candidate-item {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.candidate-item:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }

.count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.saved-item {
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  background: var(--panel-bg);
  box-shadow: var(--card-shadow);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.saved-item:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }
.saved-item .info { flex: 1; }
.saved-item .title { font-weight: 600; }
.saved-item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.saved-item .del {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}

.empty-hint {
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 2px;
}

/* MapLibre'ning standart zoom/kompas boshqaruvini ham umumiy uslubga
   moslashtirish - yumaloqroq burchak, soyali, xira oyna (blur) fon. */
.maplibregl-ctrl-top-left { top: 14px; left: 14px; }
.maplibregl-ctrl-group {
  border-radius: var(--radius) !important;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel-bg) 88%, transparent) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px rgba(20, 24, 32, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
:root[data-theme="dark"] .maplibregl-ctrl-group {
  border-color: rgba(255, 255, 255, 0.08);
}
.maplibregl-ctrl-group button {
  width: 32px !important;
  height: 32px !important;
}
.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--border) !important;
}
:root[data-theme="dark"] .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.6);
}

.maplibregl-popup-content {
  font-size: 13px;
  background: var(--panel-bg);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(20, 24, 40, 0.28);
  padding: 14px !important;
  border: 1px solid var(--border);
}
.maplibregl-popup-tip {
  border-top-color: var(--panel-bg) !important;
  border-bottom-color: var(--panel-bg) !important;
  border-left-color: var(--panel-bg) !important;
  border-right-color: var(--panel-bg) !important;
}
.maplibregl-popup-close-button {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  padding: 4px 8px;
  transition: color 0.15s;
}
.maplibregl-popup-close-button:hover {
  background: transparent;
  color: var(--danger);
}

.detail-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-popup-header b {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.detail-popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    0 4px 12px rgba(34, 211, 238, 0.28);
}
.detail-popup-icon svg {
  width: 14px;
  height: 14px;
}

/* Popup umumiy balandligi hech qachon xarita ko'rinishidan oshib
   ketmasligi kerak - sarlavha va "Saqlash" tugmasi doim ko'rinib turadi,
   ma'lumot qatorlari (masalan 9 ta kirish yo'lagi) esa o'rtada aylantirib
   (scroll) ko'riladi. */
.detail-popup {
  display: flex;
  flex-direction: column;
  max-height: min(62vh, 440px);
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(46vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.detail-rows::-webkit-scrollbar { width: 6px; }
.detail-rows::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}
.detail-rows::-webkit-scrollbar-track { background: transparent; }
.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
/* Kirish yo'laklari ro'yxati - bitta to'plam bo'lib ko'rinishi uchun
   chapdan nozik urg'u chizig'i va biroz ichkariroq. */
.detail-row--entrance {
  padding-left: 8px;
  border-left: 2px solid var(--accent-soft);
}
.detail-row--entrance .detail-row-icon {
  background: var(--accent);
  color: #fff;
}
.detail-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}
.detail-row-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.detail-label {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detail-value {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.popup-save-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
  transition: filter 0.15s, box-shadow 0.15s, transform 0.15s;
}
.popup-save-btn:hover { filter: brightness(1.08); box-shadow: 0 5px 14px rgba(79, 70, 229, 0.4); }
.popup-save-btn:active { transform: translateY(1px); }

/* Svetaforlar endi faqat 3D model sifatida chiziladi (city3d.js) - tekis
   SVG ikonka va "namuna" sanagich yorlig'i uslublari olib tashlangan. */

/* Harakatlanayotgan mashina kartochkasi (mashina ustida, u bilan yuradi) */
.vehicle-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 236px;
  padding: 12px 14px 11px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(20, 30, 54, 0.9), rgba(10, 16, 32, 0.92));
  backdrop-filter: blur(10px) saturate(1.3);
  color: #eaf1ff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.18);
  font-size: 12px;
  pointer-events: auto;
  will-change: transform;
  animation: vehicle-card-in 0.18s ease-out;
}
.vehicle-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(10, 16, 32, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
@keyframes vehicle-card-in {
  from { opacity: 0; margin-top: 6px; }
  to { opacity: 1; margin-top: 0; }
}
.vehicle-card-close {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #b9c7e4;
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}
.vehicle-card-close:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
/* mashina surati "sahna"da: tagida yorug' dog' (podium), orqasida rangli nur */
.vehicle-card-stage {
  position: relative;
  height: 112px;
  margin: 2px -4px 8px;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 26% at 50% 84%, rgba(150, 190, 255, 0.34), transparent 72%),
    radial-gradient(ellipse 70% 70% at 50% 35%, rgba(59, 130, 246, 0.26), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.vehicle-card-stage.police {
  background:
    radial-gradient(ellipse 60% 26% at 50% 84%, rgba(150, 190, 255, 0.3), transparent 72%),
    radial-gradient(ellipse 45% 60% at 25% 35%, rgba(220, 38, 38, 0.3), transparent 70%),
    radial-gradient(ellipse 45% 60% at 75% 35%, rgba(37, 99, 235, 0.35), transparent 70%);
}
.vehicle-card-stage.bus {
  background:
    radial-gradient(ellipse 60% 26% at 50% 84%, rgba(170, 255, 190, 0.28), transparent 72%),
    radial-gradient(ellipse 70% 70% at 50% 35%, rgba(34, 197, 94, 0.24), transparent 70%);
}
.vehicle-card-stage::after {
  /* shisha yaltirashi */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: vehicle-stage-sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes vehicle-stage-sheen { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }
.vehicle-card-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 196px;
  height: auto;
  transform: translate(-50%, -48%);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
  animation: vehicle-img-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.2);
  user-select: none;
}
@keyframes vehicle-img-in { from { opacity: 0; transform: translate(-42%, -48%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -48%) scale(1); } }
.vehicle-card-head { display: flex; align-items: center; gap: 10px; padding-right: 20px; }
.vehicle-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 19px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}
.vehicle-card-icon.bus { background: linear-gradient(135deg, #16a34a, #84cc16); box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3); }
.vehicle-card-icon.police { background: linear-gradient(135deg, #1d4ed8, #dc2626); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); }
.vehicle-card-title { min-width: 0; }
.vehicle-card-name { font-weight: 800; font-size: 14px; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-card-road { color: #8ea3c8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-card-speed { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.vehicle-card-kmh b {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #9ec5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vehicle-card-kmh span { margin-left: 5px; color: #8ea3c8; font-weight: 600; }
/* tezlik cheklovi belgisi (oq doira, qizil hoshiya) */
.vehicle-card-limit {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid #e11d2a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.vehicle-card-limit span { color: #111; font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; }
.vehicle-card-bar { height: 5px; margin-top: 9px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.vehicle-card-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #22c55e, #4ade80); transition: width 0.25s; }
.vehicle-card-bar i.near { background: linear-gradient(90deg, #22c55e, #facc15); }
.vehicle-card-bar i.over { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.vehicle-card-state { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #cfe0ff; font-weight: 600; }
.vehicle-card-blink { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.vehicle-card-blink.st-red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.vehicle-card-blink.st-yield,
.vehicle-card-blink.st-busy,
.vehicle-card-blink.st-queue { background: #facc15; box-shadow: 0 0 8px #facc15; }
/* burilish chirog'i - sariq miltillovchi strelka */
.vehicle-card-blink.left,
.vehicle-card-blink.right {
  width: 0;
  height: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 0 4px #fbbf24);
  animation: vehicle-blink 0.69s steps(1) infinite;
}
.vehicle-card-blink.left { border-right: 9px solid #fbbf24; }
.vehicle-card-blink.right { border-left: 9px solid #fbbf24; }
@keyframes vehicle-blink { 50% { opacity: 0.15; } }

/* =====================================================================
   "ULTRA" tugmalar: shisha (blur) fon, gradient hoshiya, kursor ustida
   aylanuvchi kamalak halqa va yorug'lik nuri o'tishi, faol holatda o'z
   rangida porlash. Barcha mavjud holat sinflari (.active, .on, .winter)
   saqlangan - faqat ko'rinish. ":root:root" - eski mavzu qoidalaridan
   ustun bo'lishi uchun (mavzu atributidan qat'i nazar).
   ===================================================================== */
@property --ua {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
:root,
:root[data-theme="dark"] {
  --u-glass: rgba(13, 21, 42, 0.6);
  --u-glass-hi: rgba(26, 40, 76, 0.78);
  --u-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.3), rgba(129, 160, 255, 0.16) 45%, rgba(255, 255, 255, 0.04));
  --u-grad: linear-gradient(120deg, #6366f1 0%, #3b82f6 30%, #06b6d4 62%, #22d3ee 80%, #6366f1 100%);
  --u-glow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 6px 22px rgba(59, 130, 246, 0.45), 0 0 30px rgba(34, 211, 238, 0.28);
  --u-glow-hi: 0 0 0 1px rgba(129, 140, 248, 0.6), 0 8px 30px rgba(59, 130, 246, 0.62), 0 0 44px rgba(34, 211, 238, 0.4);
  --u-shadow: 0 6px 18px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --u-sheen: rgba(255, 255, 255, 0.34);
}
:root[data-theme="light"] {
  --u-glass: rgba(255, 255, 255, 0.74);
  --u-glass-hi: rgba(255, 255, 255, 0.95);
  --u-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(99, 102, 241, 0.22) 50%, rgba(255, 255, 255, 0.7));
  --u-glow: 0 0 0 1px rgba(99, 102, 241, 0.28), 0 6px 20px rgba(59, 130, 246, 0.32), 0 0 26px rgba(34, 211, 238, 0.2);
  --u-glow-hi: 0 0 0 1px rgba(99, 102, 241, 0.45), 0 8px 26px rgba(59, 130, 246, 0.45), 0 0 36px rgba(34, 211, 238, 0.3);
  --u-shadow: 0 6px 16px rgba(30, 40, 80, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --u-sheen: rgba(255, 255, 255, 0.75);
}
@keyframes u-spin { to { --ua: 360deg; } }
@keyframes u-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes u-sheen {
  0% { transform: translateX(-140%) skewX(-22deg); }
  55%, 100% { transform: translateX(240%) skewX(-22deg); }
}
@keyframes u-pulse {
  0%, 100% { box-shadow: var(--u-glow); }
  50% { box-shadow: var(--u-glow-hi); }
}

/* --- yuqori bo'lim yorliqlari: shisha "yo'lak" ichida, faoli - oqib
   turuvchi gradient pilyula, porlash va vaqti-vaqti bilan nur o'tadi */
:root:root .topbar-nav {
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(var(--u-glass), var(--u-glass)) padding-box, var(--u-edge) border-box;
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: var(--u-shadow);
}
:root:root .topnav-item {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 7px 17px;
  letter-spacing: 0.015em;
  transition: color 0.2s, background 0.25s, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1.4), box-shadow 0.3s;
}
:root:root .topnav-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--u-grad);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}
:root:root .topnav-item:hover { color: var(--text); background: rgba(99, 102, 241, 0.13); transform: translateY(-1px); }
:root:root .topnav-item:hover::after { width: 46%; }
:root:root .topnav-item:active { transform: scale(0.95); }
:root:root .topnav-item.active {
  color: #fff;
  background: var(--u-grad);
  background-size: 220% 100%;
  box-shadow: var(--u-glow);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  animation: u-flow 7s ease-in-out infinite, u-pulse 3.2s ease-in-out infinite;
}
:root:root .topnav-item.active::after { display: none; }
:root:root .topnav-item.active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  transform: translateX(-140%) skewX(-22deg);
  animation: u-sheen 4.2s ease-in-out infinite;
}

/* --- xarita ustidagi tugmalar (doira va "3D" pilyula) hamda yuqori
   paneldagi ikonka tugmalar: shisha + yaltiroq hoshiya */
:root:root .map-round-btn,
:root:root .map-3d-btn,
:root:root .topbar-icon-btn,
:root:root .panel-toggle-btn {
  position: relative;
  isolation: isolate;
  border: 1.5px solid transparent !important;
  background: linear-gradient(var(--u-glass), var(--u-glass)) padding-box, var(--u-edge) border-box;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--u-shadow);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1.45), box-shadow 0.3s, color 0.2s, filter 0.2s;
}
:root:root .map-round-btn,
:root:root .map-3d-btn { overflow: hidden; }
:root:root .map-round-btn { width: 40px; height: 40px; }
:root:root .map-3d-btn { padding: 10px 17px; letter-spacing: 0.02em; }
:root:root .map-controls-row { gap: 10px; }
/* nur: kursor ustiga kelganda bir marta o'tadi */
:root:root .map-round-btn::before,
:root:root .map-3d-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, var(--u-sheen) 50%, transparent 70%);
  transform: translateX(-140%) skewX(-22deg);
}
:root:root .map-round-btn:hover::before,
:root:root .map-3d-btn:hover::before { animation: u-sheen 0.9s ease; }
/* kursor ustida: ko'tariladi, kamalak halqa aylanadi, porlaydi */
:root:root .map-round-btn:hover,
:root:root .map-3d-btn:hover,
:root:root .topbar-icon-btn:hover,
:root:root .panel-toggle-btn:hover {
  transform: translateY(-2px) scale(1.07);
  background: linear-gradient(var(--u-glass-hi), var(--u-glass-hi)) padding-box,
    conic-gradient(from var(--ua), #6366f1, #3b82f6, #06b6d4, #22d3ee, #a855f7, #ec4899, #6366f1) border-box;
  box-shadow: var(--u-glow);
  animation: u-spin 2.6s linear infinite;
}
:root:root .map-round-btn:active,
:root:root .map-3d-btn:active,
:root:root .topbar-icon-btn:active { transform: scale(0.92); transition-duration: 0.1s; }
:root:root .map-round-btn svg,
:root:root .map-3d-btn svg { position: relative; z-index: 1; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1.5), filter 0.3s; }
:root:root .map-round-btn:hover svg { transform: scale(1.12) rotate(-6deg); }

/* faol holatlar - har biri o'z rangida porlaydi (aylanuvchi halqa + puls) */
:root:root .map-3d-btn.active {
  color: #fff;
  background: var(--u-grad) padding-box, conic-gradient(from var(--ua), #c7d2fe, #22d3ee, #a5f3fc, #818cf8, #c7d2fe) border-box;
  background-size: 220% 100%, 100% 100%;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  animation: u-spin 4s linear infinite, u-pulse 3s ease-in-out infinite, u-flow 7s ease-in-out infinite;
}
/* 4K sifat tugmasi: faol - binafsha-oltin gradient (3D dan farqli) */
:root:root .quality-btn.active {
  color: #fff;
  background: linear-gradient(120deg, #7c3aed, #a855f7 35%, #f59e0b 75%, #7c3aed) padding-box,
    conic-gradient(from var(--ua), #fde68a, #c084fc, #fbbf24, #a78bfa, #fde68a) border-box;
  background-size: 220% 100%, 100% 100%;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4), 0 6px 22px rgba(124, 58, 237, 0.45), 0 0 28px rgba(251, 191, 36, 0.3);
  animation: u-spin 4s linear infinite, u-flow 7s ease-in-out infinite;
}
:root:root .quality-btn .q-label { font-weight: 800; letter-spacing: 0.04em; }
:root:root #btn-toggle-night.active {
  background: linear-gradient(var(--u-glass-hi), var(--u-glass-hi)) padding-box, conic-gradient(from var(--ua), #f59e0b, #fde68a, #fbbf24, #fb923c, #f59e0b) border-box;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35), 0 6px 22px rgba(245, 158, 11, 0.4), 0 0 26px rgba(251, 191, 36, 0.3);
  animation: u-spin 5s linear infinite;
}
:root:root #btn-toggle-night.active svg { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9)); }
:root:root #btn-season.winter {
  background: linear-gradient(var(--u-glass-hi), var(--u-glass-hi)) padding-box, conic-gradient(from var(--ua), #38bdf8, #e0f2fe, #22d3ee, #818cf8, #38bdf8) border-box;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 6px 22px rgba(14, 165, 233, 0.38), 0 0 26px rgba(56, 189, 248, 0.28);
  animation: u-spin 5s linear infinite;
}
:root:root #btn-season.winter svg { filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.95)); }
:root:root #btn-season:not(.winter) {
  background: linear-gradient(var(--u-glass-hi), var(--u-glass-hi)) padding-box, conic-gradient(from var(--ua), #22c55e, #bbf7d0, #4ade80, #14b8a6, #22c55e) border-box;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.32), 0 6px 22px rgba(22, 163, 74, 0.34), 0 0 24px rgba(74, 222, 128, 0.25);
  animation: u-spin 5s linear infinite;
}
:root:root #btn-season:not(.winter) svg { filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.9)); }
:root:root .metro-map-btn.active {
  color: #d71920;
  background: linear-gradient(#ffffff, #ffffff) padding-box, conic-gradient(from var(--ua), #d71920, #fca5a5, #ef4444, #fb7185, #d71920) border-box;
  box-shadow: 0 0 0 1px rgba(215, 25, 32, 0.3), 0 6px 22px rgba(215, 25, 32, 0.42), 0 0 26px rgba(248, 113, 113, 0.3);
  animation: u-spin 4.5s linear infinite;
}
:root:root #btn-traffic.on {
  background: linear-gradient(#ffffff, #ffffff) padding-box, conic-gradient(from var(--ua), #2563eb, #93c5fd, #06b6d4, #6366f1, #2563eb) border-box;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3), 0 6px 22px rgba(37, 99, 235, 0.45), 0 0 26px rgba(56, 189, 248, 0.3);
  animation: u-spin 4.5s linear infinite;
}
:root:root #btn-traffic.on:hover img { transform: translateX(2px) scale(1.06); }
:root:root #btn-traffic::after { z-index: 3; box-shadow: 0 0 6px rgba(229, 72, 77, 0.8); }
:root:root .topbar-icon-btn { border-radius: 12px; color: var(--muted); }
:root:root .topbar-icon-btn:hover { color: var(--text); }
:root:root #topbar-theme.is-night svg { filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.85)); }

/* --- MapLibre zoom/kompas guruhi: shisha, yaltiroq hoshiya, tugma ustida porlash */
:root:root .maplibregl-ctrl-group {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--u-glass), var(--u-glass)) padding-box, var(--u-edge) border-box !important;
  backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--u-shadow) !important;
  border-radius: 14px !important;
}
:root:root .maplibregl-ctrl-group button {
  width: 36px !important;
  height: 36px !important;
  transition: background 0.2s, box-shadow 0.2s;
}
:root:root .maplibregl-ctrl-group button:hover {
  background: rgba(99, 102, 241, 0.18) !important;
  box-shadow: inset 0 0 14px rgba(34, 211, 238, 0.35);
}

/* --- paneldagi tugmalar: asosiylari - oqib turuvchi gradient, porlash va
   nur; oddiylari - shisha fon, kursor ustida aylanuvchi gradient hoshiya */
:root:root .btn,
:root:root .coord-icon-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--u-glass), var(--u-glass)) padding-box, var(--u-edge) border-box;
  box-shadow: var(--u-shadow);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1.4), box-shadow 0.3s, filter 0.2s;
}
:root:root .btn::before,
:root:root .coord-icon-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, var(--u-sheen) 50%, transparent 70%);
  transform: translateX(-140%) skewX(-22deg);
}
:root:root .btn:hover::before,
:root:root .coord-icon-btn:hover::before { animation: u-sheen 0.9s ease; }
:root:root .btn:hover,
:root:root .coord-icon-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(var(--u-glass-hi), var(--u-glass-hi)) padding-box,
    conic-gradient(from var(--ua), #6366f1, #3b82f6, #06b6d4, #22d3ee, #a855f7, #6366f1) border-box;
  box-shadow: var(--u-glow);
  animation: u-spin 2.6s linear infinite;
}
:root:root .btn:active,
:root:root .coord-icon-btn:active { transform: scale(0.96); transition-duration: 0.1s; }
:root:root .btn-primary,
:root:root .coord-icon-btn.primary {
  color: #fff;
  background: var(--u-grad);
  background-size: 220% 100%;
  box-shadow: var(--u-glow);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
  animation: u-flow 7s ease-in-out infinite;
}
:root:root .btn-primary:hover,
:root:root .coord-icon-btn.primary:hover {
  background: var(--u-grad);
  background-size: 220% 100%;
  box-shadow: var(--u-glow-hi);
  filter: brightness(1.08);
  animation: u-flow 3s ease-in-out infinite;
}
:root:root .my-location-btn.active {
  color: #fff;
  background: linear-gradient(120deg, #16a34a, #22c55e, #14b8a6) padding-box, linear-gradient(120deg, #bbf7d0, #22c55e) border-box;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4), 0 6px 22px rgba(22, 163, 74, 0.45), 0 0 26px rgba(74, 222, 128, 0.3);
}

/* klaviatura bilan tanlanganda aniq ko'rinadigan halqa */
:root:root .map-round-btn:focus-visible,
:root:root .map-3d-btn:focus-visible,
:root:root .topnav-item:focus-visible,
:root:root .btn:focus-visible,
:root:root .coord-icon-btn:focus-visible,
:root:root .topbar-icon-btn:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}
/* harakatni kamaytirish so'ralgan bo'lsa - animatsiyalar o'chadi */
@media (prefers-reduced-motion: reduce) {
  :root:root .topnav-item,
  :root:root .topnav-item::before,
  :root:root .map-round-btn,
  :root:root .map-3d-btn,
  :root:root .map-round-btn::before,
  :root:root .map-3d-btn::before,
  :root:root .btn,
  :root:root .btn::before,
  :root:root .coord-icon-btn,
  :root:root .coord-icon-btn::before { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Yuqori paneldagi boshqaruv "dok"i (avval xarita ustida edi): shisha
   pilyula, yaltiroq gradient hoshiya, pastida oqib turuvchi nur chizig'i,
   guruhlar orasida ajratgichlar. Tugmalarning o'zi - "ULTRA" uslubida.
   ===================================================================== */
:root:root .topbar-actions { gap: 0; }
:root:root .map-controls-row.topbar-dock {
  position: relative;
  top: auto;
  right: auto;
  z-index: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(var(--u-glass), var(--u-glass)) padding-box, var(--u-edge) border-box;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--u-shadow), 0 0 26px rgba(59, 130, 246, 0.12);
  isolation: isolate;
}
/* pastki qirra bo'ylab sekin oqadigan kamalak nur */
:root:root .topbar-dock::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #22d3ee, #a855f7, #6366f1, transparent);
  background-size: 200% 100%;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.9));
  animation: u-flow 6s linear infinite;
  pointer-events: none;
}
:root:root .topbar-dock .map-round-btn { width: 38px; height: 38px; }
:root:root .topbar-dock .metro-map-btn svg { width: 28px; height: 28px; }
:root:root .topbar-dock #btn-traffic img { width: 32px; }
:root:root .topbar-dock .map-3d-btn { height: 38px; padding: 0 15px; font-size: 13px; }
/* tugma kursor ostida ko'tarilganda dok chegarasidan "chiqib" ko'rinsin */
:root:root .topbar-dock .map-round-btn:hover,
:root:root .topbar-dock .map-3d-btn:hover { transform: translateY(-1px) scale(1.08); z-index: 2; }
.dock-sep {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.55), transparent);
}
/* yaqin joylar paneli - dok ostidan, o'ng chetga tekislangan */
:root:root .topbar-dock .nearby-panel { top: calc(100% + 14px); z-index: 60; }
/* tor ekranlar: brend yozuvi yashirinadi, dok gorizontal suriladi */
@media (max-width: 1180px) {
  :root:root .topbar-dock { gap: 6px; padding: 4px 6px; }
  :root:root .topbar-dock .map-round-btn { width: 34px; height: 34px; }
  :root:root .topbar-dock .map-3d-btn { height: 34px; padding: 0 11px; }
  .dock-sep { display: none; }
}
@media (max-width: 680px) {
  .topbar-titles { display: none; }
  :root:root .topbar-actions { min-width: 0; flex: 1; justify-content: flex-end; }
  :root:root .topbar-dock { gap: 4px; padding: 3px 5px; }
  :root:root .topbar-dock .map-round-btn { width: 31px; height: 31px; }
  :root:root .topbar-dock .metro-map-btn svg { width: 23px; height: 23px; }
  :root:root .topbar-dock #btn-traffic img { width: 26px; }
  :root:root .topbar-dock .map-3d-btn { height: 31px; padding: 0 8px; font-size: 12px; }
  :root:root .topbar-dock .map-3d-btn svg { display: none; }
}

/* ===================== Brend: O'zbekiston xaritasi logosi ===================
   rangli viloyatlar xaritasi (icons/uz-map.svg - scripts/build_uz_logo.cjs)
   shisha plitkada, atrofida bayroq ranglarida aylanib turuvchi hoshiya va
   vaqti-vaqti bilan o'tadigan nur; nom - oqib turuvchi gradient, ostida
   bayroq ranglaridagi yaltiroq chiziq */
:root:root .topbar-brand { gap: 12px; cursor: default; }
:root:root .brand-icon.uz-logo {
  position: relative;
  width: 66px;
  height: 46px;
  padding: 4px 5px;
  border-radius: 15px;
  border: 1.6px solid transparent;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 30% 15%, rgba(255, 255, 255, 0.98), rgba(226, 238, 255, 0.92) 60%, rgba(196, 216, 250, 0.9)) padding-box,
    conic-gradient(from var(--ua), #0099b5, #7dd3fc, #ffffff, #1eb53a, #ce1126, #ffffff, #0099b5) border-box;
  box-shadow: 0 0 0 1px rgba(0, 153, 181, 0.25), 0 6px 20px rgba(37, 99, 235, 0.35), 0 0 26px rgba(30, 181, 58, 0.18);
  animation: u-spin 7s linear infinite, uz-glow 4s ease-in-out infinite;
}
:root[data-theme="dark"] .brand-icon.uz-logo,
:root:not([data-theme="light"]) .brand-icon.uz-logo {
  background: radial-gradient(120% 90% at 30% 15%, rgba(40, 62, 112, 0.95), rgba(16, 28, 58, 0.95) 65%, rgba(8, 14, 32, 0.95)) padding-box,
    conic-gradient(from var(--ua), #0099b5, #7dd3fc, #ffffff, #1eb53a, #ce1126, #ffffff, #0099b5) border-box;
}
:root:root .brand-icon.uz-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(10, 30, 80, 0.35)) saturate(1.12);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.4), filter 0.3s;
}
/* plitka bo'ylab o'tadigan nur */
:root:root .brand-icon.uz-logo::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-140%) skewX(-22deg);
  animation: u-sheen 5.5s ease-in-out infinite 1.2s;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: soft-light;
}
:root:root .topbar-brand:hover .brand-icon.uz-logo img {
  transform: scale(1.1) rotate(-2.5deg);
  filter: drop-shadow(0 4px 6px rgba(10, 30, 80, 0.45)) saturate(1.3);
}
@keyframes uz-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 153, 181, 0.25), 0 6px 20px rgba(37, 99, 235, 0.32), 0 0 22px rgba(30, 181, 58, 0.15); }
  50% { box-shadow: 0 0 0 1px rgba(0, 153, 181, 0.45), 0 8px 26px rgba(37, 99, 235, 0.5), 0 0 34px rgba(34, 211, 238, 0.35); }
}
:root:root .topbar-titles { gap: 5px; line-height: 1.1; }
:root:root .topbar-titles strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  background: linear-gradient(100deg, #0b1f52 0%, #1d4ed8 30%, #0891b2 52%, #1d4ed8 74%, #0b1f52 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: u-flow 7s ease-in-out infinite;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7));
}
:root[data-theme="dark"] .topbar-titles strong,
:root:not([data-theme="light"]) .topbar-titles strong {
  background-image: linear-gradient(100deg, #ffffff 0%, #bae6fd 28%, #67e8f9 50%, #bae6fd 72%, #ffffff 100%);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35));
}
/* bayroq ranglaridagi chiziq: havorang | qizil | oq | qizil | yashil */
:root:root .brand-flag {
  position: relative;
  display: block;
  height: 4px;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(90deg, #0099b5 0 32%, #ce1126 32% 34.5%, #ffffff 34.5% 65.5%, #ce1126 65.5% 68%, #1eb53a 68% 100%);
  box-shadow: 0 0 0 0.5px rgba(15, 40, 90, 0.25), 0 2px 8px rgba(0, 153, 181, 0.35);
}
:root:root .brand-flag::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  transform: translateX(-140%) skewX(-22deg);
  animation: u-sheen 4.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  :root:root .brand-icon.uz-logo,
  :root:root .brand-icon.uz-logo::after,
  :root:root .topbar-titles strong,
  :root:root .brand-flag::after { animation: none; }
}
@media (max-width: 680px) {
  :root:root .brand-icon.uz-logo { width: 54px; height: 38px; padding: 3px 4px; border-radius: 12px; }
}

/* ===================== PPX xodimi (ppx3d.js) ==================================
   tugma (bosilganda - xaritada joy tanlash rejimi), xabar, uzoqdan belgi */
#btn-ppx { position: relative; overflow: visible; }
#btn-ppx img {
  display: block;
  width: 26px;
  height: 26px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(10, 25, 70, 0.4));
  transition: transform 0.2s;
}
:root:root .topbar-dock #btn-ppx img { width: 25px; height: 25px; }
#btn-ppx:hover img { transform: scale(1.1) rotate(-4deg); }
/* xodim ko'rinmoqda - yoqilgan tugma; yashirilgan - kulrang, qizil chiziq */
:root:root #btn-ppx.on {
  background: linear-gradient(#ffffff, #ffffff) padding-box, conic-gradient(from var(--ua, 0deg), #1d4ed8, #93c5fd, #fbbf24, #6366f1, #1d4ed8) border-box;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3), 0 6px 22px rgba(37, 99, 235, 0.4), 0 0 22px rgba(251, 191, 36, 0.25);
}
#btn-ppx.ppx-off img { filter: grayscale(1) opacity(0.5); }
#btn-ppx.ppx-off::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: #e5484d;
  box-shadow: 0 0 6px rgba(229, 72, 77, 0.8);
  transform: rotate(-35deg);
  pointer-events: none;
}
:root:root #btn-ppx.active {
  background: linear-gradient(#ffffff, #ffffff) padding-box, conic-gradient(from var(--ua, 0deg), #1d4ed8, #fbbf24, #1d4ed8, #22d3ee, #1d4ed8) border-box;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 6px 22px rgba(37, 99, 235, 0.55), 0 0 26px rgba(251, 191, 36, 0.45);
  animation: ppx-armed 1.1s ease-in-out infinite;
}
@keyframes ppx-armed {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px) scale(1.06); }
}
.ppx-toast {
  position: fixed;
  left: 50%;
  top: 82px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 18px 10px 12px;
  border-radius: 14px;
  color: #fff;
  font: 600 13.5px/1.4 "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(135deg, rgba(13, 28, 72, 0.96), rgba(37, 70, 160, 0.96));
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 10px 30px rgba(8, 20, 60, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.ppx-toast::before {
  content: "";
  flex: none;
  width: 26px;
  height: 26px;
  background: url(icons/ppx.svg) no-repeat center / contain;
}
.ppx-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ppx-badges { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.ppx-badge {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 28px;
  margin: -34px 0 0 -12px;
  background: url(icons/ppx.svg) no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  will-change: transform;
}
.ppx-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 2px;
  height: 7px;
  margin-left: -1px;
  background: rgba(13, 28, 72, 0.85);
}
.ppx-badge.walking::before {
  content: "";
  position: absolute;
  right: -4px;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22e06b;
  box-shadow: 0 0 0 2px #fff, 0 0 8px #22e06b;
  animation: ppx-dot 1s ease-in-out infinite;
}
@keyframes ppx-dot { 50% { transform: scale(0.7); opacity: 0.7; } }
