:root { --bg: #0e1013; --panel: rgba(16,18,22,.88); --text: #e8e6e1; --muted: #8b8f96; --rule: #2a2e35; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 "Inter", system-ui, -apple-system, sans-serif; }
#map { position: absolute; inset: 0; }
.panel, .attr { z-index: 2; }
.panel { position: absolute; background: var(--panel); backdrop-filter: blur(6px);
  border: 1px solid var(--rule); border-radius: 10px; }
#title { top: 16px; left: 16px; padding: 14px 16px; max-width: 320px; }
#title h1 { margin: 0 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
#title p { margin: 0; color: var(--muted); font-size: 12.5px; }
/* page switcher: a native select styled as part of the title */
#page { font: inherit; letter-spacing: inherit; color: inherit; background: transparent no-repeat right 1px center / 10px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8f96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border: 0; border-bottom: 1.5px dashed var(--muted); border-radius: 0; padding: 0 16px 0 0; margin: 0;
  appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%; }
#page:hover { border-bottom-color: var(--text); }
#page:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#page option { background: #16181c; color: var(--text); font-size: 14px; }
#date { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 8px; }
#total { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { margin-top: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; font-size: 12.5px; }
.legend .sw { width: 14px; height: 4px; border-radius: 2px; }
.legend .sw.area { height: 10px; border-radius: 3px; }
.legend .val { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.legend label { cursor: pointer; }
/* while a layer's data loads after switching */
body.loading #legend, body.loading #total { opacity: .4; transition: opacity .2s; }
body.loading, body.loading #page { cursor: progress; }
.logo { display: block; width: max-content; margin-top: 2rem; opacity: .75; transition: opacity .15s; }
.logo:hover { opacity: 1; }
.logo img { display: block; }
#timeline { left: 16px; right: 16px; bottom: 24px; padding: 10px 14px 12px; display: flex; gap: 12px; align-items: center; }
#play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg);
  font-size: 15px; cursor: pointer; }
#chartwrap { flex: 1; min-width: 0; position: relative; height: 70px; cursor: ew-resize; touch-action: none; }
#chart { width: 100%; height: 100%; display: block; }
#speed { flex: none; background: transparent; color: var(--muted); border: 1px solid var(--rule); border-radius: 6px; padding: 4px; }
.attr { position: absolute; right: 16px; bottom: 4px; font-size: 10.5px; color: var(--muted); }
.attr a { color: inherit; }
.maplibregl-ctrl-attrib { display: none; }
@media (max-width: 600px) {
  #title { right: 56px; max-width: none; padding: 10px 12px; }
  #title p { display: none; }
  #date { font-size: 28px; margin-top: 2px; }
  #timeline { left: 8px; right: 8px; bottom: 40px; }  /* clears the attribution, which wraps to two lines */
  .attr { left: 8px; right: 8px; bottom: 6px; text-align: center; }
}

/* feature history panel */
#history { top: 16px; right: 56px; width: 300px; padding: 14px 16px 12px; font-size: 12.5px; }
#history[hidden] { display: none; }
#history .h-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; }
#history .h-name { font-size: 16px; font-weight: 650; padding-right: 20px; }
#history .h-meta, #history .muted { color: var(--muted); }
#history .h-spark { display: block; margin: 10px 0 6px; cursor: pointer; overflow: visible; }
#history .h-spark circle { cursor: pointer; transition: r .12s; }
#history .h-ver { min-height: 36px; font-variant-numeric: tabular-nums; }
#history .add { color: rgb(163,230,53); } #history .del { color: rgb(244,63,94); }
#history .h-ctl { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
#history .h-ctl button { background: transparent; color: var(--text); border: 1px solid var(--rule); border-radius: 6px;
  padding: 3px 9px; font: inherit; cursor: pointer; }
#history .h-ctl button:hover { border-color: var(--muted); }
#history .h-ctl a { margin-left: auto; color: var(--muted); font-size: 11.5px; }
#history .h-key { margin-top: 8px; color: var(--muted); font-size: 11.5px; display: flex; gap: 5px; align-items: center; }
#history .h-key span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
#history .h-key span + span, #history .h-key .ol { margin-left: 6px; }
#history .h-key .ol { background: none; border: 1.5px solid rgb(99,102,241); }
@media (max-width: 600px) {
  #history { top: auto; bottom: 138px; left: 8px; right: 8px; width: auto; }
}
