:root {
  color-scheme: dark;
  --ink: #edf8ff;
  --muted: #8297a8;
  --panel: rgba(8, 20, 29, 0.88);
  --panel-strong: rgba(8, 20, 29, 0.96);
  --line: rgba(166, 210, 232, 0.13);
  --cyan: #5fe4ff;
  --cyan-soft: rgba(95, 228, 255, 0.14);
  --lime: #b8f36b;
  --amber: #ffca66;
  --danger: #ff7f89;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body, .app-shell, #map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body, .app-shell { touch-action: manipulation; }

body {
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #071018;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

#map { z-index: 0; background: #071018; }
#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background: radial-gradient(circle at 55% 45%, transparent 25%, rgba(2, 10, 16, 0.22) 100%);
}

.maplibregl-ctrl-top-right .maplibregl-ctrl-group { margin-top: 96px !important; margin-right: 10px !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button {
  color: var(--ink) !important;
  background: rgba(8, 20, 29, .9) !important;
  border-color: var(--line) !important;
}
.maplibregl-ctrl-attrib {
  color: #6f8494;
  background: rgba(5, 14, 21, .72) !important;
  backdrop-filter: blur(10px);
}
.maplibregl-ctrl-attrib a { color: #9bb1c0; }
.maplibregl-canvas { outline: none; }
.map-unavailable-message {
  position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; gap: 6px;
  width: min(320px, calc(100vw - 40px)); padding: 18px; border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); text-align: center; background: var(--panel-strong); box-shadow: var(--shadow); transform: translate(-50%, -50%);
}
.map-unavailable-message b { font-size: 14px; }
.map-unavailable-message span { color: var(--muted); font-size: 11px; }

.topbar {
  position: absolute;
  z-index: 1000;
  top: max(20px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 14px 0 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 18, 27, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.3);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-mark { width: 34px; height: 34px; position: relative; display: grid; place-items: center; }
.brand-mark::before, .brand-mark::after, .brand-mark i {
  content: "";
  position: absolute;
  border: 1px solid rgba(95, 228, 255, .4);
  border-radius: 50%;
}
.brand-mark::before { width: 30px; height: 30px; }
.brand-mark::after { width: 18px; height: 18px; }
.brand-mark i:nth-child(1) { width: 5px; height: 5px; border: 0; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.brand-mark i:nth-child(2) { width: 32px; height: 1px; border: 0; border-radius: 0; background: linear-gradient(90deg, transparent, var(--cyan)); transform: rotate(-32deg); transform-origin: center; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy b { font-size: 18px; letter-spacing: .18em; }
.brand-copy small { margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: .2em; }

.top-status { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; color: #a6bac8; font-size: 13px; }
.divider { height: 16px; width: 1px; background: var(--line); }
.utc-clock { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .035em; }
.utc-clock #utcTime { color: var(--ink); }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(184, 243, 107, .8); }
.connection-dot.is-loading { background: var(--amber); animation: pulse 1.4s infinite; }
.connection-dot.is-error { background: var(--danger); box-shadow: 0 0 12px rgba(255, 127, 137, .65); }
.connection-dot.is-stale { background: var(--amber); box-shadow: 0 0 12px rgba(255, 202, 102, .65); }
.nav-cycle { padding: 5px 8px; border: 1px solid rgba(201,144,255,.2); border-radius: 99px; color: #d8b5ff; background: rgba(201,144,255,.07); font-size: 10px; letter-spacing: .06em; }
.nav-cycle.is-offline { color: var(--muted); border-color: var(--line); background: rgba(255,255,255,.025); }

.top-actions { display: flex; gap: 8px; }
.icon-button {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.035); cursor: pointer; font-size: 20px;
  transition: .2s ease;
}
.icon-button:hover { background: var(--cyan-soft); border-color: rgba(95, 228, 255, .35); color: var(--cyan); transform: translateY(-1px); }
.icon-button.is-spinning { animation: spin .65s ease; }
.layers-icon { position: relative; display: block; width: 18px; height: 15px; margin: auto; }
.layers-icon::before, .layers-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 12px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: skewY(-24deg) rotate(-12deg);
}
.layers-icon::before { top: 1px; }
.layers-icon::after { top: 6px; background: rgba(7,18,27,.72); }
.settings-icon {
  position: relative; display: block; width: 18px; height: 16px; margin: auto;
  background: linear-gradient(currentColor,currentColor) 0 3px/18px 1.5px no-repeat,
              linear-gradient(currentColor,currentColor) 0 8px/18px 1.5px no-repeat,
              linear-gradient(currentColor,currentColor) 0 13px/18px 1.5px no-repeat;
}
.settings-icon::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 5px 3.75px, var(--panel-strong) 0 2px, currentColor 2.2px 3.4px, transparent 3.6px),
              radial-gradient(circle at 13px 8.75px, var(--panel-strong) 0 2px, currentColor 2.2px 3.4px, transparent 3.6px),
              radial-gradient(circle at 8px 13.75px, var(--panel-strong) 0 2px, currentColor 2.2px 3.4px, transparent 3.6px);
}

.basemap-panel {
  position: absolute;
  z-index: 1050;
  top: 96px;
  right: 20px;
  width: 238px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(7,18,27,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
  animation: rise .18s ease both;
}
.basemap-panel[hidden] { display: none; }
.weather-settings-panel {
  position: absolute; z-index: 1050; top: 96px; right: 20px; width: 274px; padding: 14px;
  border: 1px solid var(--line); border-radius: 17px; color: var(--ink);
  background: var(--panel-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25); animation: rise .18s ease both;
}
.weather-settings-panel[hidden] { display: none; }
.unit-setting {
  min-height: 43px; display: grid; grid-template-columns: 68px 1fr; align-items: center; gap: 10px;
  padding: 7px 3px; border-top: 1px solid var(--line);
}
.unit-setting > span { color: var(--muted); font-size: 11px; }
.unit-setting > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.unit-setting button {
  min-height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); background: transparent; cursor: pointer; font-size: 10px;
}
.unit-setting button:hover { border-color: var(--line); color: var(--ink); background: var(--surface); }
.unit-setting button.is-active {
  border-color: rgba(143,116,158,.28); color: var(--title, var(--ink));
  background: var(--surface-active, rgba(143,116,158,.12));
}
.basemap-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 1px 3px 11px; }
.basemap-heading span { color: #dcecf4; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.basemap-heading small { color: var(--muted); font-size: 9px; }
.basemap-options { display: grid; gap: 5px; }
.basemap-option { width: 100%; display: grid; grid-template-columns: 42px 1fr 16px; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 12px; text-align: left; color: var(--ink); background: transparent; cursor: pointer; }
.basemap-option:hover { border-color: var(--line); background: rgba(255,255,255,.04); }
.basemap-option.is-active { border-color: rgba(95,228,255,.25); background: var(--cyan-soft); }
.basemap-option > span { min-width: 0; display: grid; gap: 3px; }
.basemap-option b { font-size: 12px; font-weight: 620; }
.basemap-option small { color: var(--muted); font-size: 9px; }
.basemap-option em { visibility: hidden; color: var(--cyan); font-style: normal; font-size: 12px; }
.basemap-option.is-active em { visibility: visible; }
.basemap-swatch { width: 42px; height: 30px; display: block; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.swatch-dark { background: linear-gradient(145deg,#101c25 0 44%,#2e4653 45% 49%,#14242e 50% 70%,#63737a 71% 74%,#1b303a 75%); }
.swatch-light { background: linear-gradient(145deg,#edf1ef 0 43%,#b3c2bd 44% 48%,#f7f8f6 49% 70%,#91aaa0 71% 74%,#dce5e1 75%); }
.swatch-satellite { background: linear-gradient(145deg,#173d31 0 28%,#416c3d 29% 45%,#283b25 46% 61%,#7b8260 62% 69%,#153b51 70%); }

.sidebar {
  position: absolute;
  z-index: 900;
  top: 106px;
  bottom: 20px;
  left: 20px;
  width: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
  overflow: hidden;
}

.sheet-handle { display: none; }
.summary { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 700; letter-spacing: .22em; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.stat { display: grid; gap: 5px; }
.stat + .stat { padding-left: 18px; border-left: 1px solid var(--line); }
.stat strong { font-size: 28px; line-height: 1; font-weight: 560; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 12px; }

.finder { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.search-box { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 10, 16, .4); }
.search-box > span { color: var(--muted); font-size: 20px; }
.search-box input { flex: 1; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #617687; }
.search-box button { display: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 19px; }
.search-box:focus-within { border-color: rgba(95, 228, 255, .45); box-shadow: 0 0 0 3px rgba(95,228,255,.08); }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 12px; padding: 4px; border-radius: 12px; background: rgba(2, 10, 16, .42); }
.filter { height: 31px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; }
.filter.is-active { color: var(--ink); background: rgba(104, 155, 179, .16); box-shadow: inset 0 0 0 1px var(--line); }

.traffic-section { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.section-heading { display: flex; justify-content: space-between; padding: 14px 20px 9px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.traffic-list { min-height: 0; flex: 1; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; scrollbar-color: rgba(130,151,168,.25) transparent; }
.traffic-card { width: 100%; display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 11px; border: 1px solid transparent; border-radius: 14px; text-align: left; background: transparent; cursor: pointer; transition: .18s ease; }
.traffic-card:hover { border-color: var(--line); background: rgba(255,255,255,.035); }
.traffic-card.is-selected { border-color: rgba(95,228,255,.25); background: var(--cyan-soft); }
.traffic-icon { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid rgba(95,228,255,.18); border-radius: 12px; color: var(--cyan); background: rgba(95,228,255,.075); font-size: 18px; }
.traffic-icon.atc { color: var(--amber); border-color: rgba(255,202,102,.2); background: rgba(255,202,102,.07); }
.traffic-main { min-width: 0; display: grid; gap: 4px; }
.traffic-main strong { overflow: hidden; text-overflow: ellipsis; font-size: 13px; letter-spacing: .035em; }
.traffic-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.traffic-meta { display: grid; justify-items: end; gap: 4px; color: #c2d2dc; font-size: 11px; }
.traffic-meta small { color: var(--muted); font-size: 10px; }

.empty-state { flex: 1; place-content: center; justify-items: center; text-align: center; padding: 30px; }
.empty-state:not([hidden]) { display: grid; }
.empty-state strong { margin-top: 16px; font-size: 14px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.empty-radar { width: 52px; height: 52px; position: relative; border: 1px solid rgba(95,228,255,.25); border-radius: 50%; }
.empty-radar::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(95,228,255,.18); border-radius: 50%; }
.empty-radar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 1px; background: linear-gradient(90deg, var(--cyan), transparent); transform-origin: left; animation: radar 2.8s linear infinite; }

.detail-panel {
  position: absolute;
  z-index: 950;
  right: 20px;
  bottom: 20px;
  width: min(450px, calc(100vw - 420px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  max-height: calc(100dvh - 126px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(95,228,255,.3) transparent;
  scrollbar-width: thin;
  touch-action: pan-y;
  animation: rise .24s ease both;
}
.detail-panel::-webkit-scrollbar { width: 7px; }
.detail-panel::-webkit-scrollbar-track { background: transparent; }
.detail-panel::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: rgba(95,228,255,.28); background-clip: padding-box; }
.detail-close { position: absolute; right: 15px; top: 15px; width: 30px; height: 30px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.05); cursor: pointer; font-size: 20px; z-index: 2; }
.detail-hero { padding: 21px 55px 18px 22px; background: linear-gradient(135deg, rgba(95,228,255,.12), transparent 60%); border-bottom: 1px solid var(--line); }
.detail-hero.atc { background: linear-gradient(135deg, rgba(255,202,102,.12), transparent 60%); }
.detail-kind { display: block; margin-bottom: 7px; color: var(--cyan); font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.detail-hero.atc .detail-kind { color: var(--amber); }
.detail-title { display: flex; align-items: baseline; gap: 10px; }
.detail-title h2 { margin: 0; font-size: 25px; letter-spacing: .03em; }
.detail-title span { color: var(--muted); font-size: 12px; }
.detail-sub { margin: 8px 0 0; color: #a9bdca; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.detail-metric { min-width: 0; padding: 13px 12px; background: rgba(5,14,21,.82); }
.detail-metric span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.detail-metric b { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 560; }
.detail-plan { padding: 16px 22px 19px; }
.route-pair { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.airport { display: grid; gap: 3px; }
.airport:last-child { text-align: right; }
.airport b { font-size: 18px; letter-spacing: .08em; }
.airport span { color: var(--muted); font-size: 9px; }
.route-line { position: relative; height: 1px; background: linear-gradient(90deg, var(--cyan), rgba(95,228,255,.2)); }
.route-line::after { content: "✈"; position: absolute; left: 50%; top: 50%; padding: 0 6px; color: var(--cyan); background: #091821; transform: translate(-50%,-50%); font-size: 12px; }
.route-text { margin: 13px 0 0; color: #9eb2bf; line-height: 1.55; overflow-wrap: anywhere; font-size: 11px; }
.route-text b { color: #d6e8f1; }
.route-scroll {
  max-height: min(28dvh, 180px);
  padding-right: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(95,228,255,.32) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.route-scroll::-webkit-scrollbar { width: 6px; }
.route-scroll::-webkit-scrollbar-track { background: transparent; }
.route-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(95,228,255,.3); }

.legend { position: absolute; z-index: 800; right: 20px; top: 106px; display: flex; gap: 14px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: #91a5b3; background: rgba(7,18,27,.72); backdrop-filter: blur(16px); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(95,228,255,.6); }
.legend-dot.atc { background: var(--amber); box-shadow: 0 0 8px rgba(255,202,102,.6); }
.legend-line { width: 15px; height: 1px; background: var(--cyan); }
.legend-line.planned { height: 0; border-top: 2px dashed #c990ff; background: transparent; }

.route-label-icon { width: 8px; height: 8px; position: absolute !important; background: none !important; border: 0 !important; pointer-events: none; }
.route-waypoint-label { position: absolute; left: 9px; top: -3px; padding: 2px 5px; border: 1px solid rgba(201,144,255,.22); border-radius: 5px; color: #ead8ff; background: rgba(8,15,24,.82); box-shadow: 0 2px 8px rgba(0,0,0,.28); white-space: nowrap; font-size: 8px; font-weight: 700; letter-spacing: .04em; }
.route-waypoint-dot { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border: 1px solid #f2e5ff; border-radius: 50%; background: #c990ff; box-shadow: 0 0 8px rgba(201,144,255,.8); }
.route-waypoint-dot.is-departure, .route-waypoint-dot.is-arrival { left: -1px; top: -1px; width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
.route-waypoint-dot.is-departure { border-color: #dffcff; background: var(--cyan); box-shadow: 0 0 11px rgba(95,228,255,.9); }
.route-waypoint-dot.is-arrival { border-color: #fff3d8; background: var(--amber); box-shadow: 0 0 11px rgba(255,202,102,.9); }
.route-waypoint-label.is-departure { color: #dffcff; border-color: rgba(95,228,255,.32); }
.route-waypoint-label.is-arrival { color: #fff0cf; border-color: rgba(255,202,102,.32); }

.toast { position: absolute; z-index: 1200; left: 50%; bottom: 30px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 12px; color: #dcecf4; background: var(--panel-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; font-size: 12px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.aircraft-div-icon, .atc-div-icon { background: none !important; border: 0 !important; cursor: pointer; }
.aircraft-div-icon { width: 40px; height: 40px; }
.atc-div-icon { width: 28px; height: 28px; }
.aircraft-div-icon:focus-visible, .atc-div-icon:focus-visible, .airport-div-icon:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 50%; }
.aircraft-marker { width: 40px; height: 40px; position: relative; display: grid; place-items: center; }
.aircraft-symbol {
  position: relative;
  display: block;
  width: 34px;
  height: 38px;
  color: var(--cyan);
  filter: none;
  transform-origin: 50% 50%;
  transform: rotate(var(--heading));
  transition: transform .7s ease;
}
.aircraft-symbol::before {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background: currentColor;
  clip-path: polygon(50% 0,56% 9%,58% 29%,62% 36%,94% 60%,92% 68%,61% 55%,59% 79%,78% 91%,76% 97%,56% 89%,54% 100%,46% 100%,44% 89%,24% 97%,22% 91%,41% 79%,39% 55%,8% 68%,6% 60%,38% 36%,42% 29%,44% 9%);
}
.aircraft-label, .atc-label { position: absolute; left: 38px; top: 7px; padding: 3px 6px; border: 1px solid rgba(95,228,255,.16); border-radius: 6px; color: #dff8ff; background: rgba(5,14,21,.82); box-shadow: 0 3px 10px rgba(0,0,0,.3); white-space: nowrap; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.aircraft-marker.is-ground .aircraft-symbol { color: var(--cyan); }
.aircraft-marker.is-selected .aircraft-symbol { filter: none; }
.aircraft-marker.is-selected::before { content: ""; position: absolute; inset: 1px; border: 1px solid rgba(95,228,255,.48); border-radius: 50%; animation: markerPulse 1.8s ease-out infinite; }
.atc-marker { width: 28px; height: 28px; position: relative; display: grid; place-items: center; }
.atc-core { width: 9px; height: 9px; border: 2px solid #071018; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 1px rgba(255,202,102,.5), 0 0 14px rgba(255,202,102,.8); }
.atc-marker::before { content: ""; position: absolute; inset: 1px; border: 1px solid rgba(255,202,102,.35); border-radius: 50%; animation: markerPulse 2.2s ease-out infinite; }
.atc-label { left: 24px; top: 2px; border-color: rgba(255,202,102,.18); }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes markerPulse { 0% { transform: scale(.55); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 820px) {
  .topbar {
    top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; height: 56px; min-height: 56px;
    display: grid; grid-template-columns: auto minmax(62px, 1fr) auto; gap: 6px;
    padding: 0 7px 0 10px; border-radius: 16px; overflow: hidden;
  }
  .brand { min-width: 0; gap: 7px; }
  .brand-mark { width: 27px; height: 27px; flex: 0 0 auto; }
  .brand-mark::before { width: 26px; height: 26px; }
  .brand-mark::after { width: 16px; height: 16px; }
  .brand-mark i:nth-child(2) { width: 27px; }
  .brand-copy b { font-size: 13px; letter-spacing: .08em; white-space: nowrap; }
  .brand-copy small { display: none; }
  .top-status { min-width: 0; justify-content: center; gap: 6px; font-size: 10px; overflow: hidden; }
  .top-status #connectionText { display: none; }
  .top-status .divider, #updateTime, .nav-cycle, #utcDate { display: none; }
  .utc-clock { min-width: 0; font-size: 9px; letter-spacing: 0; }
  .top-actions { min-width: max-content; gap: 2px; }
  .icon-button { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
  .basemap-panel { top: 76px; right: 10px; width: min(238px, calc(100vw - 20px)); }
  .weather-settings-panel { top: 76px; right: 10px; width: min(274px, calc(100vw - 20px)); }
  .sidebar { top: auto; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; height: 43dvh; min-height: 265px; border-radius: 21px; transition: height .25s ease, top .25s ease; }
  .sidebar.is-expanded { top: calc(max(10px, env(safe-area-inset-top)) + 66px); bottom: max(8px, env(safe-area-inset-bottom)); height: auto; min-height: 0; }
  .sheet-handle { height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 0; background: transparent; touch-action: manipulation; }
  .sheet-handle span { width: 38px; height: 4px; border-radius: 9px; background: rgba(166,210,232,.22); }
  .summary { padding: 3px 18px 12px; }
  .eyebrow { display: none; }
  .stats-row { margin-top: 2px; }
  .stat { display: flex; align-items: baseline; gap: 6px; }
  .stat + .stat { padding-left: 12px; }
  .stat strong { font-size: 19px; }
  .finder { padding: 11px 13px; }
  .search-box { height: 38px; }
  .search-box input { font-size: 16px; }
  .filters { margin-top: 8px; }
  .detail-panel { z-index: 1100; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-height: min(72dvh, calc(100dvh - 90px)); }
  .route-scroll { max-height: 130px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .legend { display: none; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl-group { margin-top: 78px !important; }
  .maplibregl-ctrl-attrib { max-width: 72vw; overflow: hidden; white-space: nowrap; }
}

@media (max-width: 430px) {
  .top-status { gap: 4px; }
  .utc-clock { font-size: 8.5px; }
  .brand-copy b { letter-spacing: .05em; }
}

@media (max-width: 350px) {
  .brand-copy { display: none; }
  .topbar { grid-template-columns: 29px minmax(58px, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Soft paper theme shared with the registration page. Basemap tiles are untouched. */
:root {
  color-scheme: light;
  --ink: #4b4454;
  --muted: #8d8294;
  --panel: rgba(255, 253, 253, .94);
  --panel-strong: rgba(255, 253, 253, .98);
  --line: rgba(176, 157, 184, .24);
  --cyan: #89749b;
  --cyan-soft: rgba(137, 116, 155, .10);
  --lime: #76a681;
  --amber: #c7907f;
  --danger: #b86673;
  --shadow: 0 20px 56px rgba(80, 65, 91, .15), 0 4px 16px rgba(80, 65, 91, .07);
  --radius: 24px;
}

body {
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #e9edf1;
}

#map { background: #e9edf1; }
#map::after { display: none; }

.maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  border-color: var(--line) !important;
  border-radius: 14px !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button {
  color: #64596c !important;
  background: rgba(255, 253, 253, .96) !important;
  border-color: var(--line) !important;
}
.maplibregl-ctrl-group button:hover { background: #f5eff6 !important; }
.maplibregl-ctrl-attrib {
  color: #8d8294;
  background: rgba(255, 253, 253, .88) !important;
  backdrop-filter: none;
}
.maplibregl-ctrl-attrib a { color: #716579; }

.topbar,
.basemap-panel,
.sidebar,
.detail-panel,
.legend,
.toast {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.topbar { border-radius: 23px; }
.brand { min-width: 180px; }
.brand-copy b {
  color: #4d4452;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  letter-spacing: .04em;
}
.brand-copy small { display: none; }

.brand-mark { width: 36px; height: 36px; }
.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.brand-mark::before {
  width: 25px;
  height: 25px;
  left: 3px;
  top: 4px;
  border-radius: 46% 54% 58% 42%;
  background: #dfd1e8;
  transform: rotate(18deg);
}
.brand-mark::after {
  width: 18px;
  height: 18px;
  right: 1px;
  bottom: 3px;
  border-radius: 50%;
  background: #d3e2ef;
}
.brand-mark i:nth-child(1) {
  width: 11px;
  height: 11px;
  left: 1px;
  bottom: 3px;
  border-radius: 50%;
  background: #f0d6df;
}
.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) { display: none; }

.top-status { color: #82778a; }
.divider { background: var(--line); }
.connection-dot { box-shadow: 0 0 0 3px rgba(118, 166, 129, .13); }
.connection-dot.is-loading { box-shadow: 0 0 0 3px rgba(199, 144, 127, .13); }
.connection-dot.is-error { box-shadow: 0 0 0 3px rgba(184, 102, 115, .13); }
.connection-dot.is-stale { box-shadow: 0 0 0 3px rgba(199, 144, 127, .13); }
.nav-cycle {
  color: #7b687f;
  border-color: rgba(137, 116, 155, .20);
  background: #f6f0f7;
}
.nav-cycle.is-offline { color: var(--muted); border-color: var(--line); background: #faf7fa; }

.icon-button {
  border-color: var(--line);
  color: #74677c;
  background: #faf7fa;
}
.icon-button:hover {
  color: #655572;
  border-color: rgba(137, 116, 155, .34);
  background: #f1e9f3;
  transform: translateY(-1px);
}
.layers-icon::after { background: #faf7fa; }

.basemap-panel { border-radius: 20px; }
.basemap-heading span { color: #5d5264; }
.basemap-heading small { color: var(--muted); }
.basemap-option { color: var(--ink); }
.basemap-option:hover { border-color: var(--line); background: #faf7fa; }
.basemap-option.is-active { border-color: rgba(137, 116, 155, .28); background: #f3ecf4; }
.basemap-option em { color: #806d91; }
.basemap-swatch { border-color: rgba(109, 93, 116, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }

.summary,
.finder { border-bottom-color: var(--line); }
.summary { padding-top: 20px; }
.stats-row { margin-top: 0; }
.stat + .stat { border-left-color: var(--line); }
.stat strong { color: #514858; }
.stat span { color: var(--muted); }

.search-box {
  border-color: var(--line);
  background: #faf7fa;
}
.search-box > span { color: #9a8ea0; }
.search-box input { color: var(--ink); }
.search-box input::placeholder { color: #aaa0ae; }
.search-box button { color: var(--muted); }
.search-box:focus-within {
  border-color: rgba(137, 116, 155, .48);
  box-shadow: 0 0 0 3px rgba(137, 116, 155, .09);
}
.filters { background: #f5f0f5; }
.filter { color: var(--muted); }
.filter.is-active {
  color: #5c5064;
  background: #fffdfd;
  box-shadow: 0 2px 9px rgba(80, 65, 91, .08), inset 0 0 0 1px var(--line);
}

.section-heading { color: var(--muted); }
.traffic-list { scrollbar-color: rgba(137, 116, 155, .25) transparent; }
.traffic-card:hover { border-color: var(--line); background: #faf7fa; }
.traffic-card.is-selected { border-color: rgba(137, 116, 155, .28); background: #f3ecf4; }
.traffic-icon {
  color: #806d91;
  border-color: rgba(137, 116, 155, .18);
  background: #f3ecf4;
}
.traffic-icon.atc {
  color: #a87262;
  border-color: rgba(199, 144, 127, .20);
  background: #faefeb;
}
.traffic-main strong { color: #514858; }
.traffic-main span,
.traffic-meta small { color: var(--muted); }
.traffic-meta { color: #6e6275; }

.empty-state strong { color: #615667; }
.empty-state p { color: var(--muted); }
.empty-radar {
  border: 0;
  background: #e7dcec;
  box-shadow: 22px 7px 0 #dce8f1, -16px 12px 0 #f1dfe5;
}
.empty-radar::before,
.empty-radar::after { display: none; }

.detail-panel { scrollbar-color: rgba(137, 116, 155, .28) transparent; }
.detail-panel::-webkit-scrollbar-thumb { background: rgba(137, 116, 155, .24); background-clip: padding-box; }
.detail-close { color: var(--muted); background: #f5eff6; }
.detail-close:hover { color: #5f5367; background: #eee4f0; }
.detail-hero {
  border-bottom-color: var(--line);
  background: linear-gradient(135deg, rgba(223, 209, 232, .58), rgba(255, 253, 253, .2) 64%);
}
.detail-hero.atc { background: linear-gradient(135deg, rgba(245, 222, 214, .62), rgba(255, 253, 253, .2) 64%); }
.detail-kind { color: #806d91; }
.detail-hero.atc .detail-kind { color: #a87262; }
.detail-title h2 { color: #4d4452; }
.detail-title span,
.detail-sub { color: var(--muted); }
.detail-grid { border-bottom-color: var(--line); background: var(--line); }
.detail-metric { background: rgba(255, 253, 253, .96); }
.detail-metric span { color: var(--muted); }
.detail-metric b { color: #554b5d; }
.airport b { color: #514858; }
.airport span { color: var(--muted); }
.route-line { background: linear-gradient(90deg, #89749b, rgba(137, 116, 155, .18)); }
.route-line::after { color: #89749b; background: #fffdfd; }
.route-text { color: #877b8d; }
.route-text b { color: #5d5264; }
.route-scroll { scrollbar-color: rgba(137, 116, 155, .28) transparent; }
.route-scroll::-webkit-scrollbar-thumb { background: rgba(137, 116, 155, .25); }

.legend { color: #786d7f; }
.legend-dot { background: #89749b; box-shadow: 0 0 0 3px rgba(137, 116, 155, .12); }
.legend-dot.atc { background: #c7907f; box-shadow: 0 0 0 3px rgba(199, 144, 127, .12); }
.legend-line { background: #89749b; }
.legend-line.planned { border-top-color: #aa83bd; }

.route-waypoint-label {
  color: #5b4d65;
  border-color: rgba(137, 116, 155, .23);
  background: rgba(255, 253, 253, .94);
  box-shadow: 0 2px 8px rgba(80, 65, 91, .13);
}
.route-waypoint-dot {
  border-color: #fffdfd;
  background: #a77cba;
  box-shadow: 0 0 0 3px rgba(167, 124, 186, .16);
}
.route-waypoint-dot.is-departure {
  border-color: #fffdfd;
  background: #89749b;
  box-shadow: 0 0 0 3px rgba(137, 116, 155, .16);
}
.route-waypoint-dot.is-arrival {
  border-color: #fffdfd;
  background: #c7907f;
  box-shadow: 0 0 0 3px rgba(199, 144, 127, .16);
}
.route-waypoint-label.is-departure { color: #62526f; border-color: rgba(137, 116, 155, .28); }
.route-waypoint-label.is-arrival { color: #8c5f52; border-color: rgba(199, 144, 127, .28); }

.toast { color: #5c5163; }
.aircraft-symbol {
  color: #89749b;
  filter: none;
}
.aircraft-label,
.atc-label {
  color: #514858;
  border-color: rgba(137, 116, 155, .22);
  background: rgba(255, 253, 253, .95);
  box-shadow: 0 3px 10px rgba(80, 65, 91, .14);
}
.aircraft-marker.is-ground .aircraft-symbol { color: #89749b; }
.aircraft-marker.is-selected::before { border-color: rgba(137, 116, 155, .48); }
.atc-core {
  border-color: #fffdfd;
  background: #c7907f;
  box-shadow: 0 0 0 2px rgba(199, 144, 127, .22);
}
.atc-marker::before { border-color: rgba(199, 144, 127, .38); }
.atc-label { border-color: rgba(199, 144, 127, .22); }

@media (max-width: 820px) {
  .topbar,
  .sidebar,
  .detail-panel { background: rgba(255, 253, 253, .97); }
  .sheet-handle span { background: rgba(137, 116, 155, .24); }
  .summary { padding-top: 3px; }
  .brand-copy b { font-size: 17px; }
}

/* Aircraft use a quiet badge instead of glow or a status colour. */
.aircraft-marker {
  border: 1px solid rgba(137, 116, 155, .20);
  border-radius: 50%;
  background: rgba(255, 253, 253, .94);
  box-shadow: 0 3px 9px rgba(80, 65, 91, .18);
}
.aircraft-symbol,
.aircraft-marker.is-ground .aircraft-symbol,
.aircraft-marker.is-selected .aircraft-symbol {
  color: #806c92;
  filter: none;
}
.aircraft-marker.is-selected::before {
  inset: -3px;
  border: 2px solid rgba(128, 108, 146, .54);
  animation: none;
}

/* Dark basemap: soft plum-grey furniture. */
html[data-basemap="dark"] {
  color-scheme: dark;
  --ink: #f2edf3;
  --muted: #b4a9b7;
  --panel: rgba(43, 37, 47, .95);
  --panel-strong: rgba(43, 37, 47, .98);
  --line: rgba(239, 225, 243, .15);
  --cyan: #cdbad5;
  --cyan-soft: rgba(205, 186, 213, .11);
  --lime: #acc4ae;
  --amber: #dfad9c;
  --danger: #e596a2;
  --shadow: 0 20px 56px rgba(0, 0, 0, .32), 0 4px 16px rgba(0, 0, 0, .17);
  --surface: #342e39;
  --surface-soft: #3d3542;
  --surface-active: #4a3f50;
  --title: #f6f0f6;
  --accent: #d2bedb;
}

/* Satellite basemap: warm smoky furniture that does not fight the imagery. */
html[data-basemap="satellite"] {
  color-scheme: dark;
  --ink: #f4f0e7;
  --muted: #bbb4a7;
  --panel: rgba(48, 47, 40, .95);
  --panel-strong: rgba(48, 47, 40, .98);
  --line: rgba(245, 237, 215, .16);
  --cyan: #d8c9ad;
  --cyan-soft: rgba(216, 201, 173, .11);
  --lime: #b6c39f;
  --amber: #dfb083;
  --danger: #e49a93;
  --shadow: 0 20px 56px rgba(0, 0, 0, .36), 0 4px 16px rgba(0, 0, 0, .20);
  --surface: #39382f;
  --surface-soft: #434137;
  --surface-active: #504d40;
  --title: #f7f2e8;
  --accent: #decfb2;
}

html[data-basemap="dark"] .maplibregl-ctrl-group button,
html[data-basemap="satellite"] .maplibregl-ctrl-group button {
  color: var(--ink) !important;
  background: var(--panel-strong) !important;
  border-color: var(--line) !important;
}
html[data-basemap="dark"] .maplibregl-ctrl-group button:hover,
html[data-basemap="satellite"] .maplibregl-ctrl-group button:hover { background: var(--surface-active) !important; }
html[data-basemap="dark"] .maplibregl-ctrl-attrib,
html[data-basemap="satellite"] .maplibregl-ctrl-attrib {
  color: var(--muted);
  background: var(--panel) !important;
}
html[data-basemap="dark"] .maplibregl-ctrl-attrib a,
html[data-basemap="satellite"] .maplibregl-ctrl-attrib a { color: var(--accent); }

html[data-basemap="dark"] .brand-copy b,
html[data-basemap="satellite"] .brand-copy b,
html[data-basemap="dark"] .stat strong,
html[data-basemap="satellite"] .stat strong,
html[data-basemap="dark"] .traffic-main strong,
html[data-basemap="satellite"] .traffic-main strong,
html[data-basemap="dark"] .detail-title h2,
html[data-basemap="satellite"] .detail-title h2,
html[data-basemap="dark"] .detail-metric b,
html[data-basemap="satellite"] .detail-metric b,
html[data-basemap="dark"] .airport b,
html[data-basemap="satellite"] .airport b { color: var(--title); }

html[data-basemap="dark"] .brand-mark::before { background: #75647d; }
html[data-basemap="dark"] .brand-mark::after { background: #5c7180; }
html[data-basemap="dark"] .brand-mark i:nth-child(1) { background: #815f6c; }
html[data-basemap="satellite"] .brand-mark::before { background: #756d59; }
html[data-basemap="satellite"] .brand-mark::after { background: #5f7068; }
html[data-basemap="satellite"] .brand-mark i:nth-child(1) { background: #806355; }

html[data-basemap="dark"] .top-status,
html[data-basemap="satellite"] .top-status,
html[data-basemap="dark"] .basemap-heading small,
html[data-basemap="satellite"] .basemap-heading small,
html[data-basemap="dark"] .stat span,
html[data-basemap="satellite"] .stat span,
html[data-basemap="dark"] .section-heading,
html[data-basemap="satellite"] .section-heading,
html[data-basemap="dark"] .traffic-main span,
html[data-basemap="satellite"] .traffic-main span,
html[data-basemap="dark"] .traffic-meta small,
html[data-basemap="satellite"] .traffic-meta small,
html[data-basemap="dark"] .detail-title span,
html[data-basemap="satellite"] .detail-title span,
html[data-basemap="dark"] .detail-sub,
html[data-basemap="satellite"] .detail-sub,
html[data-basemap="dark"] .detail-metric span,
html[data-basemap="satellite"] .detail-metric span,
html[data-basemap="dark"] .airport span,
html[data-basemap="satellite"] .airport span { color: var(--muted); }

html[data-basemap="dark"] .icon-button,
html[data-basemap="satellite"] .icon-button,
html[data-basemap="dark"] .search-box,
html[data-basemap="satellite"] .search-box,
html[data-basemap="dark"] .filters,
html[data-basemap="satellite"] .filters,
html[data-basemap="dark"] .detail-close,
html[data-basemap="satellite"] .detail-close {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}
html[data-basemap="dark"] .icon-button:hover,
html[data-basemap="satellite"] .icon-button:hover,
html[data-basemap="dark"] .detail-close:hover,
html[data-basemap="satellite"] .detail-close:hover {
  color: var(--title);
  border-color: var(--line);
  background: var(--surface-active);
}
html[data-basemap="dark"] .layers-icon::after,
html[data-basemap="satellite"] .layers-icon::after { background: var(--surface); }

html[data-basemap="dark"] .nav-cycle,
html[data-basemap="satellite"] .nav-cycle {
  color: var(--accent);
  border-color: var(--line);
  background: var(--surface);
}
html[data-basemap="dark"] .nav-cycle.is-offline,
html[data-basemap="satellite"] .nav-cycle.is-offline { color: var(--muted); background: var(--surface); }

html[data-basemap="dark"] .basemap-heading span,
html[data-basemap="satellite"] .basemap-heading span { color: var(--title); }
html[data-basemap="dark"] .basemap-option,
html[data-basemap="satellite"] .basemap-option { color: var(--ink); }
html[data-basemap="dark"] .basemap-option:hover,
html[data-basemap="satellite"] .basemap-option:hover { border-color: var(--line); background: var(--surface); }
html[data-basemap="dark"] .basemap-option.is-active,
html[data-basemap="satellite"] .basemap-option.is-active { border-color: var(--line); background: var(--surface-active); }
html[data-basemap="dark"] .basemap-option em,
html[data-basemap="satellite"] .basemap-option em { color: var(--accent); }

html[data-basemap="dark"] .search-box input,
html[data-basemap="satellite"] .search-box input { color: var(--ink); }
html[data-basemap="dark"] .search-box input::placeholder,
html[data-basemap="satellite"] .search-box input::placeholder { color: var(--muted); }
html[data-basemap="dark"] .search-box:focus-within,
html[data-basemap="satellite"] .search-box:focus-within {
  border-color: rgba(222, 207, 226, .33);
  box-shadow: 0 0 0 3px rgba(222, 207, 226, .07);
}
html[data-basemap="dark"] .filter,
html[data-basemap="satellite"] .filter { color: var(--muted); }
html[data-basemap="dark"] .filter.is-active,
html[data-basemap="satellite"] .filter.is-active {
  color: var(--title);
  background: var(--surface-active);
  box-shadow: inset 0 0 0 1px var(--line);
}

html[data-basemap="dark"] .traffic-card:hover,
html[data-basemap="satellite"] .traffic-card:hover { border-color: var(--line); background: var(--surface); }
html[data-basemap="dark"] .traffic-card.is-selected,
html[data-basemap="satellite"] .traffic-card.is-selected { border-color: var(--line); background: var(--surface-active); }
html[data-basemap="dark"] .traffic-icon,
html[data-basemap="satellite"] .traffic-icon {
  color: var(--accent);
  border-color: var(--line);
  background: var(--surface);
}
html[data-basemap="dark"] .traffic-icon.atc,
html[data-basemap="satellite"] .traffic-icon.atc { color: var(--amber); border-color: var(--line); background: var(--surface); }
html[data-basemap="dark"] .traffic-meta,
html[data-basemap="satellite"] .traffic-meta { color: var(--ink); }

html[data-basemap="dark"] .empty-state strong,
html[data-basemap="satellite"] .empty-state strong { color: var(--title); }
html[data-basemap="dark"] .empty-state p,
html[data-basemap="satellite"] .empty-state p { color: var(--muted); }
html[data-basemap="dark"] .empty-radar {
  background: #67586e;
  box-shadow: 22px 7px 0 #50616d, -16px 12px 0 #71535e;
}
html[data-basemap="satellite"] .empty-radar {
  background: #69614f;
  box-shadow: 22px 7px 0 #52635b, -16px 12px 0 #705749;
}

html[data-basemap="dark"] .detail-hero { background: linear-gradient(135deg, rgba(117, 100, 125, .42), transparent 66%); }
html[data-basemap="dark"] .detail-hero.atc { background: linear-gradient(135deg, rgba(129, 88, 74, .40), transparent 66%); }
html[data-basemap="satellite"] .detail-hero { background: linear-gradient(135deg, rgba(117, 109, 89, .44), transparent 66%); }
html[data-basemap="satellite"] .detail-hero.atc { background: linear-gradient(135deg, rgba(128, 88, 67, .42), transparent 66%); }
html[data-basemap="dark"] .detail-kind,
html[data-basemap="satellite"] .detail-kind { color: var(--accent); }
html[data-basemap="dark"] .detail-hero.atc .detail-kind,
html[data-basemap="satellite"] .detail-hero.atc .detail-kind { color: var(--amber); }
html[data-basemap="dark"] .detail-metric,
html[data-basemap="satellite"] .detail-metric { background: var(--surface); }
html[data-basemap="dark"] .route-line,
html[data-basemap="satellite"] .route-line { background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, .10)); }
html[data-basemap="dark"] .route-line::after,
html[data-basemap="satellite"] .route-line::after { color: var(--accent); background: var(--panel-strong); }
html[data-basemap="dark"] .route-text,
html[data-basemap="satellite"] .route-text { color: var(--muted); }
html[data-basemap="dark"] .route-text b,
html[data-basemap="satellite"] .route-text b { color: var(--title); }

html[data-basemap="dark"] .route-waypoint-label,
html[data-basemap="satellite"] .route-waypoint-label,
html[data-basemap="dark"] .aircraft-label,
html[data-basemap="satellite"] .aircraft-label,
html[data-basemap="dark"] .atc-label,
html[data-basemap="satellite"] .atc-label {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-strong);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
}

html[data-basemap="dark"] .aircraft-marker {
  border-color: rgba(221, 204, 228, .18);
  background: rgba(48, 41, 53, .94);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .30);
}
html[data-basemap="dark"] .aircraft-symbol,
html[data-basemap="dark"] .aircraft-marker.is-ground .aircraft-symbol,
html[data-basemap="dark"] .aircraft-marker.is-selected .aircraft-symbol { color: #d3c1da; filter: none; }
html[data-basemap="dark"] .aircraft-marker.is-selected::before { border-color: rgba(211, 193, 218, .58); }

html[data-basemap="satellite"] .aircraft-marker {
  border-color: rgba(239, 223, 190, .18);
  background: rgba(51, 49, 40, .94);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .34);
}
html[data-basemap="satellite"] .aircraft-symbol,
html[data-basemap="satellite"] .aircraft-marker.is-ground .aircraft-symbol,
html[data-basemap="satellite"] .aircraft-marker.is-selected .aircraft-symbol { color: #e2d1b1; filter: none; }
html[data-basemap="satellite"] .aircraft-marker.is-selected::before { border-color: rgba(226, 209, 177, .58); }

@media (max-width: 820px) {
  html[data-basemap="dark"] .topbar,
  html[data-basemap="dark"] .sidebar,
  html[data-basemap="dark"] .detail-panel,
  html[data-basemap="satellite"] .topbar,
  html[data-basemap="satellite"] .sidebar,
  html[data-basemap="satellite"] .detail-panel { background: var(--panel-strong); }
}

/* Frameless aircraft: a narrow theme-tinted blur keeps the silhouette readable. */
.aircraft-marker {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.aircraft-marker .aircraft-symbol,
.aircraft-marker.is-ground .aircraft-symbol,
.aircraft-marker.is-selected .aircraft-symbol {
  color: #766484;
  filter: drop-shadow(0 1px 1.5px rgba(70, 53, 82, .34));
}
.aircraft-marker.is-selected::before { display: none; }

html[data-basemap="dark"] .aircraft-marker,
html[data-basemap="satellite"] .aircraft-marker {
  border: 0;
  background: transparent;
  box-shadow: none;
}
html[data-basemap="dark"] .aircraft-marker .aircraft-symbol,
html[data-basemap="dark"] .aircraft-marker.is-ground .aircraft-symbol,
html[data-basemap="dark"] .aircraft-marker.is-selected .aircraft-symbol {
  color: #d1c3d7;
  filter: drop-shadow(0 0 2px rgba(118, 100, 127, .70));
}

/* Satellite uses cool charcoal and muted violet, without yellow or green furniture. */
html[data-basemap="satellite"] {
  --ink: #f1eef4;
  --muted: #ada8b4;
  --panel: rgba(45, 44, 50, .95);
  --panel-strong: rgba(45, 44, 50, .98);
  --line: rgba(231, 224, 235, .15);
  --cyan: #c8bed2;
  --cyan-soft: rgba(200, 190, 210, .11);
  --lime: #aeb8c4;
  --amber: #c7a8b6;
  --danger: #d99aa7;
  --shadow: 0 20px 56px rgba(0, 0, 0, .38), 0 4px 16px rgba(0, 0, 0, .21);
  --surface: #37363d;
  --surface-soft: #403e47;
  --surface-active: #4b4853;
  --title: #f4f0f5;
  --accent: #cbbfd4;
}
html[data-basemap="satellite"] .brand-mark::before { background: #706578; }
html[data-basemap="satellite"] .brand-mark::after { background: #606a78; }
html[data-basemap="satellite"] .brand-mark i:nth-child(1) { background: #765e69; }
html[data-basemap="satellite"] .empty-radar {
  background: #685e70;
  box-shadow: 22px 7px 0 #596471, -16px 12px 0 #715863;
}
html[data-basemap="satellite"] .detail-hero { background: linear-gradient(135deg, rgba(112, 101, 120, .44), transparent 66%); }
html[data-basemap="satellite"] .detail-hero.atc { background: linear-gradient(135deg, rgba(118, 87, 101, .42), transparent 66%); }
html[data-basemap="satellite"] .route-waypoint-dot.is-departure {
  border-color: #3f3d45;
  background: #c3b6cc;
  box-shadow: 0 0 0 3px rgba(195, 182, 204, .16);
}
html[data-basemap="satellite"] .route-waypoint-dot.is-arrival {
  border-color: #3f3d45;
  background: #c7a8b6;
  box-shadow: 0 0 0 3px rgba(199, 168, 182, .16);
}
html[data-basemap="satellite"] .route-waypoint-label.is-departure { color: #d9d0df; border-color: rgba(203, 191, 212, .28); }
html[data-basemap="satellite"] .route-waypoint-label.is-arrival { color: #dfc4d0; border-color: rgba(199, 168, 182, .28); }
html[data-basemap="satellite"] .aircraft-marker .aircraft-symbol,
html[data-basemap="satellite"] .aircraft-marker.is-ground .aircraft-symbol,
html[data-basemap="satellite"] .aircraft-marker.is-selected .aircraft-symbol {
  color: #d0c8d8;
  filter: drop-shadow(0 0 2px rgba(102, 95, 116, .72));
}

/* Airport catalogue and weather detail */
.detail-panel.is-airport-detail { width: min(560px, calc(100vw - 420px)); max-height: calc(100dvh - 126px); }
.traffic-icon.airport { color: #786589; font-size: 24px; line-height: 1; }
.airport-card .traffic-main strong { letter-spacing: .06em; }
.airport-div-icon { width: 18px; height: 18px; background: none !important; border: 0 !important; cursor: pointer; }
.airport-marker { width: 18px; height: 18px; position: relative; }
.airport-marker > span {
  position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.92); border-radius: 2px;
  background: #8f749e; box-shadow: 0 0 0 2px rgba(143,116,158,.22); transform: rotate(45deg);
}
.airport-marker > b {
  position: absolute; left: 17px; top: 1px; padding: 2px 5px; border: 1px solid var(--line);
  border-radius: 5px; color: var(--ink); background: var(--panel-strong); box-shadow: 0 2px 8px rgba(0,0,0,.16);
  white-space: nowrap; font-size: 8px; letter-spacing: .05em;
}
.airport-marker.is-selected > span { background: #b17d9b; box-shadow: 0 0 0 4px rgba(177,125,155,.22); }
.airport-hero { padding-bottom: 16px; }
.airport-location { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.airport-tabs {
  position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-strong);
}
.airport-tabs button {
  min-height: 36px; border: 1px solid transparent; border-radius: 9px; color: var(--muted);
  background: transparent; cursor: pointer; font-size: 12px;
}
.airport-tabs button.is-active { border-color: var(--line); color: var(--title, var(--ink)); background: var(--surface-active, rgba(137,116,155,.1)); }
.airport-detail-body { padding: 15px 18px 19px; }
.airport-code-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.airport-code-row > span,
.weather-metrics > span {
  min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface, rgba(255,255,255,.04));
}
.airport-code-row small,
.weather-metrics small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.airport-code-row b,
.weather-metrics b { display: block; margin-top: 5px; overflow-wrap: anywhere; color: var(--title, var(--ink)); font-size: 13px; }
.airport-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.airport-info-grid > div { min-width: 0; padding: 12px; background: var(--panel-strong); }
.airport-info-grid span { display: block; color: var(--muted); font-size: 9px; }
.airport-info-grid b { display: block; margin-top: 5px; overflow-wrap: anywhere; color: var(--title, var(--ink)); font-size: 12px; font-weight: 560; }
.airport-data-note { margin: 12px 2px 0; color: var(--muted); line-height: 1.6; font-size: 10px; }
.airport-extended-loading {
  margin-top: 12px; padding: 18px 14px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); text-align: center; font-size: 10px;
}
.airport-data-section { margin-top: 16px; }
.airport-data-section > h3 {
  margin: 0 2px 8px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .12em;
}
.runway-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.runway-card {
  min-width: 0; display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface, rgba(255,255,255,.04));
}
.runway-card > div { min-width: 0; display: grid; gap: 3px; }
.runway-card b { overflow-wrap: anywhere; color: var(--title, var(--ink)); font-size: 12px; font-weight: 620; }
.runway-card span, .runway-card small { overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 1.45; }
.airport-frequency-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.airport-frequency-list > div {
  min-width: 0; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--panel-strong);
}
.airport-frequency-list > div + div { margin-top: 1px; }
.airport-frequency-list b { color: var(--muted); font-size: 9px; font-weight: 650; }
.airport-frequency-list span { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }
.airport-frequency-list strong { color: var(--title, var(--ink)); font-size: 12px; font-weight: 620; font-variant-numeric: tabular-nums; }
.detail-message { padding: 26px 14px; text-align: center; }
.detail-message b { color: var(--title, var(--ink)); font-size: 14px; }
.detail-message p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; font-size: 11px; }
.detail-message.is-loading::before { content: ""; width: 22px; height: 22px; display: block; margin: 0 auto 13px; border: 2px solid var(--line); border-top-color: #8f749e; border-radius: 50%; animation: spin .8s linear infinite; }
.detail-action,
.weather-refresh { border: 1px solid var(--line); border-radius: 9px; color: var(--title, var(--ink)); background: var(--surface, transparent); cursor: pointer; }
.detail-action { min-height: 36px; margin-top: 15px; padding: 0 16px; }
.weather-card { margin-bottom: 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface, rgba(255,255,255,.03)); }
.weather-card-title { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.weather-card-title b { color: var(--title, var(--ink)); font-size: 12px; letter-spacing: .08em; }
.weather-card-title span { color: var(--muted); font-size: 9px; }
.weather-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--line); }
.weather-metrics > span { border: 0; border-radius: 0; background: var(--panel-strong); }
.weather-card pre {
  margin: 0; padding: 13px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink); background: transparent; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.weather-valid { margin: 0; padding: 11px 13px 0; color: var(--muted); line-height: 1.5; font-size: 10px; }
.weather-empty { padding: 18px 13px; color: var(--muted); font-size: 11px; }
.weather-warning { margin-bottom: 11px; padding: 10px 12px; border: 1px solid rgba(199,144,127,.28); border-radius: 10px; color: var(--muted); background: rgba(199,144,127,.08); line-height: 1.5; font-size: 10px; }
.weather-source { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--muted); font-size: 9px; }
.weather-source span:first-child { flex: 1; }
.weather-refresh { min-height: 29px; padding: 0 10px; font-size: 10px; }
.airport-atc-list { display: grid; gap: 8px; }
.airport-atc-list button {
  width: 100%; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-align: left;
  background: var(--surface, transparent); cursor: pointer;
}
.airport-atc-list button:hover { background: var(--surface-active, rgba(137,116,155,.1)); }
.airport-atc-list button > span { min-width: 0; display: grid; gap: 4px; }
.airport-atc-list button > span:last-child { text-align: right; }
.airport-atc-list b { overflow-wrap: anywhere; color: var(--title, var(--ink)); font-size: 12px; }
.airport-atc-list small { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
html[data-basemap="dark"] .traffic-icon.airport,
html[data-basemap="satellite"] .traffic-icon.airport { color: var(--accent); }
html[data-basemap="dark"] .airport-marker > span,
html[data-basemap="satellite"] .airport-marker > span { border-color: var(--panel-strong); background: var(--accent); box-shadow: 0 0 0 2px rgba(210,195,216,.18); }
html[data-basemap="dark"] .airport-marker.is-selected > span,
html[data-basemap="satellite"] .airport-marker.is-selected > span { background: var(--amber); box-shadow: 0 0 0 4px rgba(199,168,182,.18); }

@media (max-width: 820px) {
  .detail-panel.is-airport-detail { left: 8px; right: 8px; width: auto; max-height: min(78dvh, calc(100dvh - 86px)); }
  .airport-detail-body { padding: 13px; }
  .weather-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 430px) {
  .airport-info-grid { grid-template-columns: 1fr; }
  .airport-code-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runway-list { grid-template-columns: 1fr; }
  .airport-frequency-list > div { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 7px; padding-inline: 10px; }
  .airport-atc-list button { grid-template-columns: 1fr; }
  .airport-atc-list button > span:last-child { text-align: left; }
}

/* Final mobile geometry: keep the header, controls and sheet in separate zones. */
@media (max-width: 820px) {
  .topbar {
    height: 56px; min-height: 56px; display: grid;
    grid-template-columns: auto minmax(62px, 1fr) auto; gap: 6px;
    padding: 0 7px 0 10px; border-radius: 16px; overflow: hidden;
  }
  .brand { min-width: 0; gap: 7px; }
  .brand-mark { width: 27px; height: 27px; flex: 0 0 auto; }
  .brand-copy b { font-size: 13px; letter-spacing: .08em; white-space: nowrap; }
  .top-status { min-width: 0; justify-content: center; gap: 6px; overflow: hidden; }
  .top-status #connectionText, .top-status .divider, #utcDate { display: none; }
  .utc-clock { min-width: 0; font-size: 9px; letter-spacing: 0; }
  .top-actions { min-width: max-content; gap: 2px; }
  .icon-button { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl-group { margin-top: 78px !important; }
  .sidebar.is-expanded {
    top: calc(max(10px, env(safe-area-inset-top)) + 66px);
    bottom: max(8px, env(safe-area-inset-bottom)); height: auto; min-height: 0;
  }
}

@media (max-width: 350px) {
  .brand-copy { display: none; }
  .topbar { grid-template-columns: 29px minmax(58px, 1fr) auto; }
}

/* Visual refinement, September 2026. Existing modules, map data and interactions are retained. */
:root {
  --ink: #303441;
  --muted: #697184;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e1e4ec;
  --cyan: #89749b;
  --cyan-soft: #f0ebf5;
  --shadow: 0 8px 28px rgba(34, 43, 65, .09), 0 2px 5px rgba(34, 43, 65, .04);
  --radius: 18px;
  --surface: #f6f7fa;
  --surface-soft: #eef0f6;
  --surface-active: #f0ebf5;
  --title: #303441;
  --accent: #75618f;
  --ui-active-line: #c7b8d9;
  --ui-field-line: #cbd1dd;
  --ui-atc: #925c4c;
}
html[data-basemap="dark"], html[data-basemap="satellite"] {
  --ink: #eeedf4;
  --muted: #b0afc0;
  --panel: #22222e;
  --panel-strong: #22222e;
  --line: #3b3b4d;
  --shadow: 0 8px 30px rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .12);
  --surface: #2a2b39;
  --surface-soft: #323241;
  --surface-active: #3a304a;
  --title: #eeedf4;
  --accent: #bba4d3;
  --ui-active-line: #76628d;
  --ui-field-line: #555568;
  --ui-atc: #dfad9c;
}
html:root body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
html:root .topbar,
html:root .sidebar,
html:root .detail-panel,
html:root .basemap-panel,
html:root .weather-settings-panel,
html:root .legend,
html:root .toast {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
html:root .topbar { border-radius: 18px; }
html:root .brand-copy b { font-family: inherit; font-weight: 650; letter-spacing: .025em; color: var(--title); }
html:root .brand-mark::before { background: color-mix(in srgb, var(--accent) 25%, var(--panel-strong)); }
html:root .brand-mark::after { background: color-mix(in srgb, #7699bd 30%, var(--panel-strong)); }
html:root .brand-mark i:nth-child(1) { background: color-mix(in srgb, #bd8399 30%, var(--panel-strong)); }
html:root .top-status, html:root .basemap-heading small { color: var(--muted); }
html:root .icon-button, html:root .detail-close { color: var(--muted); background: var(--surface); border-color: var(--line); border-radius: 10px; }
html:root .icon-button:hover, html:root .detail-close:hover { color: var(--accent); border-color: var(--ui-active-line); background: var(--surface-active); }
html:root .icon-button[aria-expanded="true"] { color: var(--accent); border-color: var(--ui-active-line); background: var(--surface-active); }
html:root .layers-icon::after { background: var(--surface); }
html:root .basemap-panel, html:root .weather-settings-panel { border-radius: 14px; }
html:root .basemap-heading span { color: var(--title); }
html:root .basemap-option { color: var(--ink); border-radius: 10px; }
html:root .basemap-option:hover { background: var(--surface); }
html:root .basemap-option.is-active { border-color: var(--ui-active-line); background: var(--surface-active); }
html:root .basemap-option em { color: var(--accent); }
html:root .basemap-option small { color: var(--muted); }
html:root .unit-setting > div { background: var(--surface); border-color: var(--line); }
html:root .unit-setting button { color: var(--muted); }
html:root .unit-setting button.is-active { color: var(--accent); background: var(--surface-active); box-shadow: inset 0 0 0 1px var(--ui-active-line); }
html:root .stat strong { color: var(--title); font-weight: 600; font-variant-numeric: tabular-nums; }
html:root .stat span { color: var(--muted); }
html:root .search-box { border-color: var(--ui-field-line); border-radius: 10px; background: var(--surface); }
html:root .search-box > span, html:root .search-box input::placeholder { color: var(--muted); }
html:root .search-box:focus-within { border-color: var(--accent); background: var(--panel-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
html:root .filters { border-radius: 10px; background: var(--surface-soft); }
html:root .filter { border-radius: 7px; color: var(--muted); }
html:root .filter:hover { color: var(--accent); }
html:root .filter.is-active { color: var(--accent); font-weight: 600; background: var(--panel-strong); box-shadow: 0 1px 4px rgba(34, 43, 65, .07), inset 0 0 0 1px var(--ui-active-line); }
html:root .section-heading { color: var(--muted); letter-spacing: .035em; }
html:root .traffic-card { border-radius: 10px; }
html:root .traffic-card:hover { background: var(--surface); border-color: var(--line); }
html:root .traffic-card.is-selected { background: var(--surface-active); border-color: var(--ui-active-line); box-shadow: inset 2px 0 0 var(--accent); }
html:root .traffic-icon { color: var(--accent); background: var(--surface-active); border-color: var(--line); border-radius: 10px; }
html:root .traffic-icon.atc { color: var(--ui-atc); background: var(--surface); }
html:root .traffic-main strong { color: var(--title); font-weight: 650; }
html:root .traffic-main span, html:root .traffic-meta small { color: var(--muted); }
html:root .traffic-meta { color: var(--ink); font-variant-numeric: tabular-nums; }
html:root .empty-state strong { color: var(--title); }
html:root .empty-state p { color: var(--muted); }
html:root .empty-radar { background: color-mix(in srgb, var(--accent) 24%, var(--panel-strong)); box-shadow: 22px 7px 0 color-mix(in srgb, #7699bd 23%, var(--panel-strong)), -16px 12px 0 color-mix(in srgb, #bd8399 20%, var(--panel-strong)); }
html:root .detail-hero { background: linear-gradient(115deg, var(--surface-active), var(--panel-strong) 85%); }
html:root .detail-hero.atc { background: linear-gradient(115deg, color-mix(in srgb, var(--amber) 12%, var(--panel-strong)), var(--panel-strong) 85%); }
html:root .detail-kind { color: var(--accent); }
html:root .detail-hero.atc .detail-kind { color: var(--ui-atc); }
html:root .detail-title h2, html:root .detail-metric b, html:root .airport b { color: var(--title); }
html:root .detail-title span, html:root .detail-sub, html:root .detail-metric span, html:root .airport span { color: var(--muted); }
html:root .detail-metric { background: var(--panel-strong); }
html:root .detail-metric b { font-variant-numeric: tabular-nums; font-weight: 600; }
html:root .route-line::after { background: var(--panel-strong); }
html:root .route-text { color: var(--muted); }
html:root .route-text b { color: var(--ink); }
html:root .legend, html:root .toast { color: var(--ink); border-radius: 10px; }
html:root .legend { right: 60px; }
html:root .airport-tabs button.is-active { color: var(--accent); border-color: var(--ui-active-line); background: var(--surface-active); }
html:root .airport-code-row > span, html:root .runway-card, html:root .weather-card { background: var(--surface); border-radius: 10px; }
html:root .airport-atc-list button { border-radius: 10px; }
html:root .detail-action:hover, html:root .weather-refresh:hover { border-color: var(--ui-active-line); color: var(--accent); background: var(--surface-active); }
html:root .maplibregl-ctrl-group { box-shadow: var(--shadow) !important; }
html:root .maplibregl-ctrl-group button { background: var(--panel-strong) !important; color: var(--ink) !important; }
html:root .maplibregl-ctrl-group button:hover { background: var(--surface) !important; }
html[data-basemap="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon,
html[data-basemap="satellite"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: brightness(0) invert(.9); }
html:root .maplibregl-ctrl-attrib { color: var(--muted); background: var(--panel) !important; }
html:root .maplibregl-ctrl-attrib a { color: var(--muted); }
html:root button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) {
  html:root .topbar { border-radius: 14px; }
  html:root .sidebar, html:root .detail-panel { border-radius: 18px; background: var(--panel-strong); }
  html:root .icon-button { border-radius: 9px; }
  html:root .sheet-handle span { background: var(--ui-active-line); }
}
