/* ═══════════════════════════════════════════════════════════════════════
   Farg'ona viloyati ijtimoiy xaritasi
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #050b18;
  --ink: #eaf1ff;
  --ink-dim: #9fb0cc;
  --ink-faint: #6b7d99;

  --glass: rgba(11, 20, 38, 0.82);
  --glass-soft: rgba(20, 32, 56, 0.6);
  --edge: rgba(120, 160, 220, 0.18);
  --edge-strong: rgba(140, 185, 255, 0.34);

  --accent: #4ea8de;
  --gold: #f2b544;
  --danger: #e2483d;

  --c1: #1f9d55; /* past  */
  --c2: #7cb342;
  --c3: #e5b53a;
  --c4: #ef7d2e;
  --c5: #d92d20; /* yuqori */

  --radius: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --panel-w: 384px;
  --topbar-h: 66px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

#map { position: absolute; inset: 0; z-index: 1; }
#map canvas { outline: none; }

/* ─── Kosmos foni ────────────────────────────────────────────────────── */
/* Xarita tuvali globus tashqarisida shaffof — shu qatlam orqa fon bo'ladi.
   Yulduzlar va Somon yo'li canvas'ga chiziladi (js/app.js — drawSpace). */
.space {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #04050c;
  transition: opacity 1.4s ease;
}
.space.is-out { opacity: 0; }

.space__canvas {
  position: absolute;
  inset: 0;
  display: block;
  /* Sekin siljish — kosmos butunlay qotib qolmasin */
  animation: space-drift 120s ease-in-out infinite alternate;
}
@keyframes space-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.04) translate3d(-1.4%, 0.9%, 0); }
}

/* ─── Kirish ekrani ──────────────────────────────────────────────────── */
.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 36%, #fbfffb 0%, #e4f6e6 38%, #c5e9ca 72%, #a8dcaf 100%);
  transition: opacity 1.1s ease, visibility 1.1s;
}
.intro.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* Fondagi yumshoq yashil doiralar */
.intro__stars {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(circle 220px at 14% 20%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(circle 170px at 82% 16%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(circle 260px at 74% 82%, rgba(122, 190, 133, 0.32), transparent),
    radial-gradient(circle 200px at 20% 80%, rgba(122, 190, 133, 0.26), transparent),
    radial-gradient(circle 150px at 50% 55%, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.9;
  animation: drift 44s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2.5%, 1.5%, 0) scale(1.07); }
}

.intro__body { position: relative; text-align: center; padding: 24px; }

.intro__logo {
  width: min(360px, 74vw);
  height: auto;
  margin-bottom: 26px;
  filter: drop-shadow(0 8px 22px rgba(31, 108, 63, 0.22));
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.intro__title {
  margin: 0;
  font-size: clamp(28px, 5.4vw, 52px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #14532d;
}
.intro__subtitle {
  margin: 6px 0 26px;
  font-size: clamp(12px, 2.2vw, 16px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #2f7d4f;
}
.intro__hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: #4a7a5e;
  min-height: 18px;
}
.intro__bar {
  width: min(280px, 70vw);
  height: 3px;
  margin: 0 auto;
  border-radius: 3px;
  background: rgba(20, 83, 45, 0.14);
  overflow: hidden;
}
.intro__bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4caf50, #1f6c3f);
  transition: width 0.45s ease;
}

/* ─── Yuqori panel ───────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(5, 11, 24, 0.94), rgba(5, 11, 24, 0.55) 70%, transparent);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}
.topbar.is-in { opacity: 1; transform: none; pointer-events: auto; }

.topbar__brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Logotip to'q fonda o'qilishi uchun oq maydonchada turadi */
.topbar__mark {
  display: flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.topbar__mark img { display: block; height: 26px; width: auto; }
.topbar__brand strong { display: block; font-size: 15px; letter-spacing: 0.01em; }
.topbar__brand small { display: block; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.16em; text-transform: uppercase; }

.topbar__actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
  color: var(--ink);
  font-size: 12.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.btn:hover { background: rgba(40, 62, 100, 0.72); border-color: var(--edge-strong); }
.btn:active { transform: scale(0.97); }
.btn--ghost span { opacity: 0.75; }

/* ─── Qidiruv ────────────────────────────────────────────────────────── */
.search { position: relative; flex: 1; max-width: 420px; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 168, 222, 0.16);
}
.search__results {
  position: absolute;
  top: 44px; left: 0; right: 0;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: rgba(8, 16, 32, 0.97);
  box-shadow: var(--shadow);
  padding: 5px;
}
.search__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.search__item:hover, .search__item.is-active { background: rgba(78, 168, 222, 0.16); }
.search__item b { font-weight: 600; }
.search__item small { color: var(--ink-faint); font-size: 11.5px; margin-left: auto; }
.search__empty { padding: 12px; text-align: center; color: var(--ink-faint); font-size: 12.5px; }

/* ─── Yon panel ──────────────────────────────────────────────────────── */
.panel {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: 14px;
  bottom: 14px;
  z-index: 35;
  width: var(--panel-w);
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: var(--glass);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.panel.is-in { opacity: 1; transform: none; pointer-events: auto; }
.panel.is-collapsed { transform: translateX(calc(-100% - 18px)); }
.panel.is-collapsed .panel__toggle { transform: rotate(180deg); }

.panel__toggle {
  position: absolute;
  top: 18px; right: -14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--edge-strong);
  background: #12203a;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.35s ease, color 0.18s;
}
.panel__toggle:hover { color: var(--ink); }

.panel__scroll {
  height: 100%;
  overflow-y: auto;
  padding: 20px 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 160, 220, 0.35) transparent;
}
.panel__scroll::-webkit-scrollbar { width: 8px; }
.panel__scroll::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, 0.3); border-radius: 8px; }

