:root {
  /* omniloc.ai design tokens */
  --bg-color: #071116;
  --bg-raised: #0d1b21;
  --surface: #bcc3c0;
  --surface-ink: #0b0c0d;
  --text-main: #eceeee;
  --text-muted: #8a9296;
  --accent-color: #28aadc;
  --accent-dim: rgba(40, 170, 220, 0.35);
  --accent-ink: #06181f;
  --rule: rgba(140, 185, 205, 0.16);
  --card-bg: rgba(120, 180, 205, 0.03);
  --card-border: rgba(140, 185, 205, 0.14);
  --glare-color: rgba(255, 255, 255, 0.05);

  /* legacy aliases kept so existing rules keep resolving */
  --panel-bg: rgba(120, 180, 205, 0.03);
  --panel-border: rgba(140, 185, 205, 0.16);
  --accent-primary: #28aadc;
  --accent-primary-glow: rgba(40, 170, 220, 0.35);
  --accent-secondary: #ff4444;
  --accent-secondary-glow: rgba(255, 68, 68, 0.3);
  --accent-success: #00e676;
  --accent-warn: #e5b53c;

  --font-sans: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, monospace;
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);

  /* dashboard */
  --panel-surface: #0a161c;
  --panel-line: rgba(140, 185, 205, 0.14);
  --panel-radius: 12px;
  --control-radius: 8px;
  --meta-ink: #93a3aa;
  --series-rtk: #eef2f4;
  --series-gps: #ff4d4f;
  --series-omniloc: #34d399;
  --series-slam: #a78bfa;
}

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

body.dark-theme {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html {
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.mt-4 { margin-top: 1rem; }

/* Top Navigation */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.5rem;
  background: rgba(7, 17, 22, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-success);
  border-radius: 50%;
  box-shadow: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.status-text {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-success);
}

/* Primary workspace navigation */
.workspace-tabs {
  width: calc(100% - 5rem);
  max-width: 1736px;
  margin: 1.5rem auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
}

.workspace-tab {
  min-height: 62px;
  padding: 0.9rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-color);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.35s ease, background 0.35s ease;
}

.workspace-tab:hover {
  color: var(--text-main);
  background: var(--bg-raised);
}

.workspace-tab.active {
  color: var(--text-main);
  background: var(--bg-raised);
  box-shadow: inset 0 -2px 0 var(--accent-color);
}

.workspace-tab > span:last-child,
.source-type-button > span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.workspace-tab strong,
.source-type-button strong {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.workspace-tab small,
.source-type-button small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 1;
}

.workspace-tab-icon,
.source-type-icon {
  display: grid;
  place-items: center;
  color: currentColor;
}

body[data-workspace-tab="recorded"] #live-localization,
body[data-workspace-tab="recorded"] #live-monitor,
body[data-workspace-tab="live"] #recorded-streams,
body[data-workspace-tab="live"] #correction-results,
body[data-workspace-tab="live"] .quickstart {
  display: none;
}

/* Compact orientation strip above the working area */
.quickstart {
  width: calc(100% - 5rem);
  max-width: 1736px;
  margin: 1.5rem auto 0;
  padding: 1.5rem 1.75rem;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(520px, 1.8fr);
  align-items: center;
  gap: 0.9rem 2.5rem;
  background: var(--bg-color);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-color);
  border-radius: 0;
  box-shadow: none;
}

.quickstart-copy {
  min-width: 0;
}

.quickstart-kicker {
  display: block;
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.quickstart h1 {
  margin-top: 0.6rem;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.quickstart-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.quickstart-steps li {
  min-height: 56px;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-color);
  border: 0;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.quickstart-steps li > span {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: var(--accent-color);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: none;
}

.quickstart a {
  color: var(--accent-color);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}

.quickstart a:hover {
  color: var(--text-main);
  border-bottom-color: var(--text-main);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  flex: 1;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

#recorded-streams {
  scroll-margin-top: 92px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Glass Panels */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.75rem;
  box-shadow: none;
  transition: border-color 0.35s ease;
}

.glass-panel:hover {
  border-color: rgba(140, 185, 205, 0.3);
}

.highlight-panel {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-color);
  box-shadow: none;
}

.panel-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-main);
}

