/* Intercept Tactical UI — Dark theme */

/* Author display rules (e.g. .left-field { display: flex }) silently override
   the UA's [hidden] { display: none }, so JS `el.hidden = true` never took
   effect on such elements. Restore the HTML semantics globally. */
[hidden] {
  display: none !important;
}

:root {
  --bg-primary: #020812;
  --bg-secondary: rgba(3, 13, 24, 0.94);
  --bg-panel: rgba(3, 13, 24, 0.84);
  --border: rgba(77, 119, 153, 0.25);
  --text-primary: #eef7ff;
  --text-dim: #8696aa;
  --accent-cyan: #00fff7;
  /* Status hues sit on the shared design-system ramps (success green-400,
     warning amber-500, error red-500, confirm blue) so they read as status
     rather than glow and keep AA contrast on both themes. The -rgb twins
     feed the translucent tints below. */
  --accent-amber: #f59e0b;
  --accent-amber-rgb: 245, 158, 11;
  --accent-red: #ef4444;
  --accent-red-rgb: 239, 68, 68;
  --accent-green: #4ade80;
  --accent-green-rgb: 74, 222, 128;
  --accent-blue: #7b9aeb;
  --accent-blue-rgb: 123, 154, 235;
  --grid-case: rgba(10, 14, 20, 0.92);
  --grid-line: rgba(255, 221, 120, 0.96);
  --grid-ring: rgba(255, 242, 194, 0.94);
  --grid-label: rgba(255, 246, 214, 0.98);
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;
  --radius: 10px;
  --panel-shadow: 0 22px 52px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(0, 255, 247, 0.04);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --detection-row-height: 84px;
  --rail-width: 96px;
  --left-panel-open-width: 320px;
  --shell-anim: 0.18s ease;
  --icon-sm: 14px;
  --icon-md: 18px;
  --icon-lg: 22px;
  --brand-logo-filter: none;
}

/* Icons come from the lucide sprite (static/img/icons.svg, 24-grid, 2px
   stroke). They inherit currentColor, so state colour lives on the button. */
.icon {
  display: inline-block;
  width: var(--icon-md);
  height: var(--icon-md);
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  pointer-events: none;
}
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-md { width: var(--icon-md); height: var(--icon-md); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
button > .icon:only-child { display: block; margin: auto; }

/* Substituted on body so the state-class overrides below re-evaluate the calc
   (var() inside a custom property resolves at the declaring element). */
body {
  --left-panel-width: var(--left-panel-open-width);
  --left-workspace-edge: calc(var(--rail-width) + var(--left-panel-width));
  --detection-border: color-mix(in srgb, var(--text-dim) 28%, transparent);
}

body.left-rail-collapsed {
  --rail-width: 48px;
}
body.left-panel-closed {
  --left-panel-width: 0px;
}

body.light-mode {
  --bg-primary: #e9eef4;
  --bg-secondary: rgba(244, 248, 252, 0.94);
  --bg-panel: rgba(246, 250, 253, 0.86);
  --border: rgba(47, 76, 101, 0.22);
  --text-primary: #07131f;
  --text-dim: #536274;
  --panel-shadow: 0 18px 46px rgba(16, 32, 48, 0.18), inset 0 0 0 1px rgba(0, 120, 140, 0.08);
  /* The wordmark is white-on-transparent; invert it for the light canvas. */
  --brand-logo-filter: invert(1) hue-rotate(180deg);
}
body.light-mode .header,
body.light-mode .classification-banner,
body.light-mode .coord-bar {
  background: rgba(248, 251, 254, 0.94);
}
body.light-mode .panel,
body.light-mode .map-search-flyout {
  background: rgba(248, 251, 254, 0.84);
}
body.light-mode .left-panel,
body.light-mode .side-nav,
body.light-mode .overlay-rail {
  background: rgb(248, 251, 254);
}
body.light-mode .map-search-results {
  background: rgba(248, 251, 254, 0.96);
}
body.light-mode .track-list-row,
body.light-mode .alert-list-row,
body.light-mode .storage-row,
body.light-mode .radar-card {
  background: rgba(255, 255, 255, 0.64);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  font-family: var(--font-mono);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 247, 0.08), transparent 34%),
    var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* --- Classification Banner --- */
.classification-banner {
  order: 2;
  height: 20px;
  background: rgba(3, 13, 24, 0.7);
  border-top: 1px solid rgba(77, 119, 153, 0.12);
  border-bottom: 1px solid rgba(77, 119, 153, 0.12);
  color: var(--accent-green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  line-height: 20px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* --- Header --- */
.header {
  order: 1;
  min-height: 48px;
  background:
    linear-gradient(180deg, rgba(3, 12, 23, 0.98), rgba(2, 9, 18, 0.92));
  border-bottom: 1px solid rgba(77, 119, 153, 0.22);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.header-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.header-logo {
  display: block;
  filter: var(--brand-logo-filter);
  height: 18px;
  width: auto;
  max-width: min(160px, 18vw);
}
.header-brand-text {
  display: none;
  color: var(--text-primary);
  font: 900 20px/1 var(--font-mono);
  letter-spacing: 0.04em;
}
.header-nav-add,
.header-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font: 800 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.header-theme-toggle {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-dim);
  cursor: pointer;
}

.header-theme-toggle .theme-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.header-theme-toggle .theme-icon[hidden] {
  display: none;
}
.header-theme-toggle:hover,
.header-theme-toggle[aria-pressed="true"] {
  color: var(--accent-cyan);
  background: rgba(0,255,247,0.1);
}
.header-nav-add,
.header-tool {
  width: 36px;
  padding: 0;
  border-color: rgba(77, 119, 153, 0.28);
  font-size: 20px;
  cursor: pointer;
}
.header-status {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.header-context {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 360px;
  min-height: 30px;
  position: relative;
  /* Symmetric reserve for the absolutely positioned view toggle pinned at
     left: 0, so the centered context picker cannot slide underneath it. */
  padding: 0 200px;
}
.header-context-picker {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 32px;
  padding: 0 4px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: var(--bg-secondary);
}
.header-context-count {
  color: var(--text-primary);
  font: 600 10px/1 var(--font-mono);
}
.header-context-select {
  min-width: 180px;
  max-width: min(420px, 42vw);
  height: 24px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  font: 11px var(--font-mono);
}
.header-context-select:hover {
  border-color: var(--border);
}
.header-context-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}
.header-view-toggle {
  display: inline-flex;
  gap: 3px;
  position: absolute;
  left: 0;
  padding: 2px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: var(--bg-secondary);
}
.header-view-toggle .header-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 66px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.header-view-toggle .header-view-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
}
.header-view-toggle .header-view-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.12);
}
.header-view-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.header-system-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.header-tools::after {
  content: "";
  width: 1px;
  height: 26px;
  margin-left: 2px;
  background: rgba(77, 119, 153, 0.24);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  color: var(--text-dim);
  background: currentcolor;
  box-shadow: 0 0 8px currentcolor;
}
.status-dot.connected { color: var(--accent-green); }
.status-dot.disconnected { color: var(--accent-red); }
.status-dot.degraded { color: var(--accent-amber); }
.header-time {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

/* --- App layout --- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: -webkit-fill-available;
}
.map-container {
  order: 3;
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(77, 119, 153, 0.18);
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
#map,
#map3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#map {
  z-index: 1;
  background: #020812;
  transition: opacity 0.18s ease;
}
#map3d {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(68, 170, 255, 0.14), transparent 32%),
    radial-gradient(circle at 80% 18%, rgba(0, 255, 247, 0.12), transparent 26%),
    linear-gradient(180deg, #081019 0%, #05080d 100%);
  transition: opacity 0.18s ease;
}
.map-container.terrain-3d-active #map {
  opacity: 0;
  pointer-events: none;
}
.map-container.terrain-3d-active #map3d {
  opacity: 1;
  pointer-events: auto;
}
.map-mode-indicator {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 900;
  transform: translateX(-50%);
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(94, 224, 255, 0.35);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.88);
  color: var(--accent-cyan);
  font: 700 10px/30px var(--font-mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.map-search {
  position: relative;
}
.map-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-search-toggle svg {
  width: 22px;
  height: 22px;
}
.map-search.expanded .map-search-toggle {
  color: var(--accent-cyan);
  background-color: rgba(0, 255, 247, 0.12);
}
.map-search-flyout {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  z-index: 920;
  display: none;
  align-items: center;
  gap: 8px;
  width: min(460px, calc(100vw - 140px));
  min-height: 56px;
  padding: 0 12px;
  border: 1px solid rgba(77, 119, 153, 0.26);
  border-radius: 10px;
  background: rgba(3, 13, 24, 0.88);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(14px);
  color: var(--text-dim);
  font: 700 12px/1 var(--font-mono);
}
.map-search.expanded .map-search-flyout {
  display: flex;
}
.map-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: 800 12px/1 var(--font-mono);
}
.map-search-input::placeholder {
  color: var(--text-dim);
}
.map-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: 900 16px/1 var(--font-mono);
  cursor: pointer;
}
.map-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(77, 119, 153, 0.24);
  border-radius: 10px;
  background: rgba(3, 13, 24, 0.94);
  box-shadow: var(--panel-shadow);
  padding: 6px;
}
.search-result {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
}
.search-result:hover,
.search-result.active {
  background: rgba(0,255,247,0.1);
}
.search-result-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.search-result-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 10px;
}
.side-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 940;
  width: var(--rail-width);
  --rail-pad: 12px;

  padding: 8px var(--rail-pad) 18px;
  border-right: 1px solid rgba(77, 119, 153, 0.2);
  background: linear-gradient(180deg, rgb(3, 12, 23), rgb(2, 9, 18));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  transition: width var(--shell-anim), padding var(--shell-anim);
}
.side-nav::-webkit-scrollbar {
  display: none;
}
.side-nav.collapsed {
  --rail-pad: 6px;
}
.side-nav-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: rgba(18,18,26,0.52);
  color: var(--text-dim);
  font: 900 18px/1 var(--font-mono);
  cursor: pointer;
}
.side-nav-btn {
  min-height: 60px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.side-nav.collapsed .side-nav-btn {
  min-height: 48px;
}
.side-nav.collapsed .side-nav-btn span:not(.side-nav-icon) {
  display: none;
}
.side-nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.1);
}
.side-nav-btn.active::after {
  content: '';
  position: absolute;
  right: calc(-1 * var(--rail-pad));
  top: 16%;
  bottom: 16%;
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 2px 0 0 2px;
}
.side-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.side-nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.detection-nav-icon {
  width: 20px;
  height: 20px;
}
.section-copy,
.section-empty {
  color: var(--text-dim);
  font: 700 11px/1.4 var(--font-mono);
  margin-bottom: 12px;
}
.left-section-view {
  height: calc(100% - 48px);
  overflow-y: auto;
}
.track-list,
.alert-list,
.storage-list,
.fmv-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fmv-feed-list {
  gap: 12px;
}
.track-list-row,
.alert-list-row,
.storage-row,
.fmv-feed-card {
  border: 1px solid rgba(77, 119, 153, 0.16);
  border-radius: 8px;
  background: rgba(11, 17, 27, 0.54);
  padding: 9px 10px;
}
.track-list-row {
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.fmv-feed-card {
  position: relative;
  resize: vertical;
  overflow: auto;
  min-height: 190px;
}
.fmv-feed-card.pinned {
  background: rgba(0, 255, 247, 0.1);
}
.track-list-row:hover,
.fmv-feed-card:hover {
  background: rgba(0,255,247,0.08);
}
.track-list-row.selected {
  background: rgba(0, 255, 247, 0.1);
  box-shadow: inset 3px 0 var(--accent-cyan);
}
.track-list-head,
.alert-list-head,
.storage-row-head,
.fmv-feed-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-primary);
  font: 900 10px/1.2 var(--font-mono);
  overflow-wrap: anywhere;
}
.track-list-meta,
.alert-list-meta,
.storage-row-value,
.fmv-feed-meta {
  margin-top: 5px;
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}
.fmv-feed-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.fmv-feed-status,
.fmv-stream-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fmv-feed-status > [data-fmv-origin] {
  display: inline-flex;
  align-items: center;
}
.fmv-origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  white-space: nowrap;
}
.fmv-origin-badge.mesh {
  color: var(--accent-cyan);
}
.fmv-origin-badge svg,
.fmv-mesh-load svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Match the floating breakout panel header. */
.fmv-feed-head {
  align-items: center;
  font: 700 12px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
}
.track-stream-breakout {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 6px;
  background: rgba(18,18,26,0.52);
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  cursor: pointer;
}
.track-stream-breakout:hover {
  color: var(--accent-cyan);
}
.fmv-protocol-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(18,18,26,0.52);
}
.fmv-protocol-btn {
  min-height: 22px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid rgba(77, 119, 153, 0.22);
  background: transparent;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  cursor: pointer;
}
.fmv-protocol-btn:last-child {
  border-right: 0;
}
.fmv-protocol-btn.active,
.fmv-protocol-btn:hover {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.1);
}
.fmv-feed-video,
.track-stream-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  background: #000;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 6px;
}
video[data-fmv-playback-state="error"] {
  border-color: var(--accent-red);
  opacity: 0.55;
}
.fmv-stream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  margin-top: 6px;
}
.fmv-stream-footer .fmv-stream-meta,
.fmv-stream-footer .fmv-feed-meta {
  margin-top: 0;
}
.fmv-video-shell {
  position: relative;
  margin-top: 8px;
}
.fmv-video-shell .fmv-feed-video,
.fmv-video-shell .fmv-stream-video,
.fmv-video-shell .track-stream-video {
  margin-top: 0;
}
.fmv-mesh-load {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background:
    radial-gradient(circle at center, rgba(0, 255, 247, 0.1), transparent 55%),
    rgba(2, 8, 18, 0.88);
  color: var(--accent-cyan);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.fmv-mesh-load:hover,
.fmv-mesh-load:focus-visible {
  border-color: rgba(0, 255, 247, 0.72);
  background:
    radial-gradient(circle at center, rgba(0, 255, 247, 0.16), transparent 58%),
    rgba(2, 8, 18, 0.92);
}
.fmv-mesh-load:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -3px;
}
.fmv-mesh-load svg {
  width: 22px;
  height: 22px;
}
.fmv-mesh-load small {
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.04em;
}
.fmv-mesh-load[hidden] {
  display: none;
}
.fmv-video-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(11, 14, 22, 0.72);
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 120ms ease;
}
.fmv-video-expand svg {
  width: 14px;
  height: 14px;
  display: block;
}
.fmv-video-shell:hover .fmv-video-expand,
.fmv-video-expand:focus-visible {
  opacity: 1;
}
.fmv-video-expand:hover,
.fmv-video-expand:active {
  color: var(--accent-cyan);
}
/* Touch devices (iPad): no hover, keep the control visible. */
@media (hover: none) {
  .fmv-video-expand {
    opacity: 1;
  }
}
.track-stream-fallback {
  display: inline-flex;
  color: var(--accent-cyan);
  font: 800 10px/1.2 var(--font-mono);
  text-decoration: none;
}
.left-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.left-field select,
.left-field input {
  min-height: 30px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 6px;
  background: rgba(18,18,26,0.82);
  color: var(--text-primary);
  font: 700 10px/1.2 var(--font-mono);
  padding: 0 8px;
}
.left-action-btn {
  width: 100%;
  min-height: 30px;
  margin: 2px 0 14px;
}
/* Inference model picker (DETECTS > MODEL): a static single-select listbox,
   grouped by provider, so the whole catalogue is visible without a popover. */