.panel__head { margin-bottom: 16px; }
.panel__head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.panel__sub { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-faint); }

.backlink {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s;
}
.backlink:hover { background: rgba(78, 168, 222, 0.14); }
.backlink[hidden] { display: none; }

/* ─── Reyestr ulushi ko'rsatkichi ────────────────────────────────────── */
.gauge {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
  margin-bottom: 14px;
}
.gauge__row { display: flex; align-items: baseline; justify-content: space-between; }
.gauge__label { font-size: 12px; color: var(--ink-dim); }
.gauge__value { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge__track {
  height: 7px;
  margin: 9px 0 7px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5));
  position: relative;
  opacity: 0.42;
}
.gauge__track i {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 13px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge__note { margin: 0; font-size: 11px; color: var(--ink-faint); line-height: 1.4; }

/* ─── Ko'rsatkich kartochkalari ──────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 18px;
}
.stat {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
}
.stat__label { font-size: 11px; color: var(--ink-faint); display: block; margin-bottom: 3px; }
.stat__value {
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat__value small { font-size: 11px; font-weight: 400; color: var(--ink-faint); margin-left: 3px; }

/* ─── Ijtimoiy reyestr tarkibi ───────────────────────────────────────── */
.breakdown {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
  margin-bottom: 18px;
}
.breakdown__head {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.breakdown__bar {
  display: flex;
  height: 8px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 11px;
  background: rgba(255, 255, 255, 0.07);
}
.breakdown__bar i { transition: flex-grow 0.5s ease; }

.breakdown__row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 12.5px;
}
.breakdown__row + .breakdown__row { border-top: 1px solid rgba(120, 160, 220, 0.09); }
.breakdown__dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.breakdown__label { flex: 1; min-width: 0; color: var(--ink-dim); }
.breakdown__num { font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown__pct {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}
.breakdown__empty { font-size: 12px; color: var(--ink-faint); line-height: 1.45; }

/* ─── Ro'yxat ────────────────────────────────────────────────────────── */
.listbox__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--edge);
}
.listbox__head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); }
.listbox__count { font-size: 11.5px; color: var(--ink-faint); }
.listbox__body { display: flex; flex-direction: column; gap: 4px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.row:hover { background: rgba(78, 168, 222, 0.14); border-color: var(--edge); transform: translateX(2px); }
.row.is-active { background: rgba(78, 168, 222, 0.2); border-color: var(--accent); }

.row__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.row__main { min-width: 0; flex: 1; }
.row__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 11px; color: var(--ink-faint); }
.row__rate { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ─── Rang shkalasi ──────────────────────────────────────────────────── */
.legend {
  position: fixed;
  right: 14px;
  bottom: 34px;
  z-index: 35;
  width: 218px;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
  pointer-events: none;
}
.legend.is-in { opacity: 1; transform: none; }
.legend__title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); margin-bottom: 8px; }
.legend__scale { display: flex; height: 9px; border-radius: 5px; overflow: hidden; }
.legend__scale i { flex: 1; }
.legend__ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-faint); margin-top: 5px; }
.legend__marker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--edge);
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-faint);
}
.legend__marker svg { flex-shrink: 0; color: var(--accent); }

