/* teststarlink /stats — dark analysis page. Palette: reference data-viz palette (dark steps),
   validated on this surface: series-1 blue #3987e5 (Starlink), series-2 orange #d95926 (not Starlink). */
:root {
  color-scheme: dark;
  --bg: #0b0f17; --surface: #0f1624; --surface-2: #141d2e; --line: #22304a;
  --text: #e6ecf5; --text-2: #aab6c8; --muted: #7c8aa3;
  --s1: #3987e5; --s2: #d95926; --grid: #1c2740; --accent: #5ac8fa;
  --seq-1: #cde2fb; --seq-3: #6da7ec; --seq-5: #256abf; --seq-7: #0d366b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 20px; background: rgba(11,15,23,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.brand a, .brand a:hover, .brand a:visited { color: inherit; text-decoration: none; }
.brand a:hover span { color: #8fd8ff; }
.brand span { color: var(--accent); }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--text-2); border: 0; padding: 6px 11px; cursor: pointer; font: inherit; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--surface-2); color: var(--text); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }
.link { color: var(--accent); text-decoration: none; }
main { padding: 16px 20px 40px; max-width: 1400px; margin: 0 auto; display: grid; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 650; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px; margin: 0; min-width: 0; }
figcaption, .cap { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.card p { margin: 6px 0 0; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg text { fill: var(--text-2); font-size: 11px; font-family: inherit; }
svg .axis line, svg .grid line { stroke: var(--grid); stroke-width: 1; }
svg .axis path { stroke: var(--grid); fill: none; }
svg .lab { fill: var(--text-2); }
svg .lab.strong { fill: var(--text); font-weight: 600; }
.legend { display: flex; gap: 14px; margin: 4px 0 8px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .bar { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); vertical-align: middle; margin-right: 6px; }
td .bar.s2 { background: var(--s2); }
.tip { position: fixed; z-index: 20; pointer-events: none; background: #060a12; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; max-width: 320px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.tip b { color: var(--text); }
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.gate-card { width: min(420px, 90vw); }
.gate h1 { margin: 0 0 6px; font-size: 22px; }
#keyform { display: flex; gap: 8px; margin-top: 10px; }
#keyform input { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
#keyform button, .btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
#map svg { width: 100%; height: auto; display: block; background: #0a1220; border-radius: 8px; }
