/* RailSpotting shared tokens and base styles (public site and admin portal). */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ebe8e2;
  --ink: #1d1f22;
  --ink-2: #4d525a;
  --ink-3: #737982;
  --line: #d8d4cc;
  --accent: #0d5c63;
  --accent-ink: #ffffff;
  --focus: #e0a100;
  /* Train colors (decision 210): amber (tel) for a moving or recent train, purple (talk) for older
     ones. The names are from when they stood for EOT/HOT bursts and crew radio. */
  --talk: #b8389e;
  --talk-ink: #8a2276;
  --tel: #f0a000;
  --tel-ink: #7a5600;
  --det: #1f6feb; /* wayside defect detectors */
  --det-ink: #1a56b8;
  --mark-ring: #2b1d27;
  /* Crew radio on the railroad: teal rings (decision 210). */
  --traffic: #12988c;
  --train-now: var(--talk);
  --train-ink: var(--talk-ink);
  --quiet: #8a9099;
  --offline: #8a9099;
  --offline-area: #8d939b; /* coverage of a receiver that is offline (a light wash at the map's opacity) */
  --phone-area: #6a4fc2; /* a phone's area on the map, apart from fixed receivers' teal (decision 252) */
  --unmonitored: #b4b8be;
  --danger: #b3261e;
  --ok: #2f8f4e;
  --warn: #a86a00;
  --warn-bg: #fff4d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 6px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416;
    --surface: #1b1e21;
    --surface-2: #24282c;
    --ink: #e9e7e3;
    --ink-2: #b4b2ad;
    --ink-3: #8c8a86;
    --line: #33383d;
    --accent: #4fb3bb;
    --accent-ink: #0b1416;
    --talk: #e37fd0;
    --talk-ink: #f0a6e4;
    --tel: #ffc233;
    --tel-ink: #ffc233;
    --det: #6ea8ff;
    --det-ink: #9cc3ff;
    --mark-ring: #1b1e21;
    --traffic: #3fd1c2;
    --offline-area: #c3c7cd; /* coverage of a receiver that is offline */
  --phone-area: #a690f5;
    --unmonitored: #5d636a;
    --danger: #ff6b61;
    --ok: #4cc274;
    --warn: #ffb627;
    --warn-bg: #3a3014;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121416;
  --surface: #1b1e21;
  --surface-2: #24282c;
  --ink: #e9e7e3;
  --ink-2: #b4b2ad;
  --ink-3: #8c8a86;
  --line: #33383d;
  --accent: #4fb3bb;
  --accent-ink: #0b1416;
  --talk: #e37fd0;
  --talk-ink: #f0a6e4;
  --tel: #ffc233;
  --tel-ink: #ffc233;
  --det: #6ea8ff;
  --det-ink: #9cc3ff;
  --mark-ring: #1b1e21;
  --traffic: #3fd1c2;
  --offline-area: #c3c7cd; /* coverage of a receiver that is offline */
  --phone-area: #a690f5;
  --unmonitored: #5d636a;
  --danger: #ff6b61;
  --ok: #4cc274;
  --warn: #ffb627;
  --warn-bg: #3a3014;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; letter-spacing: 0.01em; }
h3 { font-size: 0.95rem; }

.num, time, .mono { font-variant-numeric: tabular-nums; }
.mono, code { font-family: var(--mono); font-size: 0.92em; }