/* ─── GPS: joylashuv nuqtasi ─────────────────────────────────────────── */
/* Marker elementi 0×0 — joylashuv aynan koordinataga tushadi */
.geo { position: relative; width: 0; height: 0; }

.geo__inner {
  position: absolute;
  left: -13px;
  top: -13px;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.geo__dot {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #2f80ed;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.geo__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(47, 128, 237, 0.42);
  animation: geo-pulse 2.2s ease-out infinite;
}
@keyframes geo-pulse {
  0%   { transform: scale(0.45); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ─── GPS: ma'lumot kartochkasi ──────────────────────────────────────── */
.geobox {
  position: fixed;
  z-index: 38;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 28px));
  padding: 12px 34px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--edge-strong);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: geobox-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes geobox-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
.geobox__close {
  position: absolute;
  top: 7px;
  right: 9px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.geobox__close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }

.geobox__title { font-size: 11px; color: var(--ink-faint); margin-bottom: 3px; }
.geobox__name { font-size: 15px; font-weight: 650; }
.geobox__meta { font-size: 11.5px; color: var(--ink-dim); margin-top: 3px; }
.geobox__err { font-size: 12.5px; line-height: 1.45; color: #ffb4ad; }
.geobox__wait { font-size: 12.5px; color: var(--ink-dim); }
.geobox__open {
  margin-top: 9px;
  width: 100%;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: rgba(78, 168, 222, 0.16);
  color: var(--ink);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.geobox__open:hover { background: rgba(78, 168, 222, 0.28); }

/* GPS tugmasi yoqilgan holati */
.btn.is-on {
  background: rgba(47, 128, 237, 0.26);
  border-color: #2f80ed;
  color: #cfe4ff;
}
.btn.is-busy svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.attribution {
  position: fixed;
  right: 10px;
  bottom: 6px;
  z-index: 30;
  font-size: 10px;
  color: rgba(190, 210, 240, 0.55);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* ─── Tuman yorliqlari (xarita ustida) ───────────────────────────────── */
/* Marker elementining o'lchami 0 va `transform` xossasi butunlay MapLibre
   ixtiyorida — shuning uchun ko'rinish va animatsiya ichki elementda. */
.dlabel {
  position: relative;
  width: 0;
  height: 0;
  opacity: 1;
  transition: opacity 0.3s;
}
.dlabel.is-hidden { opacity: 0; pointer-events: none; }

.dlabel__inner {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  transform-origin: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 5px;
  user-select: none;
  transition: transform 0.2s;
}
.dlabel__inner:hover { transform: translate(-50%, -50%) scale(1.08); }
.dlabel__inner small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.86;
  font-variant-numeric: tabular-nums;
}
/* ─── MFY antenna markeri ────────────────────────────────────────────── */
.mfy {
  position: relative;
  width: 0;
  height: 0;
  --glow: #4ea8de;
}

/* Ichki quti antenna tagi (17px, 21px) aynan koordinataga tushadigan
   qilib siljitilgan — to'lqinlar ham shu nuqtadan tarqaladi. */
.mfy__inner {
  position: absolute;
  left: -17px;
  top: -21px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  animation: mfy-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes mfy-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.4); }
  to   { opacity: 1; transform: none; }
}

/* to'lqinlar */
.mfy__wave {
  position: absolute;
  left: 50%; top: 62%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 1.5px solid var(--glow);
  opacity: 0;
  animation: mfy-wave 2.8s ease-out infinite;
  pointer-events: none;
}
.mfy__wave:nth-child(2) { animation-delay: 0.93s; }
.mfy__wave:nth-child(3) { animation-delay: 1.86s; }
@keyframes mfy-wave {
  0%   { transform: scale(0.5); opacity: 0.85; }
  70%  { opacity: 0.28; }
  100% { transform: scale(4.6); opacity: 0; }
}

.mfy__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--glow);
  filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
  transition: transform 0.2s ease;
}
.mfy:hover { z-index: 5; }
.mfy:hover .mfy__icon { transform: scale(1.28); }
.mfy.is-active .mfy__icon { transform: scale(1.35); }
.mfy.is-active .mfy__wave { animation-duration: 1.5s; }