.t1-model-picker {
  position: relative;
  width: 100%;
}
.t1-model-list {
  margin: 0 0 8px;
  padding: 4px;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 6px;
  background: rgba(18, 18, 26, 0.82);
}
.t1-model-list:focus {
  outline: none;
}
.t1-model-list:focus-visible {
  border-color: var(--accent-cyan);
}
.t1-model-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 4px;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
}
.t1-model-group + .t1-model-group,
.t1-model-option + .t1-model-group {
  margin-top: 4px;
  border-top: 1px solid rgba(77, 119, 153, 0.18);
}
.t1-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--text-primary);
  font: 700 10px/1.2 var(--font-mono);
  cursor: pointer;
}
.t1-model-option:hover {
  background: rgba(0, 255, 247, 0.1);
}
.t1-model-option.selected {
  background: rgba(0, 255, 247, 0.16);
}
.t1-model-list:focus-visible .t1-model-option.selected {
  outline: 1px solid var(--accent-cyan);
  outline-offset: -1px;
}
.t1-model-option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t1-model-badge {
  flex: 0 0 auto;
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.t1-model-badge.is-live {
  color: var(--accent-green);
}
.t1-model-badge.is-pending {
  color: var(--accent-amber);
}
.t1-model-empty {
  padding: 10px 8px;
  color: var(--text-dim);
  font: 800 10px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: center;
}
.t1-prompt-field {
  margin-bottom: 2px;
}
.t1-provider-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 5px;
  /* Neutral chip so brand-colored logos (e.g. Turbine One green) carry the color. */
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.t1-provider-mark {
  display: inline-flex;
}
.t1-provider-mark svg {
  display: block;
  width: 12px;
  height: 12px;
}
/* Providers without a brand logo fall back to a currentColor accent chip. */
.t1-provider-chip.provider-picogrid {
  color: var(--accent-green);
  border-color: rgba(var(--accent-green-rgb), 0.4);
}
.fmv-stream-panel {
  position: absolute;
  right: 22px;
  bottom: 104px;
  z-index: 980;
  width: min(560px, calc(100vw - 190px));
  min-width: 280px;
  min-height: 200px;
  resize: both;
  overflow: hidden;
  display: none;
}
.fmv-stream-panel.visible {
  display: flex;
  flex-direction: column;
  /* Beats the later .panel { overflow-y: auto } rule — content never scrolls. */
  overflow: hidden;
}
.fmv-stream-panel .panel-header {
  flex: 0 0 auto;
}
.fmv-stream-panel .panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
}
.fmv-stream-panel .fmv-video-shell {
  flex: 1;
  min-height: 100px;
  display: flex;
}
.fmv-stream-panel .fmv-stream-video {
  flex: 1;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
}
.fmv-stream-panel .fmv-stream-meta {
  flex: 0 1 auto;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fmv-stream-panel .fmv-stream-footer {
  flex: 0 0 auto;
  min-height: 20px;
  margin-top: 4px;
}
.fmv-stream-panel.layout-pinned {
  box-shadow: var(--panel-shadow);
}
.fmv-stream-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 6px;
}
.fmv-stream-meta {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}
.fmv-stream-resize {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 14px;
  height: 14px;
  border-right: 2px solid rgba(0, 255, 247, 0.42);
  border-bottom: 2px solid rgba(0, 255, 247, 0.42);
  pointer-events: none;
}
.alert-severity-critical { color: var(--accent-red); }
.alert-severity-warning { color: var(--accent-amber); }
.alert-severity-info { color: var(--accent-cyan); }

/* --- Clean icon labels --- */
.clean-icon { overflow: visible !important; }

/* --- Alerting sensors: orange ring breathing 0.3→1.0, one full cycle per second (Orion parity; alternate = half a cycle per pass) --- */
@keyframes sensor-alert-pulse { from { opacity: 0.3; } to { opacity: 1; } }
.clean-icon.alerting::after,
.milsym-icon.alerting::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid rgb(254, 125, 27);
  border-radius: 50%;
  pointer-events: none;
  animation: sensor-alert-pulse 0.5s ease-in-out infinite alternate;
}
.clean-icon.alerting svg > circle:first-child { stroke: rgb(254, 125, 27); stroke-opacity: 0.9; }
.alert-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  transform: translateX(-50%);
  white-space: nowrap;
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(254, 125, 27);
  background: rgba(5, 8, 13, 0.86);
  border: 1px solid rgba(254, 125, 27, 0.6);
  border-radius: 999px;
  padding: 1px 6px;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .clean-icon.alerting::after,
  .milsym-icon.alerting::after { animation: none; opacity: 0.8; }
}
.clean-label {
  position: absolute;
  left: 34px;
  top: -4px;
  white-space: nowrap;
  font: 10px/1.3 var(--font-mono);
  color: #f5f8ff;
  background: rgba(5, 8, 13, 0.86);
  border: 1px solid rgba(199, 226, 255, 0.22);
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
  padding: 2px 5px;
  border-radius: 999px;
  pointer-events: none;
}
/* LOB pill centers on the line midpoint; positioning comes from its inline transform */
.lob-label {
  left: 0;
  top: 0;
}
/* Merged LOB callout: colliding pills fuse into one always-open box that floats
   above the leader-tick convergence point (its marker latlng). */
