:root {
  --bg: #0e1114;
  --chrome: #1a1a1a;
  --chrome-2: #222226;
  --card: #2b2b2f;
  --panel: rgba(26, 26, 26, 0.94);
  --panel-solid: #1a1a1a;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f2f4f6;
  --muted: #9aa3ad;
  --yellow: #ffcc00;
  --yellow-2: #ffe38a;
  --orange: #ff8b1a;
  --teal: #2fd3a8;
  --blue: #4a90e2;
  --blue-deep: #336699;
  --danger: #ff6d5f;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: "Manrope", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --on-chrome: #f2f4f6;
  --on-chrome-muted: #9aa3ad;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --top-chrome: 52px;
  --top: calc(var(--top-chrome) + var(--safe-top));
  --strip: 0px;
  --side: min(380px, 92vw);
  --dock-pad: 72px;
  --dock-h: calc(var(--dock-pad) + var(--safe-bottom));
  --touch: 44px;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
}

/* Crawler / a11y copy; visually hidden so the map UI stays clean (no layout impact) */
.seo-h1,
.seo-landing {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.seo-landing {
  white-space: normal;
  clip: rect(0, 0, 0, 0);
}
.seo-landing .seo-faq h2,
.seo-landing .seo-faq h3 {
  font-size: inherit;
  font-weight: 700;
}
.seo-landing .seo-links a {
  color: inherit;
}
.seo-noscript {
  max-width: 40rem;
  margin: 2rem auto;
  padding: 1.25rem;
  font-family: var(--font);
  color: #122033;
  background: #eef3f8;
}

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

select,
select option {
  color-scheme: light;
}

.app {
  position: relative;
  height: 100%;
  height: 100dvh;
  max-width: 100%;
  overflow: hidden; /* clip off-canvas drawers (translateX) so they never scroll the page */
  background: var(--bg);
  isolation: isolate;
}

/* —— Top chrome —— */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--top);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: var(--safe-top) max(0.7rem, var(--safe-right)) 0 max(0.7rem, var(--safe-left));
  background: var(--chrome);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
  min-width: max-content;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--yellow);
  line-height: 0;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text strong {
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  font-weight: 800;
}

.icon-btn, .map-tools button, .chip, .text-btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text);
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.search {
  position: relative;
  width: min(220px, 34vw);
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #2a2a2e;
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
  font-size: 0.86rem;
}
.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search svg { color: var(--muted); flex: 0 0 auto; }

.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: max(100%, min(280px, calc(100vw - 1.5rem)));
  min-width: 0;
  max-width: calc(100vw - 1.5rem);
  background: var(--chrome-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: min(320px, 50vh);
  overflow-y: auto;
  z-index: 40;
}

.suggest button {
  width: 100%;
  text-align: start;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.9rem;
  display: grid;
  gap: 0.15rem;
  cursor: pointer;
}
.suggest button:hover { background: rgba(255, 204, 0, 0.08); }
.suggest b { font-size: 0.92rem; }
.suggest span { color: var(--muted); font-size: 0.78rem; }

.layer-toggles {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.layer-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.layer-toggle[data-on="1"] {
  color: #1a1400;
  background: var(--yellow);
  border-color: transparent;
  opacity: 1;
}

.layer-toggle[data-on="0"] {
  opacity: 0.55;
}

.layer-toggle:hover {
  opacity: 1;
}

.top-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-shrink: 1;
}

.chip {
  height: 32px;
  padding: 0 0.7rem;
  border-radius: 999px;
  color: var(--text);
  background: #2a2a2e;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.chip[data-on="1"] {
  color: #1a1400;
  background: var(--yellow);
  border-color: transparent;
}

.live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  padding-inline-start: 0.25rem;
  white-space: nowrap;
}
.live .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(47, 211, 168, 0.5);
  animation: pulse 1.8s ease-out infinite;
}
.live.is-error .dot { background: var(--danger); animation: none; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(47, 211, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 211, 168, 0); }
}

/* —— Side panel (Most tracked) —— */
.side-panel {
  position: absolute;
  top: var(--top);
  left: 0;
  bottom: 0;
  width: var(--side);
  z-index: 24;
  display: flex;
  flex-direction: column;
  background: rgba(22, 22, 24, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  pointer-events: none;
}
.side-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.app.has-strip .side-panel {
  transform: translateX(-105%);
  pointer-events: none;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 0.35rem;
  flex-shrink: 0;
}
.side-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.85rem 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}
.side-tab.is-on {
  color: var(--text);
}
.side-tab.is-on::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--yellow);
}

.side-pane {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.side-pane.is-on {
  display: flex;
}
.side-pane[hidden] {
  display: none !important;
}

.side-panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem 0.55rem;
  flex-shrink: 0;
}
.side-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.side-panel-close {
  margin-inline-start: auto;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 0.4rem;
  border-radius: 4px;
  background: var(--yellow);
  color: #1a1400;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.side-footnote {
  margin: 0;
  padding: 0.65rem 0.9rem 0.9rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.side-stub {
  padding: 1.2rem 1rem;
  color: var(--muted);
  line-height: 1.5;
}
.side-stub-link {
  display: inline-flex;
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--yellow);
  color: #1a1400;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.85rem;
}

/* —— Filters drawer —— */
.drawer {
  position: absolute;
  top: var(--top);
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--panel);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transform: translateX(105%);
  transition: transform 0.28s ease;
}
.drawer.is-open { transform: translateX(0); }

.site-drawer {
  position: absolute;
  top: var(--top);
  left: 0;
  bottom: 0;
  width: min(300px, 88vw);
  z-index: 27;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem;
  background: var(--panel-solid);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transform: translateX(-105%);
  transition: transform 0.28s ease;
}
.site-drawer.is-open { transform: translateX(0); }
.site-nav {
  display: grid;
  gap: 0.2rem;
  overflow: auto;
  min-height: 0;
}
.site-nav a {
  display: block;
  padding: 0.65rem 0.7rem;
  min-height: var(--touch);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  touch-action: manipulation;
}
.site-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--yellow);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}

.field, .toggle {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field select {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  color: #122033;
}
.field select option,
.lang-select option {
  background: #ffffff;
  color: #122033;
}
.toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  color: var(--text);
}
.maritime-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.maritime-section > span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.vessel-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.type-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.22rem 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.5;
}
.type-chip.is-on {
  opacity: 1;
  border-color: color-mix(in srgb, #0aa3a0 50%, var(--line));
  background: color-mix(in srgb, #0aa3a0 16%, transparent);
}
.range-row { display: grid; gap: 0.35rem; }
.range-meta { font-family: var(--mono); color: var(--muted); text-transform: none; }

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.drawer-stats div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.45rem;
  text-align: center;
  background: rgba(255,255,255,0.02);
}
.drawer-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.drawer-stats span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flight-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.8rem;
}

