:root {
  --bg: #0B1220; --bar: #0E1626; --panel: #121B2B; --line: #22314A; --line2: #1B2840; --field: #2A3B57;
  --text: #E6EDF5; --text2: #C9D4E3; --muted: #9AA9BE; --dim: #6F83A0;
  --incident: #F2A93B; --enforcement: #FF7B72; --funding: #5AA9FF; --policy: #B69CFF; --vendor: #4FD1C5;
  --ok: #8FE3B0; --okline: #2C5B41; --warn: #F2C27B; --warnline: #5A4220;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'IBM Plex Sans', system-ui, sans-serif; }
a { color: #7DBBFF; } a:hover { color: #B3D7FF; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

header.top { border-bottom: 1px solid var(--line); background: var(--bar); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 16px 32px; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 600; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.updated { font-size: 12px; color: var(--muted); }

input, select, textarea { background: var(--panel); border: 1px solid var(--field); border-radius: 6px; color: var(--text); font: 14px 'IBM Plex Sans', sans-serif; }
input, select { height: 40px; padding: 0 12px; }
textarea { padding: 8px 10px; width: 100%; min-height: 60px; resize: vertical; }

main.wrap { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--field); background: transparent; color: var(--text2); font: 500 14px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--funding); background: #16304F; color: var(--text); }
.spacer { flex: 1 1 24px; }
.filters label { font-size: 13px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.kpi .label { font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.kpi .value { font-family: 'IBM Plex Mono', monospace; font-size: 32px; font-weight: 500; margin: 6px 0; }
.kpi .sub { font-size: 13px; color: var(--muted); }

.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main-col { flex: 999 1 560px; min-width: 0; }
.side-col { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.panel > .head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 600; }
.panel .hint { font-size: 12px; color: var(--muted); }
.empty { padding: 20px; color: var(--muted); font-size: 14px; }

#map { height: 440px; border-radius: 0 0 8px 8px; background: #0E1828; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.list-item { padding: 14px 20px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 6px; }
.list-item:last-child { border-bottom: none; }
.meta { font-size: 12px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.tagline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.conf { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid; }
.conf.Confirmed { color: var(--ok); border-color: var(--okline); }
.conf.Unconfirmed { color: var(--warn); border-color: var(--warnline); }
.item-title { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.4; }
.item-title a { color: var(--text); text-decoration: none; } .item-title a:hover { text-decoration: underline; }
.summary { font-size: 14px; color: var(--text2); line-height: 1.5; margin: 0; }
.note { font-size: 14px; color: var(--text2); line-height: 1.5; margin: 0; }
.note b { color: var(--text); }

.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stage .bar { height: 4px; border-radius: 2px; background: var(--line); }
.stage.on .bar { background: var(--enforcement); }
.stage .lbl { font-size: 11px; color: #7F90A8; margin-top: 4px; }
.stage.on .lbl { color: #FFC2BD; }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--field); color: var(--text2); }

/* D-ATIS */
.shape { display: inline-block; width: 12px; height: 12px; }
.shape.tri { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--enforcement); }
.shape.sq { background: var(--vendor); border-radius: 2px; }
.shape.dia { background: var(--incident); transform: rotate(45deg) scale(.8); }
.atis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.atis-item { padding: 14px 20px; border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); display: flex; flex-direction: column; gap: 6px; }
.atis-text { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text); line-height: 1.5; }
.st { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid; }
.st.unauthorized { color: #FFB3AD; border-color: #6B2A26; }
.st.authorized { color: #9FEADF; border-color: #1F5A53; }
.st.unclear { color: var(--warn); border-color: var(--warnline); }
.live { font-size: 11px; font-weight: 600; color: var(--ok); }
.atis-icon div { width: 0; height: 0; }

.cta { background: #10233D; border: 1px solid #24476F; border-radius: 8px; padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta h2 { margin: 0 0 6px; font-size: 18px; }
.cta p { margin: 0; font-size: 14px; color: var(--text2); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 6px; background: var(--funding); color: var(--bg); font-weight: 600; font-size: 14px; text-decoration: none; border: none; cursor: pointer; }
.btn:hover { color: var(--bg); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--field); }
.btn.ghost:hover { color: var(--text); background: #16213A; }
footer.foot { font-size: 12px; color: var(--muted); line-height: 1.6; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg); color: var(--text); border: 1px solid var(--field); }
.leaflet-popup-content { font: 13px/1.45 'IBM Plex Sans', sans-serif; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } #map { height: 320px; } }