.lob-callout {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 6px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  font: 10px/1.3 var(--font-mono);
  color: #f5f8ff;
  background: rgba(5, 8, 13, 0.86);
  border: 1px solid rgba(199, 226, 255, 0.22);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  padding: 3px;
  border-radius: 10px;
  pointer-events: auto;
}
/* Each row mirrors the standalone LOB pill: dark ground, member-colored border */
.lob-callout-row {
  display: flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid;
  border-radius: 999px;
  background: rgba(5, 8, 13, 0.6);
}
.lob-callout-row:hover {
  background: rgba(255, 255, 255, 0.1);
}
/* Rows pad values into columns with spaces; keep them from collapsing */
.lob-callout-row span {
  white-space: pre;
}
.detection-reticle {
  overflow: visible;
  color: var(--accent-amber);
  fill: var(--accent-amber);
  stroke: currentcolor;
  stroke-width: 2.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.detection-reticle.selected {
  color: var(--accent-amber);
  filter: drop-shadow(0 0 2px var(--accent-cyan));
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.detection-reticle.hostile,
.detection-reticle.hostile.selected {
  color: var(--accent-red);
  fill: var(--accent-red);
}
.detection-reticle.stale {
  filter: saturate(0.4);
  stroke-dasharray: 3 2;
}
.leaflet-marker-icon:focus .detection-reticle {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* --- Azimuth grid labels --- */
.grid-label-icon { background: none !important; border: none !important; }
.grid-label {
  font: 10px/1 var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-block;
  padding: 0 1px;
  color: var(--grid-label);
  -webkit-text-stroke: 1px var(--grid-case);
  paint-order: stroke fill;
  pointer-events: none;
}
.azimuth-grid-case,
.azimuth-grid-main {
  fill: none;
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}
.azimuth-grid-case { stroke: var(--grid-case); }
.azimuth-grid-line { stroke: var(--grid-line); }
.azimuth-grid-ring { stroke: var(--grid-ring); }

/* --- Display toolbar --- */
.display-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}
.display-toolbar-title,
.display-toolbar-subtitle {
  align-self: flex-start;
  color: var(--text-primary);
  font: 900 12px/1 var(--font-mono);
  letter-spacing: 0.12em;
}
.display-toolbar-subtitle {
  color: var(--text-dim);
  font-size: 10px;
}
.display-toolbar-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}
.display-toolbar-secondary {
  display: flex;
  gap: 10px;
  align-self: flex-start;
}
.toggle-btn {
  font: 10px var(--font-mono);
  color: var(--text-dim);
  background: rgba(18,18,26,0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  min-width: 50px;
  text-align: center;
}
.display-toolbar .toggle-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.toggle-btn:hover { color: var(--text-primary); background: rgba(0, 255, 247, 0.06); }
.toggle-btn.active { color: var(--accent-cyan); background: rgba(0, 255, 247, 0.12); }

/* --- Coordinate bar --- */
.coord-bar {
  order: 4;
  min-height: 34px;
  height: auto;
  background: rgba(4, 7, 13, 0.98);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 4px 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 11px;
  color: var(--text-dim);
  gap: 8px 18px;
  flex-shrink: 0;
}
.coord-readout {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}
.coord-track-count {
  flex: 1 1 0;
  min-width: 0;
  text-align: right;
}

/* --- Floating panels --- */
.panel {
  position: absolute;
  background:
    linear-gradient(135deg, rgba(3, 13, 24, 0.92), rgba(3, 13, 24, 0.78));
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1000;
  font-size: 12px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: var(--panel-shadow);
}
.panel-header {
  min-height: 32px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-body { padding: 8px 12px; }
.panel-header .btn-close {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.panel-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(11, 14, 22, 0.42);
  color: var(--text-dim);
  cursor: pointer;
}
.panel-pin-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.panel-pin.active .panel-pin-icon {
  fill: currentColor;
}
.panel-pin:hover,
.panel-pin:active {
  border-color: rgba(94, 224, 255, 0.38);
  color: var(--accent-cyan);
  background: rgba(0,255,247,0.08);
}
.panel-pin.active {
  border-color: rgba(94, 224, 255, 0.5);
  color: var(--accent-cyan);
  background: rgba(0,255,247,0.12);
}
.layout-drag-handle {
  cursor: grab;
  touch-action: none;
}
.layout-dragging .layout-drag-handle,
.layout-drag-handle:active {
  cursor: grabbing;
}
.layout-pinned {
  z-index: 1250;
}
.layout-pinned.track-panel {
  transform: none;
  right: auto;
  bottom: auto;
  width: min(320px, calc(100vw - 16px));
}
.layout-pinned.track-panel.visible {
  transform: none;
}
.layout-pinned.track-panel:not(.visible) {
  display: none;
}

/* SOP checklist sidebar */
.sop-panel {
  top: 24px;
  right: 246px;
  width: 260px;
  max-height: 42vh;
  transition: width 0.18s ease, transform 0.18s ease;
}
.sop-panel.collapsed .sop-body { display: none; }
.sop-panel.collapsed {
  width: auto;
  max-height: none;
  overflow: hidden;
}
.sop-panel.collapsed .panel-header {
  padding: 8px 10px;
  border-bottom: none;
  gap: 8px;
}
.sop-title-short { display: none; }
.sop-panel.collapsed .sop-title-full { display: none; }
.sop-panel.collapsed .sop-title-short { display: inline; }
.sop-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sop-count {
  font-size: 10px;
  color: var(--text-dim);
}
.sop-toggle {
  font-size: 14px;
  line-height: 1;
  color: var(--accent-cyan);
}
.sop-subtitle {
  margin-bottom: 8px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.sop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sop-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sop-item:last-child { border-bottom: none; }
.sop-marker {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  margin-top: 1px;
}
.sop-item.done .sop-marker {
  border-color: var(--accent-green);
  background: rgba(var(--accent-green-rgb),0.12);
  color: var(--accent-green);
}
.sop-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sop-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.sop-detail {
  font-size: 10px;
  color: var(--text-dim);
}

/* Overlay and markup panel */
.overlay-dock {
  position: absolute;
  top: 220px;
  right: 18px;
  left: auto;
  z-index: 1000;
}
.overlay-rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 56px;
  overflow: visible;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgb(3, 12, 23), rgb(2, 9, 18));
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(14px);
}
.overlay-rail-btn {
  min-height: 56px;
  width: 56px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(77, 119, 153, 0.18);
  border-radius: 0;
  background-color: transparent;
  color: var(--text-dim);
  font: 10px/1.15 var(--font-mono);
  letter-spacing: 0.6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.overlay-rail-btn:last-child {
  border-bottom: 0;
}
.overlay-rail-btn:hover,
.overlay-rail-btn:active,
.overlay-rail-btn.active {
  color: var(--accent-cyan);
  background-color: rgba(0,255,247,0.12);
}
.overlay-rail-primary {
  color: var(--accent-cyan);
}
/* Rail artwork (pencil / layers): the original tri-colour drawings, inlined
   so each stroke reads a theme token rather than a hard-coded hex. */
.rail-art {
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  fill: none;
  overflow: visible;
}
.rail-art-base { stroke: var(--text-primary); }
.rail-art-cyan { stroke: var(--accent-cyan); }
.rail-art-amber { stroke: var(--accent-amber); }
.overlay-rail-terrain {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0 5px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.terrain-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
  filter: drop-shadow(0 3px 10px rgba(0, 255, 247, 0.14));
}
.terrain-toggle-icon-svg {
  width: 22px;
  height: 22px;
  overflow: visible;
}
.terrain-toggle-icon-depth {
  fill: rgba(0, 255, 247, 0.11);
  stroke: rgba(0, 255, 247, 0.28);
  stroke-width: 1;
}
.terrain-toggle-icon-top {
  fill: rgba(148, 218, 255, 0.14);
  stroke: currentcolor;
  stroke-opacity: 0.84;
  stroke-width: 1.2;
}
.terrain-toggle-icon-contour,
.terrain-toggle-icon-axis {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.terrain-toggle-icon-contour {
  stroke-width: 1.15;
  stroke-opacity: 0.9;
}
.terrain-toggle-icon-axis {
  stroke-width: 1;
  stroke-opacity: 0.54;
}
.terrain-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  min-width: 0;
}
.terrain-toggle-title {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 1.3px;
}
.terrain-toggle-subtitle {
  margin-top: 2px;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 1px;
  color: var(--text-dim);
}
.overlay-rail-terrain.target-2d .terrain-toggle-subtitle {
  display: none;
}
.overlay-rail-terrain.active .terrain-toggle-icon {
  filter: drop-shadow(0 4px 12px rgba(94, 224, 255, 0.2));
}
.overlay-rail-terrain.active .terrain-toggle-icon-depth {
  fill: rgba(68, 170, 255, 0.14);
  stroke: rgba(94, 224, 255, 0.34);
}
.overlay-rail-terrain.active .terrain-toggle-icon-axis {
  stroke-opacity: 0.72;
}
.overlay-rail-clear {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb),0.45);
}
.overlay-rail-clear:hover,
.overlay-rail-clear:active,
.overlay-rail-clear.active {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background-color: rgba(var(--accent-amber-rgb),0.08);
}
.overlay-panel {
  top: 0;
  right: 66px;
  left: auto;
  width: min(320px, calc(100vw - 88px));
  max-height: 52vh;
}
.overlay-panel .panel-header {
  padding: 12px 14px 10px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.overlay-panel .panel-body {
  padding: 14px;
}
.overlay-panel.collapsed .overlay-body { display: none; }
.overlay-panel.collapsed {
  display: none;
}
.overlay-panel-title {
  display: flex;
  align-items: center;
  line-height: 1;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 1.4px;
}
.overlay-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  flex: 0 0 auto;
}
.overlay-upload-btn {
  flex: 1 1 auto;
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  border: 1px solid rgba(94, 224, 255, 0.42);
  background: rgba(11, 14, 22, 0.74);
  box-shadow: inset 0 0 0 1px rgba(94, 224, 255, 0.08);
  color: var(--accent-cyan);
}
.overlay-upload-btn:hover, .overlay-upload-btn:active {
  border-color: rgba(94, 224, 255, 0.68);
  background: rgba(0,255,247,0.1);
}
.overlay-upload-btn:focus-visible {
  outline: none;
  border-color: rgba(94, 224, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0,255,247,0.12);
}
.overlay-toggle {
  flex: 0 0 42px;
  min-height: 42px;
  min-width: 40px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(11, 14, 22, 0.38);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--accent-cyan);
}
.overlay-toggle:hover,
.overlay-toggle:active {
  border-color: rgba(94, 224, 255, 0.35);
  background: rgba(0,255,247,0.08);
}
.overlay-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.overlay-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.overlay-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.overlay-section + .overlay-section {
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.overlay-subtitle {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.72);
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase;
}
.overlay-kml-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.overlay-drawing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overlay-shape-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.overlay-kml-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.overlay-shape-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.overlay-drawing-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overlay-drawing-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.overlay-drawing-group-label {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.56);
  letter-spacing: 0.9px;
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 2px;
}
.overlay-drawing-group-chevron {
  display: inline-flex;
  color: var(--text-dim);
  line-height: 1;
}
.overlay-drawing-group-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overlay-drawing-group-body.collapsed {
  display: none;
}
.overlay-drawing-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.overlay-drawing-item:last-child {
  border-bottom: none;
}
.overlay-drawing-select {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  flex: 1 1 auto;
}
.overlay-kml-item:last-child { border-bottom: none; }
.overlay-shape-item:last-child { border-bottom: none; }
.overlay-kml-toggle {
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.overlay-shape-toggle {
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.overlay-drawing-toggle {
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.overlay-kml-toggle.visible {
  border-color: transparent;
  background: var(--overlay-kml-accent, var(--accent-cyan));
  color: var(--bg-primary);
}
.overlay-drawing-toggle.visible,
.overlay-shape-toggle.visible {
  border-color: transparent;
  background: var(--accent-cyan);
  color: var(--bg-primary);
}
.overlay-shape-delete {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent-amber);
  cursor: pointer;
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s ease;
  opacity: 0.85;
}
.overlay-drawing-share,
.overlay-drawing-save,
.overlay-drawing-delete {
  min-height: 24px;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s ease;
  opacity: 0.85;
}
.overlay-drawing-share {
  min-width: 0;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(0,255,247,0.12);
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
}
.overlay-drawing-save,
.overlay-drawing-delete {
  width: 24px;
  padding: 0;
  border: none;
  background: transparent;
}
.overlay-drawing-save {
  color: var(--accent-cyan);
}
.overlay-drawing-delete {
  color: var(--accent-amber);
}
.overlay-drawing-share[disabled] {
  opacity: 0.45;
  cursor: default;
}
.overlay-drawing-save svg,
.overlay-drawing-delete svg,
.overlay-shape-delete svg {
  display: block;
}
.overlay-drawing-save svg {
  stroke: var(--accent-cyan);
}
.overlay-drawing-delete svg,
.overlay-shape-delete svg {
  stroke: var(--accent-amber);
}
.overlay-drawing-share:hover,
.overlay-drawing-save:hover,
.overlay-drawing-delete:hover,
.overlay-shape-delete:hover {
  opacity: 1;
}
.overlay-drawing-share:focus-visible,
.overlay-drawing-save:focus-visible,
.overlay-drawing-delete:focus-visible,
.overlay-shape-delete:focus-visible,
.overlay-drawing-select:focus-visible {
  opacity: 1;
  outline: 1px solid rgba(0, 255, 247, 0.7);
  outline-offset: 2px;
}
.overlay-kml-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.overlay-drawing-meta,
.overlay-shape-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.overlay-drawing-meta {
  flex: 1 1 auto;
}
.overlay-kml-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlay-drawing-name,
.overlay-shape-name {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlay-drawing-name.active {
  color: var(--accent-cyan);
}
.overlay-drawing-select {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.overlay-drawing-name-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: 600 11px var(--font-mono);
  padding: 0;
}
.overlay-drawing-name-input.active {
  color: var(--accent-cyan);
}
.overlay-drawing-name-input:focus {
  outline: 1px solid rgba(0, 255, 247, 0.7);
  outline-offset: 2px;
  color: var(--accent-cyan);
}
.overlay-kml-detail,
.overlay-drawing-detail,
.overlay-shape-detail,
.overlay-empty,
.overlay-hint,
.overlay-readout {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.68);
  line-height: 1.35;
}
.overlay-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overlay-field-label {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.74);
  letter-spacing: 0.9px;
  font-weight: 700;
  text-transform: uppercase;
}
.overlay-field-label-subtle {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.58);
  letter-spacing: 0.7px;
  font-weight: 600;
}
.overlay-text-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(94, 119, 160, 0.36);
  background: rgba(10, 12, 18, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  color: var(--text-primary);
  font: 11px var(--font-mono);
}
.overlay-text-input:focus {
  outline: none;
  border-color: rgba(94, 224, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(0,255,247,0.1);
}
.overlay-text-input::placeholder {
  color: var(--text-dim);
}
.overlay-drawing-add {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}
.overlay-style-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.overlay-kml-style-row {
  margin-bottom: 8px;
}
.overlay-color-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.overlay-color-input {
  width: 84px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(94, 119, 160, 0.38);
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  cursor: pointer;
}
.overlay-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-top: 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.overlay-check input {
  accent-color: var(--accent-cyan);
}
.overlay-tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.overlay-tool-btn {
  min-width: 0;
  min-height: 40px;
  border-color: rgba(94, 119, 160, 0.36);
  background: rgba(10, 12, 18, 0.78);
  color: rgba(224,224,232,0.78);
}
.overlay-tool-btn.active {
  color: var(--accent-cyan);
  background: rgba(0,255,247,0.14);
}
.overlay-tool-clear {
  grid-column: 1 / -1;
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb),0.72);
  background: rgba(32, 20, 4, 0.24);
}
.overlay-readout:not(:empty) {
  color: var(--accent-cyan);
}
.overlay-shape-label,
.overlay-shape-label-measure,
.overlay-kml-label {
  background: none !important;
  border: none !important;
}
.overlay-shape-label span,
.overlay-shape-label-measure span,
.overlay-kml-label span {
  transform: translate(-50%, -50%);
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.88);
  border: 1px solid var(--shape-label-color, rgba(224, 228, 236, 0.6));
  box-shadow: 0 0 0 1px rgba(5, 8, 13, 0.28);
  color: var(--shape-label-color, var(--text-primary));
  font: 600 10px/1 var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
}
.overlay-shape-label-measure span {
  background: rgba(18, 14, 6, 0.92);
}
.overlay-shape-label-marker span {
  transform: translate(-50%, calc(-50% + 18px));
}
.overlay-kml-label span {
  background: rgba(8, 12, 20, 0.9);
  border-color: var(--kml-label-color, rgba(224, 228, 236, 0.6));
  color: var(--kml-label-color, var(--text-primary));
}
.overlay-shape-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  flex: 0 0 auto;
}

/* Radar feed */
.left-panel {
  top: 0;
  bottom: 0;
  left: var(--rail-width);
  width: var(--left-panel-open-width);
  max-height: none;
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(77, 119, 153, 0.2);
  background: linear-gradient(180deg, rgb(3, 12, 23), rgb(2, 9, 18));
  box-shadow: none;
  z-index: 930;
  transition: left var(--shell-anim), transform var(--shell-anim), visibility 0s;
}
.left-panel.closed {
  transform: translateX(calc(-100% - var(--rail-width)));
  visibility: hidden;
  pointer-events: none;
  transition: left var(--shell-anim), transform var(--shell-anim), visibility 0s linear 0.18s;
}
.left-panel-close {
  flex: 0 0 auto;
}

.detection-filter-section {
  flex: none;
  min-width: 0;
  margin-bottom: var(--space-2);
  overflow: hidden;
  border: 1px solid rgba(77, 119, 153, 0.35);
  border-radius: 6px;
  background: rgba(3, 13, 24, 0.58);
}

.detection-filter-toggle {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.detection-filter-toggle:hover,
.detection-filter-toggle:focus-visible {
  color: var(--accent-cyan);
}

.detection-filter-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

.detection-filter-icon {
  width: 14px;
  height: 14px;
}

.detection-filter-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detection-filter-chevron .icon,
.overlay-drawing-group-chevron .icon { display: block; }
.arrow .icon { width: 11px; height: 11px; vertical-align: -1px; }
.detection-filter-chevron {
  color: var(--text-dim);
  transition: transform var(--shell-anim);
}

.detection-filter-section.expanded .detection-filter-chevron {
  transform: rotate(180deg);
}

.detection-filter-body {
  padding: 8px;
  border-top: 1px solid rgba(77, 119, 153, 0.28);
}

/* TRACKS tab: correlated (data-fusion FUSED) vs raw producer tracks switch. */
.track-source-section {
  flex: none;
  min-width: 0;
  margin-bottom: var(--space-2);
  border: 1px solid rgba(77, 119, 153, 0.35);
  border-radius: 6px;
  background: rgba(3, 13, 24, 0.58);
}
.track-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 8px;
}
.track-source-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.track-source-title {
  color: var(--text-primary);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.track-source-summary {
  overflow: hidden;
  color: var(--text-dim);
  font: 700 10px/1.2 var(--font-mono);
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-source-state {
  flex: none;
  min-width: 38px;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-align: right;
}
.track-source-row:has(.track-source-switch[aria-checked="true"]) .track-source-state {
  color: var(--accent-cyan);
}
.track-source-switch {
  flex: none;
  position: relative;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(77, 119, 153, 0.45);
  border-radius: 11px;
  background: rgba(11, 14, 22, 0.6);
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--shell-anim), border-color var(--shell-anim);
}
.track-source-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--shell-anim), background var(--shell-anim);
}
.track-source-switch[aria-checked="true"] {
  background: rgba(0, 255, 247, 0.22);
}
.track-source-switch[aria-checked="true"] .track-source-knob {
  transform: translateX(18px);
  background: var(--accent-cyan);
}
.track-source-switch:hover {
  filter: brightness(1.15);
}
.track-source-switch:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
body.light-mode .track-source-section {
  background: rgba(255, 255, 255, 0.64);
}
body.light-mode .track-source-switch {
  background: rgba(47, 76, 101, 0.12);
}

.detection-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.detection-filter-fields .left-field {
  min-width: 0;
  margin: 0;
}