.panel-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.source-context {
  grid-column: 1 / -1;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-color);
  border-radius: 0;
}

.replay-source-field {
  grid-column: 1 / -1;
}

.source-context-tag {
  display: inline-flex;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.6rem;
  color: var(--accent-color);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.source-context > p {
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.55;
}

/* Recorded source type and progressive disclosure */
.source-type-switch {
  margin-bottom: 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 0;
}

.source-type-button {
  min-height: 54px;
  padding: 0.7rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-muted);
  background: var(--bg-color);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}

.source-type-button:hover:not(:disabled) {
  color: var(--text-main);
  background: var(--bg-raised);
}

.source-type-button.active {
  color: var(--accent-color);
  background: var(--bg-raised);
  box-shadow: inset 0 -2px 0 var(--accent-color);
}

.source-type-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.advanced-settings {
  margin-top: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.advanced-settings summary {
  min-height: 54px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #eceeee;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary:hover {
  background: rgba(40, 170, 220, 0.035);
}

.advanced-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.advanced-summary-copy strong {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.advanced-summary-copy small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.advanced-chevron {
  flex: 0 0 auto;
  color: var(--accent-primary);
  transition: transform 0.2s ease;
}

.advanced-settings[open] .advanced-chevron {
  transform: rotate(180deg);
}

.advanced-settings.settings-locked {
  opacity: 0.58;
  pointer-events: none;
}

.advanced-settings-body {
  padding: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}

.advanced-settings-body .field {
  margin-bottom: 0;
}

.field.advanced-toggle-field {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
}

.with-status {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.live-badge {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--rule);
  border-radius: 0;
}

/* Source picker */
.source-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.source-card {
  min-height: 58px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  color: var(--text-muted);
  background: var(--bg-color);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}

.source-card:only-child {
  grid-column: 1 / -1;
}

.source-card:hover:not(:disabled) {
  color: var(--text-main);
  background: var(--bg-raised);
}

.source-card.active {
  color: var(--accent-color);
  background: var(--bg-raised);
  box-shadow: inset 0 -2px 0 var(--accent-color);
}

.source-card:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.source-card strong {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.source-card small {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.source-card.active small {
  color: inherit;
  opacity: 0.85;
}

.data-readouts-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


/* ==========================================================================
   Dashboard -- Sequences workspace
   ========================================================================== */
.glass-panel,
.quickstart,
.workspace-tabs {
  border-radius: var(--panel-radius);
  overflow: hidden;
}

.btn,
.btn-xs,
.cyber-input,
.source-picker,
.source-type-switch,
.upload-wrapper,
.live-badge,
.status-indicator,
.btn-logout,
.avatar-circle {
  border-radius: var(--control-radius);
}

.source-picker,
.source-type-switch {
  overflow: hidden;
}

.series-rtk { --series: var(--series-rtk); }
.series-gps { --series: var(--series-gps); }
.series-omniloc { --series: var(--series-omniloc); }
.series-slam { --series: var(--series-slam); }

.leg-color.rtk { background: var(--series-rtk); }
.leg-color.gps { background: var(--series-gps); }
.leg-color.omniloc { background: var(--series-omniloc); }

/* controls become a toolbar above a full-width dashboard */
body[data-workspace-tab="recorded"] .dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

body[data-workspace-tab="recorded"] #recorded-streams {
  padding: 1.1rem 1.35rem;
  background: var(--panel-surface);
  border-color: var(--panel-line);
}

body[data-workspace-tab="recorded"] #recorded-streams .panel-header {
  display: none;
}

body[data-workspace-tab="recorded"] #recorded-streams .replay-controls {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) auto;
  grid-template-areas:
    "type source  actions"
    "type context status";
  gap: 0.7rem 1.5rem;
  align-items: center;
}

body[data-workspace-tab="recorded"] #recorded-streams .source-type-switch {
  grid-area: type;
  margin: 0;
  align-self: stretch;
}

