:root {
  --sat-bg: var(--bg-canvas, #0b0f19);
  --sat-panel: var(--bg-surface, rgba(15, 23, 42, 0.92));
  --sat-card: var(--bg-surface-elevated, rgba(30, 41, 59, 0.72));
  --sat-border: var(--border-medium, rgba(148, 163, 184, 0.18));
  --sat-text: var(--text-main, #f8fafc);
  --sat-muted: var(--text-muted, #94a3b8);
  --sat-accent: #38bdf8;
  --sat-emerald: #10b981;
  --sat-amber: #f59e0b;
  --sat-danger: #f43f5e;
}

html[data-theme="light"] {
  --sat-bg: #f1f5f9;
  --sat-panel: rgba(255, 255, 255, 0.96);
  --sat-card: rgba(248, 250, 252, 0.95);
  --sat-border: rgba(15, 23, 42, 0.14);
  --sat-text: #0f172a;
  --sat-muted: #475569;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--sat-bg);
  color: var(--sat-text);
  font-family: var(--font-sans, Inter, system-ui, -apple-system, sans-serif);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden,
.hidden-pane {
  display: none !important;
}

/* Header nav slot tabs */
.header-nav-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subroute-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--sat-border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.subroute-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--sat-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.subroute-tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.2));
  color: var(--sat-text);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.simd-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--sat-muted);
  border: 1px solid var(--sat-border);
}

.simd-pill.simd-active {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Main Workspace Layout */
.sat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.viewer-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 60px);
  min-height: 620px;
  overflow: hidden;
}

/* Left Sidebar Controls */
.sat-sidebar {
  background: var(--sat-panel);
  border-right: 1px solid var(--sat-border);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-card {
  background: var(--sat-card);
  border: 1px solid var(--sat-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sat-accent);
  font-weight: 700;
}

.intake-dropzone {
  border: 1.5px dashed rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  background: rgba(56, 189, 248, 0.04);
  transition: border-color 0.2s, background 0.2s;
}

.intake-dropzone.dragover {
  border-color: var(--sat-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.intake-dropzone.collapsed {
  padding: 10px;
}

.intake-hint {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.intake-subhint {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--sat-muted);
  line-height: 1.4;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-sat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--sat-border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--sat-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-sat:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
}

.btn-sat:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sat.primary {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border-color: transparent;
  color: #ffffff;
}

.btn-sat.emerald {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.btn-sat.small {
  padding: 5px 9px;
  font-size: 11.5px;
}

/* 4-Stage Progress HUD */
.intake-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stage-pill {
  font-size: 11.5px;
  color: var(--sat-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 5px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.25s ease;
}

/* Metadata KV Grid */
.meta-grid {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 5px 8px;
  font-size: 12px;
}

.meta-k {
  color: var(--sat-muted);
}

.meta-v {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  word-break: break-word;
}

/* Form Controls */
.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-row label {
  font-size: 11.5px;
  color: var(--sat-muted);
  display: flex;
  justify-content: space-between;
}

.field-row select,
.field-row input[type="text"] {
  width: 100%;
  background: rgba(15, 23, 42, 0.72);
  color: var(--sat-text);
  border: 1px solid var(--sat-border);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12.5px;
}

html[data-theme="light"] .field-row select,
html[data-theme="light"] .field-row input[type="text"] {
  background: #ffffff;
}

.band-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.formula-bar {
  display: flex;
  gap: 6px;
}

.formula-error {
  font-size: 11.5px;
  color: var(--sat-danger);
}

.range-slider {
  width: 100%;
  accent-color: var(--sat-accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.hist-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--sat-border);
  border-radius: 6px;
  padding: 4px 6px;
}

/* Right Globe Stage */
.globe-stage {
  position: relative;
  background: #0b0f19;
  overflow: hidden;
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

.floating-banners {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 260px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.notice-banner {
  pointer-events: auto;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  backdrop-filter: blur(8px);
}

.notice-banner.info {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

/* Camera & Terrain Toolbar */
.cam-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 440px;
  justify-content: flex-end;
}

.cam-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--sat-border);
  background: rgba(15, 23, 42, 0.84);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.cam-btn:hover,
.cam-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--sat-accent);
  color: #ffffff;
}

.map-zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 28px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoom-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.16s ease;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.35);
}

.zoom-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--sat-accent);
  color: #ffffff;
}

.zoom-btn:active {
  transform: scale(0.95);
}

/* Floating Pixel Hover Tooltip */
.pixel-tooltip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  min-width: 176px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #f8fafc;
  font-size: 11.5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.tip-coord {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--sat-accent);
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 3px;
}

.tip-row,
.tip-formula {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.45;
}

.tip-row small {
  color: var(--sat-muted);
}

.tip-formula {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  color: #34d399;
}

.tip-nodata {
  color: #f59e0b;
  font-style: italic;
}

/* Pinned Quick Chips */
.pin-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pin-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
}

.pin-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.muted-note {
  font-size: 12px;
  color: var(--sat-muted);
  margin: 0;
}

/* Pixel Inspector Workspace (#/inspector) */
.inspector-workspace {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--sat-card);
  border: 1px solid var(--sat-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.curve-card {
  background: var(--sat-card);
  border: 1px solid var(--sat-border);
  border-radius: 12px;
  padding: 16px;
}

.spectral-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--sat-muted);
  font-size: 13px;
}

.pins-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.pin-table-card {
  background: var(--sat-card);
  border: 1px solid var(--sat-border);
  border-radius: 12px;
  padding: 12px;
}

.pin-table-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.badge-formula {
  margin-left: auto;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
}

.band-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.band-table th,
.band-table td {
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid var(--sat-border);
}

.band-table th {
  color: var(--sat-muted);
  font-weight: 600;
}

/* Prerendered SEO Landing Section */
.seo-landing {
  max-width: 1120px;
  margin: 28px auto;
  padding: 20px;
  border-top: 1px solid var(--sat-border);
}

.seo-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.seo-faq-card {
  background: var(--sat-card);
  border: 1px solid var(--sat-border);
  border-radius: 10px;
  padding: 14px;
}

.seo-faq-q {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--sat-text);
}

.seo-faq-a {
  font-size: 13px;
  color: var(--sat-muted);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .viewer-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .globe-stage {
    height: 60vh;
    min-height: 400px;
  }
}

.btn-stack-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-stack-row > .btn-sat {
  flex: 1 1 0;
  min-width: 110px;
}

.ovr-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.pinned-terrain-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-size: 11.5px;
}

.btn-link-clear {
  background: transparent;
  border: none;
  color: #fda4af;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.terrain-converter-box {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--sat-border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.converter-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--sat-accent);
}

.zoom-range-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.num-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--sat-border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--sat-text);
  font-size: 12px;
}

.check-pair-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.terrain-plan-warn {
  color: #fbbf24 !important;
}

.tile-opts-3col {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.8fr;
  gap: 6px;
}

.basemap-layer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.basemap-layer-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--sat-border);
}

.basemap-layer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.basemap-layer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--sat-text);
  cursor: pointer;
}

.basemap-layer-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basemap-layer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--sat-muted);
}

.basemap-layer-meta input[type="range"] {
  flex: 1;
}