/* MFY nomi — antenna tagida, faqat yaqinlashganda ko'rinadi */
.mfy__name {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  font-size: 9.5px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #f2f7ff;
  text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
body.mfy-names .mfy__name { opacity: 1; }

/* Ko'p marker chizilganda to'lqinlar o'chiriladi — brauzer qotib qolmasin */
body.mfy-quiet .mfy__wave { display: none; }
body.mfy-quiet .mfy__icon { transform: scale(0.8); }
body.mfy-quiet .mfy__inner:hover .mfy__icon { transform: scale(1.1); }

.mfy__tip {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(6, 13, 27, 0.94);
  border: 1px solid var(--edge);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.mfy:hover .mfy__tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── MFY kartochkasi (popup) ────────────────────────────────────────── */
.maplibregl-popup-content {
  padding: 0;
  border-radius: 13px;
  background: transparent;
  box-shadow: none;
}
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button {
  right: 6px; top: 4px;
  color: var(--ink-dim);
  font-size: 19px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.maplibregl-popup-close-button:hover { color: #fff; background: transparent; }

.card {
  width: 244px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--edge-strong);
  background: rgba(8, 16, 32, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.card__name { font-size: 14.5px; font-weight: 650; margin: 0 18px 1px 0; }
.card__district { font-size: 11px; color: var(--ink-faint); margin-bottom: 10px; }
.card__rate {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  margin-bottom: 10px;
  font-size: 12px;
}
.card__rate b { font-size: 16px; font-variant-numeric: tabular-nums; margin-left: auto; }
.card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.card__cell {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}
.card__cell span { display: block; font-size: 10px; color: var(--ink-faint); }
.card__cell b { font-size: 14px; font-variant-numeric: tabular-nums; }
.card__split {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--edge);
}
.card__splitrow {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 11.5px;
}
.card__splitrow i {
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
  flex-shrink: 0;
}
.card__splitrow span { flex: 1; color: var(--ink-dim); min-width: 0; }
.card__splitrow b { font-variant-numeric: tabular-nums; }

.card__warn {
  margin-top: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(226, 72, 61, 0.14);
  border: 1px solid rgba(226, 72, 61, 0.34);
  font-size: 10.5px;
  line-height: 1.35;
  color: #ffb4ad;
}

/* ─── Hover tooltip (tuman) ──────────────────────────────────────────── */
.hovertip {
  position: fixed;
  z-index: 45;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--edge-strong);
  background: rgba(8, 16, 32, 0.95);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.hovertip.is-on { opacity: 1; }
.hovertip b { display: block; font-size: 13px; margin-bottom: 2px; }
.hovertip span { color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* ─── Xarita boshqaruvi ──────────────────────────────────────────────── */
.maplibregl-ctrl-group {
  background: var(--glass) !important;
  border: 1px solid var(--edge);
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: var(--shadow) !important;
}
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--edge); }
.maplibregl-ctrl-group button span { filter: invert(1) brightness(1.6); }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { display: none; }
.maplibregl-ctrl-top-right { margin-top: calc(var(--topbar-h) + 8px); }

/* ─── Moslashuvchanlik ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  :root { --panel-w: 320px; }
  .legend { width: 190px; }
}

@media (max-width: 780px) {
  :root { --topbar-h: 58px; }
  .topbar { gap: 10px; padding: 0 10px; }
  .topbar__brand small { display: none; }
  .topbar__brand strong { display: none; }
  .topbar__mark { padding: 4px 7px; }
  .topbar__mark img { height: 21px; }
  .topbar__actions .btn:not(#btnReplay) { display: none; }
  .search { max-width: none; }

  .panel {
    top: auto;
    left: 8px; right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 56vh;
  }
  .panel.is-collapsed { transform: translateY(calc(100% - 42px)); }
  .panel__toggle { top: -13px; right: 16px; transform: rotate(90deg); }
  .panel.is-collapsed .panel__toggle { transform: rotate(270deg); }
  .legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .intro__stars, .intro__badge, .mfy__wave, .space__canvas { animation: none; }
  .mfy__inner { animation-duration: 0.01s; }
  * { transition-duration: 0.08s !important; }
}

/* ═══ Kirish ekranidagi muallif yozuvi ═══════════════════════════════════ */
.intro__by {
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(20, 83, 45, 0.45);
  text-transform: lowercase;
}

/* ═══ Ko'rinish rejimi (o'ng pastda) ═════════════════════════════════════ */
.modes {
  position: fixed;
  right: 14px;
  bottom: 244px;
  z-index: 36;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  width: 152px;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s;
  pointer-events: none;
}
.modes.is-in { opacity: 1; transform: none; pointer-events: auto; }

.modes__btn {
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.modes__btn:hover { background: rgba(78, 168, 222, 0.12); color: var(--ink); }
.modes__btn.is-on {
  background: rgba(78, 168, 222, 0.22);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(78, 168, 222, 0.45);
}

/* ═══ Ko'rsatkich tanlash menyusi ════════════════════════════════════════ */
.metric { position: relative; flex-shrink: 0; }
.metric__btn { max-width: 260px; }
.metric__btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric__caret { font-style: normal; font-size: 10px; opacity: 0.7; }

.metric__menu,
.metric__cats {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 50;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: rgba(8, 16, 32, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 5px;
}
.metric__menu { width: 288px; }

.metric__item {
  display: block;
  width: 100%;
  position: relative;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.metric__item:hover { background: rgba(78, 168, 222, 0.16); }
.metric__item.is-on { background: rgba(78, 168, 222, 0.22); }
.metric__item small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-faint);
}
.metric__item--more .metric__caret {
  position: absolute;
  right: 11px;
  top: 50%;
  margin-top: -6px;
}

/* Toifalar — uch ustunda */
.metric__cats { width: min(720px, calc(100vw - 28px)); }
.metric__catshead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 9px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 6px;
}
.metric__catshead strong { font-size: 12.5px; font-weight: 600; }
.metric__back {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}
.metric__back:hover { text-decoration: underline; }

.metric__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  max-height: min(460px, 62vh);
  overflow-y: auto;
  scrollbar-width: thin;
}
.metric__grid button {
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.metric__grid button:hover { background: rgba(78, 168, 222, 0.16); color: var(--ink); }
.metric__grid button.is-on {
  background: rgba(78, 168, 222, 0.24);
  color: var(--ink);
  font-weight: 600;
}
.metric__empty {
  grid-column: 1 / -1;
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .modes { width: 140px; bottom: 232px; }
}
@media (max-width: 780px) {
  .modes {
    right: 8px;
    bottom: auto;
    top: calc(var(--topbar-h) + 8px);
    width: auto;
    flex-direction: row;
  }
  .modes__btn { font-size: 11.5px; padding: 7px 9px; }
  .metric__btn span { display: none; }
  .metric__menu, .metric__cats { right: -60px; }
}

/* ═══ Toifalar bo'yicha ro'yxat (yon panel) ══════════════════════════════ */
.cats { margin-bottom: 18px; }
.cats:empty { display: none; }

.cats__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--edge);
}
.cats__head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.cats__count { font-size: 11px; color: var(--ink-faint); }

.cats__row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.14s;
}
.cats__row:hover { background: rgba(78, 168, 222, 0.13); }
.cats__row.is-on { background: rgba(78, 168, 222, 0.2); }
.cats__row.is-zero { opacity: 0.42; }
.cats__label {
  flex: 1;
  min-width: 0;
  color: var(--ink-dim);
  line-height: 1.3;
}
.cats__row.is-on .cats__label { color: var(--ink); font-weight: 600; }
.cats__num {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.cats__share {
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
  font-size: 10.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ═══ 2D / 3D almashtirgich ══════════════════════════════════════════════ */
.modes__sep {
  height: 1px;
  margin: 3px 4px;
  background: var(--edge);
}
.modes__dim { display: flex; gap: 2px; }
.modes__d {
  flex: 1;
  padding: 5px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.modes__d:hover { background: rgba(78, 168, 222, 0.12); color: var(--ink); }
.modes__d.is-on {
  background: rgba(242, 181, 68, 0.22);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(242, 181, 68, 0.45);
}
.modes__d.is-busy { opacity: 0.6; cursor: progress; }

/* ═══ Muassasa va tashkilotlar ═══════════════════════════════════════════ */
/* Tepadagi alohida tugma */
.orgpick__btn svg { color: var(--gold); flex-shrink: 0; }
.orgpick__btn.is-on {
  background: rgba(242, 181, 68, 0.18);
  border-color: rgba(242, 181, 68, 0.6);
  color: #ffe7b8;
}
.orgpick__off { margin-left: auto; color: var(--ink-faint); }
.orgpick__off:hover { color: #ffb4ad; }
/* Ikki tugma yonma-yon — o'rta ekranlarda qidiruv siqilib qolmasin */
.search { min-width: 150px; }
@media (max-width: 1180px) and (min-width: 781px) {
  .metric__btn { max-width: 180px; }
  .topbar #btnReplay { display: none; }
  .topbar__brand > div { display: none; }
}

.metric__orgs { width: min(560px, calc(100vw - 28px)); }
.orgmenu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  max-height: min(460px, 62vh);
  overflow-y: auto;
  scrollbar-width: thin;
}
.orgmenu button {
  --c: var(--accent);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.orgmenu button span { flex: 1; min-width: 0; }
.orgmenu button b { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.orgmenu button:hover { background: rgba(78, 168, 222, 0.14); color: var(--ink); }
.orgmenu button.is-on { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--ink); font-weight: 600; }
.orgmenu__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--c);
  color: #fff;
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
}
.orgmenu__icon--all { background: linear-gradient(135deg, #3b82f6, #a855f7 55%, #f5b82e); }

/* ─── Xarita belgisi: tomchi shaklidagi pin va yerga tarqaluvchi to'lqin ─ */
/* Marker elementi 0x0 — pin uchi aynan koordinataga tushadi */
.org { position: relative; width: 0; height: 0; --c: #4ea8de; }
.org:hover, .org.is-active { z-index: 6; }

.org__inner {
  position: absolute;
  left: -16px;
  top: -39px;
  width: 32px;
  height: 39px;
  cursor: pointer;
  animation: org-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes org-in {
  from { opacity: 0; transform: translateY(-26px) scale(0.5); }
  to   { opacity: 1; transform: none; }
}

.org__body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 39px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.org__inner:hover .org__body { transform: scale(1.18) translateY(-2px); }
.org.is-active .org__body { transform: scale(1.32) translateY(-3px); }

.org__pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%);
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--c) 70%, transparent),
    0 3px 8px rgba(0, 0, 0, 0.55);
  color: #fff;
}
.org__pin svg { transform: rotate(45deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }

.org__wave {
  position: absolute;
  left: 50%;
  top: 39px;
  width: 16px;
  height: 7px;
  margin: -3.5px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--c);
  box-shadow: 0 0 8px var(--c);
  opacity: 0;
  animation: org-wave 2.4s ease-out infinite;
  pointer-events: none;
}
.org__wave:nth-child(2) { animation-delay: 1.2s; }
@keyframes org-wave {
  0%   { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(4.2); opacity: 0; }
}
.org.is-active .org__wave { animation-duration: 1.4s; }
body.org-quiet .org__wave { display: none; }

.org__name {
  position: absolute;
  left: 50%;
  top: 45px;
  max-width: 170px;
  transform: translateX(-50%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
body.mfy-names .org__name { opacity: 1; }

.org__tip {
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: max-content;
  max-width: 260px;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: rgba(6, 13, 27, 0.95);
  box-shadow: var(--shadow);
  font-size: 11.5px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}
.org__tip b { display: block; font-weight: 600; }
.org__tip span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--c); }
.org__inner:hover .org__tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Yon panel ───────────────────────────────────────────────────────── */
.panel.is-org .gauge,
.panel.is-org .stats,
.panel.is-org .breakdown,
.panel.is-org .cats,
.panel.is-org .listbox { display: none; }

.orgs { animation: orgs-in 0.35s ease; }
@keyframes orgs-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.orgs__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--edge);
}
.orgs__head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); }
.orgs__count { font-size: 11.5px; color: var(--ink-faint); }

