/* Skytrace local receiver dashboard theme. */
:root {
  color-scheme: dark;
  --sky-30: #b6dcf2;
  --sky-20: #3d657c;
  --sky-10: #14232e;
  --beige-40: #303030;
  --beige-30: #242424;
  --beige-20: #1a1a1a;
  --beige-10: #0f0f0f;
  --white: #0b0b0b;
  --neutral-30: #f4f4f1;
  --neutral-20: #c8c8c4;
  --neutral-10: #999a96;
  --stroke: #303030;
  --blue-accent: #8bcfff;
  --green-live: #78d9a6;
  --dark-brown: #d0c2b3;
  --map-night: #111b27;
  --map-land: #182632;
  --map-water: #0f1d2b;
  --map-road: #34495a;
  --aircraft-blue: #a8dfff;
  --aircraft-highlight: #ffd89c;
  --route-blue: #84b9ef;
  --route-warm: #f4c48a;
  --sans: "Open Runde", "Avenir Next", ui-rounded, Avenir, "Trebuchet MS", system-ui, sans-serif;
  --display: "Open Runde", "Avenir Next", ui-rounded, Avenir, "Trebuchet MS", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --shadow-soft: 0 4px 32px rgba(0, 0, 0, .48);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; }

body {
  overflow: hidden;
  background: #050505;
  color: var(--neutral-30);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { color: var(--white); background: var(--blue-accent); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, #map:focus-visible {
  outline: 3px solid var(--blue-accent);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  color: var(--white);
  background: var(--neutral-30);
  border-radius: 5px;
  transition: transform 160ms ease-out;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--stroke);
  position: relative;
  z-index: 2;
}
.brand-lockup { min-width: 205px; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--sky-10);
  background: var(--neutral-30);
  border-radius: 10px;
}
.brand-mark svg { width: 20px; height: 20px; fill: currentColor; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-family: var(--display); font-size: 15px; line-height: .95; font-weight: 700; letter-spacing: .1em; }
.brand-copy strong span { color: var(--neutral-30); font-weight: 600; }
.brand-copy small { color: var(--neutral-10); font: 12px/1.2 var(--mono); letter-spacing: .035em; }
.receiver-context, .header-meta, .connection-status, .updated-block { display: flex; align-items: center; }
.receiver-context { gap: 9px; color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .035em; }
.receiver-dot, .status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--sky-30); }
.context-divider { width: 1px; height: 14px; margin: 0 3px; background: var(--stroke); }
.header-meta { gap: 24px; }
.connection-status { gap: 8px; color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .025em; }
.connection-status.is-live .status-dot { background: #537e66; }
.connection-status.is-error .status-dot { background: #a34851; }
.connection-status.is-waiting .status-dot { background: var(--blue-accent); }
.updated-block { gap: 9px; padding-left: 17px; border-left: 1px solid var(--stroke); }
.meta-label { color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .035em; }
.updated-block time { color: var(--neutral-30); font: 12px var(--mono); font-variant-numeric: tabular-nums; }

.workspace {
  --fleet-width: clamp(225px, 17.35vw, 275px);
  --fleet-collapsed-width: 64px;
  --drawer-width: 349px;
  position: relative;
  display: grid;
  grid-template-columns: var(--fleet-width) minmax(0, 1fr);
  grid-template-areas: "fleet map";
  height: calc(100dvh - 73px);
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 220ms cubic-bezier(.2,.8,.2,1);
}
.workspace.is-rail-collapsed { grid-template-columns: var(--fleet-collapsed-width) minmax(0, 1fr); }
.aircraft-rail, .detail-rail { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.aircraft-rail {
  grid-area: fleet;
  position: relative;
  justify-self: start;
  width: var(--fleet-width);
  padding: 22px 16px 12px;
  background: var(--white);
  border-right: 1px solid var(--stroke);
  overflow: hidden;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), padding 220ms ease, border-color 220ms ease;
}
.workspace.is-rail-collapsed .aircraft-rail {
  padding-right: 0;
  padding-left: 0;
  transform: translateX(calc(var(--fleet-collapsed-width) - var(--fleet-width)));
  border-right-color: transparent;
}
.rail-content { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; transition: opacity 120ms ease-out, visibility 0s linear 0s; }
.workspace.is-rail-collapsed .rail-content { opacity: 0; visibility: hidden; transition-delay: 0s, 120ms; }
.rail-heading, .detail-rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rail-heading { position: relative; margin: 1px 1px 16px; padding-right: 52px; }
.rail-toggle-button { position: absolute; top: 23px; right: 17px; z-index: 2; }
.workspace.is-rail-collapsed .rail-toggle-button { right: 10px; }
.workspace.is-rail-collapsed .rail-toggle-button svg { transform: rotate(180deg); }
.rail-toggle-button svg { transition: transform 180ms ease-out; }
.rail-heading h1, .detail-rail-heading h2 {
  margin: 0;
  color: var(--neutral-30);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -.01em;
  font-weight: 700;
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 21px;
  padding: 0 6px;
  margin-left: 5px;
  color: var(--neutral-30);
  background: var(--sky-10);
  border: 1px solid var(--sky-20);
  border-radius: 99px;
  font: 12px var(--mono);
  font-variant-numeric: tabular-nums;
  vertical-align: 2px;
}
.icon-button, .close-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--neutral-30);
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
.icon-button svg, .close-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover, .close-button:hover { background: var(--sky-10); border-color: var(--sky-30); }
.icon-button.is-refreshing svg { animation: rotate-refresh 700ms linear infinite; }
@keyframes rotate-refresh { to { transform: rotate(360deg); } }

.search-box {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  background: var(--beige-10);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}
.search-box:focus-within { background: var(--white); border-color: var(--blue-accent); }
.search-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--neutral-10); stroke-width: 1.7; stroke-linecap: round; }
.search-box input { width: 0; min-width: 0; flex: 1; padding: 0; color: var(--neutral-30); background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-box input::placeholder { color: var(--neutral-10); opacity: 1; }
.search-box input:focus-visible { outline: 0; }
kbd { padding: 8px; color: var(--neutral-10); border: 1px solid var(--stroke); border-radius: 4px; font: 12px/1 var(--mono); white-space: nowrap; }
.clear-search { width: 30px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--neutral-10); background: transparent; border: 0; cursor: pointer; }
.clear-search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.aircraft-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  margin: 14px -7px 8px;
  padding: 0 7px 10px;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--sky-30) transparent;
}
.aircraft-list::-webkit-scrollbar, .detail-rail::-webkit-scrollbar { width: 8px; }
.aircraft-list::-webkit-scrollbar-thumb, .detail-rail::-webkit-scrollbar-thumb { background: var(--sky-30); border: 2px solid transparent; border-radius: 99px; background-clip: padding-box; }
.aircraft-row {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 10px 6px;
  margin: 0;
  text-align: left;
  color: var(--neutral-30);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}
