:root {
    --bg: #0a0e0a; --panel: #101510; --border: #1f2b1f;
    --text: #c8e6c9; --dim: #6b8f6b; --accent: #00e676;
    --extreme: #ff3b30; --severe: #ff9500; --moderate: #ffd60a; --minor: #8e8e93;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'SF Mono', Menlo, Consolas, monospace; display: flex; flex-direction: column; }
header { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--border); }
h1 { font-size: 1.05rem; color: var(--accent); letter-spacing: 2px; }
.cursor { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#status { color: var(--dim); font-size: 0.75rem; }
main { flex: 1; display: grid; grid-template-columns: minmax(320px, 34%) 1fr; min-height: 0; }
#wire-panel { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
#map-panel { display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; justify-content: space-between; padding: 6px 12px; color: var(--dim); font-size: 0.72rem; border-bottom: 1px solid var(--border); background: var(--panel); }
#wire { overflow-y: auto; flex: 1; }
#map { flex: 1; background: #000; }
.wire-item { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.wire-item.fresh { animation: pulsebg 2.5s ease-out 1; }
@keyframes pulsebg { 0% { background: rgba(0, 230, 118, 0.25); } 100% { background: transparent; } }
.wire-item .meta { color: var(--dim); font-size: 0.68rem; display: block; margin-bottom: 2px; }
.wire-item a { color: var(--text); text-decoration: none; }
.wire-item a:hover { color: var(--accent); }
.tag { border: 1px solid var(--border); padding: 0 4px; margin-right: 6px; text-transform: uppercase; }
.tag.gov { color: #64b5f6; }
.tag.news { color: var(--accent); }
.tag.research { color: #ce93d8; }
.tag.vendor { color: var(--severe); }
#map-toggles label { margin-left: 10px; cursor: pointer; }
.status { padding: 24px; color: var(--dim); }
.login-form { margin-top: 12px; }
.login-form button { background: none; border: 1px solid var(--accent); color: var(--accent); font: inherit; padding: 8px 14px; cursor: pointer; }
.login-form button:hover { background: rgba(0, 230, 118, 0.1); }
.pulse { animation: pulseop 1.8s ease-out 3; }
@keyframes pulseop { 0% { opacity: 1; } 50% { opacity: 0.35; } 100% { opacity: 1; } }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
/* OSM tiles are light-themed; invert+rotate gives a dark basemap without a keyed provider */
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.7) contrast(1.1) saturate(0.5); }
.popup-title { font-weight: bold; margin-bottom: 4px; }
.popup-meta { color: var(--dim); font-size: 0.7rem; }
.popup-link a { color: var(--accent); }
@media (max-width: 860px) {
    main { grid-template-columns: 1fr; grid-template-rows: 45% 55%; }
    #wire-panel { border-right: none; border-bottom: 1px solid var(--border); }
}