.flight-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--card);
  text-align: start;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  display: grid;
  gap: 0.35rem;
  color: inherit;
}
.flight-item:hover, .flight-item.is-active {
  background: #34343a;
  border-color: rgba(255, 204, 0, 0.28);
}
.flight-item-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.flight-item .rank {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  width: 1.4rem;
  flex-shrink: 0;
}
.flight-item .cs {
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flight-item .type-chip {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.03em;
}
.flight-item .meta-num {
  margin-inline-start: auto;
  color: var(--yellow);
  font-weight: 800;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.flight-item .route-line {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  padding-inline-start: 1.85rem;
}
.flight-item .route-code {
  display: inline-block;
  margin: 0 0.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #d5dbe2;
  font-size: 0.7rem;
  font-weight: 700;
}

.sources {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  margin-top: auto;
}

/* —— Map stage —— */
.stage {
  position: absolute;
  inset: var(--top) 0 0 0;
}
#map { width: 100%; height: 100%; }

/* Required Google Maps attribution logo when Map Tiles basemap is active. */
.google-maps-logo {
  position: absolute;
  left: 0.65rem;
  bottom: 1.65rem;
  z-index: 5;
  display: block;
  line-height: 0;
  opacity: 0.92;
  pointer-events: auto;
}
.google-maps-logo[hidden] { display: none; }
.google-maps-logo img {
  display: block;
  height: 26px;
  width: auto;
}
html[dir="rtl"] .google-maps-logo {
  left: auto;
  right: 0.65rem;
}

.map-boot {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(14, 17, 20, 0.94);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.map-boot:not(.is-hidden) { pointer-events: auto; }
.map-boot-allow {
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: #1a1400;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.map-boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.map-boot-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.map-boot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(47, 211, 168, 0.45);
  animation: pulse 1.8s ease-out infinite;
}

/* Google / Flightradar24-style “my location” blue dot */
.user-loc {
  position: relative;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.user-loc-accuracy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.18);
  border: 1px solid rgba(66, 133, 244, 0.32);
  width: 40px;
  height: 40px;
  box-sizing: border-box;
}
.user-loc-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.4);
  animation: user-loc-pulse 2s ease-out infinite;
}
.user-loc-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #4285f4;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
@keyframes user-loc-pulse {
  0% { transform: scale(0.55); opacity: 0.75; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}
.map-tools #recenter.is-locating {
  color: #1a73e8;
}
.map-tools #recenter.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.layers {
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  z-index: 6;
}
.app.has-side .layers,
.app.has-strip .layers {
  left: calc(var(--side) + 0.75rem);
}
.layers-panel button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: #102033;
  cursor: pointer;
}
.weather-panel {
  width: 236px;
}
.wx-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.wx-days button {
  flex: 1 1 calc(33% - 0.3rem);
  text-align: center;
  font-size: 0.74rem;
  padding: 0.38rem 0.2rem;
}
.wx-hour {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5d7284;
}
.wx-hour input {
  width: 100%;
  accent-color: #e2a20a;
}
.wx-scale {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
}
.wx-scale i { flex: 1; }
.wx-readout {
  margin: 0.1rem 0.15rem 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
}
.wx-popup .maplibregl-popup-content {
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  color: #102033;
  font-family: inherit;
}
.wx-pop {
  display: grid;
  gap: 0.2rem;
  min-width: 150px;
}
.wx-pop p {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0;
  font-size: 0.82rem;
}
.wx-pop strong {
  display: block;
  margin-bottom: 0.25rem;
}
.layers-panel {
  width: 180px;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #102033;
  display: grid;
  gap: 0.35rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.layers-panel[hidden] {
  display: none;
}
.layers-panel p {
  margin: 0.15rem 0.2rem 0.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d7284;
}
.layers-panel button {
  text-align: start;
  border-radius: 9px;
  padding: 0.45rem 0.6rem;
  background: transparent;
}
.layers-panel button.is-on {
  background: #f7c948;
  border-color: transparent;
  font-weight: 700;
}
.legend {
  display: grid;
  gap: 0.28rem;
  padding: 0.15rem 0.25rem 0.3rem;
  font-size: 0.78rem;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.map-tools {
  position: absolute;
  right: 0.85rem;
  bottom: calc(var(--dock-h) + 1.1rem);
  display: grid;
  gap: 0.35rem;
  z-index: 5;
}
.map-tools button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.9);
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
  color: var(--text);
}
.app.has-strip .map-tools { bottom: calc(var(--dock-h) + 1.1rem); }

.hud {
  position: absolute;
  left: 0.85rem;
  bottom: calc(var(--dock-h) + 1.1rem);
  z-index: 5;
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.88);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  backdrop-filter: blur(8px);
}
.app.has-side .hud {
  left: calc(var(--side) + 0.75rem);
}
.app.has-strip .hud {
  left: calc(var(--side) + 0.75rem);
}

