:root {
  --bg: #030711;
  --panel: rgba(9, 18, 32, 0.88);
  --panel-strong: rgba(13, 27, 47, 0.94);
  --border: rgba(142, 202, 255, 0.16);
  --text: #eef7ff;
  --muted: #a7bad6;
  --accent: #54d8ff;
  --accent-2: #7ee787;
  --warning: #ffcf5a;
  --danger: #ff7d9d;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 18% 50%, rgba(44, 112, 186, 0.18), transparent 32%), #030711;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.magnetosphere-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  background:
    radial-gradient(circle at 35% 45%, rgba(84, 216, 255, 0.08), transparent 26%),
    linear-gradient(120deg, rgba(2, 6, 15, 0.2), rgba(6, 13, 26, 0.9));
}

.viewer-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

#cesiumContainer {
  position: absolute;
  inset: 0;
  background: #02050c;
}

.info-panel {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(4, 10, 20, 0.82), rgba(7, 15, 29, 0.94));
  box-shadow: -18px 0 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.panel-header,
.panel-block {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
}

.panel-header h1,
.panel-block h2 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

.panel-header h1 { font-size: clamp(1.55rem, 2vw, 2.2rem); }
.panel-block h2 { font-size: 1rem; color: #ffffff; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 10px;
}

.note {
  color: #d8e8ff;
  background: rgba(84, 216, 255, 0.08);
  border: 1px solid rgba(84, 216, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

button {
  width: 100%;
  border: 1px solid rgba(84, 216, 255, 0.26);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(84, 216, 255, 0.11);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

button:hover,
button:focus {
  background: rgba(84, 216, 255, 0.2);
  border-color: rgba(84, 216, 255, 0.52);
  transform: translateY(-1px);
}

.legend {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot,
.legend-line {
  flex: 0 0 auto;
  display: inline-block;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 16px currentColor;
}

.legend-dot.earth { color: #4aa3ff; background: #4aa3ff; }
.legend-dot.solar { color: var(--warning); background: var(--warning); }
.legend-dot.captured { color: #c8fbff; background: #c8fbff; }
.legend-dot.deflected { color: #ffd36c; background: #ffd36c; }

.legend-line {
  width: 28px;
  height: 2px;
  border-radius: 99px;
  background: #80ecff;
  box-shadow: 0 0 14px rgba(128, 236, 255, 0.8);
}

.status-pill,
.webgl-fallback {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 999px;
  border: 1px solid rgba(84, 216, 255, 0.22);
  background: rgba(5, 12, 24, 0.78);
  color: #dff6ff;
  padding: 9px 13px;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
}

.webgl-fallback {
  border-radius: 14px;
  color: #fff;
  background: rgba(120, 35, 55, 0.86);
}

.cesium-viewer,
.cesium-viewer-cesiumWidgetContainer,
.cesium-widget,
.cesium-widget canvas {
  width: 100%;
  height: 100%;
}

.cesium-widget-credits,
.cesium-viewer-bottom { display: none !important; }

@media (max-width: 980px) {
  html, body { overflow: auto; }
  .magnetosphere-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
  }
  .viewer-panel {
    min-height: 68vh;
  }
  .info-panel {
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 560px) {
  .info-panel { padding: 12px; }
  .panel-header,
  .panel-block { border-radius: 14px; padding: 14px; }
  .viewer-panel { min-height: 62vh; }
}