@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/nunito-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --cream: #FAF5EF;
  --ink: #1B1410;
  --copper: #B56A3A;
  --copper-hover: #96552C;
  --copper-bright: #DD9460;
  --dim: #9C8F84;
  --dim-2: #6B5E54;
  --line: #EDE4DA;
  --green: #009757;
  /* Text-safe rungs of the same semantics. --green/--red/--amber carry fills and
     large clocks (>=24px, which clear the 3:1 large-text bar); anything smaller
     than 18.66px uses these, which clear 4.5:1 on both white and cream. */
  --green-text: #007A46;
  --red-text: #D70015;
  --amber: #C2600A;
  --amber-text: #A85408;
  --disruption: #7A2333;
  --platform: #F5B400;
  --platform-planned: #F8D982;
  --platform-text: #16110C;
  --red: #FF3B30;
  --panel: #FFFFFF;
  --shadow: 0 24px 60px rgba(76, 50, 31, 0.10);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body.board-page { margin: 0; background: radial-gradient(circle at 72% 0%, rgba(221, 148, 96, 0.14), transparent 30rem), var(--cream); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.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; }

.board-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) 0 80px;
}

.board-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(48px, 8vw, 96px);
}

.board-brand, .nav-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.board-brand { gap: 10px; font-size: 20px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--copper-bright);
}

.nav-pill {
  padding: 12px 18px;
  background: var(--panel);
  color: var(--copper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-search {
  width: min(360px, 42vw);
}
.nav-search input {
  height: 46px;
  border-radius: 999px;
  box-shadow: none;
}

.search-hero, .board-hero {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  margin-bottom: 32px;
}

.search-hero {
  grid-template-columns: minmax(0, .7fr) minmax(480px, 1.3fr);
  align-items: end;
  gap: clamp(20px, 3vw, 32px);
  margin-bottom: 20px;
}
.stations-shell { padding-top: 32px; }
.search-hero h1 {
  max-width: 12ch;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1.05;
}
.search-hero .hero-copy {
  margin-top: 8px;
  font-size: clamp(16px, 1.5vw, 18px);
}

.board-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--copper);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: -0.04em; line-height: 0.98; }
h1 { max-width: 15ch; font-size: clamp(44px, 6vw, 68px); }
h2 { font-size: clamp(27px, 3.3vw, 40px); }
.hero-copy { max-width: 680px; margin: 18px 0 0; color: var(--dim-2); font-size: clamp(18px, 2vw, 22px); line-height: 1.45; }

.station-search { position: relative; max-width: 620px; }
.station-search.compact { max-width: none; }
.station-search input {
  width: 100%;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0 22px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
.station-search input:focus { border-color: var(--copper-bright); }

.station-search-card {
  position: relative;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(245, 180, 0, .14), transparent 9rem),
    rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}
.station-search-card .station-search {
  max-width: none;
}
.search-hint {
  margin: 12px 0 0;
  color: var(--dim-2);
  font-size: 14px;
}

