@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #05080f;
  --bg-2: #070d19;
  --surface: rgba(10, 17, 30, 0.6);
  --surface-2: rgba(13, 21, 38, 0.5);
  --surface-solid: #0a1220;
  --line: rgba(126, 182, 255, 0.13);
  --line-bright: rgba(126, 182, 255, 0.32);
  --ink: #e9f1ff;
  --ink-2: #a3b7da;
  --ink-3: #5d7296;
  --accent: #4fb8ff;
  --accent-soft: rgba(79, 184, 255, 0.16);
  --violet: #7c6cff;
  --lv0: #0d9668;
  --lv1: #0e87c9;
  --lv2: #c77d00;
  --lv3: #e11d48;
  --lvx: #64748b;
  --lv0-glow: #34d399;
  --lv1-glow: #38bdf8;
  --lv2-glow: #ffb020;
  --lv3-glow: #ff5c77;
  --radius: 18px;
  --radius-sm: 12px;
  --font-latin: "Space Grotesk";
  --font-fa: "Vazirmatn";
  --shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  --pad: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  font-family: "Space Grotesk", "Vazirmatn", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: "Vazirmatn", "Space Grotesk", system-ui, sans-serif; }

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 18% 12%, rgba(124, 108, 255, 0.13), transparent 70%),
    radial-gradient(42% 34% at 84% 82%, rgba(79, 184, 255, 0.1), transparent 70%),
    radial-gradient(30% 26% at 76% 8%, rgba(225, 29, 72, 0.07), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--bg);
}
#map canvas { outline: none; }

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 182, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 182, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(75% 70% at 50% 45%, transparent 55%, #000 100%);
  -webkit-mask-image: radial-gradient(75% 70% at 50% 45%, transparent 55%, #000 100%);
  transition: opacity 0.3s;
}
body.sat-on .grid-overlay { opacity: 0; }
body.sat-on .vignette { box-shadow: inset 0 0 180px 30px rgba(2, 4, 10, 0.6); }
#basemap-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--line-bright); background: var(--accent-soft); }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(6, 10, 22, 0.3);
  box-shadow: inset 0 0 180px 40px rgba(2, 4, 10, 0.85);
}

.trend-chart, .sp-spark { direction: ltr; }

