:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page-plane: #05060a;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --border: rgba(11, 11, 11, 0.14);
  --accent: #4a6fa5;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #17181c;
    --text-primary: #e8e8e6;
    --text-secondary: #a9a8a3;
    --text-muted: #7b7a76;
    --border: rgba(255, 255, 255, 0.14);
    --accent: #7fa6e6;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #05060a;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--text-primary);
  overflow: hidden;
}

#scene {
  position: fixed;
  inset: 0;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 330px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 14px;
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  color: var(--text-secondary);
}

.row-label {
  color: var(--text-muted);
}

#hud-header {
  align-items: center;
  gap: 8px;
}

#hud-header .row-label {
  flex: none;
}

#mode-text {
  flex: auto;
}

#hud-toggle {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

#hud-toggle:hover {
  background: var(--border);
}

#hud.collapsed {
  width: auto;
}

#hud.collapsed #hud-body {
  display: none;
}

.section-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 8px;
}

.tiles {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.tiles-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tiles-2 {
  grid-template-columns: repeat(2, 1fr);
}

.tile .label {
  color: var(--text-muted);
}

.tile .value {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tile .value .unit {
  color: var(--text-muted);
  margin-left: 2px;
}

.chart-label {
  color: var(--text-muted);
  margin-bottom: 2px;
}

canvas.chart {
  display: block;
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.orbit-summary {
  color: var(--text-muted);
  margin: 0 0 10px;
}

.control-row {
  margin: 10px 0;
}

.control-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.control-label span:last-child {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border: 1px solid var(--border);
  transition: background 0.15s ease;
}

.toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

#kick-btn {
  width: 100%;
  padding: 6px 0;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

#kick-btn:hover {
  background: var(--border);
}