.detection-filter-fields select {
  min-height: 32px;
}

.detection-position-filter {
  grid-column: 1 / -1;
}

.detection-range-filter {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(77, 119, 153, 0.2);
}

.detection-filter-label-row,
.detection-filter-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detection-filter-label-row {
  margin-bottom: 2px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.detection-filter-label-row output {
  color: var(--accent-cyan);
  font-size: 11px;
}

.detection-confidence-slider {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.detection-filter-scale {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 10px;
}

.detection-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(77, 119, 153, 0.24);
}

.detection-filter-count {
  min-width: 0;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.detection-filter-reset {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(77, 119, 153, 0.35);
  border-radius: 4px;
  background: rgba(18, 18, 26, 0.58);
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  cursor: pointer;
}

.detection-filter-reset:hover,
.detection-filter-reset:focus-visible {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* DETECTS > MODEL section: summary state and the staged-change footer. */
.detection-model-state.is-live { color: var(--accent-green); }
.detection-model-state.is-pending,
.detection-model-state.is-saving { color: var(--accent-amber); }
.detection-model-state.is-offline { color: var(--accent-red); }
.detection-model-status.is-pending { color: var(--accent-amber); }
.detection-model-actions {
  flex: none;
  display: inline-flex;
  gap: 6px;
}
.detection-model-apply {
  border-color: rgba(0, 255, 247, 0.4);
  background: rgba(0, 255, 247, 0.1);
  color: var(--accent-cyan);
}
.detection-model-apply:disabled {
  border-color: rgba(77, 119, 153, 0.35);
  background: rgba(18, 18, 26, 0.58);
  color: var(--text-dim);
  opacity: 0.6;
  cursor: default;
}

@media (hover: none), (pointer: coarse) {
  .detection-filter-toggle,
  .detection-filter-fields select,
  .detection-filter-reset {
    min-height: 44px;
  }
  .detection-confidence-slider {
    height: 44px;
  }
  /* Keep the 40x22 pill visually compact but give it a 44px tap target. */
  .track-source-row {
    min-height: 44px;
  }
  .track-source-switch::after {
    content: '';
    position: absolute;
    inset: -11px -8px;
  }
}

.detection-hostile-value {
  color: var(--accent-red);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.detection-hostile-value .detection-origin-badge {
  border-color: rgba(var(--accent-red-rgb), 0.45);
  color: var(--accent-red);
}

.detection-archive-marker {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent-amber);
  border-radius: 50%;
  background: rgba(2, 8, 18, 0.88);
  box-shadow: 0 0 0 2px rgba(0, 22, 35, 0.75), 0 0 10px rgba(var(--accent-amber-rgb), 0.22);
  color: var(--text-primary);
  font: 900 12px/1 var(--font-mono);
}

.detection-archive-marker.hostile {
  border-color: var(--accent-red);
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(0, 22, 35, 0.75), 0 0 10px rgba(var(--accent-red-rgb), 0.32);
}

/* Non-hue hostile cue: amber vs red rings converge under red-green
   color-vision deficiency, so hostile clusters also get a notch. */
.detection-archive-marker.hostile::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(2, 8, 18, 0.88);
}

.detection-archive-marker.selected {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 3px;
}

.leaflet-marker-icon:focus .detection-archive-marker {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.left-panel .panel-header {
  min-height: 48px;
  padding: 0 16px;
  border-bottom-color: rgba(77, 119, 153, 0.24);
}
.left-panel .panel-header > span:first-child {
  font: 900 15px/1 var(--font-mono);
  color: var(--text-primary);
  letter-spacing: 0.08em;
}
.left-panel .radar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}
.left-panel #leftPanelCount {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--accent-cyan);
  font: 800 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.left-panel .panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.34) transparent;
}
.left-panel .panel-body::-webkit-scrollbar {
  width: 6px;
}
.left-panel .panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.left-panel .panel-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
.left-panel .panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.52);
}
/* AS3 effector panel — bottom right */
.as3-panel {
  bottom: 52px;
  right: 96px;
  width: min(280px, calc(100vw - 20px));
}
.as3-panel .track-field {
  align-items: flex-start;
  gap: 12px;
}
.as3-panel .track-field-value {
  overflow-wrap: anywhere;
  text-align: right;
}
.as3-panel #as3Rssi {
  white-space: pre-line;
  line-height: 1.4;
}
.as3-panel .track-field-value.fused { color: var(--accent-green); }
.as3-panel .track-field-value.unqualified { color: var(--accent-amber); }
.as3-panel .track-field-value.untracked { color: var(--accent-red); }
.context-panel-title {
  display: inline-flex;
  align-items: center;
}
.context-header-actions,
.track-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.context-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(0,255,247,0.12);
  color: var(--accent-cyan);
  font-size: 10px;
  letter-spacing: 0.8px;
}
.radar-card {
  border: 1px solid rgba(77, 119, 153, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 17, 27, 0.7), rgba(11, 17, 27, 0.48));
  overflow: hidden;
}
.radar-card-global {
  border-color: var(--border);
  background: linear-gradient(135deg, rgba(0, 255, 247, 0.07), rgba(3, 20, 22, 0.36));
}
.radar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 0;
}
.radar-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.radar-card-title {
  font-size: 11px;
  color: rgba(185, 191, 213, 0.74);
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase;
}
.radar-card-summary {
  font-size: 10px;
  color: var(--text-dim);
}
.radar-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  padding: 10px;
}
.radar-control-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 22px;
}
.radar-rail-btn {
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(11, 14, 22, 0.42);
  color: var(--accent-cyan);
  font: 12px/1 var(--font-mono);
  cursor: pointer;
}
.radar-rail-btn:hover,
.radar-rail-btn:active {
  border-color: rgba(94, 224, 255, 0.35);
  background: rgba(0,255,247,0.08);
}
.radar-rail-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.radar-focus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.radar-focus-pin {
  position: relative;
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.radar-focus-pin::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: currentColor;
}
.radar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.radar-name {
  color: var(--text-primary);
  font-weight: 900;
  letter-spacing: 0.04em;
}
.radar-name.asset-name,
.asset-name {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--text-primary);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.asset-name:hover,
.asset-name:focus-visible {
  color: var(--accent-cyan);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.radar-meta {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.radar-meta-highlight {
  font-size: 10px;
  color: #ffd166;
  line-height: 1.35;
}
.radar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.radar-filter-reset {
  min-width: 32px;
  min-height: 30px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(11, 14, 22, 0.38);
  color: var(--text-dim);
  font: 10px var(--font-mono);
  letter-spacing: 0.7px;
  cursor: pointer;
}
.radar-filter-reset:hover,
.radar-filter-reset:active {
  border-color: rgba(var(--accent-amber-rgb),0.3);
  color: var(--accent-amber);
  background: rgba(var(--accent-amber-rgb),0.08);
}
.radar-filter-reset:disabled {
  opacity: 0.38;
  cursor: default;
}
.radar-filter-reset:disabled:hover,
.radar-filter-reset:disabled:active {
  border-color: rgba(255,255,255,0.08);
  color: var(--text-dim);
  background: rgba(11, 14, 22, 0.38);
}
.radar-card .btn {
  min-height: 34px;
  min-width: 72px;
  padding: 5px 9px;
  border-radius: 7px;
}
.radar-card-body {
  display: none;
  padding: 0 10px 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-direction: column;
  gap: 10px;
}
.radar-card.expanded .radar-card-body,
.radar-card-body-static {
  display: flex;
}
.radar-card-body-static {
  padding-top: 10px;
}
.radar-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radar-slider-group + .radar-slider-group {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.radar-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.radar-slider-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.radar-slider-label {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.72);
  letter-spacing: 0.9px;
  text-transform: uppercase;
}
.radar-slider-mode {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
}
.radar-slider-mode.filter {
  color: #9ad1ff;
  background: rgba(68,170,255,0.12);
  border: 1px solid rgba(68,170,255,0.2);
}
.radar-slider-mode.highlight {
  color: #ffd166;
  background: rgba(255,209,102,0.12);
  border: 1px solid rgba(255,209,102,0.22);
}
.radar-slider-value {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}
.radar-slider-value.active {
  color: var(--text-primary);
}
.radar-slider-bound {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.radar-slider-bound-label {
  font-size: 10px;
  color: rgba(185, 191, 213, 0.72);
  letter-spacing: 0.9px;
  font-weight: 700;
}
.radar-slider-bound-value {
  min-width: 52px;
  text-align: right;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}
.radar-slider-bound-value.active {
  color: var(--text-primary);
}
.radar-slider {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.12);
  outline: none;
}
.radar-slider.active {
  background: linear-gradient(90deg, rgba(0,255,247,0.65), rgba(var(--accent-amber-rgb),0.7));
}
.radar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: #f4f6ff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.22);
}
.radar-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: #f4f6ff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.22);
}
.radar-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

/* Track detail panel — right side */
.track-panel {
  top: 96px;
  right: 18px;
  width: min(360px, calc(100vw - 20px));
  max-height: calc(100% - 150px);
  transform: translateX(390px);
  transition: transform 0.2s ease;
}
.track-panel.detection-mode {
  width: min(300px, calc(100vw - 20px));
}
.track-panel.visible { transform: translateX(0); }
.track-field {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(77, 119, 153, 0.12);
}
.track-field-label { color: var(--text-dim); }
.track-field-value {
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}
.detection-source-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.detection-origin-badge {
  padding: 1px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(0, 255, 247, 0.12);
  color: var(--accent-cyan);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}
