.explorer-body {
  overflow: hidden;
  background: #02050c;
}

.explorer-shell {
  height: calc(100vh - 83px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: minmax(0, 1fr) auto;
}

.viewport-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(16, 39, 78, 0.28), rgba(1, 4, 10, 0.96) 66%);
}

#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-overlay {
  position: absolute;
  left: 1rem;
  top: 1rem;
  max-width: min(610px, calc(100% - 2rem));
  pointer-events: none;
}

.scene-overlay h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  letter-spacing: 0.02em;
}

.scene-overlay p {
  margin: 0;
  color: #aebbd0;
  font-size: 0.88rem;
}

.frame-badge {
  display: inline-flex;
  margin-bottom: 0.65rem;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(121, 227, 255, 0.4);
  border-radius: 999px;
  background: rgba(2, 12, 24, 0.7);
  color: #9deaff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-panel {
  min-width: 0;
  overflow-y: auto;
  padding: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(3, 8, 18, 0.96);
}

.control-panel h2,
.control-panel h3 {
  margin: 0;
}

.panel-section {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  background: rgba(10, 20, 40, 0.42);
}

.panel-section h3 {
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.55rem 0;
  color: #cbd5e1;
  font-size: 0.88rem;
}

.control-row input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  accent-color: #60a5fa;
}

.field-label {
  margin-bottom: 0.35rem;
  color: #aebbd0;
  font-size: 0.78rem;
}

.control-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.55rem;
  background: #07101f;
  color: #f8fafc;
  font: inherit;
}

.control-select:disabled,
.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.control-button {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.control-button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
}

.control-button.primary {
  border-color: #2563eb;
  background: #2563eb;
}

.control-button.primary:not(:disabled):hover {
  background: #3b82f6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.metric {
  padding: 0.65rem;
  border-radius: 0.65rem;
  background: rgba(2, 8, 20, 0.7);
}

.metric strong {
  display: block;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
}

.metric span {
  display: block;
  margin-top: 0.15rem;
  color: #8fa0b8;
  font-size: 0.72rem;
}

.data-status {
  margin: 0.55rem 0 0;
  color: #9fb0c8;
  font-size: 0.82rem;
}

.data-status.ready {
  color: #86efac;
}

.data-status.pending {
  color: #fcd34d;
}

.family-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.7rem;
  margin-top: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #aebbd0;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.legend-item i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--legend-color);
  box-shadow: 0 0 8px var(--legend-color);
}

.zone-list {
  display: grid;
  gap: 0.48rem;
}

.zone-list span {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  color: #aebbd0;
  font-size: 0.8rem;
}

.zone-list strong {
  color: #f8fafc;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
}

.zone-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
}

.zone-dot.earth { background: #60a5fa; }
.zone-dot.moon { background: #f8fafc; }
.zone-dot.cislunar { background: #22d3ee; }

.timeline-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 74px;
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(3, 8, 18, 0.98);
}

.timeline-panel input[type='range'] {
  width: 100%;
  accent-color: #60a5fa;
}

.timeline-panel input:disabled {
  opacity: 0.45;
}

.timeline-label {
  min-width: 188px;
  color: #cbd5e1;
  font-size: 0.82rem;
  text-align: right;
}

.play-button {
  min-width: 88px;
  margin: 0;
}

@media (max-width: 900px) {
  .explorer-body {
    overflow: auto;
  }

  .explorer-shell {
    height: auto;
    min-height: calc(100vh - 83px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(62vh, 1fr) auto auto;
  }

  .control-panel {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .timeline-panel {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .timeline-panel {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .timeline-label {
    min-width: 0;
    text-align: left;
  }

  .metric-grid,
  .family-legend {
    grid-template-columns: 1fr 1fr;
  }
}