.station-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  max-height: min(420px, 52svh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.station-results[hidden] { display: none; }
.station-results-heading {
  margin: 4px 8px 2px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.station-search-error {
  margin: 0;
  padding: 18px;
  color: var(--dim-2);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}
.station-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 18px;
}
.station-result:hover, .station-result:focus { background: var(--cream); outline: none; }
.station-result-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.station-result strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.station-result-copy span { color: var(--dim-2); font-size: 13px; }
.country-flag {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 17px;
  overflow: hidden;
  border: 1px solid rgba(27, 20, 16, 0.18);
  border-radius: 3px;
  background: var(--cream);
  color: var(--dim-2);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
.country-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.railora-loader {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  color: var(--dim-2);
}
.railora-loader.compact {
  background:
    linear-gradient(90deg, rgba(181, 106, 58, .08), rgba(245, 180, 0, .06)),
    var(--cream);
}
.railora-loader.board-loader {
  min-height: 112px;
  grid-template-columns: 1fr;
  padding: 22px;
  border: 1px dashed var(--line);
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 180, 0, .16), transparent 8rem),
    rgba(255,255,255,.72);
}
.loader-train-track {
  position: relative;
  grid-column: 1 / -1;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 45%, rgba(27,20,16,.14) 46% 54%, transparent 55%);
}
.railora-loader.board-loader .loader-train-track { height: 34px; }
.loader-train-track img {
  position: absolute;
  top: 50%;
  left: -18%;
  width: 72px;
  max-width: none;
  transform: translateY(-50%);
  animation: loader-train-run 1.8s cubic-bezier(.45,0,.25,1) infinite;
}
.railora-loader.board-loader .loader-train-track img { width: 126px; }
.railora-loader p {
  margin: 0;
  font-weight: 900;
}
.page-navigation-loader {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(250, 245, 239, .82);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.page-navigation-loader .railora-loader {
  width: min(460px, 100%);
  background: #fff;
  box-shadow: var(--shadow);
}

.popular-section, .board-card {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.network-dashboard {
  margin-bottom: 20px;
}
.country-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: none;
}
.country-filters::-webkit-scrollbar { display: none; }
/* Bare flags with one selected pill, the way the app reads. The country label
   lives in aria-label, not beside the flag: with the flag gone from the rows,
   these chips are the only place country is stated, so the selected state stays
   the high-contrast ink pill rather than a white-on-white one. */
.country-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--dim-2);
  padding: 7px 14px;
  font-weight: 900;
  cursor: pointer;
}
.country-chip:hover { background: var(--cream); }
.country-chip:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.country-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.country-chip strong {
  color: inherit;
  font-variant-numeric: tabular-nums;
}
.country-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.country-chip-label img {
  width: 22px;
  height: 16px;
  border: 1px solid rgba(27, 20, 16, .12);
  border-radius: 2px;
  object-fit: cover;
}
.board-toolbar.compact {
  margin-top: 22px;
  margin-bottom: 12px;
}
.network-metrics {
  display: grid;
  gap: 8px;
}
.network-reporting-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
}
.network-reporting-state strong { font-size: 18px; }
.network-reporting-state span { color: var(--dim-2); }
.network-stat-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 18px;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(237, 228, 218, .48);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease;
}
.network-stat-card:hover,
.network-stat-card.active,
.network-stat-card[aria-pressed="true"] {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 7%, #fff);
}
.network-stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: currentColor;
}
.network-stat-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.network-stat-copy {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}
.network-stat-copy small {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}
.network-stat-card strong {
  color: currentColor;
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.network-stat-chevron {
  color: var(--dim);
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}
.network-stat-card.blue { color: #2C4C8A; }
.network-stat-card.red { color: var(--red); }
.network-stat-card.cancelled { color: #7d2921; }
.network-impact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(180, 122, 0, .22);
  border-radius: 18px;
  background: rgba(245, 180, 0, .08);
  color: var(--ink);
  text-decoration: none;
}
.network-impact[hidden] { display: none; }
.network-impact-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--platform-fill);
  color: var(--platform-text);
  font-weight: 1000;
}
.network-impact > span:nth-child(2) {
  display: grid;
  gap: 2px;
}
.network-impact small {
  color: var(--dim-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.network-impact strong { font-size: 16px; }
.network-impact-count {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.network-impact > b {
  color: var(--amber);
  font-size: 18px;
}
.network-trains-list[hidden] { display: none; }
.network-list-rows { display: grid; }
.network-warning {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(180, 122, 0, .12);
  color: var(--amber);
  font-weight: 900;
}
.load-more-button {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--copper);
  font-weight: 900;
  cursor: pointer;
}
.load-more-button:hover {
  border-color: rgba(181, 106, 58, .32);
  background: var(--cream);
}
.load-more-button:disabled {
  cursor: wait;
  opacity: .7;
}
.load-more-button[hidden] { display: none; }
.pagination-feedback {
  margin: 12px 0 0;
  color: var(--dim-2);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}
.pagination-error { color: var(--red); }
.pagination-feedback[hidden] { display: none; }
.board-unavailable {
  display: grid;
  gap: 8px;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
}
.board-unavailable h2,
.board-unavailable p { margin: 0; }
.board-unavailable > p:last-child { color: var(--dim-2); }

.popular-section { padding: clamp(24px, 4vw, 42px); }
.page-app-promo { margin-top: 20px; }
.section-heading { margin-bottom: 24px; }
.station-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.station-card {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.station-card span { font-weight: 900; }
.station-card small { color: var(--dim-2); }
.station-directory {
  margin-top: 14px;
}
.station-directory summary {
  width: fit-content;
  margin: 0 auto;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--copper);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}
.station-directory summary::-webkit-details-marker { display: none; }
.station-directory[open] summary { margin-bottom: 14px; }

/* Rows bleed to this edge, so the value has to be a token both can read. */
.board-card { --board-card-pad: clamp(18px, 3vw, 28px); padding: var(--board-card-pad); }
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.board-toolbar p { margin: 8px 0 0; color: var(--dim-2); }

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--cream);
}
.segmented button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--dim-2);
  cursor: pointer;
  font-weight: 900;
}
.segmented button.active {
  background: var(--copper);
  color: #fff;
}
.segmented button:hover { color: var(--copper-hover); }
.segmented button.active:hover { color: #fff; background: var(--copper-hover); }

.board-panel[hidden] { display: none; }
.board-list { display: grid; }
/* ============================================================ train row
   One flat, hairline-divided list instead of a card per row: the list already
   sits inside .board-card, so a bordered card per row doubled every edge and
   cost the height that the times and the full route now occupy.

   Two shapes, one vocabulary — the same split the iOS app makes. A network row
   has no anchor station, so it carries both endpoints and both times; a board
   row is anchored, so it carries one clock, one endpoint and the track badge.
   Markup is built by public/scripts/train-row.js and mirrored by the station
   board's server render. --tr-lead is the hero column both shapes align on. */
.train-row {
  --tr-lead: 78px;
  --tr-meta-size: 12.5px;
  display: grid;
  grid-template-columns: var(--tr-lead) minmax(0, 1fr);
  grid-template-areas: "lead meta" "lead route" "lead times";
  column-gap: 14px;
  row-gap: 3px;
  align-content: center;
  /* Full bleed to the card's padding edge, so the rules read as one list. */
  margin-inline: calc(-1 * var(--board-card-pad, 16px));
  padding: 13px var(--board-card-pad, 16px);
  min-height: 92px;
  color: inherit;
}
.train-row + .train-row { border-top: 1px solid var(--line); }
.train-row.no-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "meta" "route" "times"; }
.train-row.has-reason { grid-template-areas: "lead meta" "lead route" "lead reason" "lead times"; }
.train-row.no-hero.has-reason { grid-template-areas: "meta" "route" "reason" "times"; }
.train-row[hidden] { display: none; }
/* The rows are links; a flat list with no affordance reads as static text. */
a.train-row { transition: background-color .16s ease; }
a.train-row:hover { background: var(--cream); }
a.train-row:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: -2px;
  background: var(--cream);
}
/* Dim the parts, not the row: the caption carries the meaning the dimming only
   hints at, and a child cannot out-opacity its parent. */
