:root {
  --bg: #0e1116;
  --bg-2: #161b22;
  --bg-3: #1c2330;
  --line: #2b3544;
  --text: #e7ecf3;
  --muted: #8b97a8;
  --accent: #3dd6c6;
  --warn: #f0b429;
  --danger: #f07178;
  --primary: #5b8def;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: #24345a; border-color: var(--primary); }
button.accent { background: #143d38; border-color: var(--accent); }
input, select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 16px; margin: 0; letter-spacing: 0.04em; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--bg-3);
}
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); }
.pill.ok { color: var(--accent); border-color: var(--accent); }
.pill.bad { color: var(--danger); border-color: var(--danger); }
.pill.muted { color: var(--muted); }
.planet-pick { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.planet-pick select { min-width: 260px; }
.tile-meta { color: var(--muted); font-variant-numeric: tabular-nums; }
.actions { margin-left: auto; display: flex; gap: 8px; }

.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.login-card h1 { margin: 0 0 8px; font-size: 18px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; color: var(--muted); }
.login-card button { width: 100%; }
.login-card a { color: var(--accent); }

.banner {
  padding: 8px 16px;
  background: #3a2e12;
  color: var(--warn);
  border-bottom: 1px solid #6a5420;
}
.banner.hidden, .hidden { display: none !important; }

main {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 62vh;
}
.globe-wrap { position: relative; background: #07090c; min-height: 520px; }
#globe { position: absolute; inset: 0; }
.inspect {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(14, 17, 22, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 200px;
  pointer-events: none;
}
.busy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 12, 0.55);
  gap: 12px;
}
.busy span {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.side {
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  overflow: auto;
  max-height: 70vh;
  padding: 12px 14px 24px;
}
.side-block { margin-bottom: 18px; }
.side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.ore-row {
  display: grid;
  grid-template-columns: 18px 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.ore-row:hover, .ore-row.active { background: var(--bg-3); }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.cfg label { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 12px; }
.cfg input[type="range"] { width: 140px; }
.cfg input[type="number"] { width: 78px; }

.charts {
  border-top: 1px solid var(--line);
  padding: 16px 18px 32px;
  background: var(--bg);
}
.charts h2 { margin: 0 0 10px; font-size: 14px; }
.chart-summary { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); margin-bottom: 12px; }
.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chart-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; height: 240px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
  .side { max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .chart-grid { grid-template-columns: 1fr; }
}