.city-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(5, 8, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.city-label:hover { color: var(--ink); border-color: var(--line-bright); }
.city-label b { color: var(--ink); font-weight: 700; }
.city-label .dot { width: 6px; height: 6px; }

.glass {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.glass-solid {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.micro { font-size: 10.5px; letter-spacing: 0.04em; }

.btn {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn:hover { border-color: var(--line-bright); background: var(--accent-soft); box-shadow: 0 0 18px rgba(79, 184, 255, 0.18); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, button:focus-visible, .city-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#lang-toggle { display: inline-flex; align-items: center; }
.lseg { color: var(--ink-3); font-weight: 600; transition: color 0.2s; }
.lseg.on { color: var(--accent); text-shadow: 0 0 12px rgba(79, 184, 255, 0.5); }
.lsep { color: var(--ink-3); opacity: 0.5; margin-inline: 5px; }

.btn.icon {
  padding: 2px 10px;
  font-size: 19px;
  line-height: 1.2;
  border: none;
  color: var(--ink-2);
}
.btn.icon:hover { color: var(--ink); background: transparent; box-shadow: none; }

.topbar {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  inset-inline: 16px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 16px;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark, .boot-mark { width: 34px; height: 34px; flex: none; }
.mark-drop, .boot-drop {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.4;
  filter: drop-shadow(0 0 6px rgba(79, 184, 255, 0.65));
}
.mark-pulse, .boot-pulse {
  fill: none;
  stroke: var(--lv3-glow);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(255, 92, 119, 0.7));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text h1, .brand-text p { margin: 0; }
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.brand-sub { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.18em; text-transform: uppercase; }
html[dir="rtl"] .brand-name { letter-spacing: 0.02em; }
html[dir="rtl"] .brand-sub { letter-spacing: 0.04em; }

.top-controls { display: flex; align-items: center; gap: 9px; flex-wrap: nowrap; }
.iconbtn { display: inline-flex; align-items: center; gap: 7px; }
.iconbtn .btn-ic { display: none; width: 18px; height: 18px; flex: none; }

.report-cta {
  position: fixed;
  z-index: 16;
  top: calc(env(safe-area-inset-top, 0px) + 90px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  color: #05080f;
  background: linear-gradient(90deg, #4fb8ff, #7c6cff);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(79, 184, 255, 0.32);
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.25s, transform 0.15s;
}
html[dir="rtl"] .report-cta { transform: translateX(50%); }
.report-cta svg { width: 17px; height: 17px; }
.report-cta:hover { box-shadow: 0 10px 34px rgba(124, 108, 255, 0.42); }
.report-cta:active { transform: translateX(-50%) translateY(1px); }
html[dir="rtl"] .report-cta:active { transform: translateX(50%) translateY(1px); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.clock #clock-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.clock-label { font-size: 10px; color: var(--ink-3); letter-spacing: 0.14em; }
.demo-pill { color: var(--lv2-glow); border-color: rgba(255, 176, 32, 0.35); background: rgba(199, 125, 0, 0.12); font-weight: 600; }
.status-pill { color: var(--lv3-glow); border-color: rgba(255, 92, 119, 0.35); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s ease-in-out infinite; }

.hud {
  position: fixed;
  z-index: 15;
  top: calc(env(safe-area-inset-top, 0px) + 90px);
  inset-inline-start: 16px;
  width: 332px;
  max-height: calc(100dvh - 210px);
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 16px;
  overflow: hidden;
}

.block-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
html[dir="rtl"] .block-title { letter-spacing: 0.05em; }

.gauge-block { flex: none; }
.gauge-wrap { position: relative; width: 100%; }
#gauge { width: 100%; height: auto; display: block; }
.gauge-track { fill: none; stroke: #182640; stroke-width: 11; stroke-linecap: round; }
.gauge-value {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.5s;
  filter: drop-shadow(0 0 8px currentColor);
}
.gauge-ticks text { fill: var(--ink-3); font-size: 8.5px; font-family: var(--font-latin); }
.gauge-ticks line { stroke: #24354f; stroke-width: 1.4; }
.gauge-center {
  position: absolute;
  inset-inline: 0;
  bottom: 4px;
  text-align: center;
  pointer-events: none;
}
.gauge-num {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(79, 184, 255, 0.35);
}
.gauge-unit { font-size: 13px; color: var(--ink-3); }
.gauge-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  gap: 8px;
}
.stress-chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  box-shadow: 0 0 14px -2px currentColor;
}

.counts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 12px;
}
.count-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 4px 6px;
  text-align: center;
  background: var(--surface-2);
}
.count-num { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-label { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 9.5px; color: var(--ink-2); margin-top: 1px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 7px currentColor; background: currentColor; }

.trend-block { flex: none; }
.trend-chart { position: relative; height: 86px; }
#trend-svg { width: 100%; height: 72px; display: block; overflow: visible; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 5px rgba(79, 184, 255, 0.5)); }
.trend-area { fill: url(#trend-grad); }
.trend-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.axis-row { display: flex; justify-content: space-between; margin-top: 2px; }
.crosshair {
  position: absolute;
  top: 0;
  height: 72px;
  width: 1px;
  background: var(--line-bright);
  pointer-events: none;
}
.chart-tip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -110%);
  background: var(--surface-solid);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.chart-tip b { color: var(--accent); }

.cities-block { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.city-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #223354 transparent;
}
.city-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 76px 30px 14px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: start;
  transition: background 0.15s, border-color 0.15s;
}
.city-row:hover { background: var(--accent-soft); border-color: var(--line); }
.city-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-bar { height: 5px; border-radius: 4px; background: #16233c; overflow: hidden; }
.city-bar > span { display: block; height: 100%; border-radius: 4px; transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); box-shadow: 0 0 8px currentColor; background: currentColor; }
.city-fsi { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.city-delta { font-size: 9px; color: var(--ink-3); }
.city-delta.up { color: var(--lv3-glow); }
.city-delta.down { color: var(--lv0-glow); }

.analysis {
  position: fixed;
  z-index: 18;
  top: calc(env(safe-area-inset-top, 0px) + 90px);
  inset-inline-end: 16px;
  width: 372px;
  max-height: calc(100dvh - 210px);
  padding: 18px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  animation: slide-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.analysis-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.analysis-title { display: flex; align-items: center; gap: 9px; }
.analysis-title h3 { margin: 0; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
html[dir="rtl"] .analysis-title h3 { letter-spacing: 0.05em; }
.ai-tag {
  font-size: 9.5px;
  color: var(--violet);
  border: 1px solid rgba(124, 108, 255, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 0.06em;
}
.brief-headline { margin: 4px 0 10px; font-size: 19px; line-height: 1.35; font-weight: 700; }
.brief-summary { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; }
.brief-bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.brief-bullets li {
  position: relative;
  padding-inline-start: 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.brief-bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: rotate(45deg);
}
.brief-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

.analysis-fab {
  position: fixed;
  z-index: 17;
  inset-inline-end: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.15s;
}
.analysis-fab svg { width: 17px; height: 17px; fill: var(--violet); filter: drop-shadow(0 0 6px rgba(124, 108, 255, 0.8)); }
.analysis-fab:hover { border-color: rgba(124, 108, 255, 0.5); box-shadow: 0 0 26px rgba(124, 108, 255, 0.25), var(--shadow); }
.analysis-fab:active { transform: translateY(1px); }

.legend {
  position: fixed;
  z-index: 14;
  inset-inline-start: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 15px;
  font-size: 11px;
  color: var(--ink-2);
  border-radius: 999px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.mapy-attr {
  position: fixed;
  z-index: 15;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
  inset-inline-start: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.mapy-attr img { height: 30px; width: auto; display: block; }
.mapy-credit { font-size: 10px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.mapy-credit:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 900px) {
  .mapy-attr {
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 128px);
    inset-inline-start: 12px;
    padding: 4px 9px;
    gap: 7px;
  }
  .mapy-attr img { height: 26px; }
}

.ticker {
  position: fixed;
  z-index: 16;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  inset-inline: 16px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 17px;
  overflow: hidden;
}
.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--lv3-glow);
}
html[dir="rtl"] .ticker-label { letter-spacing: 0.04em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lv3-glow); box-shadow: 0 0 9px var(--lv3-glow); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ticker-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.45s;
}
.ticker-text.fade { opacity: 0; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.7s ease 0.15s, visibility 0.7s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-core { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot-mark { width: 58px; height: 58px; }
.boot-ring {
  position: absolute;
  top: -31px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid transparent;
  background:
    conic-gradient(from 0deg, transparent 0 300deg, var(--accent) 355deg, transparent 360deg) border-box;
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  animation: spin 1.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-text {
  margin: 26px 0 0;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 3px;
}
html[dir="rtl"] .boot-text { letter-spacing: 0.1em; }
.boot-dots i {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-inline-start: 3px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s ease-in-out infinite;
}
.boot-dots i:nth-child(2) { animation-delay: 0.2s; }
.boot-dots i:nth-child(3) { animation-delay: 0.4s; }

.about {
  width: min(560px, calc(100vw - 40px));
  max-height: min(78dvh, 640px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.about[open] { display: flex; }
.about::backdrop { background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(6px); }
.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
}
.about-head h2 { margin: 0; font-size: 17px; }
.about-body { padding: 16px 22px; overflow-y: auto; }
.about-body p { margin: 0 0 13px; font-size: 13.5px; color: var(--ink-2); }
.about-body p strong { color: var(--ink); }
.about-foot { padding: 12px 22px 18px; border-top: 1px solid var(--line); }

#list-view { display: none; }
body.no-map #map, body.no-map .grid-overlay, body.no-map .vignette,
body.no-map #hud, body.no-map .legend, body.no-map #ticker-bar { display: none; }
body.no-map #list-view {
  display: block;
  position: fixed;
  z-index: 12;
  inset: 0;
  top: calc(env(safe-area-inset-top, 0px) + 74px);
  overflow-y: auto;
  padding: 62px 16px calc(40px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: thin;
}
.lv-note {
  max-width: 760px;
  margin: 0 auto 14px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  line-height: 1.6;
}
.lv-head {
  max-width: 760px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}
.lv-head-left { display: flex; align-items: baseline; gap: 6px; }
.lv-fsi { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-fsi-unit { font-size: 13px; color: var(--ink-3); }
.lv-stress { font-size: 13px; font-weight: 700; padding: 5px 13px; border-radius: 999px; border: 1px solid currentColor; box-shadow: 0 0 14px -3px currentColor; }
.lv-searchwrap { max-width: 760px; margin: 0 auto 14px; }
.lv-search {
  width: 100%;
  background: #0a1120;
  border: 1px solid #223354;
  color: var(--ink);
  padding: 11px 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}
.lv-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lv-city { max-width: 760px; margin: 0 auto 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.lv-city-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: transparent;
  border: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: start;
  min-height: 50px;
}
.lv-city-head.open { border-bottom: 1px solid var(--line); }
.lv-city-nm { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.lv-chev { color: var(--ink-3); font-size: 12px; width: 12px; flex: none; }
.lv-city-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-city-right { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.lv-city-count { font-size: 11px; color: var(--ink-3); background: rgba(126,182,255,0.08); padding: 2px 8px; border-radius: 999px; }
.lv-city-fsi { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: end; }
.lv-city-body { padding: 0 8px 6px; }
.lv-row { border-bottom: 1px solid var(--line); }
.lv-row.open { background: var(--surface-2); border-radius: 10px; }
.lv-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 10px;
  background: transparent;
  border: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  min-height: 46px;
}
.lv-namecol { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lv-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-sub { font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-meta { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.lv-lvl { font-size: 12px; color: var(--ink-2); }
.lv-out { font-size: 11px; font-weight: 700; color: #ff5c77; }
.lv-detail { padding: 0 10px 12px; }
.lv-checked { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }

.report-modal {
  width: min(520px, calc(100vw - 28px));
  max-height: min(80dvh, 680px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.report-modal[open] { display: flex; }
.report-modal::backdrop { background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(6px); }
.rp-searchwrap { padding: 12px 18px; border-bottom: 1px solid var(--line); }
#rp-search {
  width: 100%;
  background: #0a1120;
  border: 1px solid #223354;
  color: var(--ink);
  padding: 11px 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}
#rp-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rp-list { overflow-y: auto; padding: 6px 10px 14px; scrollbar-width: thin; }
.rp-row { border-bottom: 1px solid var(--line); }
.rp-row.open { background: var(--surface-2); border-radius: 10px; }
.rp-row-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 11px 10px;
  background: transparent;
  border: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  min-height: 46px;
}
.rp-name { font-size: 13.5px; font-weight: 600; }
.rp-city { font-size: 11px; color: var(--ink-3); }
.rp-empty { text-align: center; color: var(--ink-3); font-size: 12px; padding: 18px 0; }

.station-popup .maplibregl-popup-content {
  background: var(--surface-solid);
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 0;
  width: min(264px, 88vw);
  font-family: inherit;
}
.station-popup { max-width: 88vw !important; }
.station-popup .maplibregl-popup-content { max-height: 66dvh; overflow-y: auto; scrollbar-width: thin; }
.station-popup .maplibregl-popup-tip { border-top-color: var(--surface-solid); border-bottom-color: var(--surface-solid); }
.station-popup .maplibregl-popup-close-button {
  color: var(--ink-3);
  font-size: 18px;
  padding: 2px 8px;
  right: 4px;
  top: 3px;
}
html[dir="rtl"] .station-popup .maplibregl-popup-close-button { right: auto; left: 4px; }
.sp-inner { padding: 14px 16px 13px; }
.sp-name { font-size: 14px; font-weight: 700; margin: 0 14px 2px 0; line-height: 1.35; }
html[dir="rtl"] .sp-name { margin: 0 0 2px 14px; }
.sp-city { font-size: 11px; color: var(--ink-3); margin-bottom: 10px; }
.sp-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid currentColor;
  box-shadow: 0 0 12px -3px currentColor;
  margin-bottom: 11px;
}
.sp-chiprow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 11px; }
.sp-chiprow .sp-status { margin-bottom: 0; }
.sp-out-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #ff5c77;
  border: 1px dashed rgba(255, 92, 119, 0.5);
  padding: 3px 9px;
  border-radius: 999px;
}
.sp-report { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.sp-report-q { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.sp-report-q.done { color: var(--lv0-glow); }
.sp-report-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.rbtn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rbtn.has { color: var(--lv0-glow); }
.rbtn.line { color: var(--lv2-glow); }
.rbtn.no { color: var(--lv3-glow); }
.rbtn:hover { border-color: currentColor; box-shadow: 0 0 10px -3px currentColor; }
.rbtn:disabled { opacity: 0.45; cursor: default; }
.sp-report-agg { margin-top: 8px; font-size: 10.5px; color: var(--ink-3); }
.ts-holder {
  position: fixed;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
}
.ts-holder:empty { display: none; }
.ts-holder iframe { border-radius: 10px; box-shadow: var(--shadow); }
.dot-ring {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid #ff5c77;
  background: transparent;
  box-shadow: 0 0 7px rgba(255, 92, 119, 0.7);
  flex: none;
}

.sp-conf { font-size: 10.5px; color: var(--ink-3); margin: -4px 0 10px; display: flex; align-items: center; gap: 6px; }
.sp-conf::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }

.sp-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sp-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.sp-row b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.sp-scorebar { height: 5px; border-radius: 4px; background: #16233c; overflow: hidden; margin: 2px 0 10px; }
.sp-scorebar > span { display: block; height: 100%; border-radius: 4px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.sp-spark { position: relative; }
.sp-spark svg { width: 100%; height: 44px; display: block; overflow: visible; }
.sp-spark .spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.sp-spark .spark-area { fill: rgba(79, 184, 255, 0.12); }
.sp-sparklabel { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-3); margin-top: 3px; }
.sp-empty { font-size: 11px; color: var(--ink-3); text-align: center; padding: 8px 0; }
.sp-foot { font-size: 10.5px; color: var(--ink-3); margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }

.maplibregl-ctrl-attrib {
  background: rgba(5, 8, 15, 0.55) !important;
  color: var(--ink-3);
  font-size: 10px;
  border-radius: 8px;
}
.maplibregl-ctrl-attrib a { color: var(--ink-3) !important; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { z-index: 10; }

@media (max-width: 900px) {
  #net-text { display: none; }
  .top-controls { gap: 6px; }
  .pill { padding: 6px 9px; font-size: 11px; }
  .btn { padding: 6px 10px; font-size: 12.5px; }
  .iconbtn .btn-tx { display: none; }
  .iconbtn .btn-ic { display: block; }
  .iconbtn { padding: 7px 9px; }
  .brand { flex: 1; min-width: 0; }
  .brand-name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
  #net-pill { padding: 6px; }
  .report-cta { top: calc(env(safe-area-inset-top, 0px) + 82px); padding: 9px 16px; font-size: 12.5px; }
  .analysis-fab span { display: none; }
  .analysis-fab { padding: 9px 11px; }
  .gauge-num { text-shadow: none; }
  .hud {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    inset-inline: 12px;
    width: auto;
    max-height: 42dvh;
    padding: 14px;
    gap: 12px;
  }
  .topbar { inset-inline: 12px; height: 56px; padding-inline: 12px; }
  .brand-sub { display: none; }
  .clock { display: none; }
  .trend-block { display: none; }
  .gauge-block { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 4px 14px; }
  .gauge-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .counts-row { grid-column: 1 / -1; }
  .gauge-num { font-size: 34px; }
  .cities-block { min-height: 74px; }
  .city-list { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .city-list li { flex: none; }
  .city-row { grid-template-columns: auto auto; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
  .city-bar, .city-delta { display: none; }
  .analysis {
    top: auto;
    inset-inline: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    width: auto;
    max-height: 58dvh;
  }
  .analysis-fab { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 80px); padding: 9px 14px; }
  .legend { display: none; }
  .ticker { inset-inline: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); height: 44px; }
}

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