:root { --bg:#0b1118; --panel:rgba(10,16,22,.97); --panel-solid:#0a1016; --line:#2c3a48; --text:#f7fafc; --mute:#c5cfd9; --orb:#ffb454; --mil:#ff6b6b; --warn:#ffc857; --hover:#14202b; }
* { box-sizing:border-box; }
html, body { height:100%; margin:0; background:var(--bg); color:var(--text); font:15px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing:antialiased; }
#app { position:absolute; inset:0; }
#map { position:absolute; inset:0; background:var(--bg); transition:filter .4s; }
.offline #map { filter:grayscale(1) brightness(.6); }
.leaflet-container { background:var(--bg); font:inherit; }
.panel { position:absolute; z-index:1000; background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:0 4px 18px rgba(0,0,0,.45); }

/* top bar: name + three numbers */
#top { top:12px; left:56px; padding:12px 18px; display:flex; gap:28px; align-items:center; flex-wrap:wrap; max-width:calc(100% - 440px); }
#top h1 { font-size:17px; margin:0; letter-spacing:.02em; font-weight:700; }
.temp { color:var(--warn); font-size:13px; margin-top:3px; }
.stat b { display:block; font-size:24px; line-height:1.1; font-weight:700; font-variant-numeric:tabular-nums; }
.stat span { color:var(--mute); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.offline #age { color:var(--mil); }
#offline { top:92px; left:56px; padding:10px 14px; color:#ffb3b3; font-weight:600; border-color:var(--mil); max-width:calc(100% - 440px); }

/* detections list */
#side { top:12px; right:12px; width:360px; max-height:calc(100% - 92px); overflow:auto; }
#side h2 { font-size:13px; margin:0; padding:12px 16px; color:var(--mute); font-weight:700; text-transform:uppercase; letter-spacing:.08em; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--panel-solid); z-index:1; }
.row { display:block; width:100%; text-align:left; font:inherit; color:inherit; background:none; border:0; border-bottom:1px solid var(--line); padding:12px 16px 13px; cursor:pointer; }
.row:last-child { border-bottom:0; }
.row:hover, .row:focus-visible { background:var(--hover); outline:none; }
.row:focus-visible { box-shadow:inset 0 0 0 2px var(--orb); }
.row .head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.row .cs { font-size:18px; font-weight:700; letter-spacing:.01em; }
.pill { font-size:12px; font-weight:700; line-height:1; padding:4px 8px; border-radius:999px; background:#26323f; color:#e8eef4; }
.pill.mil { background:#5a1f24; color:#ffc9c9; border:1px solid #a33a40; }
.metrics { display:grid; grid-template-columns:repeat(4, auto); justify-content:space-between; gap:6px 10px; margin:10px 0 8px; }
.m b { display:block; font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.m i { display:block; font-style:normal; color:var(--mute); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; }
.when { display:block; color:var(--mute); font-size:13px; }
.row.closed .cs { color:#dfe7ee; }
.row.closed { background:rgba(255,255,255,.015); }
.empty { padding:16px; color:var(--mute); font-size:15px; }

/* about box */
#foot { bottom:12px; left:12px; max-width:min(560px, calc(100% - 24px)); padding:0; font-size:13px; color:var(--mute); }
#foot summary { cursor:pointer; padding:9px 14px; font-weight:600; color:var(--text); list-style:none; }
#foot summary::-webkit-details-marker { display:none; }
#foot summary::before { content:"i"; display:inline-block; width:18px; height:18px; line-height:18px; text-align:center; margin-right:8px; border:1px solid var(--mute); border-radius:50%; font:italic 700 12px/18px Georgia, serif; }
#foot summary:focus-visible { outline:2px solid var(--orb); outline-offset:-2px; border-radius:12px; }
#foot p { margin:0; padding:0 14px 12px; line-height:1.5; }
#foot[open] summary { border-bottom:1px solid var(--line); margin-bottom:10px; }

/* markers on the map: a dot with a halo, so a detection is visible at any zoom, plus a name tag */
.lbl { background:var(--panel-solid); color:#fff; border:2px solid var(--orb); border-radius:999px; padding:3px 9px; font-size:13px; font-weight:700; line-height:1.15; white-space:nowrap; box-shadow:0 2px 8px rgba(0,0,0,.5); width:max-content; }
.lbl.mil { border-color:var(--mil); }
.leaflet-control-zoom a { width:34px; height:34px; line-height:34px; font-size:20px; }

#ended { position:absolute; inset:0; z-index:2000; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px; background:var(--bg); }
#ended[hidden], [hidden] { display:none !important; }
#ended h1 { font-size:22px; margin:0 0 8px; }
#ended p { color:var(--mute); margin:0; }

@media (max-width:720px) {
  #top { left:56px; right:12px; max-width:none; display:grid; grid-template-columns:repeat(3, auto); justify-content:space-between; gap:8px 10px; padding:10px 14px; }
  #top .title { grid-column:1 / -1; }
  #top h1 { font-size:16px; }
  .stat b { font-size:20px; }
  .stat span { font-size:10.5px; letter-spacing:.03em; white-space:nowrap; }
  #offline { left:12px; right:12px; top:auto; bottom:calc(36% + 40px); max-width:none; }
  #side { top:auto; bottom:30px; left:12px; right:12px; width:auto; max-height:36%; }
  .row { padding:10px 14px 11px; }
  .row .cs { font-size:17px; }
  #foot { bottom:calc(36% + 42px); left:12px; max-width:calc(100% - 24px); }
  .offline #foot { display:none; }
}