.track-history {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(77, 119, 153, 0.18);
  border-radius: 8px;
  background: rgba(0,255,247,0.04);
}
.track-history-head {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.track-history-chart {
  height: 82px;
}
.track-history-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}
.track-history-chart polyline {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.track-history-empty {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
}
.detection-snapshot {
  margin-top: var(--space-3);
}
.detection-snapshot-frame {
  appearance: none;
  position: relative;
  display: grid;
  width: 100%;
  min-height: 140px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--detection-border);
  border-radius: var(--radius);
  background: #05080b;
  color: inherit;
  text-align: inherit;
}
.detection-snapshot-frame:not(:disabled) {
  cursor: zoom-in;
}
.detection-snapshot-frame:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.detection-snapshot-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.detection-snapshot-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--accent-red);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 0 8px rgba(var(--accent-red-rgb), 0.45);
  pointer-events: none;
}
.detection-snapshot-box::before {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: -2px;
  padding: 2px 4px;
  background: var(--accent-red);
  color: #fff;
  font: 700 10px/1 var(--font-mono);
  white-space: nowrap;
}
.detection-snapshot-box:not([data-label])::before {
  display: none;
}
.detection-snapshot-status {
  padding: var(--space-2);
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  text-align: center;
}
.detection-snapshot-expand {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  pointer-events: none;
}
.detection-snapshot-expand svg {
  width: 16px;
  height: 16px;
}
.detection-snapshot-frame:disabled .detection-snapshot-expand {
  display: none;
}
.detection-snapshot-dialog {
  max-width: 94vw;
  max-height: 94vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--text-primary);
}
.detection-snapshot-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(3px);
}
.detection-snapshot-dialog-shell {
  display: grid;
  gap: 8px;
  width: fit-content;
  max-width: 94vw;
}
.detection-snapshot-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-primary);
  font: 800 11px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
}
.detection-snapshot-dialog-head button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font: 400 24px/1 sans-serif;
  cursor: pointer;
}
.detection-snapshot-dialog-stage {
  position: relative;
  width: fit-content;
  max-width: 94vw;
  background: #05080b;
}
.detection-snapshot-dialog-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: calc(94vh - 40px);
}
.track-stream-section {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(77, 119, 153, 0.18);
  border-radius: 8px;
  background: rgba(0,255,247,0.035);
}
.track-stream-head {
  margin-bottom: 8px;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.track-stream-list {
  display: grid;
  gap: 6px;
}
.track-stream-card {
  position: relative;
  min-height: 160px;
  padding: 8px;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
}
.track-stream-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font: 800 10px/1.2 var(--font-mono);
  text-align: left;
  cursor: pointer;
}
.track-stream-row:hover {
  background: rgba(0,255,247,0.08);
}
.track-stream-row:disabled {
  cursor: default;
  opacity: 0.45;
}
.track-stream-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-stream-status {
  color: var(--text-dim);
}
.track-stream-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.track-fov-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(77, 119, 153, 0.18);
  border-radius: 8px;
  background: rgba(0,255,247,0.035);
}
.track-fov-section[hidden] { display: none; }
.track-fov-source {
  color: #58c7ff;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border: 1px solid rgba(88, 199, 255, 0.35);
  border-radius: 4px;
  white-space: nowrap;
  cursor: help;
}
.track-fov-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.track-fov-toggle input {
  accent-color: #58c7ff;
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn-search {
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.btn-search:hover, .btn-search:active { background: rgba(var(--accent-green-rgb),0.1); }
.btn-standby {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.btn-standby:hover, .btn-standby:active { background: rgba(var(--accent-amber-rgb),0.1); }
.btn-designate {
  border-color: var(--accent-red);
  color: var(--accent-red);
  width: 100%;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
}
.btn-designate:hover, .btn-designate:active { background: rgba(var(--accent-red-rgb),0.15); }
.btn-designate.active-state {
  background: rgba(var(--accent-red-rgb),0.18);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-red-rgb),0.32);
}
.btn-ignore {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  width: 100%;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
}
.btn-ignore:hover, .btn-ignore:active { background: rgba(var(--accent-amber-rgb),0.15); }
.btn-ownship {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  width: 100%;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  margin-top: 4px;
}
.btn-ownship:hover, .btn-ownship:active { background: rgba(var(--accent-blue-rgb),0.15); }
.btn-ownship.active-state {
  background: rgba(var(--accent-blue-rgb),0.18);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-blue-rgb),0.32);
}
.btn:disabled,
.toggle-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  min-height: 44px;
  min-width: 44px;
}
.overlay-toggle.btn-close,
.sop-toggle.btn-close {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(11, 14, 22, 0.38);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.overlay-toggle.btn-close:hover,
.overlay-toggle.btn-close:active,
.sop-toggle.btn-close:hover,
.sop-toggle.btn-close:active {
  border-color: rgba(94, 224, 255, 0.35);
  background: rgba(0,255,247,0.08);
}

/* --- Playback --- */
.header-playback-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.header-mode-pill,
.header-review-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
}
.header-mode-pill {
  color: #9fd7ff;
  background:
    radial-gradient(circle at 20% 30%, rgba(94, 224, 255, 0.16), transparent 48%),
    rgba(8, 18, 28, 0.82);
  border-color: rgba(94, 224, 255, 0.3);
}
.header-mode-pill.is-playback {
  color: #ffd07f;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 180, 68, 0.16), transparent 48%),
    rgba(24, 16, 8, 0.84);
  border-color: rgba(255, 180, 68, 0.3);
}
.header-review-indicator {
  color: var(--accent-cyan);
  background: rgba(0,255,247,0.12);
  border-color: transparent;
}
.header-review-indicator.aar {
  color: #ffd166;
  border-color: rgba(255,209,102,0.28);
  background: rgba(255,209,102,0.1);
}
.header-review-indicator.bda {
  color: #ff9a76;
  border-color: rgba(255,154,118,0.28);
  background: rgba(255,154,118,0.1);
}
.header-playback-btn {
  min-width: 96px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.header-playback-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 255, 247, 0.08);
}
.header-playback-btn.is-playback {
  color: #ffd07f;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 180, 68, 0.16), transparent 48%),
    rgba(24, 16, 8, 0.84);
  border-color: rgba(255, 180, 68, 0.45);
}
.playback-dock {
  position: absolute;
  left: 50%;
  width: min(860px, calc(100vw - 24px));
  transform: translateX(-50%);
  bottom: 10px;
  z-index: 1180;
  pointer-events: none;
}
.playback-dock-shell {
  position: relative;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(110, 208, 255, 0.2);
  background:
    radial-gradient(circle at top left, rgba(0,255,247,0.08), transparent 30%),
    radial-gradient(circle at top right, rgba(var(--accent-blue-rgb),0.12), transparent 28%),
    linear-gradient(180deg, rgba(7, 12, 20, 0.94), rgba(6, 10, 16, 0.92));
  box-shadow:
    0 18px 40px rgba(0,0,0,0.36),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  backdrop-filter: blur(18px);
}
.playback-primary-row,
.playback-primary-controls,
.playback-primary-actions,
.playback-drawer-actions,
.playback-timeline-side,
.playback-speed-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.playback-primary-row {
  flex-wrap: wrap;
}
.playback-primary-controls {
  flex: 1 1 auto;
  flex-wrap: wrap;
}
.playback-primary-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
.playback-dock-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 1 220px;
}
.playback-dock-kicker {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.18em;
  color: rgba(159, 215, 255, 0.78);
}
.playback-dock-title {
  font: 700 13px/1.1 var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playback-action-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(94, 224, 255, 0.24);
  background: rgba(8, 14, 24, 0.55);
  color: var(--accent-cyan);
}
.playback-more-btn {
  min-width: 72px;
}
.playback-dock-close {
  color: var(--accent-cyan);
}
.playback-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.playback-field-compact {
  min-width: 104px;
}
.playback-field-label {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: rgba(185, 191, 213, 0.68);
}
.playback-select {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(94, 119, 160, 0.34);
  background: rgba(10, 16, 25, 0.82);
  color: var(--text-primary);
  font: 10px var(--font-mono);
}
.playback-select:focus {
  outline: none;
  border-color: rgba(94, 224, 255, 0.42);
}
.playback-drawer {
  position: absolute;
  right: 14px;
  bottom: calc(100% + 10px);
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(110, 208, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(0,255,247,0.08), transparent 30%),
    linear-gradient(180deg, rgba(8, 14, 24, 0.96), rgba(6, 10, 16, 0.94));
  box-shadow:
    0 18px 36px rgba(0,0,0,0.34),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  backdrop-filter: blur(18px);
  z-index: 2;
}
.playback-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.playback-drawer-title,
.playback-drawer-sources-label {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: rgba(159, 215, 255, 0.76);
}
.playback-drawer-sources-label {
  margin-top: 2px;
}
.playback-drawer-actions {
  flex-wrap: wrap;
}
.playback-source-list {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  max-height: 112px;
  overflow-y: auto;
  padding-right: 4px;
}
.playback-source-empty {
  font: 10px/1.4 var(--font-mono);
  color: rgba(185, 191, 213, 0.72);
}
.playback-source-card {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 16, 25, 0.76);
  color: var(--text-primary);
  cursor: pointer;
}
.playback-source-card:hover {
  border-color: rgba(94, 224, 255, 0.26);
}
.playback-source-card.active {
  border-color: rgba(94, 224, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(94, 224, 255, 0.12);
}
.playback-source-card.saved {
  border-color: rgba(var(--accent-blue-rgb),0.24);
}
.playback-source-card.imported {
  border-color: rgba(255,209,102,0.24);
}
.playback-source-card-kind {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: rgba(159, 215, 255, 0.76);
}
.playback-source-card.imported .playback-source-card-kind {
  color: #ffd166;
}
.playback-source-card.saved .playback-source-card-kind {
  color: #8fb7ff;
}
.playback-source-card-title {
  width: 100%;
  font: 700 10px/1.25 var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playback-source-card-meta {
  font: 10px/1.35 var(--font-mono);
  color: rgba(185, 191, 213, 0.72);
}
.playback-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.playback-timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.playback-timeline-label,
.playback-timeline-time,
.playback-status-copy {
  font: 10px/1.35 var(--font-mono);
}
.playback-timeline-label {
  flex: 1 1 auto;
  color: rgba(185, 191, 213, 0.76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playback-timeline-time,
.playback-status-copy {
  color: var(--text-primary);
}
.playback-timeline-side {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.playback-scrubber-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 24px;
}
.playback-load-progress {
  position: absolute;
  inset: 7px 0;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(94, 224, 255, 0.12);
  background: rgba(8, 14, 24, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.playback-load-progress-bar {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(94, 224, 255, 0.12), rgba(94, 224, 255, 0.82), rgba(var(--accent-blue-rgb),0.38));
  box-shadow: 0 0 18px rgba(94, 224, 255, 0.28);
  animation: playback-load-sweep 1.05s ease-in-out infinite;
}
.playback-scrubber-wrap.loading .playback-marker-layer,
.playback-scrubber-wrap.loading .playback-scrubber {
  opacity: 0;
  pointer-events: none;
}
@keyframes playback-load-sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(265%);
  }
}
.playback-marker-layer {
  position: absolute;
  inset: 0 12px;
  pointer-events: none;
}
.playback-marker {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(94, 224, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(8, 14, 24, 0.4);
}
.playback-marker.bda {
  background: #ff9a76;
}
.playback-marker-range {
  position: absolute;
  top: 9px;
  height: 8px;
  border-radius: 999px;
  background: rgba(94, 224, 255, 0.18);
}
.playback-marker-range.bda {
  background: rgba(255,154,118,0.18);
}
.playback-marker-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: inherit;
}
.playback-scrubber {
  width: 100%;
  height: 10px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, rgba(94, 224, 255, 0.22), rgba(var(--accent-blue-rgb),0.4));
  outline: none;
}
.playback-scrubber::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 224, 255, 0.22), rgba(var(--accent-blue-rgb),0.4));
}
.playback-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -2px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: #f5f8ff;
  box-shadow: 0 0 0 3px rgba(6,10,16,0.32);
}
.playback-scrubber::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 224, 255, 0.22), rgba(var(--accent-blue-rgb),0.4));
}
.playback-scrubber::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: #f5f8ff;
  box-shadow: 0 0 0 3px rgba(6,10,16,0.32);
}
.playback-control-btn,
.playback-speed-btn,
.playback-review-btn {
  min-height: 34px;
  border-radius: 999px;
}
.playback-control-btn {
  min-width: 82px;
}
.playback-live-btn {
  border-color: rgba(var(--accent-green-rgb),0.4);
  color: var(--accent-green);
}
.playback-live-btn:hover,
.playback-live-btn:active {
  background: rgba(var(--accent-green-rgb),0.1);
}
.playback-speed-btn {
  min-width: 48px;
  padding: 0 10px;
}
.playback-review-btn {
  min-width: 132px;
  padding: 0 12px;
}
.playback-delete-btn {
  color: var(--accent-red);
  border-color: rgba(255, 68, 68, 0.3);
}
body.playback-active .btn-designate,
body.playback-active .btn-ownship,
body.playback-active .radar-card .btn {
  opacity: 0.45;
}

/* --- milsymbol icons --- */
.milsym-icon { overflow: visible !important; }
.milsym-icon img { overflow: visible !important; }

/* --- Leaflet overrides --- */
.leaflet-container {
  background: #020812 !important;
}
.leaflet-top.leaflet-left {
  left: calc(var(--left-workspace-edge) + 12px);
  top: 76px;
  transition: left var(--shell-anim);
}
.leaflet-bottom.leaflet-left {
  left: calc(var(--left-workspace-edge) + 12px);
  transition: left var(--shell-anim);
}
.map-drawer-control {
  position: relative;
  margin-top: 0;
  margin-left: 0;
  width: 56px;
  min-height: 56px;
}
.map-layer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  box-shadow: none;
}
.map-drawer-panel {
  top: 0;
  right: 66px;
  left: auto;
  width: min(320px, calc(100vw - 88px));
  max-height: 52vh;
}
.map-drawer-panel.collapsed {
  display: none;
}
.map-drawer-body {
  padding: 12px 0;
}
.map-drawer-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: 11px/1.2 var(--font-mono);
  text-align: left;
  cursor: pointer;
}
.map-drawer-option:hover,
.map-drawer-option:active {
  background: rgba(0,255,247,0.08);
}
.map-drawer-mark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(224,224,232,0.88);
  background: rgba(255,255,255,0.03);
  flex: 0 0 auto;
}
.map-drawer-mark.radio {
  border-radius: 50%;
}
.map-drawer-mark.checkbox {
  border-radius: 4px;
}
.map-drawer-mark.active {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: inset 0 0 0 3px var(--bg-panel);
}
.map-drawer-separator {
  margin: 8px 0;
  border-top: 1px solid var(--border);
}
.map-drawer-label {
  display: block;
  min-width: 0;
}
/* Nested option: indented under its parent layer so it reads as a property of it. */
.map-drawer-child {
  padding: 7px 16px 7px 46px;
}
.map-drawer-child .map-drawer-mark {
  width: 14px;
  height: 14px;
}
.map-drawer-child .map-drawer-mark.active {
  box-shadow: inset 0 0 0 2px var(--bg-panel);
}
.map-drawer-option[disabled] {
  opacity: 0.4;
  cursor: default;
}
.map-drawer-option[disabled]:hover {
  background: transparent;
}
#map3d .maplibregl-control-container {
  z-index: 6;
}
#map3d .maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin-top: 10px;
  margin-right: 10px;
}
#map3d .maplibregl-ctrl-group,
#map3d .maplibregl-ctrl.maplibregl-ctrl-scale {
  border: 1px solid rgba(94, 224, 255, 0.24);
  background: rgba(8, 12, 20, 0.84);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}
