:root {
  /* Palette: dark teal "night chart" ink */
  --ink: #0a1416;      /* page behind the map */
  --surface: #0f1d20;  /* panel and detail card */
  --well: #0a1517;     /* inset areas: search field, result list */
  --rule: #22393b;     /* dividers and card outlines */
  --edge: #557775;     /* outlines of controls you can use (3:1 on --surface) */
  --paper: #e2ebe8;    /* main text */
  --dim: #94aba7;      /* secondary text */
  --signal: #45c8f0;   /* links, selection */
  --sky: #ffd84d;      /* aircraft */
  --water: #5fd38d;    /* ships */
  --ok: #5fd38d;
  --warn: #ffc857;
  --bad: #ff6b6b;
  --focus: #ffd84d;

  /* Two radii, plus 50% for true circles */
  --r-box: 6px;        /* panel and detail card */
  --r-tight: 2px;      /* everything inside them */

  /* Old token names. The landing site's styles.css and the MapLibre overrides below still read them. */
  --bg: var(--ink);
  --panel: var(--surface);
  --line: var(--rule);
  --text: var(--paper);
  --muted: var(--dim);
  --accent: var(--signal);
  --air: var(--sky);
  --sea: var(--water);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--font-sans), system-ui, sans-serif; }
a { color: var(--signal); }
button { font: inherit; color: inherit; }
:where(a, button, input, summary, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.stage { position: relative; flex: 1; min-height: 0; }

/* Outage banner (tracker, and the home page via status.js). In the page flow, so it pushes the map down rather than covering it. */
.status-banner { position: relative; z-index: 5; display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; background: #2b2410; border-bottom: 1px solid var(--warn); color: var(--paper); font-size: 13px; line-height: 1.45; max-height: 40vh; overflow: auto; }
.status-banner[hidden] { display: none; }
.status-banner .sb-text { flex: 1; min-width: 0; max-width: 1080px; margin: 0 auto; }
.status-banner p { margin: 0; }
.status-banner .sb-title { font-weight: 700; color: var(--warn); }
.status-banner ul { margin: 4px 0; padding-left: 20px; }
.status-banner .sb-close { flex: none; font-size: 20px; }
.map { position: absolute !important; inset: 0; width: 100%; height: 100%; }

.panel, .detail {
  position: absolute; z-index: 2; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-box); box-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.panel { top: 12px; left: 12px; width: 320px; max-height: calc(100% - 64px); overflow: auto; padding: 14px; }
.panel.collapsed { width: auto; }
.brand { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 700; }
.brand p { margin: 2px 0 0; color: var(--dim); font-size: 12px; }
.ghost { background: transparent; border: 1px solid var(--edge); border-radius: var(--r-tight); width: 28px; height: 28px; cursor: pointer; line-height: 1; }
.ghost:hover { background: var(--rule); }

.search { position: relative; margin-top: 12px; }
.search input { width: 100%; padding: 8px 10px; border-radius: var(--r-tight); border: 1px solid var(--edge); background: var(--well); color: var(--paper); font: 13px var(--font-sans); }
.search input:focus { border-color: var(--signal); }
.results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--rule); border-radius: var(--r-tight); background: var(--well); }
.results button { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 6px; border-radius: var(--r-tight); cursor: pointer; }
.results button:hover { background: var(--rule); }
.results .dot { grid-row: span 2; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.dot.air { background: var(--sky); } .dot.sea { background: var(--water); }
.rl { font: 600 13px var(--font-mono); } .rs { font-size: 11px; color: var(--dim); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { border: 1px solid var(--rule); border-radius: var(--r-tight); padding: 10px; display: flex; flex-direction: column; }
.stat:first-child .num { color: var(--sky); } .stat:last-child .num { color: var(--water); }
.stat.off { opacity: .4; }
.num { font: 600 24px var(--font-mono); }
.lbl { font-size: 11px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.spin { width: 9px; height: 9px; border: 1.5px solid var(--dim); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 12px; font-size: 13px; }
.toggles label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggles input { accent-color: var(--signal); }

.legend { margin-top: 12px; font-size: 12px; border-top: 1px solid var(--rule); padding-top: 10px; }
.legend summary { cursor: pointer; color: var(--dim); }
.legend-grid { margin-top: 8px; }
.ramp { display: block; height: 8px; border-radius: var(--r-tight); background: linear-gradient(90deg, #ff9e3d, #ffd84d 25%, #8be37c 50%, #45c8f0 75%, #b38cff); }
.ramp-lbl { display: flex; justify-content: space-between; font: 11px var(--font-mono); color: var(--dim); margin-top: 4px; }
.ramp-lbl em { font-style: normal; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 8px; }
.swatches span { display: flex; align-items: center; gap: 6px; }
.swatches i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.swatches i.sq { border-radius: var(--r-tight); }

.sources { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 10px; font-size: 12px; display: grid; gap: 4px; }
.src { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.src .cnt { font-family: var(--font-mono); color: var(--dim); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led { width: 8px; height: 8px; border-radius: 50%; }
.led.ok { background: var(--ok); } .led.warn { background: var(--warn); } .led.bad { background: var(--bad); }
.srcnote { grid-column: 2 / -1; color: var(--dim); font-size: 11px; line-height: 1.35; margin: -2px 0 3px; }
.hint { margin: 6px 0 0; color: var(--dim); line-height: 1.45; font-size: 12px; }
code { font-family: var(--font-mono); font-size: 11px; background: var(--well); padding: 1px 4px; border-radius: var(--r-tight); }

.detail { top: 12px; right: 12px; width: 300px; padding: 16px; }
.close { position: absolute; top: 10px; right: 10px; font-size: 20px; }
.dtitle h2 { margin: 8px 0 2px; font: 700 24px var(--font-mono); padding-right: 30px; word-break: break-word; }
.dtitle p { margin: 0; color: var(--dim); font-size: 12px; }
.tag { font: 600 11px var(--font-mono); letter-spacing: .08em; /* spaced out because it is all capitals */ border: 1px solid; border-radius: var(--r-tight); padding: 2px 6px; }
.tag.air { color: var(--sky); border-color: var(--sky); }
.alert { margin-top: 10px; background: #2e1717; border: 1px solid var(--bad); color: #ffc9c2; border-radius: var(--r-tight); padding: 8px 10px; font-size: 12px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 13px; }
dt { color: var(--dim); } dd { margin: 0; font-family: var(--font-mono); text-align: right; }
.links { display: flex; gap: 12px; margin-top: 14px; font-size: 12px; flex-wrap: wrap; }
.prog { font: 11px var(--font-mono); font-style: normal; color: var(--dim); }

.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(11,15,20,.75) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: #b9c3cf; }
.maplibregl-ctrl-scale { background: rgba(11,15,20,.6); color: var(--muted); border-color: var(--muted); }

@media (max-width: 700px) {
  .panel { width: calc(100% - 24px); max-height: 46%; }
  .detail { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 45%; overflow: auto; }
}