/* —— Floating bottom dock —— */
.bottom-dock {
  position: absolute;
  left: 50%;
  bottom: max(0.85rem, var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  max-width: calc(100% - 1.2rem - var(--safe-left) - var(--safe-right));
  border-radius: 999px;
  background: rgba(22, 22, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  box-sizing: border-box;
}
.app.has-side .bottom-dock {
  left: calc(50% + var(--side) / 2);
}
.app.has-strip .bottom-dock {
  left: calc(50% + var(--side) / 2);
}

.dock-btn {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.2rem;
  min-width: 62px;
  min-height: var(--touch);
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #e8ecf0;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dock-btn svg { opacity: 0.92; }
.dock-btn:hover,
.dock-btn.is-on {
  background: rgba(255, 255, 255, 0.08);
  color: var(--yellow);
}

.playback-sheet {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-h) + 0.4rem);
  transform: translateX(-50%);
  z-index: 9;
  width: min(380px, calc(100% - 2rem));
  padding: 0.85rem 1rem 0.95rem;
  border-radius: 14px;
  background: var(--chrome);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
}
.playback-sheet[hidden] { display: none !important; }

/* JSP-101 — daily busiest airports Stats dock sheet */
.busiest-sheet {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-h) + 0.4rem);
  transform: translateX(-50%);
  z-index: 9;
  width: min(420px, calc(100% - 1.2rem));
  max-height: min(62vh, 520px);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: 14px;
  background: var(--chrome);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  box-sizing: border-box;
}
.busiest-sheet[hidden] { display: none !important; }
.busiest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.busiest-head strong {
  display: block;
  margin: 0;
  font-size: 0.98rem;
}
.busiest-hint {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.busiest-meta {
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 0.45rem;
  font-variant-numeric: tabular-nums;
}
.busiest-list {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 0.35rem;
  padding-right: 0.15rem;
  flex: 1;
  min-height: 0;
}
.busiest-empty {
  margin: 0.6rem 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.busiest-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.45rem;
  align-items: start;
  width: 100%;
  text-align: start;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(127, 140, 160, 0.08);
  color: inherit;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}
.busiest-row:hover,
.busiest-row:focus-visible {
  border-color: rgba(226, 162, 10, 0.45);
  background: rgba(226, 162, 10, 0.08);
  outline: none;
}
.busiest-rank {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.15rem;
}
.busiest-main {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}
.busiest-code {
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
}
.busiest-name {
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.busiest-sub {
  font-size: 0.7rem;
  color: var(--muted);
}
.busiest-bar {
  display: block;
  height: 3px;
  margin-top: 0.28rem;
  border-radius: 99px;
  background: rgba(127, 140, 160, 0.22);
  overflow: hidden;
}
.busiest-bar i {
  display: block;
  height: 100%;
  background: var(--yellow, #e2a20a);
  border-radius: inherit;
}
.busiest-nums {
  display: grid;
  justify-items: end;
  gap: 0.05rem;
  font-size: 0.68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.busiest-nums strong {
  color: var(--text);
  font-size: 0.95rem;
}
.busiest-foot {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}
.busiest-foot a {
  color: var(--yellow, #e2a20a);
  font-weight: 700;
  text-decoration: none;
}
html[data-theme="light"] .busiest-sheet {
  background: #fff;
}
html[dir="rtl"] .busiest-row {
  text-align: start;
}
html[dir="rtl"] .busiest-nums {
  justify-items: start;
}
@media (max-width: 720px) {
  .busiest-sheet {
    width: calc(100% - 0.9rem - var(--safe-left) - var(--safe-right));
    max-height: min(58vh, 480px);
    bottom: calc(var(--dock-h) + 0.35rem + var(--safe-bottom));
    padding: 0.75rem 0.75rem 0.65rem;
  }
  .busiest-row {
    grid-template-columns: 1.7rem 1fr auto;
    padding: 0.4rem 0.4rem;
  }
  .dock-btn[data-dock="stats"] span {
    letter-spacing: -0.01em;
  }
}

.playback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.playback-sheet strong { display: block; margin: 0; }
.playback-hint {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.playback-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.playback-scrub {
  width: 100%;
  accent-color: var(--yellow);
  margin: 0 0 0.35rem;
}
.playback-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.55rem;
  line-height: 1.35;
}
.playback-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.playback-actions .text-btn.is-accent {
  color: var(--yellow);
}
body.is-playback .hud-count::after,
body.is-playback #hudCount::after {
  content: none;
}
body.is-playback #statusText {
  color: var(--yellow);
}

/* —— Per-flight replay scrubber (detail strip) —— */
.flight-replay {
  flex-shrink: 0;
  padding: 0.7rem 0.9rem 0.75rem;
  background: #1a1a1a;
  color: #f2f4f6;
  border-block: 1px solid rgba(255, 255, 255, 0.08);
}
.flight-replay[hidden] { display: none !important; }
.flight-replay-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}
.flight-replay-head strong {
  color: var(--orange);
  font-size: 0.92rem;
  font-weight: 700;
}
.flight-replay-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--yellow);
}
.flight-replay-hint {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.flight-replay-scrub {
  width: 100%;
  accent-color: var(--orange);
  margin: 0 0 0.3rem;
}
.flight-replay-meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
  min-height: 1.1em;
}
.flight-replay-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.flight-replay-actions .text-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f4f6;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.flight-replay-actions .text-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.flight-replay-actions .text-btn.is-accent {
  color: var(--yellow);
  border-color: rgba(255, 204, 0, 0.35);
}
.flight-replay-actions .text-btn:not(:disabled):hover {
  background: rgba(255, 139, 26, 0.16);
}

/* —— Flight detail strip —— */
.strip {
  position: absolute;
  top: var(--top);
  left: 0;
  bottom: 0;
  width: var(--side);
  z-index: 28;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #f4f5f7;
  color: #1c2430;
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.28);
  animation: rise 0.28s ease;
}
.strip[hidden] { display: none !important; }

.card-head {
  position: relative;
  padding: 0.75rem 0.9rem 0.7rem;
  background: var(--chrome);
  color: #fff;
}
.card-head-actions {
  position: absolute;
  top: 0.55rem;
  inset-inline-end: 0.55rem;
  display: flex;
  gap: 0.35rem;
}
.icon-round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.icon-round.is-on {
  color: var(--yellow);
  border-color: rgba(255, 204, 0, 0.45);
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
  padding-inline-end: 5rem;
}
.card-title-row strong {
  color: var(--orange);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.pill {
  border-radius: 6px;
  background: #4a5158;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
}
.pill-type { background: var(--blue); }

@keyframes rise {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.strip-close {
  font-size: 1.35rem;
}
.strip-photo {
  position: relative;
  height: 200px;
  background: #111;
  flex-shrink: 0;
}
.strip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-photo img[hidden] { display: none; }
.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.35rem;
  padding: 1rem;
  text-align: center;
  color: var(--yellow);
  background: linear-gradient(160deg, #1a1a1a, #2c2c30);
  overflow: hidden;
}
.photo-fallback-skel {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.02) 90%
  );
  background-size: 200% 100%;
  animation: photoShimmer 1.1s linear infinite;
}
.photo-fallback[data-state="loading"] .photo-fallback-skel {
  display: block;
}
@keyframes photoShimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}
.photo-fallback-mark {
  position: relative;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 1.35rem;
  opacity: 0.9;
}
.photo-fallback-msg {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: 16rem;
  line-height: 1.35;
}
.photo-fallback[data-state="loading"] .photo-fallback-msg {
  color: rgba(255, 214, 10, 0.85);
}
.photo-fallback[data-state="empty"] .photo-fallback-mark {
  opacity: 0.45;
}
.photo-fallback[data-state="empty"] .photo-fallback-skel {
  display: none;
}
.photo-fallback.is-hidden { display: none; }
.strip-photo img.is-blur {
  filter: blur(8px) saturate(0.85);
  transform: scale(1.04);
}
.photo-credit {
  position: absolute;
  left: 0.55rem;
  bottom: 0.4rem;
  color: #fff;
  font-size: 0.72rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.airline {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding-inline-end: 5rem;
}
.route-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.4rem;
  align-items: start;
  padding: 0.95rem 0.85rem 0.55rem;
  background: #fff;
  color: #1c2430;
  text-align: center;
}
.route-board strong {
  display: block;
  font-size: 2.05rem;
  letter-spacing: 0.03em;
  line-height: 1;
}
.route-board em {
  display: block;
  margin-top: 0.35rem;
  color: #6b7280;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.route-tz {
  display: block;
  margin-top: 0.2rem;
  color: #9aa3af;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 0.9em;
}
.route-arrow {
  color: var(--yellow);
  display: grid;
  place-items: center;
  padding-top: 0.35rem;
}
.route-arrow svg {
  filter: drop-shadow(0 0 0 transparent);
}