#map3d .maplibregl-ctrl-group button {
  background-color: transparent;
}
#map3d .maplibregl-ctrl-group button + button {
  border-top-color: rgba(255, 255, 255, 0.08);
}
#map3d .maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: invert(1) hue-rotate(145deg) saturate(0.3) brightness(1.35);
}
#map3d .maplibregl-ctrl-scale {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
}
#map3d .terrain-marker {
  display: block;
  overflow: visible;
  will-change: transform;
  pointer-events: none;
}
#map3d .terrain-marker.interactive {
  cursor: pointer;
  pointer-events: auto;
}
#map3d .terrain-marker .clean-label {
  text-shadow: none;
}
#map3d .terrain-overlay-pane {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
#map3d .terrain-vector-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
#map3d .terrain-overlay-object {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
#map3d .terrain-air-trail {
  pointer-events: none;
}
#map3d .terrain-air-trail-shadow,
#map3d .terrain-air-trail-body,
#map3d .terrain-air-trail-highlight {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
#map3d .terrain-overlay-object > .terrain-marker.interactive {
  pointer-events: auto;
}
#map3d .terrain-altitude-stem {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  border-radius: 999px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(148, 218, 255, 0.92), rgba(148, 218, 255, 0.18));
  box-shadow: 0 0 8px rgba(148, 218, 255, 0.24);
  pointer-events: none;
}
#map3d .terrain-kml-point {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(5, 8, 13, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 14px rgba(0, 255, 247, 0.28);
}
#map3d .terrain-kml-label {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(94, 224, 255, 0.34);
  background: rgba(5, 8, 13, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  color: #f5f8ff;
  font: 700 10px/24px var(--font-mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.leaflet-control-zoom a {
  background: var(--bg-panel) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
.leaflet-control-scale-line {
  background: var(--bg-panel) !important;
  color: var(--text-primary) !important;
  border-color: var(--text-dim) !important;
}
.leaflet-control-attribution {
  background: rgba(10,10,15,0.7) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

/* --- Toast alerts --- */
.alert-stack {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.alert-toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--panel-shadow);
  font-size: 11px;
  pointer-events: auto;
  animation: fadeIn 0.2s ease;
  max-width: 300px;
}
.alert-toast .icon { flex: 0 0 auto; margin-top: 1px; }
/* Status tint layered over the opaque panel so text stays legible over imagery. */
.alert-toast.info { background: linear-gradient(rgba(0,255,247,0.12), rgba(0,255,247,0.12)), var(--bg-panel); border-left-color: var(--accent-cyan); color: var(--accent-cyan); }
.alert-toast.success { background: linear-gradient(rgba(var(--accent-green-rgb),0.12), rgba(var(--accent-green-rgb),0.12)), var(--bg-panel); border-left-color: var(--accent-green); color: var(--accent-green); }
.alert-toast.warning { background: linear-gradient(rgba(var(--accent-amber-rgb),0.12), rgba(var(--accent-amber-rgb),0.12)), var(--bg-panel); border-left-color: var(--accent-amber); color: var(--accent-amber); }
.alert-toast.critical,
.alert-toast.error { background: linear-gradient(rgba(var(--accent-red-rgb),0.16), rgba(var(--accent-red-rgb),0.16)), var(--bg-panel); border-left-color: var(--accent-red); color: var(--accent-red); }

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

/* --- Context menu popup --- */
.ctx-popup .leaflet-popup-content-wrapper {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0;
}
.ctx-popup .leaflet-popup-tip { background: var(--bg-panel); border: 1px solid var(--border); }
.ctx-popup .leaflet-popup-content { margin: 0; }
.ctx-menu { display: flex; flex-direction: column; min-width: 160px; }
.ctx-title {
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.ctx-subtitle {
  padding: 6px 12px;
  font-size: 10px;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--border);
}
.ctx-btn {
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}
.ctx-btn:last-child { border-bottom: none; }
.ctx-btn:hover, .ctx-btn:active { background: rgba(0,255,247,0.08); color: var(--accent-cyan); }
.ctx-btn:disabled {
  color: var(--text-dim);
  cursor: default;
  background: transparent;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header {
    gap: 10px;
    padding: 6px 10px;
    flex-wrap: wrap;
  }
  .header-tools {
    display: none;
  }
  .header-context {
    order: 3;
    flex: 1 1 100%;
    min-height: 36px;
    padding: 0;
  }
  .header-view-toggle {
    position: static;
  }
  .header-context-select {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }
  .header-playback-controls {
    order: 4;
  }
  .header-time {
    margin-left: 0;
  }
  .overlay-dock {
    top: 168px;
    right: 8px;
    left: auto;
  }
  .overlay-rail {
    width: 48px;
  }
  .overlay-rail-btn {
    width: 48px;
    min-height: 42px;
    font-size: 0;
  }
  .overlay-panel {
    right: 58px;
    left: auto;
    width: min(300px, calc(100vw - 74px));
    max-height: 40vh;
  }
  :root {
    --rail-width: 72px;
  }
  .side-nav {
    --rail-pad: 8px;

    padding-top: 8px;
    padding-bottom: 14px;
  }
  .side-nav-btn {
    min-height: 56px;
    font-size: 10px;
    gap: 6px;
  }
  .side-nav-icon {
    font-size: 15px;
  }
  .map-search {
    display: none;
  }
  .map-drawer-control {
    margin-top: 0;
    margin-left: 0;
    width: 48px;
    min-height: 42px;
  }
  .map-drawer-panel {
    right: 58px;
    left: auto;
    width: min(300px, calc(100vw - 74px));
    max-height: 40vh;
  }
  .overlay-upload-btn {
    min-width: 0;
    padding: 0 12px;
    font-size: 10px;
  }
  .sop-panel {
    top: 8px;
    right: 8px;
    max-width: calc(100vw - 16px);
  }
  .track-panel { width: 100%; right: 0; top: auto; bottom: 40px; border-radius: var(--radius) var(--radius) 0 0; }
  .track-panel.visible { transform: translateY(0); }
  .left-panel {
    left: var(--rail-width);
    top: 8px;
    bottom: 48px;
    width: min(320px, calc(100vw - 80px));
  }
  .as3-panel { width: min(220px, calc(100vw - 16px)); bottom: 44px; }
  .display-toolbar {
    min-width: 0;
  }
  .display-toolbar-body { gap: 4px; }
  .display-toolbar .toggle-btn {
    min-height: 32px;
    padding: 0 9px;
    font-size: 10px;
  }
  .coord-bar {
    padding-left: 8px;
    padding-right: 8px;
  }
  .leaflet-top.leaflet-left {
    left: calc(var(--left-workspace-edge) + 12px);
    top: 8px;
  }
  .playback-dock {
    left: 8px;
    width: calc(100vw - 16px);
    transform: none;
    bottom: 8px;
  }
  .playback-dock-shell {
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }
  .playback-primary-row,
  .playback-primary-controls,
  .playback-primary-actions,
  .playback-speed-group,
  .playback-timeline-meta,
  .playback-timeline-side,
  .playback-drawer-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .playback-field {
    min-width: 0;
  }
  .playback-primary-actions {
    margin-left: 0;
  }
  .playback-drawer {
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    width: auto;
  }
  .playback-source-list {
    width: 100%;
    max-height: 144px;
  }
  .playback-source-card {
    max-width: none;
    width: 100%;
  }
  .playback-control-btn,
  .playback-speed-btn,
  .playback-review-btn,
  .playback-action-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 1600px) {
  .header-tools {
    display: none;
  }
}

@media (max-width: 1180px) {
  .header {
    gap: 12px;
  }
  .header-tools {
    display: none;
  }
  .map-search-flyout {
    width: min(360px, calc(100vw - 140px));
  }
  .overlay-panel {
    width: min(292px, calc(100vw - 96px));
  }
  .sop-panel {
    right: 18px;
    width: 236px;
  }
  .track-panel {
    width: min(260px, calc(100vw - 20px));
  }
  .as3-panel {
    display: none;
  }
  .playback-dock {
    width: min(840px, calc(100vw - 24px));
  }
  .playback-primary-row {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .track-panel.detection-mode {
    width: 100%;
  }
}

.overlay-shared-pill {
  display: inline-block;
  background: #1f4d3a;
  color: #7ee0a4;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 1px;
  text-transform: uppercase;
}

.overlay-unsynced-caption {
  color: #d97706;
  font-size: 10px;
  margin-left: 4px;
}

.overlay-drawing-share[data-state="synced"] {
  background: #2a313b;
  color: #7d8895;
  border: 1px solid #2a313b;
  cursor: not-allowed;
}

.overlay-drawing-share[data-state="update"]::after {
  content: none;
}

.overlay-peer-pill {
  display: inline-block;
  background: #1f2c3a;
  color: #7da6e0;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 1px;
  font-family: ui-monospace, monospace;
}

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: #1a1f27;
  color: #e6ecf2;
  border: 1px solid #2a313b;
  border-radius: 6px;
  padding: 18px;
  width: min(520px, calc(100vw - 32px));
  font-family: system-ui, sans-serif;
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.confirm-dialog h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
}

.confirm-dialog p {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: #a0aab5;
}

.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.confirm-dialog-cancel {
  background: #2a313b;
  color: #d8e0e8;
  border: 1px solid #3a4250;
  padding: 6px 14px;
  cursor: pointer;
}

.confirm-dialog-confirm {
  background: #d97706;
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
}

.overlay-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 4px;
  font: 11px var(--font-mono);
  box-shadow: var(--panel-shadow);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}

.overlay-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.overlay-toast-error {
  border-left-color: var(--accent-red);
  color: var(--accent-red);
}

.overlay-toast-success {
  border-left-color: var(--accent-green);
  color: var(--accent-green);
}


.detections-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Detects triage runs edge-tight: the rail's 14px body inset wastes row width. */
.left-panel .panel-body.detections-view {
  padding-left: 6px;
  padding-right: 6px;
}


.detection-row-main:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

.detection-activity-shell {
  flex: 1;
  min-height: 0;
  position: relative;
}

.detection-activity-list {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detection-jump-latest {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.detection-jump-latest:hover,
.detection-jump-latest:hover,
.detection-jump-latest:focus-visible {
  filter: brightness(1.1);
}

.detection-jump-latest:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Webkit-only thin scrollbar: `scrollbar-width: thin` would override this
   with an ~11px track and re-widen the right inset. */
.detection-activity-list::-webkit-scrollbar {
  width: 6px;
}

.detection-activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.detection-activity-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

.detection-list-spacer {
  width: 1px;
  pointer-events: none;
}

.detection-window {
  display: flex;
  flex-direction: column;
}

.detection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--detection-row-height) - 4px);
  min-height: calc(var(--detection-row-height) - 4px);
  margin-bottom: 4px;
  padding: 7px 6px;
  touch-action: manipulation;
}

.detection-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  align-self: stretch;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.detection-row-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  flex: 0 0 64px;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 4px;
  background: rgba(2, 8, 18, 0.6);
}

/* Placeholder reticle behind the frame for detects without imagery. */
.detection-row-thumb::before {
  content: '⌖';
  color: var(--text-dim);
  font: 400 24px/1 var(--font-mono);
  opacity: 0.55;
}

.detection-row-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detection-row-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.detection-row .track-list-head {
  justify-content: flex-start;
  min-width: 0;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}


.detection-row .track-list-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detection-row-conf {
  color: var(--accent-cyan);
  font-size: 12px;
  flex: none;
}

.detection-row-conf.low {
  color: var(--text-dim);
}

.detection-row .track-list-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.detection-row-obs {
  color: var(--text-primary);
  font-weight: 900;
}

.detection-row .track-list-head,
.detection-row .track-list-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detection-row-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 3px;
}

.detection-row-confirm,
.detection-row-deny {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.detection-row-confirm svg,
.detection-row-deny svg {
  width: 16px;
  height: 16px;
}

.detection-row-confirm {
  border-color: color-mix(in srgb, var(--accent-red) 40%, transparent);
  color: var(--accent-red);
}

.detection-row-confirm:disabled {
  cursor: default;
  opacity: 0.38;
}

.detection-row-deny {
  border-color: color-mix(in srgb, var(--accent-amber) 40%, transparent);
  color: var(--accent-amber);
}

.detection-row-confirm:hover,
.detection-row-confirm:focus-visible {
  border-color: var(--accent-red);
  background: color-mix(in srgb, var(--accent-red) 12%, transparent);
}

.detection-row-deny:hover,
.detection-row-deny:focus-visible {
  border-color: var(--accent-amber);
  background: color-mix(in srgb, var(--accent-amber) 10%, transparent);
}

.detection-row-confirm:focus-visible,
.detection-row-deny:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 1px;
}

.detection-status {
  flex: none;
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
}

/* Position reads like the rest of the metadata; only hostile marks carry color. */
.detection-status-no-location {
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0;
}

.detection-row-pos {
  font-size: 12px;
  font-weight: 700;
}

.detection-status-hostile {
  color: var(--accent-red);
}

/* Sensor alert: at the sensor, not the target; listed but never on the map. */
.detection-status-alert {
  color: var(--accent-amber);
}

.detection-row.hostile {
  box-shadow: inset 3px 0 0 var(--accent-red);
  background: linear-gradient(90deg, rgba(255, 59, 59, 0.12), rgba(255, 59, 59, 0.02) 58%, transparent);
}
.detection-row.hostile .track-list-head span:first-child {
  color: var(--accent-red);
}

.detection-rail-status {
  flex: none;
  padding: var(--space-1) var(--space-2);
  color: var(--text-dim);
  font: 900 10px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.detection-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) 0 var(--space-2);
  color: var(--text-dim);
  font: 800 10px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
}

.detection-area-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--accent-cyan);
}

.detection-area-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(77, 119, 153, 0.35);
  border-radius: 4px;
  background: rgba(18, 18, 26, 0.58);
  color: var(--text-dim);
  font: 900 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.detection-area-back:hover,
.detection-area-back:focus-visible {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.detection-type-group {
  margin-bottom: var(--space-2);
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 6px;
  background: rgba(2, 8, 18, 0.48);
  overflow: hidden;
}

.detection-type-group.selected {
  background: rgba(0, 255, 247, 0.08);
}

.detection-type-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: 900 11px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
}

.detection-type-group-head:hover,
.detection-type-group-head:focus-visible {
  background: rgba(0, 255, 247, 0.06);
}

.detection-type-group-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.detection-type-group-meta strong {
  color: var(--accent-amber);
}

.detection-type-group-chevron {
  color: var(--text-dim);
  transition: transform var(--shell-anim);
}

.detection-type-group.expanded .detection-type-group-chevron {
  transform: rotate(180deg);
}

.detection-type-group-body {
  padding: 0 var(--space-1) var(--space-1);
  border-top: 1px solid rgba(77, 119, 153, 0.2);
}

.detection-type-group-body .detection-row {
  margin-top: 4px;
  margin-bottom: 0;
}

@media (pointer: coarse) {
  :root {
    --detection-row-height: 96px;
  }

  .detection-row {
    padding-block: 0;
  }

  .detection-row-confirm,
  .detection-row-deny {
    width: 44px;
    height: 44px;
  }

  .detection-area-back {
    min-height: 44px;
  }

  .detection-type-group-head {
    min-height: 44px;
  }
}


.track-panel #detectionDetailActions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
  flex: none;
}

.track-panel #detectionDetailActions[hidden] {
  display: none;
}

.track-panel #detectionDetailActions .btn {
  min-height: 44px;
}

.track-panel #assetDetailActions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
  flex: none;
}

.track-panel #assetDetailActions[hidden] {
  display: none;
}

.track-panel #assetDetailActions .btn {
  min-height: 44px;
}

/* --- Local system health --- */

.health-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(77, 119, 153, 0.28);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.health-button:hover,
.health-button[aria-expanded="true"] {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.1);
}

.health-button.unknown {
  color: var(--text-dim);
}

