:root {
  color-scheme: light;

  --blue-50: #ecf8ff;
  --blue-100: #d4eeff;
  --blue-200: #b3e3ff;
  --blue-300: #7ed2ff;
  --blue-400: #41b8ff;
  --blue-500: #1699ff;
  --blue-600: #007eff;
  --blue-700: #0070fd;
  --blue-800: #0155cc;
  --blue-900: #094b9f;
  --blue-950: #0a2a58;

  --paper: #ffffff;
  --ink: var(--blue-950);
  --muted: #476782;
  --accent: var(--blue-700);
  --accent-strong: var(--blue-800);
  --wash: var(--blue-50);
  --wash-strong: var(--blue-100);
  --white: #ffffff;

  --u-bahn: #0066b3;
  --s-bahn: #008a45;
  --tram: #d70c2c;
  --bus: #005aa7;
  --bahn: #303030;

  --ok: #006b45;
  --warn: #8a4b00;
  --bad: #a51f16;
  --unknown: #4c6a88;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  box-shadow: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: wait;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

svg {
  display: block;
}

::selection {
  background: var(--blue-300);
  color: var(--ink);
}

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

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(16px, calc((100vw - 820px) / 2));
  background: var(--blue-950);
  color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-text span {
  margin-top: 4px;
  color: var(--blue-300);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--white);
}

.icon-button:hover {
  background: var(--blue-800);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

#refresh-button.is-loading {
  opacity: 0.45;
}

/* -------------------------------------------------------------- page shell */

.page {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.stop-heading {
  padding-top: 4px;
  margin-bottom: 24px;
}

.stop-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.stop-title-row h1 {
  max-width: 100%;
  font-size: clamp(34px, 9vw, 56px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  flex: none;
  padding: 0 14px;
  background: var(--blue-950);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secondary-button:hover {
  background: var(--blue-800);
}

#edit-routes-button {
  min-height: 36px;
  padding: 0;
  background: none;
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

#edit-routes-button:hover {
  background: none;
  color: var(--blue-950);
}

.live-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
}

.live-pill.is-stale {
  color: var(--warn);
}

/* -------------------------------------------------------------- route bar */

.route-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
}

.route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  min-width: 0;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  max-width: 100%;
  color: var(--ink);
}

.route-chip .line-badge {
  width: 34px;
  height: 34px;
}

.route-chip .line-badge-mode {
  font-size: 5px;
}

.route-chip .line-badge-number {
  font-size: 13px;
}

.route-chip-destination {
  overflow: hidden;
  max-width: 190px;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-chip-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
}

.route-chip-remove:hover {
  background: var(--wash);
  color: var(--bad);
}

/* -------------------------------------------------------------- sections */

.card {
  margin: 0;
  padding: 0;
  background: none;
}

.departures-card {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
}