/* FR24-style schedule + progress + sections */
.detail-schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #fff;
  color: #1c2430;
  border-top: 1px solid #e8eaee;
  padding: 0.15rem 0.85rem 0.75rem;
}
.sched-col {
  display: grid;
  gap: 0.45rem;
}
.sched-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}
.sched-cell-end {
  align-items: flex-end;
  text-align: end;
}
.sched-cell span {
  color: #8b93a1;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sched-cell strong {
  color: #111827;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sched-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.detail-progress {
  background: #eef2f6;
  padding: 0.85rem 0.9rem 0.75rem;
  border-top: 1px solid #e0e5eb;
}
.progress-track {
  position: relative;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #c5ccd6 0 6px,
    transparent 6px 10px
  );
  margin: 0.55rem 0.15rem 0.85rem;
}
.progress-flown {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  background: var(--yellow);
  border-radius: 2px;
  max-width: 100%;
}
.progress-plane {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-inline-start: -7px;
  background: #6b7280;
  clip-path: polygon(0 45%, 55% 45%, 55% 20%, 100% 50%, 55% 80%, 55% 55%, 0 55%);
  transform: rotate(0deg);
}
html[dir="rtl"] .progress-plane {
  transform: scaleX(-1);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--mono);
}
.progress-remain-meta {
  text-align: end;
}
/* Ships reuse the strip; hide flight-only blocks. Keep dynamics for AIS. */
.strip.is-ship .detail-schedule,
.strip.is-ship .detail-progress,
.strip.is-ship #detailAircraftBlock,
.strip.is-ship #detailChartsBlock,
.strip.is-ship #detailAdsbBlock,
.strip.is-ship #flightReplay,
.strip.is-ship #view3dActions,
.strip.is-ship #view3dOpenBtn {
  display: none !important;
}
.sched-cell.is-empty {
  display: none !important;
}
.sched-cell.is-empty strong {
  /* never paint fake -- / — while empty */
  visibility: hidden;
}
.detail-schedule.is-empty {
  display: none !important;
}
.chip.chip-soon,
.chip[disabled],
.chip[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
#actShare {
  color: var(--yellow);
}
#actShareTop {
  color: var(--yellow);
  font-size: 0.95rem;
  font-weight: 800;
}
#actShare.is-copied,
#actShareTop.is-copied {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.detail-charts {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
  background: #fff;
  color: #1c2430;
}
.detail-chart {
  display: grid;
  gap: 0.35rem;
}
.detail-chart-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.detail-chart-head strong {
  margin-inline-start: auto;
  color: #111827;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}
.detail-chart-icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--blue-deep);
  flex-shrink: 0;
}
.detail-chart-icon svg {
  width: 100%;
  height: 100%;
}
.detail-sparkline {
  width: 100%;
  height: 56px;
  display: block;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.detail-sparkline[data-empty="1"] {
  opacity: 0.45;
}
.detail-block {
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.detail-block-label {
  background: var(--blue-deep);
  color: #fff;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
}
.detail-block-body {
  padding: 0.85rem;
  color: #1c2430;
}
.detail-block.is-collapsed .detail-block-body {
  display: none;
}
.ac-type-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}
.ac-type-label {
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ac-type-row strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
}
.detail-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.detail-kv {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.detail-kv span {
  color: #6b7280;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.detail-kv strong {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--mono);
  word-break: break-word;
}
.detail-kv-wide {
  grid-column: 1 / -1;
}
.detail-seats-note {
  margin: 0.65rem 0 0;
  color: #6b7280;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 500;
}
.detail-adsb-grid {
  padding: 0.85rem;
}
.detail-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef0f3;
  color: #1c2430;
}
.detail-times .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border: 0;
  border-top: 1px solid #e0e3e8;
  border-radius: 0;
  background: transparent;
}
.detail-times .stat:nth-child(odd) { border-inline-end: 1px solid #e0e3e8; }
.detail-times .stat:nth-child(-n+2) { border-top: 0; }
.detail-times .stat span {
  color: #6b7280;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}
.detail-times .stat strong {
  color: #111827;
  font-size: 0.95rem;
  font-family: var(--mono);
  font-weight: 700;
}
.detail-more {
  background: #fff;
}
.detail-more[hidden] { display: none !important; }
.detail-more-block {
  border-top: 1px solid #e5e7eb;
}
.detail-more-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  text-align: left;
}
.detail-more-body {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 0.85rem;
  color: #1c2430;
}
.detail-more-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
}
.detail-more-row span { color: #6b7280; }
.detail-more-row strong { font-weight: 700; }

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--chrome);
  margin-top: auto;
  position: sticky;
  bottom: 0;
}
.card-actions button {
  border: 0;
  background: transparent;
  color: #d5dbe2;
  padding: 0.9rem 0.3rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}
.card-actions button.is-on { color: var(--yellow); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 1.4rem 0.75rem;
  line-height: 1.45;
}