body[data-workspace-tab="recorded"] #recorded-streams .field-grid-2 {
  display: contents;
}

body[data-workspace-tab="recorded"] #recorded-streams .replay-source-field {
  grid-area: source;
  margin: 0;
}

body[data-workspace-tab="recorded"] #recorded-streams .replay-source-field > span {
  display: none;
}

body[data-workspace-tab="recorded"] #recorded-streams .source-picker {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

body[data-workspace-tab="recorded"] #recorded-streams .source-card:only-child {
  grid-column: auto;
}

body[data-workspace-tab="recorded"] #recorded-streams .source-context {
  grid-area: context;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
}

body[data-workspace-tab="recorded"] #recorded-streams .source-context-tag {
  margin: 0;
  flex: 0 0 auto;
  border-radius: 6px;
}

body[data-workspace-tab="recorded"] #recorded-streams .source-context > p {
  font-size: 0.82rem;
  color: var(--meta-ink);
}

body[data-workspace-tab="recorded"] #recorded-streams .replay-actions {
  grid-area: actions;
  margin: 0;
  gap: 0.6rem;
}

body[data-workspace-tab="recorded"] #recorded-streams .replay-actions .btn {
  width: auto;
}

body[data-workspace-tab="recorded"] #recorded-streams .system-status-msg {
  grid-area: status;
  margin: 0;
  justify-self: end;
}

/* Live tab: no parameter panel; the monitor takes the full width */
body[data-workspace-tab="live"] .dashboard-sidebar {
  display: none;
}

body[data-workspace-tab="live"] .dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

/* Live demo: the Live tab turns into the same dashboard as Sequences */
body[data-live-demo] #live-monitor {
  display: none !important;
}

body[data-workspace-tab="live"][data-live-demo] #correction-results {
  display: block;
}

#dataset-badge {
  cursor: default;
  user-select: none;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.6);
  animation: live-pulse 1.6s infinite;
  vertical-align: middle;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 77, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}

/* results container is just a stack of panels */
.dash-results {
  min-width: 0;
}

.dash-results .result-body:not(.hidden) {
  display: grid;
  gap: 1.25rem;
}

.dash-empty {
  min-height: 340px;
  background: var(--panel-surface);
  border: 1px dashed var(--panel-line);
  border-radius: var(--panel-radius);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: var(--panel-radius);
  overflow: hidden;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.35rem;
  border-bottom: 1px solid var(--panel-line);
}

.dash-head h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-main);
}

.dash-meta,
.dash-foot,
.dash-map-tag,
.dash-inset-head,
.dash-inset-foot,
.dash-metric-tag {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dash-meta {
  min-width: 0;
  overflow: hidden;
  font-size: 0.68rem;
  color: var(--meta-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* front camera: the frame is shown whole, over a blurred copy of itself */
.dash-camera .visual-stage {
  flex: 1 1 auto;
  min-height: 300px;
  background: #000;
  isolation: isolate;
}

.dash-camera .ground-stage::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -1;
  background-image: var(--frame-backdrop, none);
  background-position: center;
  background-size: cover;
  filter: blur(22px) brightness(0.42) saturate(1.1);
}

.dash-head-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.camera-overlay-toggle {
  border: 1px solid rgba(120, 200, 255, 0.35);
  border-radius: 999px;
  background: rgba(10, 20, 30, 0.7);
  color: var(--text-dim, #9fb4c4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.camera-overlay-toggle:hover {
  color: #e8f4ff;
  border-color: rgba(120, 200, 255, 0.6);
}

.camera-overlay-toggle[aria-pressed="true"] {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.65);
  color: #34d399;
}

.dash-camera .ground-stage #ground-vo-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.dash-camera .ground-stage #ground-preview,
.dash-camera .ground-stage #ground-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dash-camera .ground-stage #ground-backdrop {
  position: absolute;
  inset: -24px;
  z-index: 0;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  filter: blur(22px) brightness(0.42) saturate(1.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* while a video plays, the backdrop is painted from the video itself */
.dash-camera .ground-stage.video-mode::before,
.dash-camera .ground-stage.video-mode #ground-preview {
  display: none;
}

.dash-camera .ground-stage.video-mode #ground-backdrop {
  opacity: 1;
}

.dash-camera .scanlines,
.dash-camera #ground-overlay,
.dash-camera .drone-hud,
.dash-camera .camera-overlay {
  display: none;
}

.dash-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.35rem;
  border-top: 1px solid var(--panel-line);
  font-size: 0.62rem;
  color: var(--meta-ink);
}