.train-row.has-gone > * { opacity: .45; }
.train-row.has-gone > .tr-lead { opacity: 1; }
.train-row.has-gone .tr-clock,
.train-row.has-gone .tr-struck { opacity: .45; }

.tr-lead {
  grid-area: lead;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}
.tr-hero-glyph { width: 26px; height: 26px; color: var(--dim-2); }
.tr-hero-glyph svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tr-hero-value {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.tr-hero-unit {
  max-width: 100%;
  line-height: 1.15;
}
.tr-lead.is-late .tr-hero-value,
.tr-lead.is-late .tr-hero-unit { color: var(--red-text); }
.tr-hero-platform .platform-value { min-width: 44px; padding: 6px 10px; font-size: 18px; }

.tr-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.tr-brand { display: inline-flex; align-items: center; min-width: 0; }
.tr-brand img { height: 16px; width: auto; max-width: 64px; object-fit: contain; object-position: left center; }
.tr-brand .operator-name {
  color: var(--dim-2);
  font-size: var(--tr-meta-size);
  font-weight: 900;
  white-space: nowrap;
}
.tr-sep { color: var(--dim-2); font-size: var(--tr-meta-size); font-weight: 700; }
.tr-number {
  color: var(--dim-2);
  font-size: var(--tr-meta-size);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tr-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--tr-meta-size);
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tr-dot { position: relative; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 999px; }
.tr-status.is-ontime { color: var(--green-text); }
.tr-status.is-ontime .tr-dot { background: var(--green); }
/* A halo that expands and fades, rather than the dot itself moving: the green
   says "on time", the pulse says the figure behind it is live. Transform and
   opacity only, so it composites and never lays out — a list of twenty of these
   costs nothing. */
.tr-dot.is-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--green);
  animation: tr-live-pulse 2.6s cubic-bezier(.22, .61, .36, 1) infinite;
}
@keyframes tr-live-pulse {
  0% { transform: scale(1); opacity: .5; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}
.tr-status.is-late { color: var(--red-text); }
.tr-status.is-cancelled { color: var(--red-text); }
.tr-status.is-cancelled .tr-dot { background: var(--red); }
.tr-arrived-word { color: var(--dim-2); font-weight: 700; }
.tr-arrived-late { color: var(--red-text); }

.tr-route {
  grid-area: route;
  /* Two lines before it ever ellipsizes: a single-line clamp was dropping the
     destination, which is half of what the row is for. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.tr-arrow { padding: 0 3px; color: var(--dim-2); font-weight: 700; }

.tr-reason {
  grid-area: reason;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--amber-text);
  font-size: var(--tr-meta-size);
  font-weight: 700;
}
.tr-reason-icon { display: grid; width: 13px; height: 13px; flex: 0 0 auto; }
.tr-reason-icon svg { width: 100%; height: 100%; fill: currentColor; }
.tr-reason-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tr-times {
  grid-area: times;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.tr-time {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.tr-time.is-plain { color: var(--ink); }
.tr-time.is-ontime { color: var(--green); }
.tr-time.is-late { color: var(--red); }
.tr-time.is-void { color: var(--dim-2); }
.tr-time.is-cancelled { color: var(--dim-2); }
.tr-arrival { display: inline-flex; align-items: flex-start; gap: 3px; }
.tr-day-offset { color: var(--dim-2); font-size: 12px; font-weight: 800; }
/* The pair spreads across the row on a phone, so it needs no glue; in the
   desktop band it collapses to an inline pair and does. */
.tr-times-arrow { display: none; color: var(--dim-2); font-size: 17px; font-weight: 700; }

/* ---- board shape: one clock in the lead, one endpoint, the track badge */
.train-row.is-board {
  --tr-lead: 76px;
  grid-template-columns: var(--tr-lead) minmax(0, 1fr) auto;
  grid-template-areas: "lead meta plat" "lead route plat";
  align-items: center;
  min-height: 78px;
}
.train-row.is-board.has-reason {
  grid-template-areas: "lead meta plat" "lead route plat" "lead reason plat";
}
.tr-board-lead { justify-items: start; gap: 1px; text-align: left; }
.tr-struck {
  color: var(--dim-2);
  font-size: var(--tr-meta-size);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
/* A struck time is struck in red wherever it appears: the scheduled time a
   delayed board row moved off, and both times of a cancelled service. */
.tr-struck,
.tr-time.is-cancelled,
.tr-clock.is-cancelled {
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.tr-clock {
  font-size: 23px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.tr-clock.is-late { color: var(--red); }
.tr-clock.is-cancelled { color: var(--dim-2); }
.tr-cap { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; }
.tr-cap.is-ontime { color: var(--green-text); }
.tr-cap.is-late { color: var(--red-text); font-variant-numeric: tabular-nums; }
.tr-cap.is-ontime .tr-dot { background: var(--green); }
.tr-cap.is-cancelled { color: var(--red-text); }
.tr-cap.is-muted { color: var(--dim-2); }
.tr-plat { grid-area: plat; }

/* Owned by the trip-detail page, which renders both a stop timeline and an
   operator lockup. Scoped to their consumers so the row vocabulary above cannot
   collide with them, and so neither set is global by accident. */
.train-number {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.time {
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.train-main { display: grid; gap: 3px; min-width: 0; }
.train-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.train-main span, .platform { color: var(--dim-2); font-size: 14px; }
.status {
  justify-self: end;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
}
.platform-pill {
  justify-self: end;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--platform-text);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.45);
}
.platform-hero {
  display: grid;
  justify-items: center;
  justify-self: end;
  gap: 3px;
  min-width: 58px;
}
.tr-hero-unit,
.platform-label {
  color: var(--dim-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.platform-label { line-height: 1; }
.platform-value {
  min-width: 52px;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--platform-text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.45);
}
.platform-pill.announced,
.platform-hero.announced .platform-value,
.summary-platform.announced { background: var(--platform); }
.platform-pill.planned,
.platform-hero.planned .platform-value,
.summary-platform.planned { background: var(--platform-planned); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.status.green { color: var(--green-text); background: rgba(0, 151, 87, 0.10); }
.status.red { color: var(--red-text); background: rgba(255, 59, 48, 0.10); }
.status.neutral { color: var(--dim-2); background: var(--cream); }
.empty-state {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--dim-2);
  text-align: center;
}

@keyframes loader-train-run {
  0% { left: -55%; opacity: 0; }
  16% { opacity: 1; }
  82% { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-train-track img {
    animation: none;
  }
  .loader-train-track img {
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.train-detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, .86fr) minmax(520px, 1.14fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 28px;
}
.train-identity-card,
.metric-card,
.trip-summary-card,
.debug-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}
.train-identity-card {
  min-height: 260px;
  display: grid;
  align-content: end;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 36px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 16%, rgba(245, 180, 0, .22), transparent 12rem),
    radial-gradient(circle at 15% 0%, rgba(181, 106, 58, .18), transparent 16rem),
    #fff;
}
.train-identity-card h1 {
  max-width: 13ch;
  font-size: clamp(42px, 5vw, 72px);
}
.operator-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--dim-2);
  font-size: 14px;
  font-weight: 900;
}
.operator-lockup img {
  max-width: 86px;
  max-height: 24px;
  object-fit: contain;
}
.trip-summary-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.76)),
    #fff;
}
.station-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(250, 245, 239, .62);
}
.station-summary > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.station-summary span,
.station-summary small,
.live-strip span {
  color: var(--dim-2);
  font-size: 13px;
  font-weight: 900;
}
.station-summary > div:first-child > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
}
.station-board-link {
  width: fit-content;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(181, 106, 58, .38);
  text-underline-offset: 3px;
  transition: color .16s ease, text-decoration-color .16s ease;
}
.station-board-link:hover,
.station-board-link:focus-visible {
  color: var(--copper);
  text-decoration-color: currentColor;
}
.summary-time {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.summary-time strong {
  font-size: clamp(34px, 3.5vw, 42px);
  line-height: .92;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.summary-platform {
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--platform-text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.45);
}
.summary-platform.unknown {
  background: rgba(156, 143, 132, .14);
  color: var(--dim);
  box-shadow: none;
}
.trip-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--dim-2);
}
.trip-separator span {
  height: 1px;
  background: var(--line);
}
.trip-separator em {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--cream);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.live-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
}
.live-strip article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.live-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.live-strip .speed-metric strong {
  color: var(--copper);
  font-size: 26px;
}
.detail-metrics {
  display: grid;
  gap: 12px;
}
.metric-card {
  display: grid;
  gap: 6px;
  align-content: center;
  min-height: 96px;
  padding: 18px;
  border-radius: 26px;
}
.metric-card span,
.metric-card small {
  color: var(--dim-2);
  font-size: 13px;
  font-weight: 900;
}
.metric-card strong {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.green-text { color: var(--green-text); }
.red-text { color: var(--red-text); }

.route-timeline {
  display: grid;
}
.route-stop {
  position: relative;
  display: grid;
  grid-template-columns: 28px 76px minmax(0, 1fr) 110px 112px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
}
.route-stop + .route-stop { border-top: 1px solid var(--line); }
.route-marker {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
}
.route-marker::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: -14px;
  width: 3px;
  border-radius: 999px;
  background: var(--line);
}
.route-stop:first-child .route-marker::before { top: 50%; }
.route-stop:last-child .route-marker::before { bottom: 50%; }
.route-marker span {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--dim);
  box-shadow: 0 0 0 1px var(--line);
}
.route-stop.passed {
  opacity: .48;
}
.route-stop.passed .route-marker::before,
.route-stop.passed .route-marker span {
  background: var(--green);
}
.route-stop.next {
  margin: 6px -12px;
  padding: 16px 12px;
  border-radius: 24px;
  background: rgba(181, 106, 58, .10);
  opacity: 1;
}
.route-stop.next .route-marker::before,
.route-stop.next .route-marker span {
  background: var(--copper);
}
.route-stop.next .route-marker span {
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 6px rgba(181, 106, 58, .16);
  animation: next-stop-pulse 2.2s ease-in-out infinite;
}
.route-stop.upcoming .route-marker span {
  background: #fff;
}
.route-stop.skipped {
  opacity: .6;
}
.debug-card {
  margin-top: 18px;
}