.maplibregl-ctrl-attrib {
  background: rgba(0,0,0,0.35) !important;
  color: #9fb2c0 !important;
}
.maplibregl-ctrl-attrib a { color: #cfe0ec !important; }
.maplibregl-canvas { outline: none; will-change: auto; }
/* JSP-95: don't promote map layers into lasting compositor surfaces on iOS. */
.maplibregl-canvas-container,
.maplibregl-map { transform: none; }

.country-select { width: 100%; }
.lang-select {
  height: 34px;
  width: 118px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2a2a2e;
  color: #f2f4f6;
  padding: 0 0.55rem;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="light"] {
  --bg: #eef3f8;
  --chrome: #1f2429;
  --chrome-2: #ffffff;
  --card: #e8eef5;
  --panel: rgba(255, 255, 255, 0.97);
  --panel-solid: #ffffff;
  --line: rgba(16, 36, 56, 0.12);
  /* Readable on light panels / page chrome; dark topbar overrides below */
  --text: #122033;
  --muted: #5d7284;
  --on-chrome: #f2f4f6;
  --on-chrome-muted: #9aa3ad;
  --shadow: 0 18px 40px rgba(18, 32, 51, 0.12);
}

/* Topbar stays dark in light theme — keep light ink on chrome */
html[data-theme="light"] .topbar {
  color: var(--on-chrome);
  --text: var(--on-chrome);
  --muted: var(--on-chrome-muted);
}
html[data-theme="light"] .chip:not([data-on="1"]) {
  color: var(--on-chrome);
}
html[data-theme="light"] .layer-toggle:not([data-on="1"]) {
  color: var(--on-chrome);
}
html[data-theme="light"] .lang-select {
  background: #ffffff;
  color: #122033;
  border-color: rgba(16, 32, 51, 0.18);
}
html[data-theme="light"] .search {
  background: #ffffff;
  color: #122033;
  border-color: rgba(16, 32, 51, 0.14);
  --text: #122033;
  --muted: #5d7284;
}
html[data-theme="light"] .suggest,
html[data-theme="light"] .layers-panel {
  background: #ffffff;
  color: #122033;
  --text: #122033;
  --muted: #5d7284;
}
html[data-theme="light"] .map-tools button,
html[data-theme="light"] .hud {
  background: rgba(255, 255, 255, 0.92);
  color: #122033;
  --text: #122033;
  --muted: #5d7284;
}

/* Light panels: force theme text tokens so Arabic/LTR labels stay readable */
html[data-theme="light"] .drawer,
html[data-theme="light"] .side-panel,
html[data-theme="light"] .site-drawer,
html[data-theme="light"] .playback-sheet {
  background: var(--panel-solid);
  color: var(--text);
  --text: #122033;
  --muted: #5d7284;
  --card: #e8eef5;
  border-color: var(--line);
}
html[data-theme="light"] .side-panel {
  background: var(--panel);
}
html[data-theme="light"] .side-tabs {
  border-bottom-color: var(--line);
}
html[data-theme="light"] .side-footnote,
html[data-theme="light"] .sources {
  border-top-color: var(--line);
}
html[data-theme="light"] .drawer-stats div {
  background: rgba(16, 36, 56, 0.04);
  border-color: var(--line);
}
html[data-theme="light"] .flight-item:hover,
html[data-theme="light"] .flight-item.is-active {
  background: #dce6f0;
  border-color: rgba(226, 162, 10, 0.45);
}
html[data-theme="light"] .flight-item .route-code {
  background: rgba(16, 36, 56, 0.08);
  color: #334155;
}
html[data-theme="light"] .site-nav a:hover {
  background: rgba(16, 36, 56, 0.06);
}
html[data-theme="light"] .text-btn {
  color: var(--muted);
}
html[data-theme="light"] .field,
html[data-theme="light"] .drawer-stats span,
html[data-theme="light"] .side-tab,
html[data-theme="light"] .side-footnote,
html[data-theme="light"] .side-stub,
html[data-theme="light"] .sources,
html[data-theme="light"] .range-meta {
  color: var(--muted);
}
html[data-theme="light"] .toggle,
html[data-theme="light"] .drawer-head h2,
html[data-theme="light"] .drawer-stats b,
html[data-theme="light"] .side-panel-head h2,
html[data-theme="light"] .side-tab.is-on,
html[data-theme="light"] .site-nav a {
  color: var(--text);
}
/* Bottom dock stays dark floating chrome */
html[data-theme="light"] .bottom-dock {
  color: var(--on-chrome);
  --text: var(--on-chrome);
  --muted: var(--on-chrome-muted);
}
html[data-theme="light"] .card-head {
  color: #fff;
  --text: #f2f4f6;
  --muted: #9aa3ad;
}

html[dir="rtl"] .top-actions { margin-inline-start: 0; margin-inline-end: auto; }
html[dir="rtl"] .side-panel,
html[dir="rtl"] .strip,
html[dir="rtl"] .site-drawer {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid var(--line);
  transform: translateX(105%);
}
/* Strip uses [hidden], not .is-open — without this reset RTL hides the detail panel off-canvas. */
html[dir="rtl"] .side-panel.is-open,
html[dir="rtl"] .site-drawer.is-open,
html[dir="rtl"] .strip:not([hidden]) { transform: translateX(0); }
html[dir="rtl"] .app.has-strip .side-panel {
  transform: translateX(105%);
}
html[dir="rtl"] .drawer {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 1px solid var(--line);
  transform: translateX(-105%);
}
html[dir="rtl"] .drawer.is-open { transform: translateX(0); }
html[dir="rtl"] .hud {
  left: auto;
  right: 0.85rem;
}
html[dir="rtl"] .app.has-side .hud,
html[dir="rtl"] .app.has-strip .hud {
  left: auto;
  right: calc(var(--side) + 0.75rem);
}
html[dir="rtl"] .app.has-side .bottom-dock,
html[dir="rtl"] .app.has-strip .bottom-dock {
  left: calc(50% - var(--side) / 2);
}
html[dir="rtl"] .strip {
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.28);
}
html[dir="rtl"] .layers {
  left: auto;
  right: 0.85rem;
}
html[dir="rtl"] .app.has-side .layers,
html[dir="rtl"] .app.has-strip .layers {
  left: auto;
  right: calc(var(--side) + 0.75rem);
}
html[dir="rtl"] .map-tools {
  right: auto;
  left: 0.85rem;
}
html[dir="rtl"] .rx-drawer .rx-group-btn,
html[dir="rtl"] .site-nav a {
  text-align: start;
}
@keyframes rise-rtl {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
html[dir="rtl"] .strip {
  animation-name: rise-rtl;
}

@media (max-width: 980px) {
  .chip-optional { display: none; }
  .topbar {
    gap: 0.4rem;
    padding-inline: max(0.45rem, var(--safe-left)) max(0.45rem, var(--safe-right));
  }
  .lang-select { width: 96px; max-width: 28vw; }
  .search { width: min(150px, 28vw); min-width: 0; }
  .layer-toggle { width: 36px; height: 36px; border-radius: 10px; }
  .layer-toggle svg { width: 18px; height: 18px; }
  .live span:last-child { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .brand-text strong { font-size: 0.82rem; }
  .side-panel,
  .strip {
    width: min(100vw, 420px);
  }
  .app.has-side .hud,
  .app.has-strip .hud {
    left: max(0.85rem, var(--safe-left));
  }
  .app.has-side .layers,
  .app.has-strip .layers {
    left: max(0.85rem, var(--safe-left));
  }
  .app.has-side .bottom-dock,
  .app.has-strip .bottom-dock,
  html[dir="rtl"] .app.has-side .bottom-dock,
  html[dir="rtl"] .app.has-strip .bottom-dock {
    left: 50%;
    right: auto;
  }
  html[dir="rtl"] .app.has-side .hud,
  html[dir="rtl"] .app.has-strip .hud {
    left: auto;
    right: max(0.85rem, var(--safe-right));
  }
  html[dir="rtl"] .app.has-side .layers,
  html[dir="rtl"] .app.has-strip .layers {
    left: auto;
    right: max(0.85rem, var(--safe-right));
  }
  .bottom-dock {
    width: calc(100% - 1.2rem - var(--safe-left) - var(--safe-right));
    max-width: 440px;
    justify-content: space-between;
  }
  .dock-btn {
    min-width: 0;
    flex: 1;
    padding: 0.35rem 0.15rem;
    font-size: 0.62rem;
  }
  .weather-panel,
  .layers-panel {
    max-width: calc(100vw - 1.5rem);
  }
}

/* Phones / large phones (~320–640): bottom sheets + compact chrome */
@media (max-width: 640px) {
  :root {
    --dock-pad: 68px;
  }

  .side-panel,
  .strip {
    width: 100%;
    max-width: 100%;
    max-height: min(62vh, calc(100dvh - var(--top) - 0.5rem));
    top: auto;
    bottom: 0;
    border-right: 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px 18px 0 0;
    transform: translateY(110%);
    padding-bottom: var(--safe-bottom);
  }
  .side-panel.is-open,
  .strip:not([hidden]) {
    transform: translateY(0);
  }
  .app.has-strip .side-panel {
    transform: translateY(110%);
  }
  html[dir="rtl"] .side-panel,
  html[dir="rtl"] .strip {
    right: 0;
    left: 0;
    border-left: 0;
    border-right: 0;
    transform: translateY(110%);
  }
  html[dir="rtl"] .side-panel.is-open,
  html[dir="rtl"] .strip:not([hidden]) {
    transform: translateY(0);
  }
  html[dir="rtl"] .app.has-strip .side-panel {
    transform: translateY(110%);
  }
  .strip {
    animation: rise-up 0.28s ease;
  }
  @keyframes rise-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .drawer,
  .site-drawer {
    width: min(320px, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    padding: 0.9rem max(0.9rem, var(--safe-right)) calc(0.9rem + var(--safe-bottom)) max(0.9rem, var(--safe-left));
  }
  .site-drawer {
    border-right: 0;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  }
  .drawer {
    border-left: 0;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.35);
  }
  html[dir="rtl"] .site-drawer {
    border-left: 0;
  }
  html[dir="rtl"] .drawer {
    border-right: 0;
  }

  .hud { display: none; }
  .map-tools {
    bottom: calc(var(--dock-h) + 0.55rem);
    right: max(0.55rem, var(--safe-right));
  }
  html[dir="rtl"] .map-tools {
    right: auto;
    left: max(0.55rem, var(--safe-left));
  }
  .map-tools button {
    width: var(--touch);
    height: var(--touch);
    min-width: var(--touch);
    min-height: var(--touch);
  }
  .layers {
    top: 0.55rem;
    left: max(0.55rem, var(--safe-left));
    max-width: calc(100% - 1.1rem - var(--safe-left) - var(--safe-right));
  }
  html[dir="rtl"] .layers {
    left: auto;
    right: max(0.55rem, var(--safe-right));
  }
  .app.has-side .layers,
  .app.has-strip .layers,
  html[dir="rtl"] .app.has-side .layers,
  html[dir="rtl"] .app.has-strip .layers {
    left: max(0.55rem, var(--safe-left));
    right: auto;
  }
  html[dir="rtl"] .app.has-side .layers,
  html[dir="rtl"] .app.has-strip .layers {
    left: auto;
    right: max(0.55rem, var(--safe-right));
  }
  .app.has-side .bottom-dock,
  .app.has-strip .bottom-dock,
  html[dir="rtl"] .app.has-side .bottom-dock,
  html[dir="rtl"] .app.has-strip .bottom-dock {
    left: 50%;
    right: auto;
  }
  .google-maps-logo {
    bottom: calc(var(--dock-h) + 0.35rem);
    left: max(0.55rem, var(--safe-left));
  }
  html[dir="rtl"] .google-maps-logo {
    left: auto;
    right: max(0.55rem, var(--safe-right));
  }
  .playback-sheet {
    width: calc(100% - 1.2rem - var(--safe-left) - var(--safe-right));
    bottom: calc(var(--dock-h) + 0.35rem);
  }
  .side-tab {
    min-height: var(--touch);
    padding: 0.75rem 0.25rem;
  }
  .side-panel-close,
  .text-btn,
  .drawer-head .text-btn {
    min-height: var(--touch);
    min-width: var(--touch);
    padding: 0.45rem 0.65rem;
  }
}

/* Narrow phones (~320–430): two-row grid topbar (brand | toggles | actions / search) */
@media (max-width: 430px) {
  :root {
    --top-chrome: 96px;
    --dock-pad: 64px;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: var(--touch) 40px;
    align-items: center;
    column-gap: 0.35rem;
    row-gap: 0.35rem;
    padding-bottom: 0.4rem;
    overflow: visible;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .brand-text { display: none; } /* mark stays — full wordmark needs more than ~430px */
  .brand-mark svg {
    width: 26px;
    height: 26px;
  }

  .layer-toggles {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    gap: 0.25rem;
    min-width: 0;
  }
  .layer-toggle {
    width: var(--touch);
    height: var(--touch);
    min-width: var(--touch);
    min-height: var(--touch);
    border-radius: 12px;
  }
  .layer-toggle svg {
    width: 20px;
    height: 20px;
  }

  .top-actions {
    grid-column: 3;
    grid-row: 1;
    margin-inline-start: 0;
    margin-inline-end: 0;
    gap: 0.25rem;
    flex-shrink: 0;
    justify-self: end;
  }
  html[dir="rtl"] .top-actions {
    margin-inline-start: 0;
    margin-inline-end: 0;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    height: 40px;
    min-height: 40px;
  }
  .search input {
    font-size: 1rem; /* avoid iOS zoom on focus */
  }
  .suggest {
    width: 100%;
    max-width: none;
    left: 0;
    right: 0;
  }

  .live,
  .chip-theme {
    display: none;
  }
  .lang-select {
    width: 4.5rem;
    max-width: 28vw;
    height: 40px;
    min-height: 40px;
    font-size: 0.72rem;
    padding-inline: 0.3rem;
  }
  .icon-btn {
    width: var(--touch);
    height: var(--touch);
    min-width: var(--touch);
    min-height: var(--touch);
  }

  .bottom-dock {
    width: calc(100% - 0.8rem - var(--safe-left) - var(--safe-right));
    max-width: none;
    bottom: max(0.45rem, var(--safe-bottom));
    padding: 0.3rem 0.35rem;
    gap: 0;
    border-radius: 18px;
  }
  .dock-btn {
    min-height: var(--touch);
    padding: 0.25rem 0.1rem;
    font-size: 0.58rem;
    gap: 0.12rem;
    border-radius: 12px;
  }
  .dock-btn svg {
    width: 18px;
    height: 18px;
  }

  .strip-photo {
    height: min(160px, 28vh);
  }
  .card-title-row strong {
    font-size: 1.15rem;
  }
}

@media (max-width: 360px) {
  .lang-select {
    width: 3.85rem;
    font-size: 0.68rem;
  }
  .layer-toggles { gap: 0.18rem; }
  .topbar { column-gap: 0.28rem; }
}

/* Emergency squawk 7500 / 7600 / 7700 — map toast + detail highlight */
/* Fixed to viewport top (below chrome). Host lives inside .stage which
   already insets by --top — absolute+--top was double-offset mid-map. */
.squawk-toast-host {
  position: fixed;
  top: calc(var(--top) + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: min(360px, calc(100vw - 1.2rem));
  pointer-events: none;
}
.squawk-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(18, 14, 16, 0.92);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: squawk-toast-in 0.22s ease-out;
}
.squawk-toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.squawk-toast-code {
  flex: 0 0 auto;
  min-width: 3.2rem;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-align: center;
  color: #14080c;
  background: #ff2d2d;
}
.squawk-toast-7500 .squawk-toast-code { background: #c026ff; color: #fff; }
.squawk-toast-7600 .squawk-toast-code { background: #ff8b1a; color: #1a0c00; }
.squawk-toast-7700 .squawk-toast-code { background: #ff2d2d; color: #14080c; }
.squawk-toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.squawk-toast-body strong {
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.squawk-toast-body em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
}
@keyframes squawk-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

#detailSquawk.is-emerg {
  color: #ff6d5f;
  font-weight: 700;
}
#detailSquawk.is-emerg[data-emerg="7500"] { color: #d678ff; }
#detailSquawk.is-emerg[data-emerg="7600"] { color: #ffb05c; }
#detailSquawk.is-emerg[data-emerg="7700"] { color: #ff6d5f; }

.flight-item.is-emerg {
  border-color: rgba(255, 45, 45, 0.45);
  background: rgba(255, 45, 45, 0.08);
}
.flight-item.emerg-7500 {
  border-color: rgba(192, 38, 255, 0.45);
  background: rgba(192, 38, 255, 0.08);
}
.flight-item.emerg-7600 {
  border-color: rgba(255, 139, 26, 0.45);
  background: rgba(255, 139, 26, 0.08);
}
.flight-item .type-chip.is-emerg,
.flight-item .emerg-tag {
  color: #14080c;
  background: #ff2d2d;
  font-family: var(--mono);
  font-weight: 700;
}
.flight-item.emerg-7500 .type-chip.is-emerg,
.flight-item.emerg-7500 .emerg-tag {
  background: #c026ff;
  color: #fff;
}
.flight-item.emerg-7600 .type-chip.is-emerg,
.flight-item.emerg-7600 .emerg-tag {
  background: #ff8b1a;
  color: #1a0c00;
}

@media (max-width: 640px) {
  .squawk-toast-host {
    top: calc(var(--top) + 0.3rem);
    width: min(100% - 0.8rem, 360px);
  }
}

/* --- ATC / LiveATC radio (JSP-72) --- */
.atc-radio-bar {
  position: fixed;
  inset-inline: auto;
  inset-inline-end: 0.65rem;
  bottom: calc(4.1rem + env(safe-area-inset-bottom, 0px));
  z-index: 46;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem 0.4rem;
  padding: 0.28rem 0.45rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel, #0f1720) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--stroke, #2a3a48) 70%, transparent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  color: var(--text, #e8eef4);
  font-family: Manrope, "Segoe UI", sans-serif;
  max-width: min(420px, calc(100vw - 1.1rem));
  margin-inline: 0;
  left: auto;
  right: 0.65rem;
  font-size: 0.72rem;
  line-height: 1.15;
}
.atc-radio-bar[hidden] {
  display: none !important;
}
.atc-radio-bar .atc-label {
  font-weight: 700;
  font-size: 0.72rem;
  min-width: 0;
  max-width: 7.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atc-radio-bar .atc-status {
  font-size: 0.62rem;
  opacity: 0.7;
  flex: 0 1 auto;
  max-width: 7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atc-radio-bar select,
.atc-radio-bar button,
.atc-radio-bar input[type="range"] {
  font: inherit;
}
.atc-radio-bar select {
  border-radius: 6px;
  border: 1px solid var(--stroke, #2a3a48);
  background: var(--panel-2, #15202b);
  color: inherit;
  padding: 0.12rem 0.28rem;
  max-width: 6.5rem;
  min-height: 1.55rem;
}
.atc-radio-bar #atcAirportSelect {
  max-width: 7.5rem;
}
.atc-radio-bar button {
  border-radius: 999px;
  border: 1px solid var(--stroke, #2a3a48);
  background: var(--panel-2, #15202b);
  color: inherit;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  min-height: 1.55rem;
  font-size: 0.68rem;
}
.atc-radio-bar button[aria-pressed="true"] {
  border-color: color-mix(in srgb, #e11d2e 55%, var(--stroke, #2a3a48));
  background: color-mix(in srgb, #e11d2e 18%, var(--panel-2, #15202b));
}
.atc-radio-bar input[type="range"] {
  width: 3.6rem;
  accent-color: #e11d2e;
}
.atc-radio-bar .atc-credit {
  font-size: 0.55rem;
  opacity: 0.55;
  text-decoration: none;
  color: inherit;
  display: none; /* keep strip compact; credit stays in docs/popup */
}
.atc-radio-bar .atc-credit:hover {
  opacity: 1;
  text-decoration: underline;
}
.atc-radio-bar #atcCloseBtn {
  padding: 0.1rem 0.4rem;
  min-width: 1.4rem;
}
.atc-detail-block {
  margin: 0.35rem 0.85rem 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--stroke, #2a3a48) 70%, transparent);
  background: color-mix(in srgb, var(--panel-2, #15202b) 70%, transparent);
}
.atc-detail-block[hidden] {
  display: none !important;
}
.atc-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.atc-detail-block .atc-detail-title {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
  width: 100%;
}
.atc-detail-block .atc-detail-meta {
  font-size: 0.78rem;
  flex: 1 1 8rem;
  opacity: 0.85;
}
.atc-detail-block button {
  border-radius: 999px;
  border: 1px solid var(--stroke, #2a3a48);
  background: var(--panel, #0f1720);
  color: inherit;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.atc-popup {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.atc-popup-play {
  border-radius: 999px;
  border: 0;
  background: #1f6feb;
  color: #fff;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}
.atc-popup-feed {
  border-radius: 8px;
  border: 1px solid #2a3a48;
  background: #0f1720;
  color: #e8eef4;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
}
.atc-popup-none {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #8fa6b8;
}
body.has-atc-bar .bottom-dock {
  bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 640px) {
  .atc-radio-bar {
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
    inset-inline: auto;
    inset-inline-end: 0.4rem;
    right: 0.4rem;
    left: auto;
    max-width: calc(100vw - 0.8rem);
    padding: 0.22rem 0.35rem;
    flex-wrap: wrap;
  }
  .atc-radio-bar .atc-label {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
  }
  .atc-radio-bar .atc-status {
    display: none;
  }
}

/* —— Sky ID (camera / which-flight) —— */
.sky-id-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  color: #f4f6fb;
  background: #0b0d12;
  overscroll-behavior: none;
  touch-action: none;
}
.sky-id-overlay[hidden] { display: none !important; }
.sky-id-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b0d12;
  transform: scaleX(1);
}
.sky-id-overlay.no-camera .sky-id-video { opacity: 0; }
.sky-id-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,10,16,.72) 0%, rgba(8,10,16,.12) 28%, rgba(8,10,16,.18) 62%, rgba(8,10,16,.82) 100%);
  pointer-events: none;
}
.sky-id-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
}
.sky-id-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.sky-id-titles strong {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.sky-id-titles span {
  color: rgba(244,246,251,.72);
  font-size: 0.84rem;
}
.sky-id-close {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(18,22,30,.55);
  color: inherit;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  cursor: pointer;
}
.sky-id-crosshair {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.sky-id-crosshair::before,
.sky-id-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255,220,80,.92);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35);
}
.sky-id-crosshair::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}
.sky-id-crosshair::after {
  top: 50%;
  left: 0;
  height: 2px;
  width: 100%;
  transform: translateY(-50%);
}
.sky-id-crosshair i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: 2px solid rgba(255,220,80,.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35);
}
.sky-id-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.sky-id-marker {
  position: absolute;
  transform: translate(-50%, -120%);
  pointer-events: auto;
  border: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  background: rgba(12,16,24,.72);
  color: #f4f6fb;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
  max-width: 9.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.sky-id-marker span {
  display: block;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sky-id-marker em {
  display: block;
  font-style: normal;
  opacity: 0.75;
  font-size: 0.68rem;
}
.sky-id-marker.is-hot {
  background: rgba(230, 170, 20, .9);
  color: #111;
}
.sky-id-status {
  position: relative;
  z-index: 2;
  margin: auto 1rem 0.55rem;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(244,246,251,.86);
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.sky-id-match {
  position: relative;
  z-index: 3;
  margin: 0 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(14,18,26,.88);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}
.sky-id-match[hidden] { display: none !important; }
.sky-id-match-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.sky-id-match-main strong {
  font-size: 1.05rem;
}
.sky-id-match-main span,
.sky-id-match-main em {
  font-style: normal;
  font-size: 0.8rem;
  color: rgba(244,246,251,.72);
}
.sky-id-open {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: #e6aa14;
  color: #111;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.sky-id-list {
  position: relative;
  z-index: 3;
  margin: 0 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  max-height: min(42vh, 320px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  background: rgba(14,18,26,.9);
  border: 1px solid rgba(255,255,255,.12);
}
.sky-id-list[hidden] { display: none !important; }
.sky-id-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  text-align: start;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
  color: inherit;
  padding: 0.75rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.sky-id-row:last-child { border-bottom: 0; }
.sky-id-row strong { font-size: 0.95rem; }
.sky-id-row span {
  font-size: 0.78rem;
  color: rgba(244,246,251,.7);
}
.sky-id-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: rgba(244,246,251,.75);
  font-size: 0.88rem;
}
.map-tools #skyIdBtn {
  display: grid;
  place-items: center;
  padding: 0;
}
.map-tools #skyIdBtn svg { display: block; }
body.sky-id-open {
  overflow: hidden;
}
html[dir="rtl"] .sky-id-marker,
html[dir="rtl"] .sky-id-row,
html[dir="rtl"] .sky-id-match-main {
  text-align: right;
}



/* —— JSP-103 FR24-like 3D aircraft view —— */
.strip-photo { position: relative; }
.view3d-photo-btn {
  position: absolute;
  inset-inline-end: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  border: 0;
  border-radius: 0.45rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0b1220;
  background: rgba(255, 214, 64, 0.92);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.view3d-photo-btn:active { transform: scale(0.98); }
.view3d-actions {
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}
.view3d-open-btn {
  border: 1px solid rgba(255,214,64,0.45);
  background: rgba(255,214,64,0.12);
  color: #ffe08a;
  border-radius: 0.45rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.view3d-open-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* JSP-104 hooks — unstyled until sibling fills */
.seatmap-mount:empty[hidden],
.seatmap-open-btn[hidden] { display: none !important; }
.strip.is-ship .view3d-actions,
.strip.is-ship .view3d-photo-btn { display: none !important; }

.view3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #070b12;
  color: #e8eef5;
}
.view3d-overlay[hidden] { display: none !important; }
.view3d-chrome {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: rgba(10,14,22,0.92);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.view3d-chrome-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.view3d-chrome-left strong { font-size: 0.95rem; letter-spacing: 0.02em; }
.view3d-hud {
  font-size: 0.68rem;
  color: #9aabbc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.view3d-modes {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.5rem;
  overflow: hidden;
}
.view3d-mode-btn {
  border: 0;
  background: transparent;
  color: #b7c4d2;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.view3d-mode-btn.is-on {
  background: rgba(255,214,64,0.18);
  color: #ffe08a;
}
.view3d-close {
  border: 0;
  background: rgba(255,255,255,0.06);
  color: #e8eef5;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.aircraft3d-host {
  flex: 1;
  min-height: 0;
  position: relative;
  touch-action: none;
}
.aircraft3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.view3d-hint,
.view3d-credit {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.68rem;
  color: #7f8f9f;
  background: rgba(10,14,22,0.9);
}
.view3d-credit { padding-top: 0; padding-bottom: 0.55rem; }
body.view3d-open { overflow: hidden; }

@media (max-width: 700px) {
  .view3d-chrome { flex-wrap: wrap; }
  .view3d-modes { order: 3; width: 100%; }
  .view3d-mode-btn { flex: 1; }
  .view3d-photo-btn { padding: 0.3rem 0.48rem; font-size: 0.68rem; }
}
@media (prefers-reduced-motion: reduce) {
  .view3d-photo-btn:active { transform: none; }
}