.muted { color: var(--ink-3); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* Header bar: a dark strip like a station sign, in both themes. */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  min-height: 52px;
  background: #16191c;
  color: #f1efe9;
  border-bottom: 4px solid var(--focus);
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}
/* The kit's dark lockup: its mark is 30 px tall at 45 px; the margins take back its own padding. */
.brand-lockup { display: block; height: 45px; width: auto; margin: -7.5px 0 -7.5px -7.5px; }
.brand-mark { display: none; }
.brand-tag { color: var(--focus); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topnav a {
  color: #c9c6bf;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topnav a[aria-current="page"] { color: #16191c; background: var(--focus); }
.topbar .tools { display: flex; gap: 8px; align-items: center; }

/* Buttons and inputs */
button, .button {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}
button:hover, .button:hover { border-color: var(--ink-3); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger, .button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* Google and YouTube marks, used as their owners publish them (branding/third-party/README.md).
   Each comes in a light and a dark version; only the one for the current theme shows. */
.theme-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-light { display: none; }
  :root:not([data-theme="light"]) .theme-dark { display: inline-block; }
}
:root[data-theme="dark"] .theme-light { display: none; }
:root[data-theme="dark"] .theme-dark { display: inline-block; }
.google-signin { display: inline-flex; line-height: 0; border-radius: 4px; }
.google-signin img { width: 180px; height: 40px; }
.google-signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yt-button { padding-top: 2px; padding-bottom: 2px; gap: 2px; }
.yt-button img { height: 30px; width: auto; }
.yt-icon { height: 18px; width: auto; vertical-align: -4px; }
/* Google Photos asks for its full-color icon on white with a #3C4043 label, in either theme. */
.button.gphotos-button { background: #fff; color: #3c4043; border-color: #dadce0; padding-top: 4px; padding-bottom: 4px; gap: 8px; }
.button.gphotos-button:hover { border-color: #9aa0a6; }
.gphotos-button img { width: 24px; height: 24px; }
.topbar button { background: transparent; color: #f1efe9; border-color: #4a4f55; }
.topbar button:hover { border-color: #c9c6bf; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 8px;
  max-width: 100%;
}
textarea { min-height: 70px; width: 100%; }
label { font-weight: 600; font-size: 0.88rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
  vertical-align: 1px;
}
.badge.ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.badge.bad, .badge.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.badge.warn { color: var(--warn); border-color: var(--warn); background: transparent; }
.badge.train { color: var(--talk-ink); border-color: var(--talk); background: transparent; }
.badge.train.tel { color: var(--tel-ink); border-color: var(--tel); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: 0;
  margin-right: 6px;
  flex: none;
}
.dot.online { background: var(--ok); }
.dot.offline { background: transparent; border: 2px dashed var(--offline); }
.dot.nearby { background: var(--tel); box-shadow: 0 0 0 1px var(--mark-ring); }
.dot.recent { background: var(--tel); }
/* A train with a known direction (decision 276): the map's arrow, in the recent color. */
.arrow-swatch { width: 14px; height: 14px; flex: none; vertical-align: middle; margin-right: 6px; }
.arrow-swatch path { fill: var(--tel); stroke: var(--surface); stroke-width: 0.18; }
.dot.earlier { background: var(--talk); }
.dot.past { background: transparent; border: 2px solid var(--talk); }
.dot.stopped { box-shadow: inset 0 0 0 2px var(--danger); }
/* Blink: a moving train within the nearby window (decision 210); later ones are solid. */
@keyframes rs-blink-fast { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0.15; } }
/* The fill alone, for a stopped train's mark: its red border stays (decision 208). */
@keyframes rs-blink-fill { 0%, 49.9% { fill-opacity: 1; } 50%, 100% { fill-opacity: 0.15; } }
@media (prefers-reduced-motion: no-preference) {
  .dot.nearby { animation: rs-blink-fast 0.5s infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.nearby { box-shadow: 0 0 0 2px var(--ink); }
}
/* Detectors: one color. An outline when quiet, solid when it reported a train in the recent
   window (30 min), flashing in the nearby window (5 min). */
.det-swatch {
  display: inline-block; width: 9px; height: 9px; margin: 0 8px 0 2px; flex: none; transform: rotate(45deg); box-sizing: border-box;
  background: var(--surface); border: 1.5px solid var(--det);
}
.det-swatch.nearby, .det-swatch.recent { background: var(--det); }
@media (prefers-reduced-motion: no-preference) {
  .det-swatch.nearby { animation: rs-blink-fast 0.5s infinite; }
}
.dot.activity { background: transparent; border: 2px solid var(--traffic); }
.dot.quiet { background: var(--quiet); }
.dot.unmonitored { background: transparent; border: 1.5px solid var(--unmonitored); }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 700; }
.table-wrap { overflow-x: auto; max-width: 100%; }

.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--ok);
  color: var(--ok);
  background: var(--surface);
  margin-bottom: 14px;
}
.flash.error { border-color: var(--danger); color: var(--danger); }

.empty { color: var(--ink-3); font-style: italic; padding: 6px 0; }

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--train-now);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.9rem;
}
.toast strong { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 180ms ease-out; }
  @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Search box with suggestions (public map and admin placement) */
