:root {
  --bg: #ccd6e3;
  --panel: rgba(255, 255, 255, 0.92);
  --fg: #1d1d1b;
  --muted: #55524c;
  --line: #c9c4ba;
  --accent: #0b5cad;
  --badge-bg: #fff4d6;
  --badge-fg: #6b4a00;
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel: rgba(28, 28, 26, 0.92);
    --fg: #ecebe7;
    --muted: #b3afa7;
    --line: #45433f;
    --accent: #7db7f0;
    --badge-bg: #3d3216;
    --badge-fg: #f5d98a;
    --on-accent: #111111;
  }
}
:root[data-theme="dark"] {
  --panel: rgba(28, 28, 26, 0.92);
  --fg: #ecebe7;
  --muted: #b3afa7;
  --line: #45433f;
  --accent: #7db7f0;
  --badge-bg: #3d3216;
  --badge-fg: #f5d98a;
  --on-accent: #111111;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }

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

.bar { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; backdrop-filter: blur(6px); max-width: 760px; }
.title { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 1.05rem; margin: 0; letter-spacing: 0.01em; white-space: nowrap; }
/* What kind of map this is, when it isn't the finished one (viewer.js) */
.badge { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--badge-bg); color: var(--badge-fg); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.badge[hidden] { display: none; }
/* The remark a cut was given (map.json "note", viewer.js): a phrase of up to 80 characters, so it may wrap,
   and a word longer than the bar breaks rather than run out of it */
#note { white-space: normal; overflow-wrap: anywhere; }
.search { display: flex; gap: 6px; flex: 1 1 240px; min-width: 0; }
/* 16px: phones zoom the whole page in when a smaller text field takes focus */
.search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--fg); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search button, .controls button { font: inherit; border: 1px solid var(--line); background: var(--panel);
  color: var(--fg); border-radius: 6px; cursor: pointer; }
.search button { padding: 6px 12px; }
button:disabled, input:disabled { opacity: 0.5; cursor: default; }
.status { flex-basis: 100%; margin: 0; font-size: 0.82rem; color: var(--muted); min-height: 0; overflow-wrap: anywhere; }
.status:empty { display: none; }

.controls { position: fixed; right: 12px; bottom: 56px; z-index: 10; display: flex; flex-direction: column; gap: 6px; }
.controls button { width: 40px; height: 40px; font-size: 1.25rem; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.credits summary { cursor: pointer; }
.credits p { margin: 6px 0 0; }
.credits { position: fixed; left: 12px; right: 64px; bottom: 12px; z-index: 10; margin: 0;
  font-size: 0.75rem; color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; max-width: 760px; }
/* A long credits line must not push the panel off a short screen */
.credits details[open] { max-height: calc(100vh - 140px); overflow-y: auto; }
.credits a { color: var(--accent); }

/* Search pin. The element itself has no size and sits exactly on the map
   point (viewer.js dropPin); the drop is drawn above it with its tip there:
   an 18 px square turned 45 degrees, whose sharp corner ends 18 * sqrt(2) / 2
   = 12.7 px under its center, so the center goes 13 px above the point. */
.pin { width: 0; height: 0; pointer-events: none; }
.pin::before { content: ""; box-sizing: border-box; position: absolute; left: -9px; top: -22px; width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0; background: #d1342f; border: 2px solid #fff; transform: rotate(-45deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.noscript { position: fixed; top: 96px; left: 12px; right: 12px; z-index: 10; margin: 0; max-width: 760px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.noscript a { color: var(--accent); }

@media (max-width: 480px) {
  .bar { top: 8px; left: 8px; right: 8px; padding: 8px; }
  /* A note that does not fit on the title's line goes under it, at the bar's width: squeezed in
     beside the title and the kind badge it was a column of two or three words a line */
  .title { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  .credits { left: 8px; right: 56px; bottom: 8px; }
  .controls { right: 8px; }
}

/* The live layers (vehicles, weather) have their rules in live.css, which is
   loaded only together with their code, where a layer is on (viewer.js
   TRANSIT_CUTS). None of them is here. */