/* trajectories */
.dash-map {
  position: relative;
  aspect-ratio: 980 / 520;
  background: #04090c;
  overflow: hidden;
}

.dash-map .trajectory-stage {
  position: absolute;
  inset: 0;
  min-height: 0;
  background: #04090c;
}

.dash-map #replay-trajectory {
  width: 100%;
  height: 100%;
}

.dash-map-tag {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 2;
  font-size: 0.64rem;
  color: #dfe7ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.dash-attrib {
  position: absolute;
  right: calc(33% + 30px);
  bottom: 10px;
  z-index: 2;
  font-size: 0.7rem;
  color: #dfe7ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.map-scale-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  fill: #eef2f4;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 3px;
}

.dash-inset {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: 33%;
  background: rgba(5, 12, 16, 0.94);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.dash-inset-head,
.dash-inset-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.6rem;
  color: #dfe7ea;
}

.dash-inset .satellite-stage {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 16 / 10 !important;
  padding: 0;
  background: #000;
  box-shadow: none;
}

.dash-inset .satellite-stage #satellite-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dash-inset .satellite-stage #slam-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* the close-up is a live zoom-21 map; the per-frame satellite crop stays
   hidden and only the GPS-jammed odometry video uses this stage directly */
.dash-inset #satellite-detail-map {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: #04090c;
}

.dash-inset #satellite-image {
  visibility: hidden;
}

.gps-jammed-video-mode .dash-inset #satellite-detail-map {
  display: none;
}

.dash-inset #satellite-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dash-scale {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-scale-bar {
  display: inline-block;
  width: 0;
  height: 2px;
  background: #eef2f4;
}

.gps-jammed-video-mode .dash-inset .dash-scale {
  visibility: hidden;
}

.jam-area-label {
  fill: #ffd9d9;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.14em;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.78);
}

.dash-metric.jammed .dash-metric-value b {
  font-size: 1.45rem;
  letter-spacing: 0;
}

/* series metrics */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--panel-line);
}

.dash-metric {
  min-width: 0;
  padding: 0.85rem 1.35rem 0.95rem;
  border-left: 1px solid var(--panel-line);
}

.dash-metric:first-child {
  border-left: 0;
}

.dash-metric-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--series);
}

.dash-metric-name i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--series);
}

.dash-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.dash-metric-value {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--series);
  white-space: nowrap;
}

.dash-metric-value b {
  font-weight: inherit;
}

.dash-metric-value small {
  margin-left: 0.55rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--meta-ink);
}

.dash-metric-tag {
  flex: 0 0 auto;
  font-size: 0.58rem;
  color: var(--meta-ink);
}

/* position error */
.dash-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.75rem;
  padding: 1rem 1.35rem 0;
}

.dash-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.98rem;
  color: #dfe7ea;
}

.dash-chart-legend i {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--series);
}

.dash-chart-stage {
  padding: 0.35rem 1.1rem 0.9rem;
}