.place-search { position: relative; }
.search-input { width: 100%; font-size: 0.95rem; }
.search-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 3000;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-list { list-style: none; margin: 0; padding: 4px; max-height: min(60vh, 420px); overflow-y: auto; }
.search-group { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px 2px; }
.search-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 8px; border-radius: 4px; cursor: pointer; }
.search-item[aria-selected="true"], .search-item:hover { background: var(--surface-2); }
.search-name { font-weight: 600; }
.search-name mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--focus); text-decoration-thickness: 2px; }
.search-detail { font-size: 0.78rem; color: var(--ink-3); }
.search-status { font-size: 0.75rem; color: var(--ink-3); padding: 4px 12px 8px; }
.search-status:empty { display: none; }

/* Privacy policy and terms links, and the pages themselves. */
.legal-links a { margin-right: 14px; }
.site-foot { max-width: 900px; margin: 0 auto; padding: 8px 16px 28px; color: var(--ink-3); }
.page-legal main { max-width: 780px; margin: 0 auto; padding: 18px 16px 24px; }
.legal { line-height: 1.55; }
.legal h1 { margin-top: 0; }
.legal h2 { margin: 26px 0 8px; font-size: 1.15rem; }
.legal h3 { margin: 16px 0 6px; font-size: 1rem; }
.legal li { margin-bottom: 6px; }
.legal code { overflow-wrap: anywhere; }
.legal .callout { border-left: 4px solid var(--tel); padding: 8px 12px; background: color-mix(in srgb, var(--tel) 10%, transparent); }

