:root {
  --bg: #0e1116;
  --panel: #171b22;
  --text: #e6e6e6;
  --muted: #8a94a3;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --red: #e74c3c;
  --grey: #566072;
  --border: #262b34;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0 16px 32px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.app-header h1 { font-size: 18px; margin: 0; }

.app-nav { display: flex; gap: 8px; }
.app-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.app-nav a.active { color: var(--text); background: var(--panel); border-color: var(--muted); }

.source-error { color: var(--red); font-size: 13px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel-title { margin: 0 0 12px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px 20px;
}

.nav-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-grid > div > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-grid .label { font-size: 11px; color: var(--muted); }

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  width: fit-content;
}
.status-pill.grey { background: var(--grey); }
.status-pill.green { background: var(--green); color: #06210f; }
.status-pill.yellow { background: var(--yellow); color: #2b2400; }
.status-pill.red { background: var(--red); }

.rf-blocks { display: flex; gap: 16px; flex-wrap: wrap; }

.rf-block-card {
  flex: 1 1 260px;
  background: #10141a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}

.rf-block-card h3 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }

.bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 6px 0; }
.bar-row .bar-label { width: 90px; color: var(--muted); }
.bar-track { flex: 1; height: 8px; background: #232935; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); }
.bar-value { width: 46px; text-align: right; }

.spectrum-plots { display: flex; gap: 16px; flex-wrap: wrap; }
.spectrum-plot-wrap { flex: 1 1 420px; }
.spectrum-plot-wrap canvas { width: 100%; height: 200px; background: #10141a; border: 1px solid var(--border); border-radius: 6px; }
.spectrum-plot-wrap .caption { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; }

.waterfall-canvas { width: 100%; height: 300px; margin-top: 10px; background: #10141a; border: 1px solid var(--border); border-radius: 6px; image-rendering: pixelated; }

/* Vertical split used by the Position & Time page: time info left, map right. */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.split-grid .panel { margin-bottom: 0; }

.timedelta-plot-wrap { margin-top: 14px; }
.timedelta-plot-wrap canvas { width: 100%; height: 120px; background: #10141a; border: 1px solid var(--border); border-radius: 6px; }
.timedelta-plot-wrap .caption { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; }

#map { height: 70vh; min-height: 420px; border-radius: 6px; }
.map-stats { display: flex; gap: 24px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.map-stats strong { color: var(--text); }

.ref-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ref-form label { display: flex; align-items: center; gap: 6px; }
.ref-form input {
  width: 130px;
  background: #10141a;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 6px;
}
.ref-form button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
}
.ref-form button:hover { border-color: var(--muted); }
.ref-hint { font-style: italic; }

