:root {
  /* The SIRI-FM gateway's palette (its dashboard.css), so the two tools look alike. Text
     colours meet 4.5:1 on both surfaces, and --line meets the 3:1 AA bar for a graphical object. */
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f5f5f5;
  --text: #1a1a1a;
  --muted: #4a4a4a;
  --line: #8a8a8a;
  --line-strong: #5c5c5c;
  --accent: #0b57d0;
  --accent-surface: #eaf1fd;
  --yes: #1b5e20;
  --no: #b3261e;
  --warn: #8a5000;
  --lift-available: #1b5e20;
  --lift-notAvailable: #b3261e;
  --lift-unknown: #8a5000;
  --lift-noData: #595959;
  --epiap: #1f5fbf;
  --chb: #7b3fa0;
  --psa: #257559;
  --halteviewer: #b0306a;
  --otp: #8a4b08;
  --osm: #55721b;
  --shadow: 0 4px 18px rgba(16, 24, 40, 0.14);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Screen only: on paper the light palette applies whatever the reader's preference. */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --panel: #15181d;
    --panel-2: #1e222a;
    --text: #e6e8ec;
    --muted: #b6bcc6;
    --line: #767d88;
    --line-strong: #a3aab4;
    --accent: #9cc0fb;
    --accent-surface: #17233a;
    --yes: #7cc47f;
    --no: #f2938c;
    --warn: #e2a75c;
    --lift-available: #7cc47f;
    --lift-notAvailable: #f2938c;
    --lift-unknown: #e2a75c;
    --lift-noData: #a9b0ba;
    --epiap: #6ea0ff;
    --chb: #c08ae6;
    --psa: #5cc8a3;
    --halteviewer: #f07fb0;
    --otp: #e8a868;
    --osm: #a5cf5b;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
/* Every :hover below has a :focus-visible twin, so the keyboard sees what the pointer sees. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Links among other text are underlined: their colour alone is too close to the text's. The
   header, the cards and the diagram read as links by their shape. */
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus-visible { background: var(--accent-surface); text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: 12px; }
button.id { font-family: var(--mono); font-size: 12px; color: inherit; background: none; border: none; border-radius: 4px; padding: 0; cursor: copy; }
button.id:hover, button.id:focus-visible { background: var(--accent-surface); }
button {
  font: inherit;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}
button:hover, button:focus-visible { background: var(--accent-surface); border-color: var(--accent); }
input, select {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 5px 8px;
}
input:hover, select:hover, input:focus-visible, select:focus-visible { border-color: var(--accent); }
/* A date field's focus is on its parts inside, where :focus-visible does not reach the field itself. */
input[type="date"]:is(:focus, :focus-within) { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.yes { color: var(--yes); font-weight: 600; }
.no { color: var(--no); font-weight: 600; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip { position: absolute; left: -9999px; top: 0; background: var(--panel); padding: 8px 16px; z-index: 30; }
.skip:focus { left: 0; }
/* Focus moved there by script (the skip target, an opened item's heading) needs no ring. */
[tabindex="-1"]:focus { outline: none; }

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  z-index: 5;
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.brand .org { color: var(--muted); font-weight: 500; margin-right: 4px; }
.brand:hover, .brand:focus-visible { background: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 5px 10px; border-radius: 4px; text-decoration: none; }
.nav a:hover, .nav a:focus-visible { text-decoration: underline; }
.brand, .skip, .about-out { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* The language switcher, the same segmented pill as the SIRI-FM gateway's header. Its corners are
   rounded on the links, so a focus ring outside them stays whole. */
.lang { display: flex; border: 1px solid var(--line); border-radius: 4px; }
.lang a { padding: 2px 8px; font-size: 0.8rem; font-weight: 600; line-height: 1.6; text-decoration: none; color: var(--muted); background: none; }
.lang a:first-child { border-radius: 3px 0 0 3px; }
.lang a:last-child { border-radius: 0 3px 3px 0; }
.lang a + a { border-left: 1px solid var(--line); }
.lang a:hover { color: var(--text); }
.lang a[aria-current="true"] { background: var(--accent); color: var(--bg); }
.lang a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; padding: 7px 12px; }
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 70vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.search-results .group { padding: 6px 12px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.search-results .hit { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; cursor: pointer; }
.search-results .hit.active, .search-results .hit:hover { background: var(--accent-surface); }
.search-results .meta { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .empty { padding: 10px 12px; color: var(--muted); }

/* layout */
.main { flex: 1; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; }
.view-about, .view-changes, .view-status { overflow: auto; padding: 16px 20px 40px; }

/* sidebar */
.sidebar {
  position: absolute;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: min(400px, calc(100% - 24px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 4;
  transition: width .15s ease;
}
.sidebar.expanded { width: min(820px, calc(100% - 24px)); }
.sidebar-bar { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 8px 0; }
.icon-btn { background: none; border: none; border-radius: 4px; font-size: 16px; padding: 2px 8px; color: var(--muted); }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--text); background: var(--accent-surface); }
.sidebar-body { overflow: auto; padding: 0 16px 16px; }
.loading, .empty { padding: 16px 0; color: var(--muted); }
.item-head h1 { margin: 2px 0 4px; font-size: 20px; line-height: 1.25; }
.item-type { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.item-key .id { background: var(--panel-2); padding: 1px 5px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.badge, .chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  white-space: nowrap;
}
.chip { font-weight: 600; letter-spacing: .02em; background: var(--panel); }
.src-epiap { color: var(--epiap); border-color: var(--epiap); }
.src-chb { color: var(--chb); border-color: var(--chb); }
.src-psa { color: var(--psa); border-color: var(--psa); }
.src-halteviewer { color: var(--halteviewer); border-color: var(--halteviewer); }
.src-otp { color: var(--otp); border-color: var(--otp); }
.src-osm { color: var(--osm); border-color: var(--osm); }

/* OTP walking routes */
.badge.otp-ok, .ok { color: var(--yes); border-color: var(--yes); }
.badge.otp-warn { color: var(--warn); border-color: var(--warn); }
.badge.otp-fail, .card.otp .warn { color: var(--no); border-color: var(--no); }
.dot.otp-ok, .dot.otp-info, .dot.otp-warn, .dot.otp-fail { width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; display: inline-block; }
.dot.otp-ok { background: var(--yes); }
.dot.otp-info { background: var(--lift-noData); }
.dot.otp-warn { background: var(--warn); }
.dot.otp-fail { background: var(--no); }
.card.otp h3 { margin: 12px 0 4px; font-size: 13px; }
.card.otp details { margin: 6px 0; }
.otp-issues, .otp-segments, .otp-quays, .otp-steps { list-style: none; margin: 0; padding: 0; }
.otp-issues li, .otp-segments li { padding: 4px 0; border-bottom: 1px solid var(--panel-2); }
.otp-segments li.shown, .otp-matrix td.shown { outline: 2px solid var(--accent); outline-offset: -2px; }
.otp-steps { margin: 2px 0 2px 18px; font-size: 12px; }
.fix-links { font-size: 12px; margin-top: 2px; }
.fix-links .failed { color: var(--no); }
.otp-verdict { font-size: 12px; margin-left: 4px; }
.otp-shown { background: var(--accent-surface); border-radius: 6px; padding: 6px 8px; margin: 8px 0; }
/* Scrolled to when a connection is picked below the card: clear of the sticky tab bar. */
.otp-shown { scroll-margin-top: 56px; }
.otp-shown h3 { margin: 2px 0 6px; font-size: 14px; }
.otp-shown .otp-issues { margin-bottom: 6px; }
.otp-shown .otp-issues li { border-bottom-color: var(--panel); }
.otp-route + .otp-route { margin-top: 6px; }
.swatch { display: inline-block; width: 18px; height: 4px; margin-right: 6px; vertical-align: middle; }
/* The map's OTP_COLORS: forward from the lower quay to the higher, back the other way. */
.swatch.forward { --swatch: #1565c0; }
.swatch.back { --swatch: #ad1457; }
.swatch.walk { background: repeating-linear-gradient(90deg, var(--swatch) 0 4px, transparent 4px 7px); }
.swatch.wheelchair { background: var(--swatch); }
.otp-matrix-wrap { overflow-x: auto; }
.otp-matrix { border-collapse: collapse; font-size: 11px; }
.otp-matrix th { font-weight: 600; padding: 2px 4px; text-align: left; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.otp-matrix td { padding: 0; border: 1px solid var(--panel); }
.otp-matrix td button { border: 0; background: none; padding: 3px 4px; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.otp-matrix td.v-ok { background: color-mix(in srgb, var(--yes) 18%, transparent); }
.otp-matrix td.v-warn { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.otp-matrix td.v-fail { background: color-mix(in srgb, var(--no) 30%, transparent); }

/* OpenStreetMap links */
.osm-state { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.osm-matched { color: var(--yes); }
.osm-suspect, .osm-ambiguous, .osm-possible { color: var(--warn); }
.osm-unlinked { color: var(--no); }
.osm-links { list-style: none; margin: 0; padding: 0; }
.osm-links li { padding: 3px 0; }
.card.osm .facts { margin-top: 8px; }
.access-yes { color: var(--yes); border-color: var(--yes); }
.access-partial { color: var(--warn); border-color: var(--warn); }
.access-no { color: var(--no); border-color: var(--no); }
.status-expired, .status-outofuse, .removed { color: var(--no); border-color: var(--no); }
.status-plan { color: var(--warn); border-color: var(--warn); }
/* An expired, out-of-use or planned item in a list: a link, struck through. */
.inactive { opacity: 0.75; text-decoration: line-through; }
.rel .badge { font-size: 11px; padding: 0 5px; }
.actions { display: flex; gap: 6px; margin: 6px 0; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: baseline; }
.breadcrumb .sep { margin: 0 6px; }
.card { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin: 10px 0; }
.card h2 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card h3, .source-block h3, .tab-body h3 { font-size: 13px; margin: 12px 0 6px; }
.facts { margin: 0; display: grid; gap: 2px; }
.fact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.fact:last-child { border-bottom: none; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; text-align: right; }
.fact dt { padding-left: calc(var(--depth, 0) * 14px); }
.fact.group { border-bottom: none; padding-bottom: 0; }
.fact.group dt { color: var(--text); font-weight: 600; }
.notice { background: color-mix(in srgb, var(--warn) 15%, transparent); border-radius: 4px; padding: 6px 8px; margin-bottom: 8px; }
.codes { margin: 0; padding-left: 18px; }
.count { color: var(--muted); font-weight: 400; font-size: 12px; }

/* lift */
.lift-status { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
/* A lift's state is always a word or a glyph as well; the colour repeats it. The glyph sits in
   the dot, white on the state colour, as on the gateway's map markers. */
.dot { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--lift-noData); color: var(--panel); font-size: 8px; font-weight: 700; line-height: 1; flex: none; }
.lift-status .dot { width: 14px; height: 14px; font-size: 9px; }
.lift-available .dot, .dot.lift-available { background: var(--lift-available); }
.lift-notAvailable .dot, .dot.lift-notAvailable { background: var(--lift-notAvailable); }
.lift-unknown .dot, .dot.lift-unknown { background: var(--lift-unknown); }
.lift-noData .dot, .dot.lift-noData { background: var(--lift-noData); }
/* Days as an SVG strip filled from the gateway's patterns: out of service is cross-hatched,
   unknown hatched, no data dotted, so each state stays distinct with red/green colour blindness. */
svg.strip { display: block; width: 100%; height: 16px; margin: 8px 0; }
svg.strip .cell { stroke: var(--panel); stroke-width: 0.15; }
svg.strip .c-available { fill: var(--lift-available); }
svg.strip .c-notAvailable { fill: url(#p-notAvailable); }
svg.strip .c-unknown { fill: url(#p-unknown); }
svg.strip .c-noData { fill: url(#p-noData); }
#p-notAvailable { color: var(--panel); }
#p-notAvailable .ground { fill: var(--lift-notAvailable); }
#p-unknown { color: var(--panel); }
#p-unknown .ground { fill: var(--lift-unknown); }
#p-noData { color: var(--lift-noData); }
#p-noData .ground { fill: var(--panel-2); }
svg.defs { position: absolute; width: 0; height: 0; }
.event { font-size: 12px; }
.link-btn { background: none; border: none; border-radius: 0; padding: 0; color: var(--accent); cursor: pointer; }
.link-btn:hover, .link-btn:focus-visible { background: var(--accent-surface); text-decoration: underline; }
.gateway-links { margin-top: 8px; font-size: 13px; }
.lift-list { list-style: none; margin: 0; padding: 0; }
.lift-list li { display: flex; align-items: center; gap: 6px; padding: 2px 0; flex-wrap: wrap; }
.lift-list .dot { width: 12px; height: 12px; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-top: 12px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 10px; color: var(--muted); }
.tabs button:hover, .tabs button:focus-visible { color: var(--text); background: var(--accent-surface); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { padding-top: 8px; }
.filter { width: 100%; margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; }
.attrs th, .attrs td { text-align: left; vertical-align: top; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.attrs th { width: 50%; font-weight: 400; word-break: break-all; }
.attrs .nl { color: var(--muted); font-size: 12px; word-break: normal; }
small.en { color: var(--muted); font-size: 11px; font-weight: 400; font-style: italic; }
.fact dt small.en { display: block; line-height: 1.2; }
.attrs td { word-break: break-word; }
.attrs th { padding-left: calc(6px + var(--depth, 0) * 14px); }
.attrs tr.group th { font-weight: 600; }
.attrs tr.group th, .attrs tr.group td { border-bottom-style: dashed; }
.rel { margin: 4px 0 8px; padding-left: 18px; }
.connections { list-style: none; margin: 0; padding: 0; }
.connections li { padding: 2px 0; }
.connections .arrow { display: inline-block; width: 1.4em; color: var(--muted); }
.rel .dot, .connections .dot { width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; }
.connections .via { font-size: 12px; color: var(--muted); }

details summary { cursor: pointer; padding: 2px 0; }
pre.xml, pre.diff {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  overflow: auto;
  max-height: 60vh;
}
/* A diff line wraps anywhere: one long line of XML would widen a table cell, and the page, to fit it. */
pre.diff { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.diff .add { color: var(--yes); }
pre.diff .del { color: var(--no); }
pre.diff .hunk { color: var(--accent); }
pre.diff .hdr { color: var(--muted); }
.versions { list-style: none; margin: 0; padding: 0; }
.version { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: center; width: 100%; text-align: left; margin: 2px 0; background: none; }
.version { color: var(--text); }
.version.active { border-color: var(--accent); background: var(--accent-surface); }
.version .when { min-width: 132px; }
.kind-added .kind, tr.kind-added .kind, .summary .add { color: var(--yes); }
.kind-removed .kind, tr.kind-removed .kind, .summary .del { color: var(--no); }
.kind-modified .kind, tr.kind-modified .kind, .summary .mod { color: var(--warn); }
.diff-inline { margin: 4px 0 10px; }
.diff-inline pre.diff { margin: 0; }
/* The version list scrolls sideways on its own when narrow; an open diff stays the width of the view. */
#change-list, #status-list, .table-scroll { overflow-x: auto; }
.change-table tr.diff-row > td { padding: 0 0 6px; white-space: normal; }
.change-table tr.diff-row .diff-inline { position: sticky; left: 0; max-width: calc(100vw - 40px); }
/* Sized by the table: its long lines would otherwise re-balance the columns and re-wrap other rows. */
.change-table tr.diff-row .diff-inline { contain: inline-size; }
/* Highlights the row under the pointer or holding focus in any table, so the eye can follow a wide row. A change with an open diff is highlighted too. */
:is(.summary, .change-table, .attrs) tbody tr:not(.diff-row):is(:hover, :focus-within) > :is(td, th),
.change-table tr:not(.diff-row):is(:hover, :focus-within) + tr.diff-row > td { background: var(--panel-2); }
.summary tbody tr.failed:is(:hover, :focus-within) > td { background: color-mix(in srgb, var(--no) 16%, transparent); }
.change-table td.change-actions { white-space: nowrap; text-align: right; }
/* Both labels share one grid cell, so the button keeps the longer one's width and nothing moves when it toggles. */
.diff-toggle { display: inline-grid; justify-items: end; }
.diff-toggle > span { grid-area: 1 / 1; }
.diff-toggle[aria-expanded="true"] .when-closed, .diff-toggle[aria-expanded="false"] .when-open { visibility: hidden; }
/* The highlight and focus ring go on the shown label, so neither takes the hidden one's width. */
.diff-toggle:hover, .diff-toggle:focus-visible { background: none; text-decoration: none; outline: none; }
.diff-toggle:hover > span, .diff-toggle:focus-visible > span { background: var(--accent-surface); text-decoration: underline; }
.diff-toggle:focus-visible > span { outline: 3px solid var(--accent); outline-offset: 2px; }
.change-table td.change-actions a { margin-left: 8px; }

/* layers */
.layers { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; flex-direction: column; align-items: flex-end; }
.layers-toggle { box-shadow: var(--shadow); padding: 6px 12px; }
.layers-panel {
  margin-top: 6px;
  width: 270px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.level-picker { margin-top: 6px; display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 4px; box-shadow: var(--shadow); padding: 4px 6px 4px 10px; font-size: 13px; }
.layers-panel fieldset { border: none; padding: 0; margin: 8px 0 0; }
/* A sidebar link to what the pointer is over on the map; the map outlines in the same orange. */
a.map-hover { background: color-mix(in srgb, #ff6d00 22%, transparent); outline: 1px solid #ff6d00; border-radius: 3px; }
.layers-panel legend { font-weight: 600; padding: 0; }
/* Each row at least 24px tall, so every checkbox has room for a finger (WCAG 2.2 target size). */
.layer-opt, .layers-panel legend label { display: flex; align-items: center; gap: 6px; min-height: 24px; cursor: pointer; }
.layer-opt i, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.layer-opt i.sq { border-radius: 2px; }
.layer-opt i.ring { background: #fff; border: 2.5px solid; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin: 4px 0; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-status {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 12px;
  background: var(--panel);
  padding: 2px 10px;
  border-radius: 999px;
  z-index: 2;
  color: var(--muted);
}
/* Capped by the popup's maxWidth (map.js); a name or id with no break in it wraps. */
.hover-popup .maplibregl-popup-content { padding: 6px 10px; font-size: 13px; background: var(--panel); color: var(--text); overflow-wrap: anywhere; }
.hover-popup .maplibregl-popup-tip { display: none; }
/* MapLibre's controls get the page's focus ring. They stay white
   in the dark scheme too, so their ring keeps the light scheme's accent. */
.maplibregl-ctrl button:focus-visible, .maplibregl-ctrl summary:focus-visible { outline: 3px solid #0b57d0; outline-offset: -3px; box-shadow: none; }
/* On hover or focus they keep MapLibre's own faint grey. */
.maplibregl-ctrl-group button:is(:hover, :focus-visible) { background-color: rgb(0 0 0 / 5%); }

/* changes */
.changes { max-width: 1200px; margin: 0 auto; }
.changes h1 { margin: 4px 0; }
.changes h2 { font-size: 15px; margin: 18px 0 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 10px 0; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.changes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 0 24px; }
.changes-grid section { max-height: 360px; overflow: auto; }
.summary th, .summary td, .change-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.change-table td:nth-child(5) { white-space: normal; }
/* A count's label wraps on a narrow screen; the count stays beside it. */
.summary.labels td:first-child { white-space: normal; }
tr.failed td { background: color-mix(in srgb, var(--no) 8%, transparent); }

/* status */
.health-dot { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; border-radius: 50%; background: var(--line); color: var(--panel); font-size: 8px; font-weight: 700; line-height: 1; vertical-align: middle; }
.health-ok { background: var(--yes); }
.health-warn { background: var(--warn); }
.health-error { background: var(--no); }
.health-off { background: var(--muted); }
.status { max-width: 1200px; margin: 0 auto; }
.status h1 { margin: 4px 0; }
.status h2 { font-size: 15px; margin: 18px 0 8px; }
.status .num { text-align: right; font-variant-numeric: tabular-nums; }
.sources td { vertical-align: top; }
.sources tr.disabled td { color: var(--muted); }
.sources .error { max-width: 320px; white-space: normal; color: var(--no); font-size: 12px; }
.outcome-loaded { color: var(--yes); }
.outcome-failed, .outcome-missing { color: var(--no); }
.outcome-refused, .outcome-interrupted, .outcome-running { color: var(--warn); }
.osm-table th { font-weight: 500; font-size: 12px; color: var(--muted); }
.objects { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: flex-start; }
.status-list td { white-space: normal; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand .org { display: none; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  /* Wrapped onto a line of its own, the switcher still sits at the far right. */
  .lang { margin-left: auto; }
  .sidebar { top: auto; height: 55%; left: 8px; right: 8px; bottom: 8px; width: auto; }
  .sidebar.expanded { width: auto; height: calc(100% - 16px); }
  .layers-panel { width: 240px; }
  /* Too narrow to sit beside the attribution: above it, left of the scale. */
  .map-status { bottom: 30px; }
}

/* about */
.about { max-width: 820px; margin: 0 auto; line-height: 1.55; }
.about h1 { margin: 4px 0 8px; }
.about .lede { font-size: 16px; }
.about h2 { font-size: 13px; margin: 28px 0 4px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.about kbd { font-family: var(--mono); font-size: 12px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); }
.about-flow { overflow-x: auto; margin: 8px 0; }
.about-flow svg { display: block; width: 100%; min-width: 560px; height: auto; font-size: 13px; }
.about-flow rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.about-flow text { fill: var(--text); }
.about-flow .name { font-weight: 600; }
.about-flow .role { fill: var(--muted); font-size: 12px; }
.about-flow .flow { fill: none; stroke: var(--line); stroke-width: 1.5; }
.about-src { cursor: pointer; }
.about-src rect { stroke: currentColor; stroke-width: 1.5; }
.about-src .name { fill: currentColor; }
.about-src:hover rect, .about-src:focus-visible rect { fill: var(--accent-surface); }
.about-src[aria-pressed="true"] rect { stroke-width: 3; fill: var(--panel-2); }
.about-src:focus { outline: none; }
.about-src:focus-visible rect { stroke-dasharray: 4 2; }
.about-mid rect { fill: var(--panel-2); stroke: var(--line-strong); }
.about-out rect { stroke: var(--accent); }
.about-out .name { fill: var(--accent); }
.about-out:hover rect, .about-out:focus-visible rect { fill: var(--accent-surface); }
.about-flow .src-line-epiap { stroke: var(--epiap); }
.about-flow .src-line-chb { stroke: var(--chb); }
.about-flow .src-line-psa { stroke: var(--psa); }
.about-flow .src-line-halteviewer { stroke: var(--halteviewer); }
.about-flow .src-line-osm { stroke: var(--osm); }
.about-flow .src-line-otp { stroke: var(--otp); }
.about-source { min-height: 7.5em; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
.about-source h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.about-source p { margin: 4px 0; }
.about-cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.about-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); text-decoration: none; }
.about-card strong { color: var(--accent); }
.about-card span { color: var(--muted); font-size: 13px; }
.about-card:hover, .about-card:focus-visible { background: var(--accent-surface); border-color: var(--accent); text-decoration: none; }

.otp-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0; }
.otp-progress progress { width: min(320px, 100%); height: 10px; }
.otp-progress .muted { flex-basis: 100%; }
/* The card's matrix: one coloured square per pair, its metres on hover and in the tab. Fixed
   columns share the card's width, so even Utrecht's tracks fit without scrolling. */
.otp-matrix.dots { table-layout: fixed; margin: 6px 0; }
.otp-matrix.dots th { font-size: 10px; max-width: none; padding: 1px 2px; text-align: center; }
.otp-matrix.dots thead th:first-child { width: 5.5em; }
.otp-matrix.dots tbody th { text-align: left; }
/* The cell is a square at least, taller when the row's name is; the button fills all of it, so
   the hover and focus ring trace the same box as a picked cell's. */
.otp-matrix.dots td { position: relative; }
.otp-matrix.dots td::after { content: ''; display: block; aspect-ratio: 1; }
.otp-matrix.dots td button { position: absolute; inset: 0; padding: 0; }
.otp-matrix.dots td button:hover, .otp-matrix.dots td button:focus-visible { outline: 2px solid var(--text); outline-offset: -1px; }
/* Upright when a column is wide enough; sideways when a big station's tracks leave a few pixels. */
.otp-matrix.dots.narrow thead th:not(:first-child) { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; padding: 2px 0; vertical-align: bottom; }
.otp-change-counts { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.otp-change-worse { color: var(--no); }
.otp-change-better { color: var(--yes); }