.health-button.ok {
  color: var(--accent-green);
}

.health-button.warn {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.42);
}

.health-button.crit {
  color: var(--accent-red);
  border-color: rgba(var(--accent-red-rgb), 0.55);
  background: color-mix(in srgb, var(--accent-red) 8%, var(--bg-secondary));
}

/* The dot shows WebSocket connectivity only: green when connected, red when down. */
.health-button-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.health-button-value {
  max-width: 92px;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-button-label {
  color: var(--text-dim);
}

.health-button .health-button-mesh {
  max-width: none;
  color: var(--text-dim);
  font-weight: 600;
}

.health-button.ws-down .health-button-dot {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.health-button-segment::before {
  content: "·";
  margin-right: 7px;
  color: var(--text-dim);
}

.health-button-segment.ok {
  color: var(--text-primary);
}

.health-button-segment.warn {
  color: var(--accent-amber);
}

.health-button-segment.crit {
  color: var(--accent-red);
}

.health-panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 20px));
  max-height: min(720px, calc(100vh - 100px));
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 96%, transparent), var(--bg-secondary));
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
}

.health-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 32px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  transform: rotate(45deg);
}

.health-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-uptime {
  flex: 0 0 auto;
  color: var(--text-dim);
  font: 600 10px/1 var(--font-mono);
  white-space: nowrap;
}

/* --- External systems status --- */

.sys-panel {
  left: 0;
  right: auto;
}

/* Sections with only a head row (NOT DETECTED / NO UNITS) stay compact. */
.sys-section .health-section-head:only-child {
  margin-bottom: 0;
}

.sys-panel::before {
  left: 32px;
  right: auto;
}

.sys-panel-title {
  flex: 1;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.sys-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentcolor;
  box-shadow: 0 0 8px currentcolor;
}

.sys-dot.ok {
  color: var(--accent-green);
}

.sys-dot.warn {
  color: var(--accent-amber);
}

.sys-dot.crit {
  color: var(--accent-red);
}

.sys-dot.off {
  color: color-mix(in srgb, var(--text-dim) 55%, transparent);
  box-shadow: none;
}

.sys-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font: 800 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
}

.sys-sub {
  flex: 0 0 auto;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.health-section-badge.sys-badge-off {
  color: var(--text-dim);
}

.sys-readout-note {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--text-dim);
  font: 700 10px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}

.sys-unit-list {
  display: grid;
  gap: 6px;
}

.sys-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font: 600 10px/1.3 var(--font-mono);
}

.sys-unit-name {
  font-weight: 800;
}

.sys-unit-meta {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sys-unit-mode.ok {
  color: var(--accent-green);
}

.sys-unit-mode.warn {
  color: var(--accent-amber);
}

.health-chip.warn {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.35);
}

.health-chip.crit {
  color: var(--accent-red);
  border-color: rgba(var(--accent-red-rgb), 0.4);
}

.status-tab-list {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
}

.status-tab {
  min-height: 29px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  cursor: pointer;
}

.status-tab:hover {
  color: var(--text-primary);
}

.status-tab.active {
  background: rgba(0, 255, 247, 0.12);
  color: var(--accent-cyan);
}

.status-tab:focus-visible {
  outline: 1px solid var(--accent-cyan);
  outline-offset: 2px;
}

.health-no-data {
  padding: 30px 10px;
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-align: center;
}

.health-section {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg-primary) 55%, transparent);
}

.health-section-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.health-section-badge,
.health-stale {
  margin-left: auto;
  padding: 3px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.health-stale {
  margin-left: 0;
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.35);
}

.health-section-badge.ok {
  color: var(--accent-green);
  border-color: rgba(var(--accent-green-rgb), 0.3);
}

.health-section-badge.warn {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.35);
}

.health-section-badge.crit {
  color: var(--accent-red);
  border-color: rgba(var(--accent-red-rgb), 0.4);
}

.health-readout-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.health-primary {
  color: var(--text-primary);
  font: 800 19px/1.2 var(--font-mono);
  letter-spacing: -0.03em;
}

.health-primary.warn {
  color: var(--accent-amber);
}

.health-primary.crit {
  color: var(--accent-red);
}

.health-thresholds {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--text-dim);
  font: 700 10px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}

.health-threshold.warn span {
  color: var(--accent-amber);
}

.health-threshold.crit span {
  color: var(--accent-red);
}

.health-charge {
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: right;
}

.health-charge.charging {
  color: var(--accent-green);
}

.health-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.health-chip-row:empty {
  display: none;
}

.health-chip {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
}

.wan-active {
  display: grid;
  gap: 2px;
}

.wan-active-name {
  color: var(--accent-cyan);
  font: 800 15px/1.2 var(--font-mono);
  letter-spacing: -0.01em;
}

.wan-active-throughput {
  color: var(--text-dim);
  font: 600 10px/1.4 var(--font-mono);
}

.wan-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.wan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 10px/1.4 var(--font-mono);
}

.wan-led {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.wan-led.green { background: var(--accent-green); }
.wan-led.yellow,
.wan-led.flash { background: var(--accent-amber); }
.wan-led.red { background: var(--accent-red); }
.wan-led.gray { background: color-mix(in srgb, var(--text-dim) 60%, transparent); }

.wan-name {
  min-width: 60px;
  color: var(--text-primary);
  font-weight: 700;
}

.wan-ip {
  flex: 1;
  color: var(--text-dim);
}

.wan-signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.wan-signal-bar {
  width: 3px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--accent-cyan) 20%, transparent);
}

.wan-signal-bar:nth-child(1) { height: 4px; }
.wan-signal-bar:nth-child(2) { height: 6px; }
.wan-signal-bar:nth-child(3) { height: 8px; }
.wan-signal-bar:nth-child(4) { height: 10px; }
.wan-signal-bar:nth-child(5) { height: 12px; }

.wan-signal-bar.active {
  background: var(--accent-cyan);
}

.starlink-metrics {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font: 600 10px/1.4 var(--font-mono);
}

.starlink-label {
  color: var(--text-dim);
}

.starlink-value {
  color: var(--text-primary);
  font-weight: 700;
}

.health-meta {
  margin-top: 4px;
  color: var(--text-dim);
  font: 600 10px/1.4 var(--font-mono);
}

.health-detail-list {
  margin-top: 7px;
  color: var(--text-dim);
  font: 500 10px/1.55 var(--font-mono);
  white-space: pre-line;
}

.mesh-meta:empty {
  display: none;
}

.mesh-body {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.mesh-empty {
  padding: 22px 8px;
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-align: center;
}

.mesh-peer {
  padding: 9px;
  border: 1px solid rgba(77, 119, 153, 0.22);
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg-secondary) 75%, transparent);
}

.mesh-peer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mesh-peer-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font: 700 11px/1.2 var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mesh-peer-state {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 800 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-align: center;
}

.mesh-peer-state.up {
  color: var(--accent-green);
  border-color: rgba(var(--accent-green-rgb), 0.3);
}

.mesh-peer-state.partial {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.35);
}

.mesh-peer-state.down {
  color: var(--accent-red);
  border-color: rgba(var(--accent-red-rgb), 0.4);
}

.mesh-peer-detail,
.mesh-peer-metrics {
  margin-top: 5px;
  color: var(--text-dim);
  font: 500 10px/1.45 var(--font-mono);
}

.health-sparkline-wrap {
  position: relative;
  margin-top: 9px;
  height: 48px;
  border-top: 1px solid rgba(77, 119, 153, 0.16);
  background:
    linear-gradient(rgba(77, 119, 153, 0.07) 1px, transparent 1px);
  background-size: 100% 16px;
}

.health-sparkline {
  width: 100%;
  height: 48px;
  overflow: visible;
}

.health-sparkline-path {
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.health-sparkline-path.primary {
  stroke: var(--accent-cyan);
}

.health-sparkline-path.secondary {
  stroke: var(--accent-amber);
  opacity: 0.78;
}

.health-sparkline-path.power {
  stroke: var(--accent-green);
}

.health-sparkline-area {
  stroke: none;
}

.health-sparkline-dot.primary {
  fill: var(--accent-cyan);
}

.health-sparkline-dot.secondary {
  fill: var(--accent-amber);
}

.health-sparkline-dot.power {
  fill: var(--accent-green);
}

.health-sparkline-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.health-grad-start.primary { stop-color: var(--accent-cyan); stop-opacity: 0.28; }
.health-grad-end.primary { stop-color: var(--accent-cyan); stop-opacity: 0; }
.health-grad-start.secondary { stop-color: var(--accent-amber); stop-opacity: 0.16; }
.health-grad-end.secondary { stop-color: var(--accent-amber); stop-opacity: 0; }
.health-grad-start.power { stop-color: var(--accent-green); stop-opacity: 0.24; }
.health-grad-end.power { stop-color: var(--accent-green); stop-opacity: 0; }

.health-sparkline-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: 700 10px/1 var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
}

body.playback-active .health-panel {
  border-color: rgba(var(--accent-amber-rgb), 0.28);
}

@media (max-width: 1100px) {
  .health-button .health-button-mesh {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-system-status {
    margin-left: auto;
  }

  .health-button-value {
    max-width: 64px;
  }


  .health-panel {
    position: fixed;
    top: 72px;
    right: 10px;
    left: auto;
    width: min(340px, calc(100vw - 20px));
    max-height: calc(100vh - 92px);
  }

  .health-panel.sys-panel {
    right: auto;
    left: 10px;
  }

  .health-panel::before {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
 * RF heatmap layer
 * ------------------------------------------------------------------------- */
.leaflet-heatmapPane-pane {
  pointer-events: none;
}
.heatmap-image {
  /* Grids are coarse (≤96 cells); let the browser smooth them into a field. */
  image-rendering: auto;
  filter: saturate(1.05);
}
/* Angular uncertainty wedges duplicate what the heatmap shows; hide them while
 * the layer paints (the LOB lines themselves stay visible). */
body.heatmap-visible .lob-uncertainty {
  display: none;
}

.map-drawer-row {
  display: flex;
  align-items: stretch;
}
.map-drawer-row .map-drawer-option {
  flex: 1 1 auto;
  min-width: 0;
}
.map-drawer-gear {
  flex: 0 0 auto;
  width: 40px;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-drawer-gear svg {
  width: 16px;
  height: 16px;
}
.map-drawer-gear:hover,
.map-drawer-gear:focus-visible {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.08);
}

.heatmap-flyout {
  top: 0;
  right: 66px;
  left: auto;
  width: min(320px, calc(100vw - 88px));
  max-height: 70vh;
  font: 11px/1.3 var(--font-mono);
}
.heatmap-flyout.collapsed {
  display: none;
}
.heatmap-flyout .panel-header {
  letter-spacing: 0.08em;
}
.heatmap-flyout-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.heatmap-flyout-close:hover {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.08);
}
.heatmap-flyout-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px 14px;
}
.heatmap-enable {
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.heatmap-enable.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.12);
}
.heatmap-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.heatmap-field-label {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.heatmap-segment {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.heatmap-segment-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.heatmap-segment-btn:last-child {
  border-right: 0;
}
.heatmap-segment-btn:hover {
  color: var(--text-primary);
}
.heatmap-segment-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.12);
}