.orgs__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.orgchip {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 5px;
  border-radius: 20px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.orgchip[data-type="all"] { padding-left: 10px; }
.orgchip b { font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.orgchip:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--ink); }
.orgchip.is-on {
  background: color-mix(in srgb, var(--c) 24%, transparent);
  border-color: var(--c);
  color: var(--ink);
  font-weight: 600;
}
.orgchip.is-on b { color: var(--ink); }
.orgchip.is-zero { opacity: 0.45; }
.orgchip__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
}

.orgs__list { display: flex; flex-direction: column; gap: 4px; }
.orgrow {
  --c: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.orgrow:hover {
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
  transform: translateX(2px);
}
.orgrow__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  color: var(--c);
}
.orgrow__main { min-width: 0; flex: 1; }
.orgrow__name {
  font-size: 12.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.orgrow__meta { margin-top: 2px; font-size: 11px; color: var(--ink-faint); }
.orgrow__warn { color: #f0c46a; }
.orgs__empty { padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }

/* Tafsilot */
.orgd { --c: var(--accent); }
.orgd__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px 3px 4px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  font-size: 11.5px;
  font-weight: 600;
}
.orgd__badge i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent);
}
.orgd__name { margin: 11px 0 4px; font-size: 17px; font-weight: 650; line-height: 1.3; }
.orgd__place { margin: 0 0 14px; font-size: 12px; color: var(--ink-faint); }