.aircraft-row:hover { background: rgba(255, 255, 255, .035); }
.aircraft-row.is-selected { background: var(--sky-10); border-bottom-color: var(--sky-30); }
.list-plane {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--neutral-30);
  background: var(--sky-20);
  border-radius: 50%;
}
.list-plane svg { width: 20px; height: 20px; fill: currentColor; }
.aircraft-row.is-selected .list-plane { color: #050505; background: var(--sky-30); }
.aircraft-row-main { min-width: 0; display: grid; gap: 4px; }
.aircraft-callsign { overflow: hidden; color: var(--neutral-30); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.aircraft-icao { color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .015em; }
.aircraft-row-side { min-width: 52px; display: grid; justify-items: end; gap: 4px; text-align: right; }
.aircraft-alt { color: var(--neutral-30); font: 12px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.aircraft-state { max-width: 82px; color: var(--green-live); font-size: 12px; line-height: 1.2; text-align: right; }
.aircraft-state.is-stale, .aircraft-state.is-waiting { color: var(--neutral-10); }
.empty-list { padding: 20px 9px; color: var(--neutral-10); font-size: 14px; line-height: 1.5; }
.rail-note, .detail-rail-note { margin: 0; color: var(--neutral-10); font-size: 14px; line-height: 1.45; }
.rail-note { padding: 11px 4px 1px; border-top: 1px solid var(--stroke); }

.map-stage { grid-area: map; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--map-night); }
#map { position: absolute; inset: 0; }
.map-topbar { position: absolute; z-index: 2; top: 22px; left: 20px; right: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.workspace.is-details-open .map-topbar { right: calc(var(--drawer-width) + 28px); }
.map-title, .map-action { pointer-events: auto; }
.map-title {
  min-width: 160px;
  display: grid;
  gap: 4px;
  padding: 11px 13px 10px;
  background: rgba(255,250,252,.96);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(25,42,81,.08);
}
.map-title h2 { margin: 0; color: var(--neutral-30); font-family: var(--display); font-size: 18px; line-height: 1.1; font-weight: 700; letter-spacing: -.005em; }
.map-subtitle { color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .02em; }
.map-position-count { color: var(--neutral-10); font-size: 12px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.map-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--neutral-30);
  background: var(--white);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  box-shadow: 0 3px 12px rgba(25,42,81,.08);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, opacity 140ms ease-out;
}
.map-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.map-action:hover:not(:disabled) { background: var(--sky-10); border-color: var(--sky-30); }
.map-action:disabled { color: #777083; opacity: .7; cursor: not-allowed; }
.workspace.is-details-open .map-message {
  position: absolute;
  z-index: 2;
  top: 84px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 11px 14px;
  transform: translateX(-50%);
  color: var(--neutral-30);
  background: var(--white);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(25,42,81,.1);
  font-size: 12px;
  line-height: 1.45;
}
.map-aircraft-marker {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--aircraft-blue);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 150ms ease-out, transform 150ms ease-out, opacity 150ms ease-out;
}
.map-aircraft-marker:hover { transform: scale(1.08); }
.map-aircraft-marker.is-selected { color: var(--aircraft-highlight); }
.map-aircraft-marker.is-stale { opacity: .74; }
.map-aircraft-marker svg { width: 27px; height: 27px; fill: currentColor; filter: drop-shadow(0 2px 2px rgba(4,8,16,.82)); }
.map-aircraft-marker.is-selected svg { filter: drop-shadow(0 0 6px rgba(132,185,239,.78)); }
.maplibregl-ctrl-bottom-right { right: 12px; bottom: 48px; }
.workspace.is-details-open .maplibregl-ctrl-bottom-right { right: calc(var(--drawer-width) + 12px); }
.maplibregl-ctrl-group {
  overflow: hidden;
  background: var(--white) !important;
  border: 1px solid var(--stroke) !important;
  border-radius: 7px !important;
  box-shadow: 0 3px 12px rgba(25,42,81,.12) !important;
}
.maplibregl-ctrl-group button { width: 40px !important; height: 40px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--stroke) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: sepia(.25) hue-rotate(195deg) saturate(.7); }
.maplibregl-ctrl-attrib { color: var(--neutral-30) !important; background: rgba(255,250,252,.88) !important; font-size: 12px !important; }
.maplibregl-ctrl-attrib a { color: var(--neutral-30) !important; text-decoration-color: var(--blue-accent); text-underline-offset: 2px; }
.aircraft-picker-popup .maplibregl-popup-content { padding: 13px; color: var(--neutral-30); background: var(--white); border: 1px solid var(--stroke); border-radius: 8px; box-shadow: 0 4px 14px rgba(25,42,81,.14); }
.aircraft-picker-popup .maplibregl-popup-tip { border-top-color: var(--white); border-bottom-color: var(--white); }
.aircraft-picker-popup .maplibregl-popup-close-button { width: 34px; height: 34px; color: var(--neutral-30); font-size: 20px; }
.aircraft-picker-content { min-width: 200px; }
.aircraft-picker-heading { display: block; padding: 2px 32px 10px 0; color: var(--neutral-30); font: 600 15px/1.15 var(--display); }
.aircraft-picker-list { display: grid; max-height: 220px; overflow: auto; }
.aircraft-picker-option { min-height: 44px; display: grid; align-content: center; gap: 3px; padding: 6px 8px; text-align: left; color: var(--neutral-30); background: transparent; border: 0; border-top: 1px solid var(--stroke); cursor: pointer; }
.aircraft-picker-option:hover { background: var(--sky-10); }
.aircraft-picker-callsign { font-size: 12px; font-weight: 650; }
.aircraft-picker-icao { color: var(--neutral-10); font: 12px var(--mono); }

.detail-rail {
  position: absolute;
  z-index: 8;
  top: 10px;
  right: 8px;
  bottom: 10px;
  width: min(var(--drawer-width), calc(100% - 20px));
  padding: 19px 19px 14px;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(4, 8, 18, .42);
  scrollbar-width: thin;
  scrollbar-color: var(--sky-30) transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 14px));
  transition: transform 140ms cubic-bezier(.7,0,.84,0), opacity 120ms ease-in, visibility 0s linear 140ms;
}
.detail-rail.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); transition: transform 220ms cubic-bezier(.16,1,.3,1), opacity 180ms ease-out, visibility 0s; }
.detail-rail-heading { min-height: 44px; padding-bottom: 12px; border-bottom: 1px solid var(--stroke); }
.detail-rail-heading h2 { font-size: 18px; }
.close-button { width: 36px; height: 36px; }
.aircraft-details { padding-top: 15px; }
.detail-placeholder { min-height: 185px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 13px; padding: 14px 4px; color: var(--neutral-10); }
.detail-placeholder p { max-width: 25ch; margin: 0; font-size: 14px; line-height: 1.5; }
.placeholder-plane { width: 42px; height: 42px; display: grid; place-items: center; color: var(--neutral-30); background: var(--sky-10); border: 1px solid var(--sky-20); border-radius: 50%; }
.placeholder-plane svg { width: 23px; height: 23px; fill: currentColor; }
.detail-rail-note { padding-top: 12px; border-top: 1px solid var(--stroke); }
#aircraft-details[data-animate="true"] .detail-content { animation: detail-arrive 180ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes detail-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.detail-image {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 0 18px;
  margin: 0 0 18px;
  color: var(--neutral-30);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  border-radius: 0;
}
.detail-image-icon { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; color: var(--sky-10); background: var(--neutral-30); border-radius: 50%; }
.detail-image-icon svg { width: 30px; height: 30px; fill: currentColor; }
.detail-image-copy { display: grid; gap: 5px; min-width: 0; }
.detail-image-copy strong { font-size: 12px; font-weight: 650; }
.detail-image-copy span { color: var(--neutral-10); font: 12px var(--mono); }
.signal-monitor { display: grid; gap: 11px; }
.signal-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.signal-heading b { font: 600 12px var(--mono); }
.signal-meter { display: block; height: 8px; overflow: hidden; background: rgba(150, 122, 161, .25); border-radius: 99px; }
.signal-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-accent), var(--sky-30), var(--route-warm)); border-radius: inherit; }
.signal-caption { color: var(--neutral-10); font: 12px var(--mono); }
.details-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 2px 0 14px; }
.details-callsign { overflow-wrap: anywhere; color: var(--neutral-30); font: 700 22px/1.1 var(--display); letter-spacing: 0; }
.details-icao { margin-top: 5px; color: var(--neutral-10); font: 12px var(--mono); letter-spacing: .02em; }
.status-pill { flex: 0 0 auto; padding: 8px 10px; color: #a7e4be; background: #153426; border: 1px solid #275b3d; border-radius: 99px; font: 12px/1 var(--mono); }
.status-pill.is-stale { color: var(--neutral-10); background: #1a1a1a; border-color: var(--stroke); }
.status-pill.is-waiting { color: var(--neutral-10); background: var(--sky-10); }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.fact { min-width: 0; padding: 11px 0 10px; border-bottom: 1px solid var(--stroke); }
.fact-label { display: block; margin-bottom: 5px; color: var(--neutral-10); font-size: 12px; line-height: 1.3; }
.fact-value { display: block; overflow-wrap: anywhere; color: var(--neutral-30); font: 12px var(--mono); font-variant-numeric: tabular-nums; line-height: 1.35; }
.fact-wide { grid-column: 1 / -1; }
.detail-note { margin: 13px 0 0; color: var(--neutral-10); font-size: 14px; line-height: 1.45; }
.detail-locate {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  color: var(--neutral-30);
  background: var(--white);
  border: 1px solid var(--sky-20);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}
.detail-locate:hover { background: var(--sky-10); border-color: var(--blue-accent); }
.detail-locate svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1120px) {
  .workspace { --fleet-width: 225px; --drawer-width: 320px; grid-template-columns: var(--fleet-width) minmax(0, 1fr); }
  .aircraft-rail { padding-right: 12px; padding-left: 12px; }
  .detail-rail { padding-right: 15px; padding-left: 15px; }
  .header-meta { gap: 13px; }
}
@media (max-width: 960px) {
  body { overflow: auto; }
  .topbar { padding: 0 16px; }
  .receiver-context { display: none; }
  .workspace {
    --fleet-width: clamp(190px, 25vw, 225px);
    --drawer-width: min(286px, 38vw);
    height: calc(100dvh - 73px);
    min-height: 560px;
    grid-template-columns: var(--fleet-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "fleet map";
  }
  .aircraft-rail { min-height: 0; }
  .detail-rail { width: min(var(--drawer-width), calc(100% - 16px)); right: 8px; }
  }
@media (min-width: 681px) and (max-width: 920px) {
  .workspace.is-details-open .map-action { display: none; }
  .workspace.is-details-open .map-title { min-width: 0; max-width: 150px; }
  .workspace.is-details-open .map-subtitle,
  .workspace.is-details-open .map-position-count { display: none; }
}
@media (min-width: 681px) and (max-width: 720px) {
  .workspace.is-details-open .map-title { max-width: 90px; }
}
@media (max-width: 680px) {
  .topbar { height: 62px; padding: 0 13px; gap: 8px; }
  .brand-lockup { min-width: auto; gap: 8px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 8px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { display: none; }
  .header-meta { gap: 0; }
  .connection-status { max-width: 125px; gap: 6px; font-size: 12px; line-height: 1.35; }
  .updated-block { display: none; }
  .workspace {
    position: relative;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56dvh auto;
    grid-template-areas: "map" "fleet";
    overflow: visible;
  }
  .workspace.is-rail-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56dvh 64px; }
  .map-stage { min-height: 360px; }
  .aircraft-rail { width: 100%; min-height: 270px; padding: 15px 14px 11px; border-right: 0; border-bottom: 1px solid var(--stroke); transform: none; }
  .rail-heading { margin-bottom: 12px; padding-right: 52px; }
  .rail-toggle-button { top: 15px; right: 14px; }
  .workspace.is-rail-collapsed .aircraft-rail { height: 64px; min-height: 0; padding: 10px 14px; transform: none; border-bottom-color: var(--stroke); }
  .workspace.is-rail-collapsed .rail-toggle-button { top: 10px; right: 14px; }
  .aircraft-list { max-height: 310px; flex: 0 1 auto; }
  .rail-note { margin-top: auto; }
  .detail-rail { position: fixed; z-index: 20; top: auto; right: 10px; bottom: 10px; left: 10px; width: auto; max-height: min(68dvh, 560px); padding: 15px 16px 18px; transform: translateY(calc(100% + 14px)); }
  .detail-rail.is-open { transform: translateY(0); }
  .map-topbar { top: 12px; left: 12px; right: 12px; }
  .map-title { min-width: 0; padding: 9px 10px; }
  .map-title h2 { font-size: 16px; }
  .map-subtitle { font-size: 12px; }
  .map-action { min-height: 42px; padding: 0 9px; font-size: 12px; }
  .maplibregl-ctrl-bottom-right { right: 7px; bottom: 48px; }
  .workspace.is-details-open .map-topbar { right: 12px; }
}

@media (max-width: 800px) {
  .detail-rail {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(46dvh, 360px);
    transform: translateY(calc(100% + 14px));
  }
  .detail-rail.is-open { transform: translateY(0); }
  .workspace.is-details-open .map-topbar { right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* Dark dashboard surfaces and signal accents */
::selection { color: #050505; background: var(--sky-30); }
button:focus-visible, a:focus-visible, input:focus-visible, #map:focus-visible {
  outline-color: var(--blue-accent);
}
.topbar {
  background: #090909;
  border-bottom-color: var(--stroke);
}
.brand-mark { color: #050505; background: var(--sky-30); border-radius: 12px; }
.brand-copy strong { font-size: 16px; letter-spacing: .025em; }
.brand-copy strong span { color: var(--blue-accent); }
.brand-copy small { font-size: 11px; }
.receiver-context {
  gap: 9px;
  padding: 8px 12px;
  color: var(--neutral-20);
  background: #111;
  border: 1px solid var(--stroke);
  border-radius: 99px;
  font: 13px var(--sans);
  letter-spacing: .015em;
}
.receiver-dot { background: var(--blue-accent); }
.connection-status { color: var(--neutral-20); font: 13px var(--sans); letter-spacing: 0; }
.connection-status.is-live .status-dot { background: var(--green-live); }
.workspace { background: var(--beige-10); }
.aircraft-rail { background: #090909; }
.rail-heading h1, .detail-rail-heading h2 { font-size: 22px; font-weight: 650; letter-spacing: -.025em; }
.count-badge { min-width: 30px; height: 30px; padding: 0 8px; background: var(--sky-10); border-color: var(--sky-20); font-size: 13px; line-height: 1; vertical-align: middle; }
.icon-button, .close-button { border-radius: 13px; background: #111; }
.icon-button:hover, .close-button:hover { background: var(--beige-20); border-color: var(--sky-20); }
.search-box { height: 46px; padding: 0 12px; background: var(--beige-10); border-radius: 12px; }
.search-box:focus-within { background: var(--white); border-color: var(--blue-accent); }
.search-box input { font-size: 14px; }
.search-icon { color: var(--blue-accent); }
kbd { background: var(--beige-20); border-radius: 8px; }
.aircraft-list { margin-top: 18px; scrollbar-color: var(--sky-20) transparent; }
.aircraft-list::-webkit-scrollbar-thumb, .detail-rail::-webkit-scrollbar-thumb { background: var(--sky-20); }
.aircraft-row { min-height: 66px; padding: 10px 6px; margin: 0; border-radius: 0; }
.aircraft-row:hover { background: rgba(255,255,255,.035); }
.aircraft-row.is-selected { background: var(--sky-10); border-bottom-color: var(--sky-30); }
.list-plane { color: var(--blue-accent); background: transparent; border-radius: 0; }
.list-plane svg { width: 24px; height: 24px; }
.aircraft-row.is-selected .list-plane { color: #050505; background: var(--sky-30); }
.aircraft-callsign { font-size: 14px; font-weight: 650; }
.aircraft-state { font-size: 13px; }
.rail-note { border-top-color: var(--stroke); }
.map-stage {
  margin: 10px;
  background: #111b27;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
#map { border-radius: inherit; }
.map-topbar { top: 18px; left: 18px; right: 18px; }
.map-title {
  gap: 5px;
  padding: 13px 16px 12px;
  background: rgba(9,9,9,.94);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 4px 22px rgba(0,0,0,.42);
}
.map-title h2 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.map-subtitle, .map-position-count { font-size: 13px; }
.map-action {
  min-height: 46px;
  padding: 0 18px;
  color: var(--neutral-30);
  background: #101010;
  border: 1px solid var(--stroke);
  border-radius: 99px;
  box-shadow: 0 4px 18px rgba(0,0,0,.38);
  font-size: 14px;
  transition: background-color 180ms ease-out, opacity 180ms ease-out;
}
.map-action:hover:not(:disabled) { color: var(--neutral-30); background: #242424; border-color: var(--sky-20); }
.map-action:disabled { color: var(--neutral-10); background: #101010; border-color: var(--stroke); opacity: 1; }
.workspace.is-details-open .map-message {
  padding: 12px 16px;
  color: var(--neutral-30);
  background: #0b0b0b;
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(0,0,0,.4);
  font-size: 14px;
}
.map-aircraft-marker { color: var(--aircraft-blue); }
.map-aircraft-marker.is-selected { color: var(--aircraft-highlight); }
.map-aircraft-marker svg { filter: drop-shadow(0 2px 3px rgba(4,12,20,.9)); }
.map-aircraft-marker.is-selected svg { filter: drop-shadow(0 0 6px rgba(132,185,239,.78)); }
.maplibregl-ctrl-group {
  border-radius: 13px !important;
  background: #0b0b0b !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.4) !important;
}
.maplibregl-ctrl-group button { width: 42px !important; height: 42px !important; background-color: #0b0b0b !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { color: var(--neutral-30) !important; background: rgba(9,9,9,.94) !important; }
.maplibregl-ctrl-attrib a { color: var(--blue-accent) !important; text-decoration-color: var(--sky-30); }
.aircraft-picker-popup .maplibregl-popup-content {
  color: var(--neutral-30);
  background: var(--white);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.46);
}
.aircraft-picker-popup .maplibregl-popup-tip { border-top-color: var(--white); border-bottom-color: var(--white); }
.aircraft-picker-popup .maplibregl-popup-close-button { color: var(--neutral-30); }
.aircraft-picker-heading { color: var(--neutral-30); font-size: 16px; }
.aircraft-picker-option { color: var(--neutral-30); border-top-color: var(--stroke); }
.aircraft-picker-option:hover { background: var(--sky-10); }
.aircraft-picker-callsign { font-size: 13px; }
.detail-rail {
  top: 12px;
  right: 10px;
  bottom: 12px;
  padding: 22px;
  background: var(--white);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  scrollbar-color: var(--sky-20) transparent;
}
.detail-rail-heading { min-height: 48px; padding-bottom: 14px; }
.detail-rail-heading h2 { font-size: 19px; }
.close-button { background: var(--beige-10); }
.detail-placeholder { padding: 18px 4px; font-size: 15px; }
.placeholder-plane { color: var(--blue-accent); background: transparent; border: 0; border-radius: 0; }
.detail-image {
  min-height: 0;
  padding: 0 0 18px;
  margin: 0 0 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  border-radius: 0;
}
.signal-heading { font-size: 15px; }
.signal-heading b { font-size: 13px; }
.signal-meter { height: 9px; background: #1b252c; }
.signal-meter i { background: linear-gradient(90deg, #156cc2, #84b9ef 62%, #e7b77b); }
.signal-caption { font-size: 13px; }
.details-title-row { margin-bottom: 18px; }
.details-callsign { font-size: 24px; letter-spacing: -.025em; }
.status-pill { padding: 8px 10px; }
.status-pill.is-stale { background: var(--beige-20); }
.status-pill.is-waiting { background: var(--sky-10); }
.fact-grid { column-gap: 20px; }
.fact { padding: 13px 0 12px; border-bottom-color: var(--stroke); }
.fact-label { font-size: 13px; }
.fact-value { font-size: 13px; }
.detail-note { font-size: 14px; }
.detail-locate {
  min-height: 48px;
  margin-top: 18px;
  color: var(--neutral-30);
  background: #101010;
  border: 1px solid var(--stroke);
  border-radius: 99px;
  font-size: 14px;
  transition: background-color 180ms ease-out;
}
.detail-locate:hover { color: var(--neutral-30); background: #242424; border-color: var(--sky-20); }

/* Keep compact controls aligned in the demo dashboard at typical laptop widths. */
.rail-heading { padding-right: 44px; }
.rail-heading h1 {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1;
}
.count-badge {
  min-width: 0;
  height: auto;
  padding: 0;
  margin: 0;
  color: var(--blue-accent);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 600 13px/1 var(--mono);
  vertical-align: baseline;
}
.map-topbar { align-items: center; }
.close-button { width: 44px; height: 44px; }
@media (max-width: 680px) {
  .topbar { background: #090909; }
  .brand-copy strong { font-size: 14px; }
  .workspace { background: var(--beige-10); }
  .map-stage { margin: 8px 8px 0; border-radius: 20px; }
  .aircraft-rail { background: var(--white); }
  .detail-rail { right: 8px; bottom: 0; left: 8px; padding: 18px 18px 22px; border-radius: 22px 22px 0 0; }
  .map-topbar { top: 12px; left: 12px; right: 12px; }
  .map-title { padding: 9px 11px; border-radius: 14px; }
  .map-title h2 { font-size: 16px; }
  .map-subtitle, .map-position-count { font-size: 12px; }
  .map-action { min-height: 42px; padding: 0 12px; font-size: 13px; }
}
