:root {
  --paper: #f2efe4;
  --paper-strong: #fffaf0;
  --ink: #17324d;
  --ink-soft: #5b7188;
  --ocean: #0f4c5c;
  --ocean-deep: #0a2f39;
  --sky: #b8dce7;
  --satellite: #ff7a59;
  --ground: #2a9d8f;
  --link: rgba(245, 176, 65, 0.55);
  --panel-shadow: 0 18px 48px rgba(16, 36, 52, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(140deg, #dce6eb 0%, #f2efe4 45%, #e8f0ec 100%);
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
}

.status-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: end;
}

.status-pill,
.time-readout {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--panel-shadow);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 380px);
  gap: 20px;
}

.globe-panel,
.card {
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--panel-shadow);
  border: 1px solid rgba(23, 50, 77, 0.08);
}

.globe-panel {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 92, 109, 0.92) 0%, rgba(10, 47, 57, 0.96) 100%);
}

#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#globe-canvas.dragging {
  cursor: grabbing;
}

.canvas-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.legend {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.84);
  color: var(--ink);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.satellite-dot {
  background: var(--satellite);
}

.ground-dot {
  background: var(--ground);
}

.link-dot {
  background: rgba(245, 176, 65, 0.9);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  padding: 18px 18px 20px;
}

.controls-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

button,
select,
input {
  font: inherit;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-button {
  background: var(--ink);
  color: var(--paper-strong);
  flex: 1;
}

.secondary-button {
  background: rgba(23, 50, 77, 0.08);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.slider-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

#frame-slider {
  width: 100%;
}

.limit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.limit-row input {
  width: 112px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(23, 50, 77, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.inline-hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}

.range-meta label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-top: 16px;
  font-size: 0.94rem;
}

.snapshot-select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(23, 50, 77, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.snapshot-meta {
  margin-top: 12px;
  line-height: 1.5;
}

.stats-grid,
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  margin: 16px 0 0;
}

.stats-grid div,
.details-grid div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(23, 50, 77, 0.05);
}

dt {
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

dd {
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
}

.muted-copy {
  margin-top: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.hidden {
  display: none;
}

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

  .globe-panel {
    min-height: 58vh;
  }

  .status-block {
    align-items: start;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .controls-row,
  .toggle-grid,
  .stats-grid,
  .details-grid,
  .range-meta,
  .limit-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .legend {
    right: 16px;
    left: 16px;
    bottom: 16px;
  }
}