.orgd__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.orgd__cell {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
}
.orgd__cell--wide { grid-column: 1 / -1; }
.orgd__cell span { display: block; font-size: 10.5px; color: var(--ink-faint); margin-bottom: 3px; line-height: 1.3; }
.orgd__cell b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.orgd__cell--wide b { font-size: 12.5px; font-weight: 500; line-height: 1.45; }
.orgd__cell small { font-size: 11px; font-weight: 400; color: var(--ink-faint); }

.orgd__bar {
  display: flex;
  height: 8px;
  margin: 11px 0 5px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}
.orgd__bar i:first-child { background: var(--c); }
.orgd__bar i:last-child { background: color-mix(in srgb, var(--c) 35%, #3a4a63); }
.orgd__legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--ink-faint); }
.orgd__legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.orgd__legend .is-b { background: var(--c); }
.orgd__legend .is-l { background: color-mix(in srgb, var(--c) 35%, #3a4a63); }

.orgd__docs {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--edge);
  background: var(--glass-soft);
}
.orgd__docshead {
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.orgd__docs ol { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.5; }
.orgd__docs li + li { margin-top: 4px; }
.orgd__docs li::marker { color: var(--c); font-weight: 700; }
.orgd__none { margin: 0; font-size: 12px; color: var(--ink-faint); }

.orgd__map {
  display: block;
  margin-top: 13px;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--ink);
  font-size: 12.5px;
  text-align: center;
  text-decoration: none;
  transition: background 0.16s;
}
.orgd__map:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
.orgd__coords { margin: 8px 0 0; font-size: 10.5px; color: var(--ink-faint); text-align: center; font-variant-numeric: tabular-nums; }

/* ─── Rang shkalasi o'rnida bo'limlar ─────────────────────────────────── */
.legend__orgs { display: none; }
body.org-mode .legend { pointer-events: auto; }
body.org-mode .legend__scale,
body.org-mode .legend__ends,
body.org-mode .legend__marker { display: none; }
body.org-mode .legend__orgs { display: flex; flex-direction: column; gap: 1px; }
.legend__org {
  --c: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, opacity 0.14s;
}
.legend__org:hover { background: rgba(78, 168, 222, 0.12); color: var(--ink); }
.legend__org i {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--c);
  color: #fff;
}
.legend__org i svg { transform: rotate(45deg); }
.legend__org span { flex: 1; min-width: 0; }
.legend__org b { font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.legend__org.is-off { opacity: 0.38; }

@media (max-width: 780px) {
  .orgmenu { grid-template-columns: 1fr; }
  .metric__orgs { right: -60px; }
}
@media (prefers-reduced-motion: reduce) {
  .org__wave { animation: none; }
  .org__inner { animation-duration: 0.01s; }
}
