:root {
  --ink: #10171e;
  --ink-soft: #5b6a78;
  --paper: #f7f5f1;
  --panel: rgba(255, 255, 255, 0.92);
  --route: #d6462f;
  --line: rgba(16, 23, 30, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 16px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

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

.overlay {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: auto;
  max-width: min(28rem, calc(100vw - 24px));
  z-index: 2;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 6px 24px rgba(16, 23, 30, 0.12);
}

h1 { margin: 0; font-size: 1.15rem; letter-spacing: -0.01em; }

.meta { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.85rem; }

.status {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.status::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--route);
  vertical-align: 1px;
}
/* A fix older than a few minutes is stale, not live — say so honestly. */
.status.stale::before { background: var(--ink-soft); }

/* plain pages (trip index) */
.page-plain { display: grid; place-items: start center; padding: 8vh 20px; }
.page-plain main { width: min(40rem, 100%); }
.page-plain h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }

.trip-list { list-style: none; padding: 0; margin: 0; }
.trip-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.trip-list a { color: inherit; font-weight: 600; text-decoration: none; }
.trip-list a:hover { text-decoration: underline; }

.badge {
  margin-left: auto;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: var(--route);
  padding: 2px 7px; border-radius: 999px;
}

.empty { color: var(--ink-soft); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf2;
    --ink-soft: #94a3b1;
    --paper: #0f1419;
    --panel: rgba(20, 27, 34, 0.92);
    --line: rgba(232, 237, 242, 0.14);
  }
}