/* ---- ASSETS rail section ------------------------------------------------ */
/* The slot renders promoted kind tabs + ASSETS as direct rail children. */
.asset-rail-slot {
  display: contents;
}
.asset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.asset-chip {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(11, 17, 27, 0.54);
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  padding: 6px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.asset-chip b {
  font-weight: 900;
  color: var(--text-primary);
}
.asset-chip:hover {
  color: var(--text-primary);
}
.asset-chip.active {
  color: var(--accent-cyan);
  border-color: rgba(0, 255, 247, 0.45);
  background: rgba(0, 255, 247, 0.12);
}
.asset-chip.active b {
  color: var(--accent-cyan);
}
.asset-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.asset-group:last-child {
  margin-bottom: 0;
}
.asset-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(77, 119, 153, 0.22);
  color: var(--text-dim);
  font: 900 10px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
}
.asset-group-count {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.asset-card {
  border: 1px solid rgba(77, 119, 153, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(11, 17, 27, 0.7), rgba(11, 17, 27, 0.48));
  overflow: hidden;
}
.asset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}
.asset-glyph {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--accent-cyan);
  display: inline-flex;
}
.asset-glyph svg {
  width: 100%;
  height: 100%;
}
.asset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.asset-meta {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.asset-status {
  font-weight: 900;
}
.asset-status-ok {
  color: var(--accent-green);
}
.asset-status-warn {
  color: var(--accent-amber);
}
.asset-status-bad {
  color: var(--accent-red);
}
.asset-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.asset-fold {
  border: 1px dashed rgba(77, 119, 153, 0.3);
  border-radius: 8px;
  padding: 0 10px;
}
.asset-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 0;
  color: var(--text-dim);
  font: 900 10px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.asset-fold > summary::-webkit-details-marker {
  display: none;
}
.asset-fold > summary::after {
  content: '+';
  font-size: 13px;
  color: var(--text-primary);
}
.asset-fold[open] > summary::after {
  content: '\2013';
}
.asset-fold > summary b {
  color: var(--text-primary);
  font-weight: 900;
}
.asset-fold[open] > summary {
  border-bottom: 1px solid rgba(77, 119, 153, 0.22);
  margin-bottom: 10px;
}
.asset-fold .asset-group:last-child {
  margin-bottom: 10px;
}

/* Kind-named detail (RADAR DETAIL, CAMERA DETAIL, ... ASSET DETAIL). */
.track-panel.asset-mode {
  width: 320px;
}
.asset-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.asset-detail[hidden] {
  display: none;
}
.asset-detail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.asset-detail-heading {
  margin: 0 0 4px;
  color: var(--text-dim);
  font: 900 10px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(77, 119, 153, 0.22);
  padding-bottom: 4px;
}

/* SETTINGS > ASSET RAIL editor. */
.settings-section {
  margin-bottom: 18px;
}
.settings-help {
  margin: 0 0 10px;
  color: var(--text-dim);
  font: 700 10px/1.5 var(--font-mono);
}
.asset-layout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.asset-layout-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(77, 119, 153, 0.16);
  border-radius: 8px;
  background: rgba(11, 17, 27, 0.54);
  padding: 7px 8px;
}
.asset-layout-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}
.asset-layout-order .radar-rail-btn {
  width: 22px;
  height: 20px;
}
.asset-layout-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--text-dim);
  display: inline-flex;
}
.asset-layout-icon svg {
  width: 100%;
  height: 100%;
}
.asset-layout-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.asset-layout-name {
  color: var(--text-primary);
  font: 900 10px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
}
.asset-layout-meta {
  color: var(--text-dim);
  font: 700 10px/1.3 var(--font-mono);
}
.asset-layout-segment {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex: 0 0 auto;
}
.asset-layout-segment-btn {
  min-width: 0;
  padding: 7px 7px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.asset-layout-segment-btn:last-child {
  border-right: 0;
}
.asset-layout-segment-btn:hover:not(:disabled) {
  color: var(--text-primary);
}
.asset-layout-segment-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.12);
}
.asset-layout-segment-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.asset-layout-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.asset-layout-source {
  color: var(--text-dim);
  font: 700 10px/1.4 var(--font-mono);
  min-width: 0;
}
.asset-layout-footer .btn {
  flex: 0 0 auto;
}
body.light-mode .asset-card,
body.light-mode .asset-layout-row,
body.light-mode .asset-chip {
  background: rgba(255, 255, 255, 0.72);
}
body.light-mode .asset-chip.active,
body.light-mode .asset-layout-segment-btn.active {
  background: rgba(0, 150, 160, 0.14);
}
.heatmap-select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(3, 13, 24, 0.6);
  color: var(--text-primary);
  font: 11px/1.2 var(--font-mono);
}
.heatmap-status {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 10px;
  letter-spacing: 0.06em;
  word-break: break-word;
}
.heatmap-status.dim {
  color: var(--text-dim);
}
.heatmap-status.ok {
  border-color: rgba(var(--accent-green-rgb), 0.35);
}
.heatmap-status.warn {
  border-color: rgba(var(--accent-amber-rgb), 0.5);
  color: var(--accent-amber);
}
.heatmap-status.crit {
  border-color: rgba(var(--accent-red-rgb), 0.5);
  color: var(--accent-red);
}
.heatmap-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.heatmap-legend-ramp {
  display: block;
  height: 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
/* Inferno: transparent black through purple and orange to pale yellow. */
.heatmap-legend.emitter .heatmap-legend-ramp {
  background: linear-gradient(90deg, rgba(0, 0, 4, 0.2), #1f0c48 12.5%, #550f6d 25%, #88226a 37.5%, #ba3655 50%, #e35933 62.5%, #f98c0a 75%, #f9c932 87.5%, #fcffa4);
}
/* Signal effects: weak blue through green and yellow to strong red, labelled in dBm. */
.heatmap-legend.coverage .heatmap-legend-ramp {
  background: linear-gradient(90deg, #2b308c, #00a0dc 25%, #50c850 50%, #ffbe00 75%, #dc1e1e);
}
.heatmap-legend-mass {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  min-height: 11px;
}
.heatmap-legend-mass:empty {
  display: none;
}
.heatmap-contributions {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.4;
}
.heatmap-contributions:empty {
  display: none;
}
.heatmap-legend-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.heatmap-advanced summary {
  cursor: pointer;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.heatmap-advanced .heatmap-field {
  margin-top: 10px;
}
.heatmap-assumptions {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--text-dim);
  font: 10px/1.5 var(--font-mono);
  letter-spacing: 0.04em;
}
body.light-mode .heatmap-select {
  background: rgba(255, 255, 255, 0.7);
}
body.light-mode .heatmap-status {
  background: rgba(7, 19, 31, 0.04);
}
body.light-mode .map-drawer-gear:hover,
body.light-mode .heatmap-segment-btn.active,
body.light-mode .heatmap-enable.active {
  background: rgba(0, 120, 140, 0.12);
  color: #007a8a;
}


/* --- RF geolocation vectors (heatmap contours, hypothesis, fix ellipses) --- */
.heatmap-contour {
  pointer-events: none;
  mix-blend-mode: screen;
}
.heatmap-hypothesis,
.heatmap-threshold-ring {
  pointer-events: none;
}
.heatmap-threshold-label {
  pointer-events: none;
  white-space: nowrap;
}
.heatmap-threshold-label span {
  display: inline-block;
  transform: translate(-50%, -100%);
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(5, 8, 13, 0.7);
  color: #fff1c4;
  font: 10px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}
.geo-ellipse,
.geo-ellipse-case,
.geo-ellipse-previous,
.geo-cep,
.geo-trail,
.geo-trail-dot {
  pointer-events: none;
}
.geo-ellipse,
.geo-ellipse-case {
  transition: opacity 0.4s ease;
}
/* Thin secondary rings get a soft halo so they survive imagery texture. */
.geo-ellipse-previous,
.geo-cep,
.geo-trail {
  filter: drop-shadow(0 0 1px rgba(5, 8, 13, 0.9));
}
/* RF geolocation enrichment block appended to the shared detection detail:
   title, summary line, position-quality rows, diagnostics disclosure. */
.detection-geolocation {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 140, 0, 0.35);
}
.detection-geolocation-title {
  color: #ff8c00;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.detection-geolocation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(77, 119, 153, 0.12);
}
.detection-geolocation-freq {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.detection-geolocation-state,
.detection-geolocation-flag,
.detection-chip {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--text-primary);
}
.detection-geolocation-state.ok {
  color: var(--accent-green);
  border-color: rgba(var(--accent-green-rgb), 0.45);
}
.detection-geolocation-state.warn,
.detection-geolocation-flag {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.5);
}
.detection-geolocation-state.dim {
  color: var(--text-dim);
}
.detection-geolocation-age {
  margin-left: auto;
  color: var(--text-dim);
}
.detection-geolocation .track-field-value.warn {
  color: var(--accent-amber);
}
.detection-chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  font-weight: 600;
}
.detection-geolocation-diagnostics {
  margin-top: 6px;
}
.detection-geolocation-diagnostics summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  list-style: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  user-select: none;
}
.detection-geolocation-diagnostics summary::-webkit-details-marker {
  display: none;
}
.detection-geolocation-diagnostics summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.15s ease;
}
.detection-geolocation-diagnostics[open] summary::before {
  transform: rotate(90deg);
}
.detection-geolocation-diagnostics summary:hover,
.detection-geolocation-diagnostics summary:focus-visible {
  color: var(--text-primary);
  outline: none;
}
.detection-geolocation-diagnostics .track-field {
  padding: 5px 0;
}
.detection-geolocation-diagnostics .track-field-value {
  font-weight: 600;
  color: var(--text-dim);
}
body.light-mode .heatmap-threshold-label span {
  background: rgba(255, 255, 255, 0.8);
  color: #7a4a00;
}
body.light-mode .heatmap-contour {
  mix-blend-mode: multiply;
}

/* Operators who ask for reduced motion get state changes without the pulses
   and slides; the alerting ring keeps its colour, it just stops throbbing. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- ASSETS rail, camera kind: slew-to-cue --------------------------------
   The ALL CAMERAS card sets the mode for every camera; each camera card says what it is
   doing and opens to reveal its own controls. Rules sit behind disclosure
   rows whose closed state still reads the current value. Type never drops
   below 10px; status colours come from the SDK ramps via tokens. */
.cue-defaults-card .radar-card-body-static {
  gap: 8px;
}
/* One full-width mode control; the buttons share the row equally and never
   clip at the narrow panel width. Selection is a fill tint, not an outline. */
.cue-defaults-row,
.cue-camera-mode-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cue-mode-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}
.cue-mode-seg {
  display: flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(11, 14, 22, 0.42);
}
.cue-mode-seg-mixed {
  border-style: dashed;
}
.cue-mode-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.6px;
  white-space: nowrap;
  cursor: pointer;
}
.cue-mode-btn:last-child {
  border-right: 0;
}
.cue-mode-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.cue-mode-btn:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: -2px;
}
.cue-mode-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 255, 247, 0.12);
}
.cue-mode-btn.active[data-cue-value="OFF"] {
  color: var(--text-primary);
  background: rgba(134, 150, 170, 0.22);
}
.cue-mode-btn.active[data-cue-value="AUTO"] {
  color: var(--accent-green);
  background: rgba(var(--accent-green-rgb), 0.14);
}
.cue-mode-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.cue-mode-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

/* DIFFERS badge + RESET, on ALL CAMERAS and inside an opened camera card. */
.cue-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.cue-override-row .radar-filter-reset {
  flex-shrink: 0;
}
/* inline-block (not flex) so a long badge ellipsizes instead of overflowing. */
.cue-badge {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  min-width: 0;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cue-badge-override {
  color: var(--accent-amber);
  border-color: rgba(var(--accent-amber-rgb), 0.35);
  background: rgba(var(--accent-amber-rgb), 0.08);
}

/* Disclosure rows: chevron, label, and the current value right-aligned. */
.cue-section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 0 2px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 1px;
  text-align: left;
  cursor: pointer;
}
.cue-section-toggle .icon {
  flex: 0 0 auto;
  color: var(--text-dim);
}
.cue-section-toggle:hover,
.cue-section-toggle:hover .icon {
  color: var(--text-primary);
}
.cue-section-toggle:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: -2px;
}
.cue-toggle-label {
  flex: 0 0 auto;
}
.cue-toggle-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cue-section-toggle-override .cue-toggle-value {
  color: var(--accent-amber);
}
.cue-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 0 6px;
}
.cue-section-caption,
.cue-body-caption {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}
.cue-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.cue-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-left: 6px;
  border-left: 2px solid transparent;
}
.cue-field-override {
  border-left-color: var(--accent-amber);
}
.cue-field-row {
  display: flex;
  gap: 10px;
}
.cue-field-row > .cue-field {
  flex: 1 1 0;
}
.cue-field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}
.cue-field-label small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  opacity: 0.75;
}
.cue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cue-chip {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(11, 14, 22, 0.38);
  color: var(--text-dim);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.6px;
  cursor: pointer;
}
.cue-chip:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}
.cue-chip:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 1px;
}
.cue-chip.active {
  color: var(--accent-cyan);
  border-color: transparent;
  background: rgba(0, 255, 247, 0.12);
}
.cue-input {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(18, 18, 26, 0.82);
  color: var(--text-primary);
  font: 700 10px/1.2 var(--font-mono);
}
.cue-input:focus {
  outline: none;
  border-color: rgba(94, 224, 255, 0.42);
}
.cue-input::placeholder {
  color: rgba(134, 150, 170, 0.55);
  font-weight: 500;
}
.cue-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cue-range-sep {
  color: var(--text-dim);
  font-size: 10px;
}

/* Camera card: name, one status line, where it is, then VIEW / HOLD. */
.camera-card .radar-card-body {
  padding-top: 8px;
  gap: 8px;
}
.camera-card-unsupported .radar-name {
  color: var(--text-dim);
}
.cue-state {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: 10px;
  line-height: 1.3;
}
.cue-dot {
  flex: 0 0 auto;
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentcolor;
}
.cue-status {
  font-weight: 700;
  letter-spacing: 0.4px;
}
.cue-state-target {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.cue-status-off,
.cue-status-nofix,
.cue-status-unsupported {
  color: var(--text-dim);
}
.cue-status-armed {
  color: var(--accent-cyan);
}
.cue-status-slewing,
.cue-status-tracking {
  color: var(--accent-green);
}
.cue-status-slewing.cue-dot {
  animation: cue-pulse 1s ease-in-out infinite;
}
@keyframes cue-pulse {
  50% { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .cue-status-slewing.cue-dot { animation: none; }
}
.cue-status-hold {
  color: var(--accent-amber);
}
.cue-status-error {
  color: var(--accent-red);
}
/* Meta parts separate themselves, so nothing dangles when one wraps. */
.cue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  overflow-wrap: normal;
}
.cue-meta > span + span:not(.cue-badge)::before {
  content: "·";
  margin-right: 4px;
  color: rgba(134, 150, 170, 0.6);
}
.cue-meta .cue-badge {
  line-height: 14px;
  padding: 0 5px;
  letter-spacing: 0.5px;
}
.cue-reason {
  color: rgba(185, 191, 213, 0.6);
}
.cue-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.radar-card .btn.cue-hold-btn {
  min-width: 64px;
  min-height: 28px;
  padding: 3px 8px;
}
.cue-view-btn {
  min-height: 28px;
}

/* Light canvas: dark control fills read as grey slabs on white, so give
   the cue segment, chips, and inputs a light fill with the shared border. */
body.light-mode .cue-mode-seg,
body.light-mode .cue-chip,
body.light-mode .cue-input {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border);
}
body.light-mode .cue-mode-btn.active {
  background: rgba(0, 150, 145, 0.14);
  color: #007a76;
}
body.light-mode .cue-chip.active {
  background: rgba(0, 150, 145, 0.14);
  color: #007a76;
}
body.light-mode .cue-mode-btn.active[data-cue-value="OFF"] {
  background: rgba(7, 19, 31, 0.08);
  color: var(--text-primary);
}
body.light-mode .cue-mode-btn.active[data-cue-value="AUTO"] {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}
body.light-mode .cue-section-toggle {
  color: var(--text-dim);
  border-top-color: rgba(7, 19, 31, 0.08);
}