.section-heading h2 {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.filter-group {
  display: flex;
  flex: none;
  gap: 8px;
}

.filter-group button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-group button:hover:not(:disabled) {
  background: var(--wash);
  color: var(--ink);
}

.filter-group button.is-active {
  background: var(--blue-950);
  color: var(--white);
}

.filter-group button.is-active:hover {
  background: var(--blue-800);
  color: var(--white);
}

.departures-subtitle {
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.departure-list {
  margin-top: 4px;
}

.departure-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.departure-list.is-all .departure-row.is-followed {
  background: var(--wash);
}

.departure-row.is-cancelled {
  color: var(--muted);
}

.departure-row.is-cancelled .departure-destination {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.line-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--white);
  font-family: var(--mono);
  line-height: 1;
  text-align: center;
}

.line-badge-mode {
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.line-badge-number {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.mode-ubahn {
  background: var(--u-bahn);
}

.mode-sbahn {
  background: var(--s-bahn);
  border-radius: 50%;
}

.mode-tram {
  background: var(--tram);
}

.mode-bus,
.mode-regional_bus {
  background: var(--bus);
  border-radius: 50%;
}

.mode-bahn {
  background: var(--bahn);
}

.departure-body {
  min-width: 0;
}

.departure-destination {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.departure-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: uppercase;
}

.departure-meta .dot {
  color: var(--blue-500);
}

.trend {
  font-weight: 700;
}

.trend.worse {
  color: var(--bad);
}

.trend.better {
  color: var(--ok);
}

.trend.stable {
  color: var(--muted);
}

.departure-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}

.departure-countdown {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 1;
  white-space: nowrap;
}

.departure-countdown.is-imminent {
  color: var(--accent-strong);
}

.delay-chip {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.delay-chip.late,
.delay-chip.cancelled {
  color: var(--bad);
}

.delay-chip.slight {
  color: var(--warn);
}

.delay-chip.on-time {
  color: var(--ok);
}

.delay-chip.unknown {
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 0;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
}

.empty-state span {
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.5;
}

/* ----------------------------------------------------------------- health */

[data-status="excellent"] {
  --health-color: #006b45;
}

[data-status="healthy"] {
  --health-color: #3f6b00;
}

[data-status="strained"] {
  --health-color: #8a4b00;
}

[data-status="critical"] {
  --health-color: #a51f16;
}

[data-status="unknown"] {
  --health-color: var(--unknown);
}

.health-card {
  margin-top: 40px;
}

.health-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.health-score-block {
  display: flex;
  align-items: baseline;
  flex: none;
  color: var(--health-color);
}

.health-score {
  font-family: var(--mono);
  font-size: 64px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.09em;
  line-height: 0.8;
}

.health-unit {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.health-summary {
  min-width: 0;
  padding-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--health-color);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: currentColor;
}

.health-summary h2 {
  margin-top: 7px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

.health-copy {
  max-width: 56ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.health-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin-top: 24px;
}

.health-metrics dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.health-metrics dd {
  margin-top: 4px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-metrics dd.is-alert {
  color: var(--bad);
}

.history {
  margin-top: 28px;
}

.history-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.history-summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.history-chart {
  position: relative;
  height: 54px;
  margin-top: 10px;
}

.health-bars {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(60, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
}

.bar {
  height: var(--h, 2%);
  min-height: 1px;
  background: var(--bar-color, var(--blue-200));
}

.bar--excellent {
  --bar-color: #12815e;
}

.bar--healthy {
  --bar-color: #6b8f25;
}

.bar--strained {
  --bar-color: #c68013;
}

.bar--critical {
  --bar-color: #b9382d;
}

.bar--unknown {
  --bar-color: var(--blue-300);
}

.bar--empty {
  --bar-color: var(--blue-100);
}

.bar.is-latest {
  background: var(--ink);
}

.chart-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 6px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.chart-empty strong {
  color: var(--ink);
  font-size: 9px;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.health-explainer {
  margin-top: 24px;
}

.health-explainer summary {
  width: fit-content;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.health-explainer p {
  max-width: 70ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.health-explainer strong {
  color: var(--ink);
}

/* ----------------------------------------------------------------- loading */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 12px;
  background: var(--bad);
  color: var(--white);
}

.banner-icon {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.banner-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.banner-copy strong {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.banner-copy span {
  font-size: 11px;
  line-height: 1.4;
}

.banner button {
  min-height: 34px;
  flex: none;
  padding: 0 10px;
  background: var(--white);
  color: var(--bad);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.loading-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.loading-card h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.loading-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 10px;
  height: 10px;
  flex: none;
  margin-top: 6px;
  background: var(--accent);
}

.retry-button {
  min-height: 40px;
  margin-left: auto;
  flex: none;
  padding: 0 12px;
  background: var(--blue-950);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.loading-card.is-error h2 {
  color: var(--bad);
}

.loading-card.is-error .spinner {
  display: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 40px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------- dialogs */

.dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px max(16px, calc((100vw - 720px) / 2)) 32px;
  overflow: auto;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.dialog::backdrop {
  background: var(--blue-950);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dialog-heading h2 {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-transform: uppercase;
}

.dialog .icon-button {
  background: var(--blue-950);
  color: var(--white);
}

.dialog .icon-button:hover {
  background: var(--blue-800);
}

.dialog-hint {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-transform: uppercase;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 0 12px;
  background: var(--wash);
  color: var(--muted);
}

.search-field:focus-within {
  background: var(--wash-strong);
}

.search-field svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-field input::placeholder {
  color: var(--muted);
}

.station-results,
.route-options,
.saved-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.station-results,
.saved-list {
  max-height: 52dvh;
  overflow: auto;
}

.station-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 0;
  background: none;
  text-align: left;
}

.station-result:hover {
  background: var(--wash);
}

.station-result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.station-result-main strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-result-main span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
}

.mode-chips {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
}

.mode-chip {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#routes-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#routes-dialog .route-options {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#routes-dialog .dialog-actions {
  flex: none;
}

.route-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 0;
  cursor: pointer;
}

.route-option:hover,
.route-option:has(input:checked) {
  background: var(--wash);
}

.route-option input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
  appearance: none;
  background: var(--wash-strong);
}

.route-option input:checked {
  background: var(--accent);
}

.route-option .line-badge {
  width: 40px;
  height: 40px;
}

.route-option .line-badge-mode {
  font-size: 5.5px;
}

.route-option .line-badge-number {
  font-size: 15px;
}

.route-option-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.route-option-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-option-copy span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.text-button {
  min-height: 40px;
  padding: 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-button:hover {
  color: var(--bad);
  background: var(--wash);
}

.save-form {
  margin-top: 20px;
}

.save-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-row {
  display: flex;
  gap: 8px;
}

.save-row input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: var(--wash);
  color: var(--ink);
  font-size: 15px;
}

.save-row input:focus {
  background: var(--wash-strong);
}

.save-form .dialog-hint {
  margin-top: 8px;
}

.saved-heading {
  margin-top: 28px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.saved-item:hover {
  background: var(--wash);
}

.saved-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.saved-item-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-item-copy span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.saved-item-actions {
  display: flex;
  flex: none;
  gap: 10px;
}

.saved-open,
.saved-delete {
  min-height: 36px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saved-open:hover {
  background: var(--wash);
}

.saved-delete {
  color: var(--muted);
}

.saved-delete:hover {
  background: var(--wash);
  color: var(--bad);
}

.saved-list .empty-state {
  padding: 16px 0;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  padding: 12px 16px;
  background: var(--blue-950);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.toast[data-tone="error"] {
  background: var(--bad);
}

/* -------------------------------------------------------------- responsive */

@media (min-width: 600px) {
  .page {
    padding: 32px 24px 48px;
  }

  .stop-title-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .stop-title-row h1 {
    font-size: clamp(42px, 6vw, 64px);
  }

  .route-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .departure-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 16px 0;
  }

  .departure-row .line-badge {
    width: 48px;
    height: 48px;
  }

  .departure-row .line-badge-mode {
    font-size: 6.5px;
  }

  .departure-row .line-badge-number {
    font-size: 18px;
  }

  .departure-destination {
    font-size: 17px;
  }

  .departure-countdown {
    font-size: 24px;
  }

  .health-score {
    font-size: 80px;
  }

  .health-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dialog {
    padding: 32px max(24px, calc((100vw - 720px) / 2)) 48px;
  }
}

@media (max-width: 430px) {
  .brand-text span {
    display: none;
  }

  .route-chip-destination {
    max-width: 150px;
  }

  .health-main {
    gap: 10px;
  }

  .health-score {
    font-size: 56px;
  }

  .health-summary h2 {
    font-size: 16px;
  }

  .save-row {
    flex-wrap: wrap;
  }

  .save-row input {
    flex: 1 1 100%;
  }

  .save-row .primary-button {
    width: 100%;
  }
}