#position-error-chart {
  display: block;
  width: 100%;
  height: 230px;
}

.chart-grid {
  stroke: rgba(140, 185, 205, 0.1);
  stroke-width: 1;
}

.chart-tick {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--meta-ink);
}

.chart-cursor {
  stroke: rgba(223, 231, 234, 0.35);
  stroke-width: 1;
}

@media (max-width: 1100px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-workspace-tab="recorded"] #recorded-streams .replay-controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "type" "source" "context" "actions" "status";
  }

  body[data-workspace-tab="recorded"] #recorded-streams .system-status-msg {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .dash-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-metric {
    border-left: 0;
    border-top: 1px solid var(--panel-line);
  }

  .dash-metric:first-child {
    border-top: 0;
  }

  .dash-inset {
    width: 45%;
  }
}

/* Forms & Inputs */
.field-group, .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field span, .subhead {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.cyber-input {
  background: var(--bg-color);
  border: 1px solid var(--rule);
  color: var(--text-main);
  padding: 0.8rem 0.85rem;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color 0.25s ease;
  width: 100%;
}

.cyber-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: none;
}

.upload-wrapper {
  background: var(--bg-color);
  border: 1px dashed var(--rule);
  border-radius: 0;
  padding: 0.5rem;
  transition: border-color 0.25s ease;
}

.upload-wrapper:hover {
  border-color: var(--accent-primary);
}

.upload-wrapper input[type="file"]::file-selector-button {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  margin-right: 1rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease;
}

.upload-wrapper input[type="file"]::file-selector-button:hover {
  background: var(--accent-color);
  color: var(--accent-ink);
}

.noise-panel {
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-warn);
  border-radius: 0;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.form-actions, .replay-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  align-items: stretch;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--accent-ink);
  border-color: var(--accent-color);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: #4fbde6;
  border-color: #4fbde6;
}

.btn-glow {
  box-shadow: none;
}

.btn-glow:hover:not(:disabled) {
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--rule);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-ink);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--rule);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-raised);
  border-color: rgba(140, 185, 205, 0.34);
}

