:root {
  --bg: #0a0e16;
  --panel: rgba(14, 20, 32, 0.92);
  --line: #1f2a3d;
  --txt: #d7e0ee;
  --dim: #7f8da2;
  --accent: #4ea1ff;
  --good: #3ad07a;
  --warn: #ffb14e;
  --bad: #ff5d5d;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
  font: 13px/1.45 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif; overflow: hidden; }

#cesiumContainer { position: absolute; inset: 0; }

/* hide a few default Cesium chrome bits we don't need */
.cesium-viewer-toolbar, .cesium-viewer-fullscreenContainer { top: 52px; }

/* ---- top bar ---- */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 10;
  display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(8,12,20,.96), rgba(8,12,20,.78));
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.brand { font-weight: 700; letter-spacing: .3px; font-size: 15px; }
.brand .dim { color: var(--dim); font-weight: 500; }
.ctl { color: var(--dim); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ctl.status { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }
select, button { background: #131c2c; color: var(--txt); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px; font: inherit; cursor: pointer; }
select:hover, button:hover { border-color: var(--accent); }
.time button { padding: 3px 7px; }
.time button.active { background: var(--accent); color: #04101f; border-color: var(--accent); font-weight: 700; }
.toggle input { accent-color: var(--accent); }

/* ---- side panel ---- */
#panel {
  position: absolute; top: 60px; right: 12px; width: 320px; max-height: calc(100% - 96px);
  overflow-y: auto; z-index: 10; padding: 14px 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
#panel.hidden, #loader.hidden { display: none; }
#panelClose { position: absolute; top: 8px; right: 8px; border: none; background: none;
  color: var(--dim); font-size: 20px; line-height: 1; padding: 2px 6px; }
#satName { margin: 2px 30px 10px 0; font-size: 16px; color: #fff; word-break: break-word; }
#satInfo { width: 100%; border-collapse: collapse; }
#satInfo th { text-align: left; color: var(--dim); font-weight: 500; padding: 3px 0; width: 44%; }
#satInfo td { text-align: right; font-variant-numeric: tabular-nums; padding: 3px 0; }

#fuzzyPanel { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
#fuzzyPanel h3 { margin: 0 0 6px; font-size: 13px; }
.badge { background: var(--warn); color: #2a1c00; border-radius: 4px; font-size: 10px;
  padding: 1px 5px; vertical-align: middle; margin-left: 4px; }
.note { color: var(--dim); font-size: 11.5px; margin: 0 0 8px; }
#fuzzyTable { width: 100%; border-collapse: collapse; }
#fuzzyTable th { color: var(--dim); font-weight: 500; text-align: left; padding: 2px 0; }
#fuzzyTable td { padding: 3px 0; font-variant-numeric: tabular-nums; }
#fuzzyTable td:nth-child(2), #fuzzyTable th:nth-child(2),
#fuzzyTable td:nth-child(3), #fuzzyTable th:nth-child(3) { text-align: right; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.fused { margin-top: 8px; color: var(--txt); font-size: 12px; }

/* ---- legend / footer ---- */
#legend { position: absolute; bottom: 0; left: 0; right: 0; z-index: 9; padding: 6px 14px;
  font-size: 11px; color: var(--dim); background: linear-gradient(0deg, rgba(8,12,20,.92), transparent);
  text-align: center; }
#legend a { color: var(--accent); text-decoration: none; }
#legend .dim { opacity: .7; }

/* ---- loader ---- */
#loader { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; background: rgba(6,9,16,.6); }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  #topbar { gap: 10px; overflow-x: auto; }
  #panel { width: calc(100% - 24px); right: 12px; }
}