.train-detail-shell {
  display: grid;
  gap: 20px;
  max-width: 1080px;
}

.trip-status-card {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 38px;
  background:
    radial-gradient(circle at 88% 0%, rgba(245, 180, 0, .15), transparent 14rem),
    radial-gradient(circle at 0% 0%, rgba(221, 148, 96, .15), transparent 20rem),
    #fff;
  box-shadow: var(--shadow);
}

.trip-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.trip-status-header .operator-lockup {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.operator-lockup .operator-name {
  color: var(--dim-2);
}

.trip-status-header .operator-lockup img {
  width: auto;
  max-width: 128px;
  height: 28px;
  max-height: 28px;
}

.trip-status-header .train-number {
  min-height: 24px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.operator-website-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  /* `--ink` on white, not `--copper` on white: 12px/900 is too small for the "large text" AA
     exception, and copper-on-white only clears 4.13:1 there (measured) — short of the 4.5:1
     floor. `--copper-hover` (5.78:1, measured) is the interaction cue instead. */
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.operator-website-link:hover,
.operator-website-link:focus-visible {
  background: var(--copper-hover);
  color: #fff;
}

.journey-status {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.journey-status span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.journey-status.cancelled span {
  color: var(--red);
}

.journey-status small {
  color: var(--dim-2);
  font-size: 12px;
  font-weight: 900;
}

.trip-route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.trip-route-meta .eyebrow {
  margin: 0;
}

.trip-route-meta > p:last-child {
  margin: 0;
  color: var(--dim-2);
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.journey-endpoints {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.journey-endpoints .station-summary {
  height: 100%;
  align-items: center;
  background: rgba(250, 245, 239, .72);
}

.journey-endpoints .trip-separator {
  grid-template-columns: 38px auto 38px;
}

.journey-endpoints .trip-separator em {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--copper);
  font-size: 18px;
}

.live-strip {
  grid-template-columns: 1.35fr .8fr 1fr;
}

.live-strip article {
  min-height: 104px;
  align-content: center;
}

.live-strip article small {
  overflow: hidden;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-strip .next-stop-metric strong {
  font-size: 24px;
}

.live-strip .speed-metric strong {
  color: var(--dim);
}

.live-strip .speed-metric strong.has-live-data {
  color: var(--copper);
}

.train-alerts {
  display: grid;
  gap: 10px;
}

.train-alert {
  padding: 15px 16px;
  border: 1px solid rgba(122, 35, 51, .24);
  border-radius: 18px;
  background: rgba(122, 35, 51, .08);
}

.train-alert-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--disruption);
}

.train-alert-header > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--disruption);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.train-alert-header small {
  color: var(--dim-2);
  font-size: 12px;
  font-weight: 900;
}

.train-alert p {
  margin: 8px 0 0 29px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.service-notice {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(194, 96, 10, .2);
  border-radius: 18px;
  background: rgba(194, 96, 10, .09);
  color: var(--amber);
}

.service-notice strong {
  font-size: 13px;
  font-weight: 900;
}

.service-notice span {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.speed-card {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  overflow: hidden;
  border: 1px solid rgba(181, 106, 58, .22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 8% 0%, rgba(221, 148, 96, .18), transparent 12rem),
    #fff;
  box-shadow: 0 16px 36px rgba(76, 50, 31, .07);
}

.speed-freshness {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(181, 106, 58, .10);
  color: var(--copper);
  font-size: 11px;
  font-weight: 900;
}

.speed-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 7px 0 0;
}

.speed-value strong {
  color: var(--copper);
  font-size: clamp(48px, 7vw, 72px);
  line-height: .88;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}

.speed-value span {
  color: var(--dim);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}

.speed-context {
  display: grid;
  gap: 4px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.speed-context strong {
  font-size: 18px;
}

.speed-context span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--dim-2);
  font-size: 12px;
  font-weight: 900;
}

.speed-context small {
  max-width: 34ch;
  color: var(--dim-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

/* Its own block, deliberately styled like a small standalone chip rather than nested in
   `.speed-card` — BE:sncb has a trainset label with no GPS speed to sit next to. */
.trainset-label {
  display: flex;
}

.trainset-label[hidden] {
  display: none;
}

.trainset-label span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--dim-2);
  font-size: 12px;
  font-weight: 900;
}

.car-occupancy {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  border: 1px solid rgba(181, 106, 58, .22);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(76, 50, 31, .07);
}

.car-occupancy[hidden] {
  display: none;
}

.car-occupancy-label {
  color: var(--dim-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.car-occupancy-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Same semantic colors as the delay/status system (--green/--amber/--red) so a low/medium/high
   car reads with the same "good/watch/bad" meaning as everywhere else on the site. Base is
   neutral, NOT green: `level` is typed as the closed union today, but this is JSON off the
   network, not something TypeScript actually checks at runtime — a level string the backend adds
   later and this build doesn't recognize would otherwise render as "confirmed low occupancy",
   the opposite of honest. `--low` is its own explicit class for exactly that reason. */
.car-occupancy-cell {
  width: 22px;
  height: 28px;
  border-radius: 6px;
  background: var(--dim-2);
  opacity: .35;
}

.car-occupancy-cell--low {
  background: var(--green);
  opacity: 1;
}

.car-occupancy-cell--medium {
  background: var(--amber);
  opacity: 1;
}

.car-occupancy-cell--high {
  background: var(--red);
  opacity: 1;
}

.route-card {
  box-shadow: 0 18px 50px rgba(76, 50, 31, .07);
}

.past-stops {
  border-bottom: 1px solid var(--line);
}

.past-stops > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 4px auto 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--dim-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.past-stops > summary .open-label {
  display: none;
}

.past-stops > summary i {
  font-size: 16px;
  font-style: normal;
  line-height: 1;
  transition: transform .2s ease;
}

.past-stops[open] > summary .closed-label {
  display: none;
}

.past-stops[open] > summary .open-label {
  display: inline;
}

.past-stops[open] > summary i {
  transform: rotate(180deg);
}

.past-stops[open] .past-stops-content {
  animation: reveal-past-stops .26s ease-out both;
}

.past-stops > summary::-webkit-details-marker {
  display: none;
}

@keyframes reveal-past-stops {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes next-stop-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(181, 106, 58, .12); }
  50% { box-shadow: 0 0 0 10px rgba(181, 106, 58, .03); }
}

@media (prefers-reduced-motion: reduce) {
  .past-stops[open] .past-stops-content,
  .route-stop.next .route-marker span,
  .tr-dot.is-live::after {
    animation: none;
  }
}

.debug-card {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: none;
}

.debug-card summary {
  padding: 14px 18px;
  color: var(--dim-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.debug-card > div {
  padding: 0 18px 16px;
}

.debug-card p {
  margin: 4px 0;
  color: var(--dim-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================ desktop band
   Past ~900px the stacked phone row wastes a line. The reading order is
   unchanged — meta, route, times, status — the grid just folds: the time pair
   collapses from spread-across-the-row to an inline pair, and the status earns
   its own column so it stops floating at the end of the meta line. The board
   row folds further, to a single band, because every one of its cells is short
   and typed: it is a departure panel, and it is read one column at a time. */
@media (min-width: 900px) {
  .train-row {
    --tr-lead: 96px;
    grid-template-columns: var(--tr-lead) minmax(0, 1fr) minmax(150px, auto) 128px;
    grid-template-areas:
      "lead meta  times status"
      "lead route times status";
    align-items: center;
    column-gap: 20px;
    row-gap: 2px;
    min-height: 80px;
    padding: 14px var(--board-card-pad, 16px);
  }
  .train-row.has-reason {
    grid-template-areas:
      "lead meta   times status"
      "lead route  times status"
      "lead reason times status";
  }
  .train-row.no-hero {
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto) 128px;
    grid-template-areas: "meta times status" "route times status";
  }
  .train-row.no-hero.has-reason {
    grid-template-areas: "meta times status" "route times status" "reason times status";
  }
  .tr-status {
    grid-area: status;
    margin-left: 0;
    justify-content: flex-end;
    align-self: center;
  }
  .tr-times { justify-content: flex-end; align-self: center; gap: 9px; }
  .tr-times-arrow { display: inline; }
  .tr-time { font-size: 22px; }
  .tr-route { font-size: 18px; -webkit-line-clamp: 1; }

  .train-row.is-board {
    --tr-lead: 100px;
    /* Fixed operator column: marks run from the OUIGO disc to the Lyria wordmark,
       so without it the train number starts on a different x on every row. */
    grid-template-columns: var(--tr-lead) 156px minmax(0, 1fr) auto;
    grid-template-areas: "lead meta route plat";
    min-height: 72px;
    column-gap: 18px;
  }
  .train-row.is-board.has-reason {
    grid-template-areas: "lead meta route plat" "lead meta reason plat";
  }
  .tr-clock { font-size: 22px; }
}

@media (max-width: 820px) {
  .board-nav {
    align-items: stretch;
    flex-direction: column;
  }
  .nav-search {
    width: 100%;
  }
  .search-hero, .board-hero, .board-toolbar, .train-detail-hero { grid-template-columns: 1fr; display: grid; }
  .search-hero {
    gap: 16px;
    margin-bottom: 20px;
  }
  .search-hero h1 { font-size: 36px; }
  .search-hero .hero-copy {
    margin-top: 8px;
    font-size: 16px;
  }
  .station-search-card {
    padding: 16px;
    border-radius: 20px;
  }
  .station-search input { height: 56px; }
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .network-metrics { grid-template-columns: 1fr; }
  .route-stop { grid-template-columns: 24px 68px minmax(0, 1fr); }
  .route-stop .platform,
  .route-stop .status { grid-column: 3; justify-self: start; }
  .station-summary,
  .live-strip {
    grid-template-columns: 1fr;
  }
  .summary-time {
    justify-items: start;
  }
  .summary-time strong {
    font-size: 34px;
  }
  .trip-status-card {
    border-radius: 28px;
  }
  .trip-status-header {
    align-items: flex-start;
  }
  .journey-endpoints {
    grid-template-columns: 1fr;
  }
  .journey-endpoints .trip-separator {
    grid-template-columns: 1fr auto 1fr;
  }
  .journey-endpoints .trip-separator em {
    transform: rotate(90deg);
  }
  .speed-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .speed-context {
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .live-strip article {
    min-height: 0;
  }
  .live-strip article small {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .board-shell {
    width: min(100% - 20px, 1160px);
    padding-top: 22px;
  }
  .stations-shell { padding-top: 16px; }
  .network-impact {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .network-impact-count {
    grid-column: 2;
  }
  .network-impact > b {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  h1 {
    font-size: clamp(38px, 12vw, 52px);
  }
  .hero-copy {
    font-size: 17px;
  }
  .station-search-card,
  .popular-section,
  .board-card {
    border-radius: 24px;
  }
  .board-hero {
    gap: 18px;
    margin-bottom: 24px;
  }
  .board-hero .station-search input {
    height: 56px;
  }
  .station-grid {
    grid-template-columns: 1fr 1fr;
  }
  .station-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .board-toolbar {
    gap: 14px;
    margin-bottom: 12px;
  }
  .segmented,
  .time-filters {
    width: 100%;
  }
  .segmented button,
  .time-filters button {
    flex: 1;
    padding: 8px 10px;
  }
  .time-filters {
    margin-bottom: 12px;
  }
  .train-row { --tr-lead: 70px; min-height: 86px; column-gap: 12px; }
  .train-row.is-board { --tr-lead: 68px; min-height: 74px; }
  .tr-time { font-size: 22px; }
  .tr-clock { font-size: 21px; }
  .train-row .platform-value {
    min-width: 44px;
    padding: 6px 9px;
    font-size: 17px;
  }
  .trip-status-card {
    gap: 18px;
    padding: 18px;
  }
  .trip-status-header {
    display: grid;
  }
  .journey-status {
    justify-items: start;
  }
  .trip-route-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .journey-endpoints .station-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 14px;
  }
  .journey-endpoints .station-summary > div:first-child > strong {
    overflow: visible;
    white-space: normal;
    line-height: 1.15;
  }
  .journey-endpoints .summary-time {
    justify-items: end;
  }
  .journey-endpoints .summary-time strong {
    font-size: 30px;
  }
  .operator-lockup {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .route-card {
    padding-inline: 14px;
  }
  .route-stop {
    grid-template-columns: 22px 58px minmax(0, 1fr);
    gap: 10px;
  }
  .route-stop .time {
    font-size: 18px;
  }
}

/* ============================================================ station links
   The crawlable path into the catalogue, and a real way out of a board for a
   traveller who picked the wrong station. */
.station-links {
  margin-top: 28px;
  padding: var(--board-card-pad, 24px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.station-links h2 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.2vw, 26px);
}
.station-links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.station-links a {
  display: grid;
  gap: 2px;
  min-height: 44px;
  align-content: center;
  padding: 9px 12px;
  border-radius: 14px;
}
.station-links a:hover { background: var(--cream); }
.station-links a:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.station-links strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.station-links span { color: var(--dim-2); font-size: 13px; }