.btn-danger {
  background: transparent;
  color: #ff8a8a;
  border: 1px solid rgba(255, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: #ff4444;
  border-color: #ff4444;
  color: var(--accent-ink);
}

/* System Status Msgs */
.system-status-msg {
  margin-top: 1rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

/* Terminal Blocks */
.terminal-block {
  background: var(--bg-color);
  border: 1px solid var(--rule);
  border-radius: 0;
  margin-top: 1rem;
  overflow: hidden;
}

.terminal-header {
  background: var(--bg-raised);
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.terminal-block pre {
  padding: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8a9296;
  white-space: pre-wrap;
  margin: 0;
  max-height: 250px;
  overflow-y: auto;
}

.terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Jetson Live Specific */
.jetson-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1400px) {
  .jetson-grid {
    grid-template-columns: 1fr;
  }
}

.feed-card {
  background: var(--bg-color);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Gauges HUD Overlay */
.imu-overlay {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 20;
  background: rgba(7, 17, 22, 0.82);
  padding: 0.75rem;
  border-radius: 0;
  border: 1px solid var(--rule);
  backdrop-filter: blur(4px);
}
.gauge-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gauge-mini {
  width: 60px;
  height: 60px;
}
.gauge-svg {
  width: 100%;
  height: 100%;
}
.gauge-val {
  stroke-dasharray: 236;
  stroke-dashoffset: 236; 
  transition: stroke-dashoffset 0.1s linear, stroke 0.2s ease;
}
.gauge-mini .gauge-val {
  stroke-width: 14; 
}
.gauge-mini .gauge-bg {
  stroke-width: 14; 
}
.gauge-label-center {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gauge-mini .gauge-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}
.gauge-mini .gauge-unit {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-title-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.1rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--rule);
}

.card-title-bar h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 0;
}

.card-heading {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.panel-description-strip {
  padding: 0.6rem 1.1rem;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 1px solid var(--rule);
  font-size: 0.74rem;
  line-height: 1.5;
}

.dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: none;
}

.dot-blue {
  width: 6px;
  height: 6px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: none;
}

.legend-mini {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.leg-color {
  width: 12px;
  height: 2px;
  border-radius: 0;
}
.leg-color.blue { background: #28aadc; }
.leg-color.red { background: #ff4444; }
.leg-color.green { background: #00e676; }

.visual-stage {
  position: relative;
  background: #000;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 1;
}

.visual-stage img, .visual-stage svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#satellite-stage.isi-saved-overlay-mode {
  background:
    radial-gradient(circle at 50% 18%, rgba(40, 170, 220, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(7, 17, 22, 0.98), rgba(7, 17, 22, 0.98));
  padding: 0.75rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

#satellite-stage.isi-saved-overlay-mode #satellite-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 208%;
  height: calc(100% - 1.5rem);
  max-width: none;
  object-fit: fill;
  clip-path: none;
  transform: translate(-76%, -50%);
  transform-origin: center center;
}

#ground-overlay,
#replay-trajectory {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.trajectory-stage {
  background-color: var(--bg-color);
  background-image:
    linear-gradient(rgba(140, 185, 205, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 185, 205, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.3;
}

.camera-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
  background: rgba(7, 17, 22, 0.82);
  border: 1px solid var(--rule);
  padding: 0.3rem 0.55rem;
  border-radius: 0;
  pointer-events: none;
  z-index: 10;
}

.replay-camera-overlay {
  background: rgba(255, 68, 68, 0.18);
  border: 1px solid rgba(255, 68, 68, 0.35);
  color: #ffb0b0;
}

.drone-hud {
  position: absolute;
  z-index: 12;
  display: flex;
  gap: 0.5rem;
  pointer-events: none;
}

.drone-hud-top {
  top: 1rem;
  left: 1rem;
  flex-wrap: wrap;
}

.drone-hud-bottom {
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  flex-direction: column;
  align-items: flex-start;
}

.drone-hud-chip,
.drone-hud-line {
  background: rgba(7, 17, 22, 0.82);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--text-main);
  font-family: var(--font-mono);
  box-shadow: none;
  backdrop-filter: blur(4px);
}

.drone-hud-chip {
  padding: 0.4rem 0.7rem;
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.drone-hud-line {
  padding: 0.4rem 0.65rem;
  font-size: 0.74rem;
  line-height: 1.35;
}

.result-trajectory-row .feed-card {
  min-height: 320px;
}

.replay-trajectory-stage {
  min-height: 320px;
}

/* Results Area */
.data-readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.readout-box {
  background: var(--bg-color);
  border: 1px solid var(--rule);
  padding: 1.25rem;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.readout-highlight {
  background: var(--bg-raised);
  border-color: var(--rule);
  border-left: 3px solid var(--accent-color);
}

.readout-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.readout-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-main);
}

.highlight-text {
  color: var(--accent-color);
  text-shadow: none;
}

.result-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.result-visuals.gps-jammed-video-mode {
  grid-template-columns: 1fr;
}

.result-visuals.gps-jammed-video-mode #result-satellite-card {
  grid-column: 1 / -1;
}

.result-visuals.gps-jammed-video-mode #result-ground-card {
  display: none;
}

.live-error-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.live-error-card {
  background: var(--bg-color);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: none;
}

.live-error-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.live-error-value {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.4;
}

#live-error-stage-card[data-stage="good"] {
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.08);
}

#live-error-stage-card[data-stage="plausible"] {
  border-color: rgba(229, 181, 60, 0.34);
  background: rgba(229, 181, 60, 0.08);
}

#live-error-stage-card[data-stage="weak"] {
  border-color: rgba(242, 163, 60, 0.34);
  background: rgba(242, 163, 60, 0.08);
}

