/* Shared by index.html (flat, Leaflet) and globe.html (MapLibre). */
:root {
  --live: #1a9850; --late: #f39c12; --silent: #d73027; --feed_outage: #8e44ad; --retired: #8c8c8c; --unknown: #c8c8c8;
  --bg: #ffffff; --fg: #1d1d1f; --muted: #6e6e73; --panel: rgba(255,255,255,.95); --line: #d2d2d7; --link: #0a66c2;
  --warn-bg: #fdecea; --warn-fg: #a4161a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1c1e; --fg: #f5f5f7; --muted: #a1a1a6; --panel: rgba(28,28,30,.95); --line: #3a3a3c; --link: #6cb6ff;
    --warn-bg: #3b1d1d; --warn-fg: #ffb4ab; }
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
#map { position: absolute; inset: 0; }

/* Info panel and legend share one left-hand column so they stack and never overlap. Clicks on
   the gap between them fall through to the map. */
#side { position: absolute; z-index: 1000; top: 10px; bottom: 24px; left: 10px;
  width: min(440px, calc(100vw - 20px)); display: flex; flex-direction: column; gap: 10px;
  pointer-events: none; }
.panel { pointer-events: auto; background: var(--panel); color: var(--fg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
#info { flex: 0 1 auto; min-height: 0; overflow: auto; }
#info h1 { font-size: 16px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
#info h1 .logo { width: 24px; height: 24px; flex: none; }
.views { font-size: 12.5px; margin-bottom: 6px; color: var(--muted); }
.views b { color: var(--fg); }
.notice { background: var(--warn-bg); color: var(--warn-fg); border-radius: 6px; padding: 6px 8px;
  font-size: 12.5px; margin-bottom: 6px; }
.meta { color: var(--muted); font-size: 12px; }
.updated { font-size: 13px; margin-bottom: 2px; }
.stale { color: var(--silent); font-weight: 600; }
details { margin-top: 6px; font-size: 12.5px; }
summary { cursor: pointer; color: var(--link); }
details dl { margin: 6px 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; }
details dt { font-weight: 600; white-space: nowrap; }
details dd { margin: 0; }
details ul { margin: 4px 0; padding-left: 18px; }
details li { margin-bottom: 5px; }
.licence { color: var(--muted); }
#legend { flex: none; margin-top: auto; align-self: flex-start; font-size: 13px; }
#legend summary { color: var(--fg); font-weight: 600; }
#legend label { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 1px 0; }
#legend .sw { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.4); flex: none; }
#legend .sq { border-radius: 2px; transform: rotate(45deg); width: 10px; height: 10px; }
#legend hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
#legend .n { color: var(--muted); margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
#legend .key { font-size: 12px; color: var(--muted); }
#testnote { color: #d73027; font-weight: 600; }

/* Station popups (both map libraries put this inside their own popup box, which is always light). */
.sensor-popup { font-size: 13px; color: #1d1d1f; }
.sensor-popup table { border-collapse: collapse; }
.sensor-popup td { padding: 1px 8px 1px 0; vertical-align: top; }
.sensor-popup td:first-child { color: #666; white-space: nowrap; }
.sensor-popup a { color: #0a66c2; }

/* DART diamonds (HTML versions) and the event-mode radar ping. */
.dart-icon { width: 12px; height: 12px; transform: rotate(45deg); border: 1.5px solid #000; box-sizing: border-box; }
.dart-recent { box-shadow: 0 0 0 4px rgba(215,48,39,.45); }
.ping { position: relative; width: 12px; height: 12px; cursor: pointer; }
.ping .dart-icon { position: absolute; inset: 0; }
.ping::before, .ping::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #d73027; box-sizing: border-box;
  animation: ping 1.8s ease-out infinite; pointer-events: none; }
.ping::after { animation-delay: .9s; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ping::before, .ping::after { animation: none; }
  .ping::before { transform: scale(2); opacity: .6; }
}

@media (max-width: 600px) {
  #side { bottom: 16px; }
  #info { max-height: 45vh; }
}
