:root {
  color-scheme: light dark;
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-fg: #16201c;
  --panel-muted: #5a6b63;
  --panel-border: rgba(0, 0, 0, 0.1);
  --accent: #0b6e4f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --panel-bg: rgba(20, 26, 24, 0.92);
    --panel-fg: #e8efeb;
    --panel-muted: #9bb0a7;
    --panel-border: rgba(255, 255, 255, 0.12);
    --accent: #4ec294;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#map { position: absolute; inset: 0; }

#panel {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 1;
  width: min(300px, calc(100vw - 24px));
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel-bg);
  color: var(--panel-fg);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

#panel h1 {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

#status {
  margin: 0;
  color: var(--panel-muted);
  font-size: 12px;
}

#status.error { color: #c0392b; }

@media (prefers-color-scheme: dark) {
  #status.error { color: #ff8a7a; }
}

#facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 10px 0 0;
  font-size: 12px;
}

#facts dt { color: var(--panel-muted); }

#facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

#download {
  display: none;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

#download:hover { text-decoration: underline; }

#download.ready { display: inline-block; }

/* The archive is multi-GB — make that explicit before anyone clicks. */
#download::after {
  content: " ↓";
}

@media (max-width: 480px) {
  #panel { padding: 12px; }
}

#source-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--panel-muted);
}

#source-note code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.16);
  font-size: 10.5px;
}