#live-error-stage-card[data-stage="reject"] {
  border-color: rgba(255, 68, 68, 0.34);
  background: rgba(255, 68, 68, 0.08);
}

@media (max-width: 800px) {
  .workspace-tabs {
    width: calc(100% - 2rem);
  }

  .workspace-tab {
    padding-inline: 0.55rem;
  }

  .quickstart {
    width: calc(100% - 2rem);
    grid-template-columns: 1fr;
  }

  .quickstart-steps {
    grid-template-columns: 1fr;
  }

  .source-type-button small,
  .workspace-tab small {
    display: none;
  }

  .advanced-settings-body {
    grid-template-columns: 1fr;
  }

  .advanced-toggle-field {
    grid-column: 1;
  }

  .data-readouts, .result-visuals, .live-error-strip {
    grid-template-columns: 1fr;
  }
}

.external-link {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  transition: color 0.2s ease;
}

.external-link:hover {
  opacity: 0.8;
}

.overlay-summary-chip {
  margin-left: auto;
  margin-right: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.result-ground {
  min-height: 200px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  background: transparent;
  border-radius: 0;
  border: 1px dashed var(--rule);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

/* Toggle Switch specific for replay clear cache */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: transparent;
  border: 1px solid var(--rule);
  transition: .3s;
  border-radius: 0;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 0;
}

.toggle-switch input:checked + .slider {
  background-color: transparent;
  border-color: var(--accent-color);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--accent-color);
  box-shadow: none;
}

/* Jetson Controls Bar */
.jetson-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
}

.jetson-controls .control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.jetson-controls .compact {
  margin: 0;
  gap: 0.5rem;
}

.jetson-controls .live-model-field {
  min-width: 260px;
}

.jetson-controls .compact-select {
  height: 32px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.noise-level-group {
  display: flex;
  gap: 0.25rem;
}

.btn-xs {
  padding: 0.4rem 0.7rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-xs:hover {
  border-color: var(--accent-color);
  color: var(--text-main);
}

.btn-xs.active,
.noise-level-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-ink);
}

#pause-stream-btn.paused {
  background: rgba(255, 68, 68, 0.15);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

/* Scrollbar customization */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* SVG Colors Overrides for JS Injection */
.overlay-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  paint-order: stroke;
  stroke: rgba(7, 17, 22, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-family: var(--font-mono);
}

.overlay-label-sub {
  font-size: 12px;
  font-weight: 700;
}

.overlay-guide {
  stroke-dasharray: 6 8;
}

.overlay-guide-secondary {
  stroke-dasharray: 4 6;
}

.pose-marker line,
.pose-marker circle {
  filter: none;
}

.pose-marker .pose-uncertainty-ring,
.pose-marker-gnss .gnss-sample {
  filter: none;
}

.pose-marker-gnss .gnss-sample {
  opacity: 0.96;
}

.trajectory-axis-label,
.trajectory-legend-label {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: #8a9296;
}

.trajectory-caption {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: #8a9296;
}

.trajectory-track {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}

.trajectory-track-halo {
  filter: none;
  opacity: 0.54;
}

.trajectory-track-input {
  opacity: 0.74;
}

.trajectory-track-refined-halo {
  filter: none;
  opacity: 0.48;
}

.trajectory-track-refined {
  filter: none;
}

.trajectory-track-gt {
  stroke-dasharray: none;
  opacity: 0.95;
  filter: none;
}