/* About page. */
.page-about main { max-width: 820px; margin: 0 auto; padding: 18px 16px 24px; }
.about-lead { font-size: 1.08rem; }
.about-stats { list-style: none; padding: 0; margin: 18px 0 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.about-stats li { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.about-stats strong { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--accent); }
.about-stats span { font-size: 0.85rem; color: var(--ink-2); }
.about-steps > li { margin-bottom: 10px; }
.about-steps ul { margin-top: 6px; }
.about-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.about-paths section { border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px; }
.about-paths h3 { margin-top: 12px; }

/* Signed-in menu at the top right. */
.me-menu { position: relative; }
.me-menu summary {
  position: relative; list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 3px 10px 3px 3px; border: 1px solid #4a4f55; border-radius: 999px; color: #f1efe9; font-weight: 600; font-size: 0.9rem;
}
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu summary:hover, .me-menu[open] summary { border-color: #c9c6bf; }
.me-menu summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.me-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.avatar.initial { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.85rem; }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; }
.me-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 190px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); padding: 6px; display: flex; flex-direction: column;
}
.me-pop a, .me-pop button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--ink); text-decoration: none; font: inherit; font-size: 0.92rem; cursor: pointer;
}
.me-pop a:hover, .me-pop button:hover, .me-pop a:focus-visible, .me-pop button:focus-visible { background: var(--surface-2); outline: none; }
.me-pop form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.topbar .signin-btn { background: transparent; color: #f1efe9; border-color: #4a4f55; text-decoration: none; }
@media (max-width: 640px) { .me-name { display: none; } .me-menu summary { padding: 3px; } }

/* Profile editor and public profile. */
.profile-form { max-width: 720px; display: flex; flex-direction: column; gap: 4px; }
.profile-form label { display: block; margin-top: 10px; }
.profile-form input:not([type="checkbox"]), .profile-form textarea { width: 100%; }
.profile-form .help { margin-bottom: 4px; }
.profile-form h2 { margin: 20px 0 0; font-size: 1.05rem; }
.profile-who { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.privacy-choices { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 14px 0 0; }
.privacy-choices legend { font-weight: 700; padding: 0 4px; }
.privacy-choices .check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.row-input { display: flex; gap: 8px; flex-wrap: wrap; }
.row-input input { flex: 1 1 240px; }
.socials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.account .site-foot { max-width: 1240px; }
.page-person main { max-width: 780px; margin: 0 auto; padding: 18px 16px 24px; }
.page-person .card { margin-bottom: 12px; }
.person-head { display: flex; gap: 16px; align-items: center; }
.person-head h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
/* Business profiles (decision 262): a banner with the site's icon (or the name's initial), then
   the details the business gave. */
.biz { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.biz-banner { display: flex; gap: 14px; align-items: center; }
.biz-banner h2 { margin: 0 0 2px; font-size: 1.4rem; overflow-wrap: anywhere; }
.biz-banner.preview { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.biz-icon { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.biz-icon-box { position: relative; flex: none; width: 48px; height: 48px; }
.biz-icon-box > img.biz-icon { position: absolute; inset: 0; }
.biz-icon-box:not(:has(.initial)):not(:has(img)) { display: none; }
.biz-icon.initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.4rem;
  background: var(--accent); color: #fff; border: 0; }
.biz-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0; }
.biz-facts dt { color: var(--ink-3); font-size: 0.85rem; }
.biz-facts dd { margin: 0; overflow-wrap: anywhere; }
.biz-hours { border-collapse: collapse; margin-top: 8px; }
.biz-hours caption { text-align: left; padding-bottom: 2px; }
.biz-hours th { text-align: left; font-weight: 600; padding: 1px 16px 1px 0; }
.biz-hours td { padding: 1px 0; }
.biz-hours-form { display: grid; grid-template-columns: max-content minmax(0, 20rem); gap: 6px 12px; align-items: center; }
.biz-hours-form label { margin: 0; }
.biz-remove { margin: -6px 0 24px; }
#business h3 { margin: 18px 0 2px; font-size: 1rem; }
.person .bio { white-space: pre-line; overflow-wrap: anywhere; }
.person-links { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.person-links a { display: inline-block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.person-note { padding: 8px 0; border-bottom: 1px solid var(--line); }
.person-note:last-child { border-bottom: 0; }

/* Phones: one header row on every page. The logo stands in for the name, and the tabs stay on
   one line (scrolling sideways if they ever must) instead of stacking into a column. */
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 6px 12px; min-height: 48px; flex-wrap: nowrap; }
  .brand { gap: 6px; }
  .brand-lockup { display: none; }
  .brand-mark { display: block; width: 28px; height: 28px; }
  .topnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; flex: 1; min-width: 0; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 8px; font-size: 0.86rem; white-space: nowrap; }
  .topbar .tools { margin-left: auto; flex-wrap: nowrap; }
  .topbar .tools .public-link { display: none; }
}

/* A map inside a scrolling page, on touch screens: one finger scrolls the page, two move and zoom
   the map (see coopMap in common.js). */
.map-hint {
  position: absolute; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45); color: #fff; font-weight: 700; font-size: 1rem; text-align: center; padding: 16px;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.map-hint.show { opacity: 1; }

/* Notifications: the badge on the menu and the inbox. */
.me-badge {
  position: absolute; top: -4px; left: 20px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.me-count { color: var(--danger); font-weight: 600; font-size: 0.85em; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.inbox li:last-child { border-bottom: 0; }
.inbox li.new { border-left: 3px solid var(--accent); padding-left: 10px; }
.inbox .when { color: var(--ink-3); font-size: 0.85rem; }
.inbox p { margin: 4px 0 0; }

/* Leaflet maps (live map, embedded map, receiver placement): the controls follow the theme. Dark
   tiles invert and rotate hues so water stays blue and parks green. Only the tile layer is
   filtered; markers, circles, popups and controls keep their real colors. */
.leaflet-bar a, .leaflet-control-attribution { background: var(--surface); color: var(--ink); }
.leaflet-control-attribution a { color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }
  :root:not([data-theme="light"]) .leaflet-container { background: #1b1e21; }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }
:root[data-theme="dark"] .leaflet-container { background: #1b1e21; }

/* The hidden attribute always wins over display rules (buttons in .actions set display). */
[hidden] { display: none !important; }

/* Receiver API guide (decision 192). */
.api-doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.api-toc { position: sticky; top: 12px; font-size: 0.92rem; }
.api-toc ol { margin: 8px 0 0; padding-left: 20px; }
.api-toc li { margin: 4px 0; }
.api-guide { min-width: 0; }
.api-code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto;
  font-size: 0.85rem; line-height: 1.45; white-space: pre; }
.api-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 0.9rem; display: block; overflow-x: auto; }
.api-table th, .api-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.api-table th { font-weight: 600; white-space: nowrap; }
.api-table td:first-child { white-space: nowrap; }
.api-endpoint { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 14px; scroll-margin-top: 12px; }
.api-method { display: inline-block; min-width: 3.4em; text-align: center; padding: 1px 6px; border-radius: 4px; font-size: 0.8rem;
  font-weight: 700; color: #fff; background: var(--accent); vertical-align: middle; }
.api-method.api-POST { background: #7a4fb3; }
@media (max-width: 900px) { .api-doc { grid-template-columns: 1fr; } .api-toc { position: static; } }
/* A crossing off the main line (decision 280): the map's small grey dashed ring. */
.dot.offline-track { width: 7px; height: 7px; background: transparent; border: 1.5px dashed var(--unmonitored); }