/* GPS-Denied init phase animations */
@keyframes gd-pulse-win {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.1; }
}
@keyframes gd-scan-pulse {
  0%   { opacity: 0.9; stroke-width: 2; }
  50%  { opacity: 0.3; stroke-width: 5; }
  100% { opacity: 0.9; stroke-width: 2; }
}
@keyframes gd-coldstart-spin {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -502; }
}
@keyframes gd-search-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
.gd-pulse-win-1 {
  animation: gd-pulse-win 3s ease-in-out infinite;
}
.gd-pulse-win-2 {
  animation: gd-pulse-win 3s ease-in-out infinite;
  animation-delay: -1s;
}
.gd-pulse-win-3 {
  animation: gd-pulse-win 3s ease-in-out infinite;
  animation-delay: -2s;
}
.gd-scan-box {
  animation: gd-scan-pulse 1.1s ease-in-out infinite;
}
.gd-coldstart-ring {
  animation: gd-coldstart-spin 2.2s linear infinite;
}
.gd-search-label {
  animation: gd-search-blink 1.3s ease-in-out infinite;
}

.ground-reticle-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ground-reticle-label {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: #eceeee;
  paint-order: stroke;
  stroke: rgba(7, 17, 22, 0.9);
  stroke-width: 4px;
}

.ground-reticle-label-sub {
  font-size: 12px;
}

/* --- NEW LOGIN & PRODUCTION UI STYLES --- */

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 17, 22, 0.92);
  backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-background-anim {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140, 185, 205, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 185, 205, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: -1;
}

@keyframes bg-drift {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.1) translate(-2%, 3%); }
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 3rem 2.5rem;
  background: var(--bg-color);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent-color);
  border-radius: 0;
  box-shadow: none;
  animation: card-enter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes card-enter {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 64px;
  width: auto;
  margin-bottom: 1.75rem;
  filter: none;
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.login-header p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.login-btn-mt {
  margin-top: 2rem;
  padding: 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-error {
  margin-top: 1rem;
  padding: 0.85rem;
  background: transparent;
  border: 1px solid rgba(255, 68, 68, 0.4);
  border-left: 3px solid #ff4444;
  border-radius: 0;
  color: #ff8a8a;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-align: left;
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Network & Status Badges */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.network-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 1.25rem;
  border-right: 1px solid var(--rule);
}

.metric {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signal-box {
  color: var(--accent-color);
}

.latency-box {
  color: var(--accent-success);
  background: transparent;
  padding: 0.25rem 0.5rem;
  border-radius: 0;
  border: 1px solid var(--rule);
}

.ping-dot {
  background-color: #00e676;
  box-shadow: none;
}

.dji-badge {
  background: transparent;
  border-color: var(--rule);
}

.dji-badge .status-text {
  color: var(--accent-warn);
}

.dji-dot {
  background-color: #e5b53c;
  box-shadow: none;
}

.outline-badge {
  background: transparent;
  border-style: dashed;
}

#system-online-badge,
#system-online-badge * {
  cursor: default;
  user-select: none;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: 0.5rem;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  box-shadow: none;
}

.user-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-logout:hover {
  background: #ff4444;
  border-color: #ff4444;
  color: var(--accent-ink);
}

/* Drone UI Polish */
.battery-chip {
  color: var(--accent-success);
  border-color: var(--rule) !important;
  background: transparent !important;
}

/* Disconnected Modifiers */
.metric-offline .signal-box {
  color: #8a9296;
}
.metric-offline .latency-box {
  background: transparent;
  border-color: transparent;
}
.dji-offline {
  background: rgba(255, 68, 68, 0.1);
  border-color: rgba(255, 68, 68, 0.2);
}
.dji-offline .status-text {
  color: #ffb0b0;
}
.dji-offline .dji-dot {
  background-color: #ff4444;
  box-shadow: none;
  animation: none;
}

/* landing-zone label on the perception map layer */
.perception-lz-label {
  fill: #ffd154;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  paint-order: stroke;
  stroke: rgba(6, 9, 13, 0.9);
}

/* the GPU PC behind the Live tab is not reachable */
#system-online-badge.is-offline {
  opacity: 0.7;
  border-color: rgba(255, 77, 79, 0.55);
  color: #ff8a8c;
}
#system-online-badge.is-offline .pulse-dot {
  background: #ff4d4f;
  box-shadow: none;
  animation: none;
}
