:root {
  --brand-graphite: #28352F;
  --brand-acid: #C9E46A;
  --brand-sage: #DCE3DA;
  --brand-stone: #F3F1EC;
  --font-family-sans: "Manrope", "Avenir Next", Avenir, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Semantic presentation colors. Domain states map to these roles in UI only. */
  --semantic-positive: #7CC69A;
  --semantic-positive-bg: rgba(124, 198, 154, .09);
  --semantic-caution: #D7AD69;
  --semantic-caution-bg: rgba(215, 173, 105, .10);
  --semantic-warning: #E89545;
  --semantic-warning-bg: rgba(232, 149, 69, .11);
  --semantic-critical: #EC7979;
  --semantic-critical-bg: rgba(236, 121, 121, .11);
  --semantic-cancelled: #F07B86;
  --semantic-cancelled-bg: rgba(240, 123, 134, .12);

  --bg: #18211D;
  --surface: #202A25;
  --surface-raised: #25312B;
  --surface-muted: #2B3731;
  --text: #F3F1EC;
  --muted: #AEB8AF;
  --muted-strong: #D4DAD3;
  --line: rgba(220, 227, 218, .12);
  --line-strong: rgba(220, 227, 218, .23);
  --accent: var(--brand-acid);
  --accent-ink: #1B251F;
  --overlay: rgba(8, 13, 10, .70);
  --shadow-sheet: 0 -18px 52px rgba(6, 10, 8, .26);
  --semantic-neutral: var(--muted);
  --semantic-neutral-bg: var(--surface-muted);
  --semantic-realtime: var(--accent);
  --semantic-estimated: var(--muted-strong);
  --semantic-warning-banner-bg: #6A4828;
  --semantic-warning-banner-fg: #FFF2DE;

  /* Spacing scale. Component-specific exceptions stay explicit only when geometry requires them. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;

  /* Typography roles used by the current product hierarchy. */
  --type-display-time-size: clamp(2.42rem, 11.5vw, 2.85rem);
  --type-display-countdown-size: clamp(1.95rem, 9vw, 2.35rem);
  --type-heading-size: 1.45rem;
  --type-body-size: .84rem;
  --type-label-size: .72rem;
  --type-caption-size: .64rem;
  --type-display-weight: 770;
  --type-emphasis-weight: 760;
  --type-label-weight: 700;
  --type-body-weight: 650;
  --type-display-tracking: -.055em;

  /* Shape roles. */
  --radius-badge: 7px;
  --radius-compact: 8px;
  --radius-control: 9px;
  --radius-panel: 10px;
  --radius-surface: 14px;
  --radius-sheet: 18px;
  --radius-pill: 999px;
  --gate-cut: 14px;

  /* Control sizing keeps touch targets explicit. */
  --control-height: 44px;
  --control-field-height: 48px;
  --control-large-height: 50px;
  --focus-ring-width: 3px;
  --focus-ring-offset: 3px;

  /* Motion roles: feedback, state changes, navigation. */
  --motion-instant: 150ms;
  --motion-state-change: 240ms;
  --motion-navigation: 300ms;
  --ease-brand: cubic-bezier(.22, 1, .36, 1);

  color-scheme: dark;
}

html[data-theme="light"] {
  --semantic-positive: #286D4C;
  --semantic-positive-bg: rgba(40, 109, 76, .07);
  --semantic-caution: #8C6427;
  --semantic-caution-bg: rgba(140, 100, 39, .08);
  --semantic-warning: #A65216;
  --semantic-warning-bg: rgba(166, 82, 22, .08);
  --semantic-critical: #A83D42;
  --semantic-critical-bg: rgba(168, 61, 66, .08);
  --semantic-cancelled: #972F39;
  --semantic-cancelled-bg: rgba(151, 47, 57, .08);

  --bg: var(--brand-stone);
  --surface: #F8F7F2;
  --surface-raised: #FCFBF7;
  --surface-muted: #E8ECE5;
  --text: var(--brand-graphite);
  --muted: #66716B;
  --muted-strong: #4D5953;
  --line: rgba(40, 53, 47, .12);
  --line-strong: rgba(40, 53, 47, .22);
  --overlay: rgba(31, 43, 37, .34);
  --shadow-sheet: 0 -18px 50px rgba(40, 53, 47, .11);
  --semantic-warning-banner-bg: #F0DFCC;
  --semantic-warning-banner-fg: #6A4020;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family-sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, select, input { font: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
img, svg { display: block; }
[hidden] { display: none !important; }

/* Design System Lite — primitives. Domain components keep their own semantics and layout. */
.ui-button {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-weight: 730;
}
.ui-icon-button {
  min-width: var(--control-height);
  min-height: var(--control-height);
  border-radius: var(--radius-control);
}
.ui-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-raised);
}
.ui-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: var(--space-1) 7px;
  border: 0;
  border-radius: var(--radius-badge);
  font-size: .7rem;
  line-height: 1;
  font-weight: var(--type-emphasis-weight);
  white-space: nowrap;
}
.ui-chip {
  width: fit-content;
  border-radius: var(--radius-pill);
}
.ui-sheet {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sheet);
}
.ui-control {
  width: 100%;
  min-height: var(--control-field-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}
.ui-field {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: .8rem;
  font-weight: var(--type-label-weight);
}
.ui-progress {
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
}
.ui-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.ui-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.ui-countdown {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -90px;
  z-index: 120;
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}
.skip-link:focus { top: max(12px, env(safe-area-inset-top)); }

/* Brand launch: short, non-blocking gate opening. */
.brand-intro {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  background: var(--bg);
  pointer-events: none;
  opacity: 1;
  transition: opacity 130ms ease 400ms, visibility 0s linear 540ms;
}
.brand-intro.is-done { opacity: 0; visibility: hidden; }
.intro-mark { position: relative; width: 62px; height: 62px; }
.intro-door {
  position: absolute;
  top: 6px;
  width: 22px;
  height: 44px;
  background: var(--text);
  animation: intro-door 520ms var(--ease-brand) both;
}
.intro-door-left {
  left: 6px;
  clip-path: polygon(0 0, 100% 18%, 100% 77%, 0 100%);
  transform: translateX(6px);
}
.intro-door-right {
  right: 6px;
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 77%);
  transform: translateX(-6px);
}
.intro-marker {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 21px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateX(-50%) translateY(7px) scale(.82);
  opacity: 0;
  animation: intro-marker 520ms var(--ease-brand) both;
}
@keyframes intro-door {
  0% { opacity: 0; transform: translateX(0); }
  36% { opacity: 1; }
  68%, 100% { opacity: 1; transform: translateX(0); }
}
@keyframes intro-marker {
  0%, 34% { opacity: 0; }
  62%, 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.banner {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 32px;
  padding: 7px 14px;
  text-align: center;
  font-size: var(--type-label-size);
  line-height: 1.25;
  font-weight: 820;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.banner-demo { background: var(--accent); color: var(--accent-ink); }
.banner-warning { background: var(--semantic-warning-banner-bg); color: var(--semantic-warning-banner-fg); letter-spacing: 0; text-transform: none; }

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--control-height);
  margin-bottom: 10px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.brand-mark-tile {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: var(--radius-compact);
  background: var(--brand-stone);
  box-shadow: inset 0 0 0 1px rgba(40, 53, 47, .07);
}
.brand-mark-tile img { width: 100%; height: 100%; }
.brand-wordmark {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 680;
  letter-spacing: -.04em;
}
.header-action,
.close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-control);
  display: grid;
  place-items: center;
  transition: background var(--motion-instant), color var(--motion-instant), transform var(--motion-instant);
}
.header-action { color: var(--muted-strong); }
.header-action svg { width: 23px; height: 23px; fill: currentColor; }
.header-action:active,
.close-btn:active { transform: scale(.96); }

/* Route is the first decision cue, but stays compact. */
.route-panel {
  position: relative;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 11px;
}
.route-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}
.route-station { min-width: 0; }
.route-station-to { text-align: right; }
.route-station strong {
  display: block;
  color: var(--text);
  font-size: clamp(1rem, 4.8vw, 1.22rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 740;
  text-wrap: balance;
  min-block-size: 2.12em;
  display: grid;
  align-content: center;
}

.route-origin-source-label {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--type-caption-size);
  line-height: 1.2;
  font-weight: 650;
}
.route-origin-source-label[hidden] { display: none; }
.route-location-control {
  margin: 5px 0 2px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: var(--type-caption-size);
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.route-location-control[hidden] { display: none; }
.route-panel[data-origin-source="current-location"] .route-station-from strong::before {
  content: "⌖ ";
  color: var(--accent);
}

.swap-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  overflow: hidden;
  transition: transform var(--motion-instant), border-color var(--motion-state-change), background var(--motion-state-change);
}
.swap-btn:active:not(:disabled) { transform: scale(.96); }
.swap-btn:disabled { opacity: 1; }
.swap-glyph {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  transform-origin: center;
}
.swap-glyph svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}
.route-panel.is-swapping .swap-glyph { animation: direction-switch-glyph var(--motion-navigation) var(--ease-brand); }
@keyframes direction-switch-glyph {
  0%, 100% { transform: translateX(0); }
  48% { transform: translateX(2px); }
  52% { transform: translateX(-2px); }
}
.route-panel.is-swapping-forward .route-station-from,
.route-panel.is-swapping-forward .route-station-to { animation: station-switch-forward var(--motion-navigation) var(--ease-brand); }
.route-panel.is-swapping-reverse .route-station-from,
.route-panel.is-swapping-reverse .route-station-to { animation: station-switch-reverse var(--motion-navigation) var(--ease-brand); }
  42% { transform: translateX(-4px) rotateY(-12deg); }
  50% { transform: translateX(-6px) rotateY(-42deg); }
  58% { transform: translateX(-4px) rotateY(10deg); }
}
@keyframes station-switch-forward {
  0%, 100% { opacity: 1; transform: translateX(0); }
  46% { opacity: 0; transform: translateX(8px); }
  54% { opacity: 0; transform: translateX(-8px); }
}
@keyframes station-switch-reverse {
  0%, 100% { opacity: 1; transform: translateX(0); }
  46% { opacity: 0; transform: translateX(-8px); }
  54% { opacity: 0; transform: translateX(8px); }
}

.route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin-top: 5px;
  min-height: var(--control-height);
}
.updated {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .71rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.refresh-marker {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}
.refresh-marker::before,
.refresh-marker::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 2px;
  background: var(--muted);
}
.refresh-marker::before { left: 1px; transform: skewY(24deg); }
.refresh-marker::after { right: 1px; transform: skewY(-24deg); }
.is-refreshing .refresh-marker { animation: refresh-gate 420ms var(--ease-brand) 1; }
.is-refreshing .refresh-marker::before,
.is-refreshing .refresh-marker::after { background: var(--accent); }
@keyframes refresh-gate {
  0% { transform: scaleX(1); opacity: .75; }
  48% { transform: scaleX(.42); opacity: 1; }
  100% { transform: scaleX(1); opacity: .75; }
}
.updated.warn { color: var(--semantic-warning); }
.updated.danger { color: var(--semantic-critical); }
.updated.warn .refresh-marker::before,
.updated.warn .refresh-marker::after { background: var(--semantic-warning); }
.updated.danger .refresh-marker::before,
.updated.danger .refresh-marker::after { background: var(--semantic-critical); }

.profile-trigger {
  min-height: var(--control-height);
  max-width: 58%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 5px 0 5px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.15;
  font-weight: 680;
  text-align: right;
}
.profile-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.station-directions-slot {
  min-block-size: 33px;
  display: flex;
  align-items: flex-start;
}
.station-directions-link {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  margin-top: 1px;
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 680;
  text-decoration: none;
}
.station-directions-link:hover { text-decoration: underline; }
.station-directions-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.train-list { display: grid; gap: 0; }
.train-card {
  position: relative;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

/* Primary departure: actual/estimated departure time wins, countdown supports it. */
.train-card[data-nearest="true"] {
  min-height: 164px;
  margin-bottom: 10px;
  padding: 14px 14px 12px;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - var(--gate-cut)) 0, 100% var(--gate-cut), 100% 100%, 0 100%);
}
.primary-marker {
  position: absolute;
  top: 0;
  left: 50%;
  width: 16px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}
.primary-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.primary-timeblock { min-width: 0; }
.departure-time {
  color: var(--text);
  font-size: var(--type-display-time-size);
  line-height: .94;
  font-weight: var(--type-display-weight);
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.time-kind {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1;
  font-weight: 640;
}
.primary-countdown {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 92px;
  color: var(--text);
  white-space: nowrap;
}
.countdown-prefix,
.countdown-unit {
  color: var(--muted-strong);
  font-size: .78rem;
  line-height: 1;
  font-weight: 680;
}
.countdown-number {
  display: inline-block;
  min-width: 1.1ch;
  color: var(--text);
  font-size: var(--type-display-countdown-size);
  line-height: .92;
  font-weight: var(--type-emphasis-weight);
  letter-spacing: var(--type-display-tracking);
  text-align: right;
  font-variant-numeric: tabular-nums;
  transform-origin: center bottom;
}
.primary-countdown.is-text {
  max-width: 145px;
  white-space: normal;
  text-align: right;
}
.primary-countdown.is-text .countdown-prefix,
.primary-countdown.is-text .countdown-unit { display: none; }
.primary-countdown.is-text .countdown-number {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.12;
  letter-spacing: -.02em;
}
.countdown-number.is-ticking { animation: minute-tick var(--motion-state-change) var(--ease-brand); }
@keyframes minute-tick {
  0% { opacity: 1; transform: translateY(0); }
  44% { opacity: 0; transform: translateY(-5px); }
  45% { transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

.primary-quickline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}
.primary-platform {
  min-width: 0;
  color: var(--text);
  font-size: clamp(.94rem, 4vw, 1.05rem);
  line-height: 1.16;
  font-weight: 730;
  letter-spacing: -.02em;
}
.primary-platform > span {
  color: var(--muted);
  font-size: var(--type-caption-size);
  font-weight: 620;
  letter-spacing: 0;
  white-space: nowrap;
}
.primary-delayline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 7px;
  text-align: right;
}
.status { letter-spacing: 0; }
.status.on-time { color: var(--semantic-positive); background: var(--semantic-positive-bg); }
.status.minor { color: var(--semantic-caution); background: var(--semantic-caution-bg); }
.status.warn { color: var(--semantic-warning); background: var(--semantic-warning-bg); }
.status.danger { color: var(--semantic-critical); background: var(--semantic-critical-bg); }
.status.cancelled { color: var(--semantic-cancelled); background: var(--semantic-cancelled-bg); font-weight: 820; }
.status.neutral { color: var(--semantic-neutral); background: var(--semantic-neutral-bg); }
.planned-time {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.1;
  font-weight: 610;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.primary-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.25;
}
.primary-train {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.primary-train strong { color: var(--muted-strong); font-weight: 690; }
.primary-arrival { text-align: right; white-space: nowrap; }
.primary-arrival strong { color: var(--muted-strong); font-weight: 700; font-variant-numeric: tabular-nums; }

.later-heading {
  margin: 1px 0 1px;
  padding: 7px 0 4px;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1;
  font-weight: 690;
}

/* Later departures behave like a departure board, not a stack of cards. */
.train-card:not([data-nearest="true"]) {
  min-height: 78px;
  padding: 10px 0 9px;
  border-bottom: 1px solid var(--line);
}
.secondary-topline,
.secondary-midline,
.secondary-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}
.secondary-topline { gap: 10px; }
.secondary-time {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.secondary-countdown {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  min-width: 74px;
  color: var(--muted-strong);
  line-height: 1;
  white-space: nowrap;
}
.secondary-countdown-prefix,
.secondary-countdown-unit {
  color: var(--muted);
  font-size: var(--type-label-size);
  font-weight: 640;
}
.secondary-countdown strong {
  min-width: 1.2ch;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -.035em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.secondary-countdown.is-text { max-width: 150px; white-space: normal; }
.secondary-countdown.is-text strong { font-size: var(--type-label-size); line-height: 1.1; letter-spacing: 0; }
.secondary-midline {
  gap: 8px;
  margin-top: 6px;
}
.secondary-platform {
  min-width: 0;
  color: var(--text);
  font-size: .82rem;
  line-height: 1.1;
  font-weight: 700;
}
.secondary-platform > span {
  color: var(--muted);
  font-size: .61rem;
  font-weight: 600;
  white-space: nowrap;
}
.secondary-midline .status { flex: 0 0 auto; min-height: 23px; padding: 3px 6px; font-size: .66rem; }
.secondary-meta {
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: var(--type-caption-size);
  line-height: 1.15;
}
.secondary-train {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.secondary-train strong { color: var(--muted-strong); font-weight: 650; }
.secondary-arrival { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.secondary-meta .planned-time { font-size: var(--type-caption-size); }

.train-card.cancelled { opacity: .84; }
.train-card.cancelled[data-nearest="true"] .primary-marker { background: var(--semantic-cancelled); }

.warning-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin-top: 2px;
}
.warning-item {
  padding-left: 10px;
  border-left: 2px solid var(--semantic-warning);
  color: var(--semantic-warning);
  font-size: .67rem;
  line-height: 1.3;
}

.cancelled-area { display: grid; gap: 6px; margin-bottom: 8px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.choice-btn,
.ticket-choice {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-weight: 730;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .73rem;
}
.pager-btn-next { color: var(--muted-strong); }
.pager-btn:disabled { opacity: .28; }

.empty-state {
  position: relative;
  margin: 4px 0 2px;
  padding: 26px 14px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}
.empty-state h2 { margin: 10px 0 5px; color: var(--text); font-size: 1.18rem; letter-spacing: -.03em; }
.empty-state p { margin: 0 auto 16px; max-width: 34rem; font-size: .84rem; }
.empty-state .primary-btn { min-width: 168px; }
.empty-marker {
  display: inline-block;
  width: 21px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.primary-btn,
.secondary-btn {
  padding: 10px 13px;
  border: 1px solid transparent;
}
.primary-btn { background: var(--accent); color: var(--accent-ink); }
.secondary-btn { border-color: var(--line); background: transparent; color: var(--text); }
.full { width: 100%; }

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.modal::backdrop { background: var(--overlay); backdrop-filter: blur(5px); }
.modal[open] { display: grid; align-items: end; justify-items: stretch; }
.modal-card {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  border-bottom: 0;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow: auto;
}
.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  background: var(--line-strong);
  border-radius: var(--radius-pill);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 9px 0 0; font-size: var(--type-heading-size); line-height: 1.1; letter-spacing: -.04em; }
.sheet-brand,
.onboarding-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.sheet-brand img { width: 21px; height: 21px; padding: 2px; border-radius: 5px; background: var(--brand-stone); }
.close-btn { font-size: 1.7rem; line-height: 1; }
.field { margin-top: var(--space-4); }
select { padding: 0 11px; }

.station-picker {
  position: relative;
  width: 100%;
}
.station-search-input {
  padding: 0 38px 0 11px;
  outline: 0;
  appearance: none;
}
.station-search-input::placeholder { color: var(--muted); }
.station-search-input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
.station-picker.has-error .station-search-input { border-color: var(--semantic-critical); }
.station-options {
  position: relative;
  z-index: 4;
  width: 100%;
  max-height: min(280px, 38vh);
  overflow: auto;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  overscroll-behavior: contain;
}
.station-option {
  width: 100%;
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: .86rem;
  line-height: 1.25;
}
.station-option:last-child { border-bottom: 0; }
.station-option.is-active,
.station-option:focus-visible { background: var(--surface-muted); }
.station-option[aria-selected="true"] { font-weight: 720; }
.station-option-mark {
  width: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  opacity: 0;
}
.station-option[aria-selected="true"] .station-option-mark { opacity: 1; }
.station-option-empty {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  padding: 9px 11px;
  color: var(--muted);
  font-size: .82rem;
}
.station-picker-error {
  margin: 6px 0 0;
  color: var(--semantic-critical);
  font-size: .75rem;
  line-height: 1.35;
}
.field-note { margin: 6px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--control-large-height);
  margin-top: 15px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 660;
}
.toggle-row input { width: 21px; height: 21px; accent-color: var(--accent); }
.modal-card > .primary-btn:last-child { margin-top: 18px; }

.settings-card { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.settings-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.settings-section:first-of-type { margin-top: var(--space-4); }
.settings-section-title {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--type-caption-size);
  font-weight: 780;
  letter-spacing: .08em;
}
.settings-section .field:first-of-type { margin-top: 0; }
.settings-details { margin-top: var(--space-2); color: var(--muted); font-size: .74rem; line-height: 1.45; }
.settings-details summary {
  width: fit-content;
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  font-weight: 720;
  cursor: pointer;
}
.settings-details p { margin: 4px 0 0; }
.settings-capability { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.settings-capability:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-capability-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.settings-capability-head strong { color: var(--text); font-size: .84rem; }
.settings-status { color: var(--muted-strong); font-size: .74rem; font-weight: 760; text-align: right; }
.settings-capability > p { margin: 5px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.42; }
.settings-capability .settings-privacy-note { color: var(--muted); font-size: .69rem; }
.settings-capability-action { width: fit-content; margin-top: var(--space-2); min-height: var(--control-height); }
.settings-save { margin-top: var(--space-5); }
.choice-grid { display: grid; gap: 7px; margin-top: 19px; }
.choice-btn,
.ticket-choice {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
}
.choice-btn span:last-child { color: var(--accent); }
.ticket-choice {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 11px 13px;
}
.ticket-choice span { color: var(--muted); font-size: .74rem; font-weight: 520; }
.onboarding[open] {
  display: block;
  overflow: hidden;
  background: var(--bg);
}
.onboarding::backdrop {
  background: var(--bg);
  backdrop-filter: none;
}
.onboarding-screen {
  width: min(720px, 100%);
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  margin: 0 auto;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-4);
  overflow: hidden;
  background: var(--bg);
}
.onboarding-header {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.onboarding-brand {
  margin: 0;
  color: var(--muted-strong);
}
.onboarding-brand .brand-mark-tile { width: 32px; height: 32px; flex-basis: 32px; }
.onboarding-about-link {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: var(--radius-control);
  color: var(--muted-strong);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.onboarding-about-link:hover { color: var(--text); }
.onboarding-step {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.onboarding-step-intro { padding: var(--space-2) 0 0; }
.step-count {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .02em;
}
.onboarding-step h2 {
  margin: var(--space-2) 0 7px;
  max-width: 20ch;
  color: var(--text);
  font-size: clamp(1.45rem, 6.6vw, 1.9rem);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.onboarding-step-intro > p:not(.onboarding-origin) {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.42;
}
.onboarding-origin {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}
.onboarding-origin strong { color: var(--muted-strong); font-weight: 720; }
.onboarding-station-picker {
  min-height: 0;
  margin-top: var(--space-4);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}
.onboarding-step .station-search-input {
  min-height: var(--control-large-height);
  background: var(--surface-raised);
}
.onboarding-step .station-options {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}
.onboarding-step .station-option {
  min-height: var(--control-large-height);
  padding-top: 10px;
  padding-bottom: 10px;
}
.onboarding-step .station-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.onboarding-actions {
  position: relative;
  z-index: 2;
  padding-top: var(--space-3);
  background: var(--bg);
}
.onboarding-actions-step2 {
  display: grid;
  gap: var(--space-2);
}
.onboarding .primary-btn { margin: 0; }
.onboarding .primary-btn:disabled { opacity: .46; }
.onboarding-back {
  width: fit-content;
  min-height: var(--control-height);
  margin: 0 auto;
  padding: 0 var(--space-3);
  border: 0;
  background: transparent;
  color: var(--muted-strong);
}
.onboarding-back:hover { color: var(--text); }

.skeleton-primary {
  height: 164px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  clip-path: polygon(0 0, calc(100% - var(--gate-cut)) 0, 100% var(--gate-cut), 100% 100%, 0 100%);
}
.skeleton-later-heading { height: 25px; }
.skeleton-row { height: 78px; border-bottom: 1px solid var(--line); }
.ui-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(95deg, transparent 22%, color-mix(in srgb, var(--brand-sage) 9%, transparent) 50%, transparent 78%);
  animation: skeleton-pass 1.35s linear infinite;
}
@keyframes skeleton-pass { to { transform: translateX(100%); } }

:focus-visible {
  outline: var(--focus-ring-width) solid var(--accent);
  outline-offset: var(--focus-ring-offset);
}

@media (hover: hover) and (pointer: fine) {
  .header-action:hover,
  .close-btn:hover,
  .profile-trigger:hover,
  .pager-btn:hover:not(:disabled) { background: var(--surface); color: var(--text); }
  .swap-btn:hover { border-color: var(--muted); background: var(--surface-muted); }
  .primary-btn:hover { filter: brightness(1.03); }
}

@media (min-width: 620px) {
  .shell { padding-left: 22px; padding-right: 22px; }
  .route-gate { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); gap: 14px; }
  .swap-btn { width: 50px; height: 50px; }
  .train-card[data-nearest="true"] { padding: 15px 16px 13px; }
  .primary-footer { font-size: var(--type-label-size); }
  .secondary-meta { font-size: .68rem; }
}

@media (max-width: 380px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .brand-wordmark { font-size: 1.06rem; }
  .route-gate { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: 7px; }
  .swap-btn { width: 46px; height: 46px; }
  .route-station strong { font-size: .92rem; line-height: 1.04; overflow-wrap: break-word; hyphens: auto; }
  .train-card[data-nearest="true"] { padding-left: 12px; padding-right: 12px; }
  .departure-time { font-size: 2.34rem; }
  .countdown-number { font-size: 1.92rem; }
  .primary-countdown { min-width: 84px; }
  .primary-platform { font-size: .9rem; }
  .primary-footer { gap: 5px 7px; }
  .secondary-arrival { display: none; }
}

@media (max-height: 720px) and (max-width: 500px) {
  .shell { padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .app-header { margin-bottom: 5px; }
  .route-panel { padding-bottom: 7px; margin-bottom: 8px; }
  .route-meta { margin-top: 2px; min-height: 40px; }
  .profile-trigger { min-height: 40px; }
  .train-card[data-nearest="true"] { min-height: 154px; margin-bottom: 7px; padding-top: 12px; padding-bottom: 10px; }
  .primary-quickline { margin-top: 9px; }
  .primary-footer { margin-top: 7px; padding-top: 7px; }
  .later-heading { padding-top: 5px; }
  .train-card:not([data-nearest="true"]) { min-height: 72px; padding-top: 8px; padding-bottom: 7px; }
  .secondary-midline { margin-top: 5px; }
  .secondary-meta { margin-top: 4px; }
  .pager { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .brand-intro { display: none; }
}

/* 1.4 — progressive PWA install + active journey. The main departure hierarchy stays untouched. */
.active-journey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 9px;
  padding: 10px 11px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent) 12%);
  border-radius: 0 10px 10px 0;
}
.active-journey-main { display: flex; min-width: 0; align-items: center; gap: 10px; }
.active-journey-main > div { min-width: 0; }
.active-journey-marker {
  width: 12px; height: 8px; flex: 0 0 12px; background: var(--accent);
  clip-path: polygon(50% 0,100% 100%,0 100%);
}
.active-journey-kicker { margin: 0 0 2px; color: var(--muted); font-size: .67rem; font-weight: 730; }
.active-journey-route { display: flex; align-items: baseline; gap: 5px; min-width: 0; margin: 0; color: var(--text); font-size: .83rem; line-height: 1.15; }
.active-journey-route strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-journey-route span { color: var(--muted); }
.active-journey-meta { margin: 3px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.journey-end-btn {
  min-height: var(--control-height); flex: 0 0 auto; padding: 7px 9px; border: 0; border-radius: var(--radius-compact);
  background: transparent; color: var(--muted-strong); font-size: .7rem; font-weight: 700;
}

.install-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
  padding: 8px 8px 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.install-prompt-copy { display: flex; align-items: center; gap: 9px; min-width: 0; }
.install-mini-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--radius-compact); background: var(--brand-graphite); }
.install-mini-mark img { width: 22px; height: 22px; }
.install-prompt-copy > div { min-width: 0; }
.install-prompt-copy strong { display: block; color: var(--text); font-size: .76rem; line-height: 1.15; }
.install-prompt-copy p { margin: 2px 0 0; color: var(--muted); font-size: var(--type-caption-size); line-height: 1.22; }
.install-prompt-actions { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.install-action,.install-guide,.install-dismiss {
  min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-compact); font-weight: 720;
}
.install-action { padding: 7px 10px; background: var(--brand-graphite); color: var(--brand-stone); font-size: .7rem; }
.install-guide { padding: 7px 8px; color: var(--muted-strong); text-decoration: none; font-size: .69rem; }
.install-dismiss { width: 44px; padding: 0; background: transparent; color: var(--muted); font-size: 1.15rem; }

.board-btn {
  grid-column: 1 / -1;
  justify-self: stretch;
  min-height: var(--control-height);
  margin-top: 2px;
  border: 0;
  border-radius: var(--radius-compact);
  background: var(--brand-graphite);
  color: var(--brand-stone);
  font-size: .78rem;
  font-weight: 780;
}
html[data-theme="dark"] .board-btn { background: var(--accent); color: var(--accent-ink); }
.board-btn:disabled { opacity: .6; }
.secondary-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.track-btn {
  width: auto;
  min-height: var(--control-height);
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-compact);
  background: transparent;
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 740;
}
.track-btn:disabled { opacity: .6; }
.current-data-indicator {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: .56rem;
  line-height: 1;
}
.connections-disclaimer {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.4;
}

.settings-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.settings-links a,
.settings-links span { min-height: var(--control-height); display: inline-flex; align-items: center; color: var(--muted); font-size: var(--type-label-size); }
.settings-links a { color: var(--muted-strong); font-weight: 700; text-decoration: none; }

.notification-card { min-height: 0; }
.notification-mark { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 15px; border-radius: var(--radius-panel); background: var(--brand-graphite); }
.notification-mark img { width: 29px; height: 29px; }
.notification-card h2 { margin: 0 0 8px; color: var(--text); font-size: 1.35rem; line-height: 1.08; letter-spacing: -.035em; }
.notification-card > p { margin: 0 0 4px; color: var(--muted); font-size: var(--type-body-size); line-height: 1.45; }
.notification-unsupported { margin: 11px 0 2px; padding: 9px 10px; border-left: 2px solid var(--semantic-caution); background: var(--semantic-caution-bg); color: var(--muted-strong); font-size: .76rem; line-height: 1.4; }
.notification-unsupported a { color: inherit; font-weight: 720; }
.notification-card .primary-btn { margin-top: 16px; }
.notification-card .secondary-btn { margin-top: 7px; }
.journey-location-card { min-height: 0; }
.journey-location-card h2 { margin: 0 0 8px; color: var(--text); font-size: 1.35rem; line-height: 1.08; letter-spacing: -.035em; }
.journey-location-card > p { margin: 0; color: var(--muted); font-size: var(--type-body-size); line-height: 1.45; }
.journey-location-actions { display: grid; gap: 7px; margin-top: 16px; }

@media (max-width: 380px) {
  .active-journey { gap: 6px; padding-right: 5px; }
  .active-journey-route { font-size: .77rem; }
  .journey-end-btn { max-width: 74px; line-height: 1.1; }
  .install-prompt { align-items: flex-start; }
  .install-mini-mark { display: none; }
  .install-prompt-copy p { max-width: 23ch; }
  .install-prompt-actions { align-self: center; }
}

/* 1.5 — async states. Zachowuje istniejący język wizualny. */
.updated {
  min-height: var(--control-height);
  padding: 6px 8px 6px 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
}
.updated:active:not(:disabled) { opacity: .72; }
.updated[aria-busy="true"] { color: var(--muted-strong); }

.connections-loading {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
  color: var(--muted);
  font-size: var(--type-label-size);
  font-weight: 650;
}
.loading-gate {
  position: relative;
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
  perspective: 90px;
}
.loading-door {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 7px;
  background: var(--brand-graphite);
  transform-origin: center;
  opacity: .9;
}
.loading-door-left { left: 2px; clip-path: polygon(0 0,100% 14%,100% 86%,0 100%); animation: loading-gate-left 1050ms var(--ease-brand) infinite; }
.loading-door-right { right: 2px; clip-path: polygon(0 14%,100% 0,100% 100%,0 86%); animation: loading-gate-right 1050ms var(--ease-brand) infinite; }
.loading-marker {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 8px;
  height: 7px;
  transform: translateX(-50%);
  background: var(--accent);
  clip-path: polygon(50% 0,100% 100%,0 100%);
}
@keyframes loading-gate-left {
  0%,100% { transform: translateX(0) rotateY(0deg); }
  48%,52% { transform: translateX(2px) rotateY(-8deg); }
}
@keyframes loading-gate-right {
  0%,100% { transform: translateX(0) rotateY(0deg); }
  48%,52% { transform: translateX(-2px) rotateY(8deg); }
}
.skeleton-quiet::after { opacity: .42; animation-duration: 1.6s; }
.action-feedback {
  grid-column: 1 / -1;
  display: block;
  margin-top: 3px;
  color: var(--semantic-critical);
  font-size: .69rem;
  line-height: 1.35;
}
.action-feedback[hidden] { display: none; }
button[data-async-state="pending"] { cursor: progress; }
button[data-async-state="pending"]::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
  animation: async-dot 900ms ease-in-out infinite alternate;
}
@keyframes async-dot { to { opacity: 1; transform: translateX(2px); } }

@media (prefers-reduced-motion: reduce) {
  .loading-door-left,
  .loading-door-right,
  button[data-async-state="pending"]::after { animation: none !important; }
}

/* Immediate mobile press feedback without bounce. */
.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.pager-btn:active:not(:disabled),
.profile-trigger:active:not(:disabled),
.board-btn:active:not(:disabled),
.journey-end-btn:active:not(:disabled),
.install-action:active:not(:disabled),
.install-dismiss:active:not(:disabled),
.install-guide:active,
.settings-links a:active {
  opacity: .78;
}

/* 1.6 — recommendation priority + exact-train active journey. */
.recommendation-label {
  grid-column: 1 / -1;
  width: fit-content;
  margin: 0 0 7px;
  padding: 3px 7px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--muted-strong);
  font-size: var(--type-caption-size);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: .01em;
}
html[data-theme="dark"] .recommendation-label { color: var(--accent); }

.journey-mode #trains,
.journey-mode #cancelledArea,
.journey-mode #emptyState,
.journey-mode .pager,
.journey-mode .connections-disclaimer { display: none !important; }
.journey-mode .swap-btn { opacity: .38; cursor: default; }

.active-journey {
  align-items: flex-start;
  padding: 12px 11px;
}
.active-journey-main { align-items: flex-start; flex: 1 1 auto; }
.active-journey-copy { flex: 1 1 auto; min-width: 0; }
.active-journey-state {
  margin: 5px 0 0;
  color: var(--text);
  font-size: .78rem;
  line-height: 1.32;
  font-weight: 670;
}
.active-journey-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.active-journey-grid p { min-width: 0; margin: 0; }
.active-journey-grid span,
.active-journey-grid small {
  display: block;
  color: var(--muted);
  font-size: .63rem;
  line-height: 1.28;
}
.active-journey-grid strong {
  display: block;
  overflow: hidden;
  margin: 2px 0;
  color: var(--text);
  font-size: .82rem;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.active-journey-train {
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: .66rem;
  line-height: 1.3;
}
.active-journey-issue {
  margin: 8px 0 0;
  padding: 7px 8px;
  border-left: 2px solid var(--semantic-critical);
  background: var(--semantic-critical-bg);
  color: var(--muted-strong);
  font-size: .7rem;
  line-height: 1.35;
}
.active-journey[aria-busy="true"] .active-journey-marker { animation: journey-marker-pulse 1050ms ease-in-out infinite alternate; }
@keyframes journey-marker-pulse { to { opacity: .52; } }

@media (max-width: 380px) {
  .active-journey { display: block; padding-right: 9px; }
  .journey-end-btn { width: 100%; max-width: none; margin-top: 8px; }
  .active-journey-grid { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .active-journey[aria-busy="true"] .active-journey-marker { animation: none !important; }
}

/* 1.8 — Active Journey jako pełny ekran śledzenia konkretnego kursu. */
.active-journey {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0 0 10px;
  padding: 14px 14px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-raised);
  clip-path: polygon(0 0, calc(100% - var(--gate-cut)) 0, 100% var(--gate-cut), 100% 100%, 0 100%);
  font-variant-numeric: tabular-nums;
}
.active-journey-marker {
  position: absolute;
  top: 0;
  left: 50%;
  width: 16px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}
.active-journey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.active-journey-head-copy { min-width: 0; }
.active-journey-kicker {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: .66rem;
  font-weight: 790;
  line-height: 1.2;
}
html[data-theme="light"] .active-journey-kicker { color: var(--muted-strong); }
.active-journey-route {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: .84rem;
  line-height: 1.18;
}
.active-journey-route strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-journey-route span { color: var(--muted); }
.journey-end-btn {
  min-height: var(--control-height);
  flex: 0 0 auto;
  margin: -8px -6px 0 0;
  padding: 7px 7px;
  border: 0;
  border-radius: var(--radius-compact);
  background: transparent;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
}
.journey-complete-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface) 92%, var(--text));
  color: var(--text);
  font-size: .84rem;
  font-weight: 780;
}
.journey-complete-btn.journey-complete-emphasized {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}
.journey-end-btn.is-secondary { margin-top: 5px; font-size: .69rem; opacity: .9; }
.active-journey-train {
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: .66rem;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-journey-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}
.active-journey-arrival { min-width: 0; }
.active-journey-arrival > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 650;
  line-height: 1.1;
}
.active-journey-arrival > strong {
  display: block;
  color: var(--text);
  font-size: clamp(2.35rem, 11vw, 2.78rem);
  font-weight: 770;
  line-height: .94;
  letter-spacing: -.055em;
}
.active-journey-arrival-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 7px;
}
.active-journey-arrival-meta small {
  color: var(--muted);
  font-size: var(--type-caption-size);
  line-height: 1.15;
}
.active-journey-arrival-meta .status {
  min-height: 23px;
  padding: 3px 6px;
  font-size: .65rem;
}
.active-journey-countdown {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  justify-content: end;
  column-gap: 4px;
  min-width: 102px;
  color: var(--text);
  white-space: nowrap;
}
.active-journey-countdown-prefix,
.active-journey-countdown > span:not(.active-journey-countdown-prefix) {
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 680;
  line-height: 1;
}
.active-journey-countdown > strong {
  min-width: 1.1ch;
  color: var(--text);
  font-size: clamp(2rem, 9vw, 2.38rem);
  font-weight: var(--type-display-weight);
  line-height: .92;
  letter-spacing: var(--type-display-tracking);
  text-align: right;
}
.active-journey-countdown > small {
  grid-column: 1 / -1;
  margin-top: 5px;
  color: var(--muted);
  font-size: .63rem;
  font-weight: 650;
  line-height: 1;
  text-align: right;
}
.active-journey-countdown.is-text {
  grid-template-columns: auto;
  min-width: 100px;
}
.active-journey-countdown.is-text .active-journey-countdown-prefix,
.active-journey-countdown.is-text > span:not(.active-journey-countdown-prefix) { display: none; }
.active-journey-countdown.is-text > strong {
  grid-column: 1;
  max-width: 120px;
  font-size: 1.18rem;
  line-height: 1.05;
  letter-spacing: -.02em;
  white-space: normal;
}
.active-journey-state {
  margin: 13px 0 0;
  padding: 9px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--text);
  font-size: .82rem;
  font-weight: 690;
  line-height: 1.3;
}
.active-journey.is-approaching .active-journey-state {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-weight: 760;
}
.journey-destination-alert {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--text);
  font-size: .78rem;
  line-height: 1.3;
}
.journey-destination-alert[hidden] { display: none !important; }
.journey-destination-alert strong { font-size: .82rem; font-weight: 780; }
.journey-destination-alert span { color: var(--muted-strong); }
.active-journey-stations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.active-journey-stations p { min-width: 0; margin: 0; }
.active-journey-stations span,
.active-journey-stations small {
  display: block;
  color: var(--muted);
  font-size: .63rem;
  line-height: 1.25;
}
.active-journey-stations strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin: 3px 0;
  color: var(--muted-strong);
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-journey-next strong { color: var(--text); font-weight: 760; }
.active-journey-progress-track {
  height: 3px;
  margin-top: 13px;
}
.active-journey-progress-track span {
  width: 0;
  background: var(--accent);
  transition: width var(--motion-state-change) var(--ease-brand);
}
.active-journey-progress-copy {
  margin: 5px 0 0;
  color: var(--muted-strong);
  font-size: .65rem;
  font-weight: 670;
  line-height: 1.2;
}
.active-journey-meta {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .63rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.active-journey-issue {
  margin: 9px 0 0;
  padding: 8px 9px;
  border-left: 2px solid var(--semantic-critical);
  border-radius: 0 7px 7px 0;
  background: var(--semantic-critical-bg);
  color: var(--muted-strong);
  font-size: .7rem;
  line-height: 1.35;
}
.active-journey[aria-busy="true"] .active-journey-marker { animation: journey-marker-pulse 1050ms ease-in-out infinite alternate; }

@media (max-width: 380px) {
  .active-journey { padding: 13px 12px 12px; }
  .active-journey-hero { gap: 8px; }
  .active-journey-arrival > strong { font-size: 2.28rem; }
  .active-journey-countdown > strong { font-size: 2rem; }
  .active-journey-countdown { min-width: 88px; }
  .active-journey-stations { gap: 8px; }
  .active-journey-stations strong { font-size: .81rem; }
  .journey-end-btn { width: auto; max-width: none; margin: -8px -5px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .active-journey-progress-track span { transition: none !important; }
  .active-journey[aria-busy="true"] .active-journey-marker { animation: none !important; }
}

/* 1.9.1 PR3 — Active Trip: passenger-first hierarchy and final lifecycle state */
.journey-mode #routePanel { display: none !important; }

.active-journey-hero {
  grid-template-columns: minmax(0, 1.18fr) minmax(90px, .82fr);
  align-items: end;
}
.active-journey-countdown {
  justify-content: start;
  min-width: 0;
}
.active-journey-countdown > strong {
  font-size: clamp(2.85rem, 14vw, 3.55rem);
  text-align: left;
}
.active-journey-countdown > small { text-align: left; }
.active-journey-arrival { text-align: right; }
.active-journey-arrival > strong {
  font-size: clamp(1.55rem, 7vw, 1.92rem);
  letter-spacing: -.035em;
}
.active-journey-arrival-meta { justify-content: flex-end; }
.active-journey-state {
  margin-top: 12px;
  padding: 0;
  border-left: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 660;
}
.active-journey.is-approaching .active-journey-state {
  background: transparent;
  color: var(--text);
  font-weight: 760;
}
.active-journey-position-meta:empty { display: none; }
.active-journey-meta[hidden] { display: none; }
.active-journey-meta:not([hidden]) {
  margin-top: 10px;
  padding: 8px 9px;
  border-left: 2px solid var(--semantic-warning);
  border-radius: 0 7px 7px 0;
  background: var(--semantic-warning-bg);
  color: var(--muted-strong);
  font-size: .69rem;
}
.active-journey-destination-state {
  margin-top: 16px;
  padding: 16px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.active-journey-destination-state strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.45rem, 7vw, 1.9rem);
  font-weight: 790;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.active-journey-destination-state p {
  margin: 7px 0 0;
  color: var(--muted-strong);
  font-size: .77rem;
  line-height: 1.35;
}
.journey-end-btn {
  width: auto;
  min-height: 44px;
  margin: 14px 0 0;
  padding: 9px 0;
  color: var(--muted-strong);
  font-size: .72rem;
  text-align: left;
}
.active-journey.is-completed .journey-end-btn {
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .82rem;
  font-weight: 780;
  text-align: center;
}
.active-journey.is-completed .active-journey-marker { opacity: .55; }
.active-journey.is-completed .active-journey-state,
.active-journey.is-at-destination .active-journey-state { margin-top: 12px; }

.journey-stop-card { max-width: 430px; }
.journey-stop-copy {
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: .8rem;
  line-height: 1.45;
}
.journey-stop-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  margin-top: 18px;
}
.journey-stop-actions .ui-button { min-height: 44px; }

@media (max-width: 380px) {
  .active-journey-hero { grid-template-columns: minmax(0, 1.12fr) minmax(82px, .88fr); }
  .active-journey-countdown > strong { font-size: 2.75rem; }
  .active-journey-arrival > strong { font-size: 1.48rem; }
  .journey-end-btn { width: auto; margin: 13px 0 0; }
  .active-journey.is-completed .journey-end-btn { width: 100%; }
  .journey-stop-actions { grid-template-columns: 1fr; }
}

/* 1.9.1 PR5 — trust/support integration. */
.active-journey-support { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); display: grid; gap: var(--space-2); color: var(--muted); font-size: var(--type-label-size); }
.active-journey-support a { width: fit-content; color: var(--muted-strong); text-underline-offset: 3px; }
.active-journey-support a:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-badge); }
.settings-links { display: grid; gap: 2px; }
.settings-links a, .settings-links span { min-height: 36px; display: flex; align-items: center; color: var(--muted-strong); text-decoration: none; }
.settings-links a:focus-visible { outline: var(--focus-ring-width) solid var(--accent); outline-offset: var(--focus-ring-offset); border-radius: var(--radius-badge); }

/* PR5C — fixed departure/arrival geometry and compact evidence indicator. */
.connection-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
}
.connection-time-block { min-width: 0; }
.connection-time-block.arrival-block { text-align: right; }
.connection-time-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .6rem;
  line-height: 1;
  font-weight: 760;
  letter-spacing: .08em;
}
.arrival-time {
  color: var(--text);
  font-size: var(--type-display-time-size);
  line-height: .94;
  font-weight: var(--type-display-weight);
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.departure-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.15;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.primary-times { margin-top: 2px; }
.primary-times .primary-countdown {
  justify-content: flex-start;
  min-width: 0;
  margin-top: 8px;
}
.secondary-times {
  gap: 10px;
  padding-right: 24px;
}
.secondary-arrival-time {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.secondary-times .secondary-countdown {
  justify-content: flex-start;
  min-width: 0;
  margin-top: 5px;
}
.connection-source-indicator {
  position: absolute;
  top: 10px;
  right: 8px;
  z-index: 2;
}
.current-data-indicator.is-current { color: var(--accent); }
.current-data-indicator.is-last-known {
  color: var(--semantic-caution);
  background: var(--semantic-caution-bg);
  border-color: color-mix(in srgb, var(--semantic-caution) 45%, var(--line-strong));
}
.train-card[data-nearest="true"] .connection-source-indicator { top: 13px; right: 13px; }
.train-card[data-nearest="true"] .recommendation-label { margin-right: 30px; }
.primary-quickline .primary-train {
  text-align: right;
  color: var(--muted);
  font-size: .68rem;
}
.primary-footer { grid-template-columns: 1fr; }
.secondary-midline .secondary-train {
  text-align: right;
  color: var(--muted);
  font-size: var(--type-caption-size);
}
@media (max-width: 380px) {
  .connection-times { gap: 8px; }
  .arrival-time { font-size: 2.05rem; }
  .secondary-time,
  .secondary-arrival-time { font-size: 1.22rem; }
}

/* PR5D time UI freeze — permanent absolute-primary hierarchy; both representations remain visible. */
.connection-time-block { display: flex; flex-direction: column; }
.connection-time-absolute,
.connection-time-relative { min-width: 0; font-variant-numeric: tabular-nums; }
.connection-time-relative { white-space: nowrap; letter-spacing: -.035em; }
.time-mode-absolute .connection-time-absolute { order: 1; }
.time-mode-absolute .connection-time-relative {
  order: 2;
  margin-top: 6px;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 4.4vw, 1.35rem);
  line-height: 1.05;
  font-weight: 680;
}
.delay-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 760;
}
.delay-chip.delay-subtle { color: var(--muted-strong); background: color-mix(in srgb, var(--surface-raised) 92%, var(--text)); }
.delay-chip.delay-amber { color: var(--semantic-caution); background: var(--semantic-caution-bg); }
.delay-chip.delay-orange { color: #b85d13; background: color-mix(in srgb, #f29a4a 18%, var(--surface-raised)); }
.primary-train,
.secondary-train { overflow-wrap: normal; word-break: normal; }
.primary-train strong,
.secondary-train strong { white-space: nowrap; }
.journey-close-btn {
  position: relative;
  z-index: 3;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: -9px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--semantic-cancelled);
  font-size: 1.45rem;
  line-height: 1;
}
.journey-close-btn:hover { background: color-mix(in srgb, var(--semantic-cancelled) 8%, transparent); }
.journey-close-btn:focus-visible { outline: var(--focus-ring-width) solid var(--semantic-cancelled); outline-offset: 1px; }
.journey-complete-btn.journey-complete-disabled,
.journey-complete-btn:disabled {
  opacity: .45;
  cursor: default;
  background: color-mix(in srgb, var(--surface) 96%, var(--text));
  border-color: var(--line);
  color: var(--muted);
}
.active-journey:not(.is-completed) .journey-end-btn { display: none !important; }

/* PR5D R2 final — calm capped time scale + human-readable long relative durations. */
.connection-time-label { order: 0; }
.departure-meta { order: 3; }

/* Hero, absolute-primary: departure is strongest, arrival ~86% optical weight. */
.primary-times.time-mode-absolute .departure-block .connection-time-absolute {
  font-size: clamp(2.75rem, 9.5vw, 3.125rem); /* 44–50px */
}
.primary-times.time-mode-absolute .arrival-block .connection-time-absolute {
  font-size: clamp(2.375rem, 8.2vw, 2.6875rem); /* 38–43px */
}
.primary-times.time-mode-absolute .connection-time-relative {
  font-size: clamp(1.1875rem, 4.2vw, 1.375rem); /* 19–22px */
  line-height: 1.08;
}

/* Alternatives are deliberately calmer than hero in both modes. */
.secondary-times.time-mode-absolute .departure-block .connection-time-absolute {
  font-size: clamp(1.625rem, 5.8vw, 1.9375rem); /* 26–31px */
}
.secondary-times.time-mode-absolute .arrival-block .connection-time-absolute {
  font-size: clamp(1.5rem, 5.3vw, 1.8125rem); /* 24–29px */
}
.secondary-times.time-mode-absolute .connection-time-relative {
  font-size: clamp(1.0625rem, 3.8vw, 1.1875rem); /* 17–19px */
  line-height: 1.08;
}

/* Hour-scale secondary strings remain readable without disturbing the frozen absolute-primary hierarchy. */
.connection-time-relative.is-long-relative {
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: normal;
  max-width: 100%;
  letter-spacing: -.045em;
}

/* Small screens keep the same hierarchy; desktop/tablet stop growing at the caps above. */

/* PR12 — global shell + full Settings view. Product card/time geometry is unchanged. */
.shell{padding:12px 14px calc(24px + env(safe-area-inset-bottom))}
.banner{position:relative;top:auto;z-index:20}
.settings-view[hidden],.app-product-view[hidden]{display:none!important}
.settings-view{max-width:620px;margin:0 auto;padding:8px 0 0}
.settings-form{display:block;padding-bottom:calc(84px + env(safe-area-inset-bottom))}
.settings-view-head{padding:8px 0 18px;border-bottom:1px solid var(--line)}
.settings-view-head h1{margin:0;color:var(--text);font-size:clamp(1.65rem,7vw,2.1rem);line-height:1.05;letter-spacing:-.04em}
.settings-view-head>p:last-child{max-width:54ch;margin:8px 0 0;color:var(--muted);font-size:.82rem;line-height:1.5}
.settings-eyebrow{margin:0 0 5px;color:var(--muted);font-size:var(--type-caption-size);font-weight:780;letter-spacing:.08em;text-transform:uppercase}
.settings-section{margin-top:var(--space-5);padding-top:var(--space-4);border-top:1px solid var(--line)}
.settings-section:first-of-type{margin-top:var(--space-4);border-top:0;padding-top:0}
.settings-section-title{margin:0 0 var(--space-3);color:var(--muted);font-size:var(--type-caption-size);font-weight:780;letter-spacing:.08em}
.settings-choice-group{min-width:0;margin:var(--space-4) 0 0;padding:0;border:0}
.settings-choice-group>legend{padding:0;margin:0 0 8px;color:var(--text);font-size:.82rem;font-weight:700}
.settings-radio-row{position:relative;display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;align-items:start;min-height:58px;margin-top:7px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface);cursor:pointer}
.settings-radio-row:has(input:checked){border-color:var(--accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 45%,transparent);background:color-mix(in srgb,var(--surface) 92%,var(--accent) 8%)}
.settings-radio-row input{width:18px;height:18px;margin:2px 0 0;accent-color:var(--accent)}
.settings-radio-row strong,.settings-radio-row small{display:block}.settings-radio-row strong{font-size:.82rem}.settings-radio-row small{margin-top:3px;color:var(--muted);font-size:.7rem;line-height:1.35}
.settings-ticket-base{display:grid;gap:2px;padding:2px 0 10px}.settings-ticket-base strong{font-size:.87rem}.settings-ticket-base span{color:var(--muted);font-size:.72rem}
.settings-switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;padding:10px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);cursor:pointer}
.settings-switch-row>span{min-width:0}.settings-switch-row strong,.settings-switch-row small{display:block}.settings-switch-row strong{font-size:.82rem}.settings-switch-row small{margin-top:3px;color:var(--muted);font-size:.7rem;line-height:1.35}
.settings-switch-row input{appearance:none;-webkit-appearance:none;width:48px;height:28px;flex:0 0 48px;margin:0;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface-muted);position:relative;cursor:pointer;transition:background var(--motion-instant)}
.settings-switch-row input::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--text);transition:transform var(--motion-instant)}
.settings-switch-row input:checked{background:var(--accent);border-color:var(--accent)}.settings-switch-row input:checked::after{transform:translateX(20px);background:var(--accent-ink)}
.settings-switch-row input:focus-visible{outline:var(--focus-ring-width) solid var(--accent);outline-offset:var(--focus-ring-offset)}
.settings-segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.settings-segmented label{position:relative;min-width:0}.settings-segmented input{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none}.settings-segmented span{min-height:44px;display:flex;align-items:center;justify-content:center;padding:8px 6px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface);color:var(--muted-strong);font-size:.76rem;font-weight:680;cursor:pointer}
.settings-segmented input:checked+span{border-color:var(--accent);background:color-mix(in srgb,var(--surface) 88%,var(--accent) 12%);color:var(--text);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 45%,transparent)}
.settings-segmented input:checked+span::before{content:"✓";margin-right:5px;color:var(--accent-ink);font-weight:900}.settings-segmented input:focus-visible+span{outline:var(--focus-ring-width) solid var(--accent);outline-offset:var(--focus-ring-offset)}
.settings-save-spacer{height:22px}.settings-save-bar{position:sticky;bottom:0;z-index:35;margin:0 -14px calc(-24px - env(safe-area-inset-bottom));padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:color-mix(in srgb,var(--bg) 96%,transparent);backdrop-filter:blur(10px)}
.settings-save-bar .primary-btn{min-height:48px}.settings-mode .global-footer{display:block}
.install-prompt[data-install-context="journey"]{margin-top:0;border-color:var(--line-strong)}
@media(max-width:380px){.settings-view-head h1{font-size:1.65rem}.settings-radio-row{padding:9px 10px}.settings-segmented{gap:4px}.settings-segmented span{padding-inline:3px;font-size:.72rem}}
@media(prefers-reduced-motion:reduce){.settings-switch-row input,.settings-switch-row input::after{transition:none}.settings-save-bar{backdrop-filter:none}}

/* PR13 — Active Journey destination timing + route progress presentation. */
.active-journey-arrival-status {
  display: block;
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: .64rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: right;
}
.active-journey-arrival-status.on-time { color: var(--semantic-positive); }
.active-journey-arrival-status.minor { color: var(--muted-strong); }
.active-journey-arrival-status.warn { color: var(--semantic-caution); }
.active-journey-arrival-status.danger { color: var(--semantic-critical); }

.active-journey-next-block {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.active-journey-next-block > span,
.active-journey-next-block > small {
  display: block;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.3;
}
.active-journey-next-block > strong {
  display: block;
  min-width: 0;
  margin: 3px 0;
  overflow: hidden;
  color: var(--text);
  font-size: .95rem;
  font-weight: 770;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-journey-next-block[data-next-reason="prediction_orientation"] > span,
.active-journey-next-block[data-next-reason="timetable_orientation"] > span {
  font-weight: 650;
}

.journey-route-progress {
  margin-top: 14px;
  min-width: 0;
}
.journey-route-visual {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 18px;
}
.journey-route-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  box-sizing: border-box;
}
.journey-route-dot[data-progress-kind="confirmed"] {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
}
.journey-route-dot[data-progress-kind="orientation"] {
  border-style: dashed;
  border-color: var(--muted-strong);
  background: var(--surface-raised);
}
.journey-route-dot[data-last-confirmed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}
.journey-route-segment {
  flex: 1 1 0;
  min-width: 3px;
  height: 3px;
  margin: 0 2px;
  border-radius: 999px;
  background: var(--line-strong);
}
.journey-route-segment[data-progress-kind="confirmed"] {
  background: var(--accent);
}
.journey-route-segment[data-progress-kind="orientation"] {
  height: 2px;
  border-radius: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--muted-strong) 0 5px,
    transparent 5px 8px
  );
}
.journey-route-edge-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: .6rem;
  font-weight: 620;
  line-height: 1.2;
}
.journey-route-edge-labels span {
  min-width: 0;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journey-route-edge-labels span:last-child { text-align: right; }

@media (max-width: 380px) {
  .active-journey-next-block > strong { font-size: .88rem; }
  .journey-route-dot { width: 8px; height: 8px; flex-basis: 8px; border-width: 1.5px; }
  .journey-route-dot[data-last-confirmed="true"]::after { inset: -4px; }
  .journey-route-segment { min-width: 2px; margin-inline: 1px; }
  .journey-route-edge-labels { font-size: .56rem; gap: 8px; }
}

.journey-community-stop {
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
}

/* 1.13 Personal Live Journey — one route rail, semantic personal marker. */
.active-journey-progress-context {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}
.active-journey-progress-context[hidden] { display: none; }
.journey-route-visual { position: relative; }
.journey-personal-marker {
  position: absolute;
  top: -13px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--positive, #2f9b67);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.22));
}
.journey-personal-marker::after {
  content: 'TY';
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-size: .52rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text);
  white-space: nowrap;
}

/* 1.14 Journey Situation: timetable-expected marker is intentionally distinct from TY. */
.journey-expected-marker {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 1.5px dashed var(--muted-strong);
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
  z-index: 3;
}
.journey-expected-marker::after {
  content: '≈';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

/* 1.15 Connections disruption/cancellation presentation */
.cancelled-area { display: grid; gap: 7px; margin-bottom: 9px; min-width: 0; }
.shared-disruption {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--semantic-caution) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--semantic-caution-bg) 68%, transparent);
  overflow: clip;
}
.shared-disruption > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}
.shared-disruption > summary::-webkit-details-marker { display: none; }
.shared-disruption > summary:focus-visible,
.train-disruption-detail > summary:focus-visible,
.cancelled-strip-item:focus-visible,
.disruption-badge:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.shared-disruption-label { color: var(--muted-strong); font-size: .78rem; font-weight: 760; }
.shared-disruption-summary { grid-column: 1 / -1; min-width: 0; color: var(--text); font-size: .82rem; line-height: 1.35; }
.shared-disruption-count { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.shared-disruption-toggle { color: var(--muted-strong); font-size: .7rem; font-weight: 680; white-space: nowrap; justify-self: end; }
.shared-disruption-body { padding: 0 10px 10px; color: var(--muted-strong); font-size: .76rem; line-height: 1.42; }
.shared-disruption-body p { margin: 5px 0 0; }
.shared-disruption-affected { color: var(--muted); }

.cancelled-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 0 7px 9px;
  border-left: 2px solid var(--semantic-cancelled);
  border-radius: 0 9px 9px 0;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}
.cancelled-strip-label { color: var(--semantic-cancelled); font-size: .68rem; font-weight: 820; letter-spacing: .055em; }
.cancelled-strip-scroller {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
  padding: 1px 9px 3px 0;
  -webkit-overflow-scrolling: touch;
}
.cancelled-strip-entry { flex: 0 0 auto; }
.cancelled-strip-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted-strong);
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
  white-space: nowrap;
}
.cancelled-strip-item time { color: var(--text); font-size: .82rem; font-weight: 790; font-variant-numeric: tabular-nums; }
.cancelled-strip-item[aria-expanded="true"] { border-color: var(--semantic-cancelled); }
.cancelled-detail-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 7px 8px 2px 0;
  color: var(--muted-strong);
  font-size: .75rem;
  line-height: 1.4;
}
.cancelled-detail-panel strong { display: block; color: var(--text); margin-bottom: 2px; }
.cancelled-detail-reason, .cancelled-detail-shared { margin-top: 5px; }

.disruption-badges { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.disruption-badge {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--semantic-caution) 45%, var(--line));
  border-radius: 999px;
  background: var(--semantic-caution-bg);
  color: var(--muted-strong);
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
}
.train-disruption-detail { grid-column: 1 / -1; min-width: 0; font-size: .72rem; color: var(--muted-strong); }
.train-disruption-detail > summary { cursor: pointer; font-weight: 680; }
.train-disruption-body { margin-top: 4px; line-height: 1.4; overflow-wrap: anywhere; }

@media (max-width: 420px) {
  .shared-disruption > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; padding: 8px 9px; }
  .shared-disruption-summary { font-size: .78rem; }
  .cancelled-strip { grid-template-columns: 1fr; gap: 4px; padding-left: 8px; }
  .cancelled-strip-scroller { width: 100%; }
  .cancelled-detail-panel { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cancelled-strip-scroller { scroll-behavior: auto; }
}

/* 1.19 — execution identity ambiguity + accessible manual choice. */
.journey-execution-resolution {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}
.journey-execution-resolution[hidden] { display: none; }
.journey-execution-resolution-text {
  margin: 0;
  color: var(--text);
  font-size: .74rem;
  font-weight: 690;
  line-height: 1.38;
}
.journey-execution-choices {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}
.journey-execution-choices[hidden] { display: none; }
.journey-execution-choice {
  width: 100%;
  min-height: 44px;
  justify-content: space-between;
  text-align: left;
  white-space: normal;
}
.journey-execution-choice > span { min-width: 0; }
.journey-execution-choice > small {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: var(--type-caption-size);
  font-weight: 720;
}
.journey-execution-choice[aria-pressed="true"] {
  border-color: var(--accent);
}
@media (max-width: 390px) {
  .journey-execution-resolution { padding: 9px; }
  .journey-execution-choice { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .journey-execution-resolution *,
  .journey-execution-choice { transition: none !important; animation: none !important; }
}

/* 1.20 — accessibility preferences, calm passenger actions and shared modal surfaces. */
html[data-text-size="standard"] { font-size: 100%; }
html[data-text-size="large"] { font-size: 112.5%; }
html[data-text-size="xlarge"] { font-size: 125%; }

html[data-contrast="high"] {
  --bg: #0B100D;
  --surface: #111914;
  --surface-raised: #162019;
  --surface-muted: #1C2820;
  --text: #FFFFFF;
  --muted: #DCE3DA;
  --muted-strong: #F3F1EC;
  --line: rgba(255,255,255,.27);
  --line-strong: rgba(255,255,255,.47);
  --accent: #D8F279;
  --focus-ring-width: 4px;
}
html[data-theme="light"][data-contrast="high"] {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-muted: #EEF1EC;
  --text: #101713;
  --muted: #3F4A44;
  --muted-strong: #202C26;
  --line: rgba(16,23,19,.28);
  --line-strong: rgba(16,23,19,.48);
  --accent: #769600;
  --accent-ink: #101713;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

.settings-segmented-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-segmented-three span { min-height: 48px; line-height: 1.15; text-align: center; }
.journey-execution-open { width: 100%; margin-top: 8px; }
.execution-choice-card,
.install-center-card { width: min(100%, 520px); }
.execution-choice-card > p,
.install-center-card > p { margin: 12px 0 0; color: var(--muted-strong); font-size: var(--type-body-size); line-height: 1.48; }
.install-center-actions { display: grid; gap: 8px; margin-top: 18px; }
.install-center-actions a { text-decoration: none; }

@media (max-width: 390px) {
  html[data-text-size="xlarge"] .settings-segmented { grid-template-columns: 1fr; }
  html[data-text-size="xlarge"] .settings-segmented span { justify-content: flex-start; padding-inline: 10px; text-align: left; }
  .execution-choice-card,
  .install-center-card { max-height: min(84vh, 680px); overflow: auto; }
}

/* 1.22 — persistent install surface, subtle interaction feedback and modal containment. */
button:not(:disabled) { cursor: pointer; }
.ui-button,
.ui-icon-button,
.global-header-action,
.swap-btn,
.board-btn,
.journey-end-btn,
.journey-close-btn,
.updated {
  transition: opacity 90ms linear, background-color 90ms linear, border-color 90ms linear, color 90ms linear;
}
@media (hover: hover) and (pointer: fine) {
  .ui-button:not(:disabled):hover,
  .ui-icon-button:not(:disabled):hover,
  .global-header-action:not(:disabled):hover,
  .swap-btn:not(:disabled):hover,
  .board-btn:not(:disabled):hover,
  .journey-end-btn:not(:disabled):hover,
  .journey-close-btn:not(:disabled):hover,
  .updated:not(:disabled):hover { opacity: .90; }
}
.ui-button:not(:disabled):active,
.ui-icon-button:not(:disabled):active,
.global-header-action:not(:disabled):active,
.swap-btn:not(:disabled):active,
.board-btn:not(:disabled):active,
.journey-end-btn:not(:disabled):active,
.journey-close-btn:not(:disabled):active,
.updated:not(:disabled):active { opacity: .76; }
button:disabled,
.ui-button:disabled,
.ui-icon-button:disabled { cursor: default; opacity: .52; }

.install-card {
  margin: 20px 0 0;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-surface);
  background: var(--surface);
}
.install-card[hidden] { display: none; }
.install-card .install-prompt-copy { flex: 1 1 auto; min-width: 0; }
.install-card .install-prompt-copy > div { min-width: 0; }
.install-card .install-prompt-actions { gap: 8px; flex: 0 0 auto; }
.install-card .install-action { min-height: 44px; padding: 9px 13px; background: var(--accent); color: var(--accent-ink); }
.install-card .install-guide { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 6px; border-radius: var(--radius-control); color: var(--muted-strong); text-decoration: underline; text-underline-offset: 3px; }

body[data-wsiadam-scroll-lock="true"] { overscroll-behavior: none; }
dialog.modal[open] { overscroll-behavior: contain; }
dialog.modal[open] .modal-card { overscroll-behavior: contain; }

.passive-journey-context {
  margin: 10px 0 12px;
  padding: 11px 12px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface-raised) 92%, var(--accent) 8%);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}
.passive-journey-context[hidden] { display: none; }
.passive-journey-direction { margin: 0; color: var(--muted-strong); font-size: var(--type-label-size); line-height: 1.35; }
.passive-journey-segment { margin: 3px 0 0; color: var(--muted); font-size: var(--type-caption-size); line-height: 1.35; }
.passive-journey-suggestion { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.passive-journey-suggestion[hidden] { display: none; }
.passive-journey-train { display: block; margin-bottom: 7px; color: var(--text); font-size: var(--type-body-size); }
.passive-journey-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.passive-journey-actions .secondary-btn { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .ui-button,
  .ui-icon-button,
  .global-header-action,
  .swap-btn,
  .board-btn,
  .journey-end-btn,
  .journey-close-btn,
  .updated { transition: none; }
}
html[data-motion="reduced"] .ui-button,
html[data-motion="reduced"] .ui-icon-button,
html[data-motion="reduced"] .global-header-action,
html[data-motion="reduced"] .swap-btn,
html[data-motion="reduced"] .board-btn,
html[data-motion="reduced"] .journey-end-btn,
html[data-motion="reduced"] .journey-close-btn,
html[data-motion="reduced"] .updated { transition: none; }

@media (max-width: 520px) {
  .install-card { flex-direction: column; align-items: stretch; gap: 11px; }
  .install-card .install-prompt-copy { align-items: flex-start; width: 100%; }
  .install-card .install-prompt-copy > div { flex: 1 1 auto; }
  .install-card .install-prompt-actions { width: auto; align-self: flex-start; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 340px) {
  .install-card .install-mini-mark { display: none; }
  .install-card .install-prompt-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .install-card .install-action,
  .install-card .install-guide { width: 100%; justify-content: center; }
}

/* 1.23 — bounded boarding assistance; action state only, never a train-position widget. */
.boarding-assistance {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 5px;
  padding-left: 9px;
  border-left: 2px solid var(--semantic-caution);
  color: var(--muted-strong);
  font-size: .72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.boarding-assistance[data-level="ACTION_REQUIRED"] {
  border-left-color: var(--semantic-warning);
  color: var(--semantic-warning);
}
html[data-contrast="high"] .boarding-assistance { border-left-width: 3px; }

/* 1.27 Auto Wsiadam — informational guidance is not disruption styling. */
.boarding-assistance[data-level="INFO"] {
  border-left-color: var(--accent, currentColor);
  color: var(--muted-strong);
}
.historical-departed {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.3;
}
.route-context-status {
  margin: 6px 0 0;
  color: var(--muted-strong);
  font-size: .76rem;
  line-height: 1.35;
}
.route-context-status[data-state="no-direct-route"] { color: var(--semantic-caution); }
.active-journey-automation-notice {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 2px solid var(--accent, currentColor);
  color: var(--muted-strong);
  font-size: .78rem;
  line-height: 1.35;
}
.settings-segmented-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 380px) {
  .settings-segmented-three { grid-template-columns: 1fr; }
}

/* 1.27 — semantic passenger communication: INFO is normal guidance, ATTENTION
   is abnormal awareness, ACTION_REQUIRED indicates likely passenger action. */
.active-journey-state[data-communication-level="INFO"] { color: var(--text); }
.active-journey-state[data-communication-level="ATTENTION"],
.active-journey-issue[data-communication-level="ATTENTION"] {
  border-left-color: var(--semantic-caution);
  color: var(--muted-strong);
}
.active-journey-issue[data-communication-level="ACTION_REQUIRED"] {
  border-left-color: var(--semantic-critical);
  background: var(--semantic-critical-bg);
}
.journey-execution-resolution[data-importance="attention"] {
  border-color: var(--semantic-caution);
}

/* Post-1.27 Pruszcz Rail -> Bus Continuation. Rail remains the primary product surface. */
.pruszcz-continuation{margin-top:1rem;padding:1rem;border:1px solid var(--border-subtle,rgba(127,127,127,.24));border-radius:1rem;background:var(--surface-raised,rgba(127,127,127,.06))}
.pruszcz-continuation[hidden]{display:none!important}
.pruszcz-continuation-head{display:flex;gap:.75rem;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.pruszcz-continuation-head h2{font-size:1.05rem;margin:.15rem 0 .25rem}
.pruszcz-continuation-kicker{font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;opacity:.72}
.pruszcz-continuation-status{margin:.5rem 0;color:var(--text-muted,currentColor)}
.pruszcz-continuation-list{display:grid;gap:.65rem;margin-top:.75rem}
.pruszcz-bus-card{padding:.8rem;border:1px solid var(--border-subtle,rgba(127,127,127,.22));border-radius:.85rem;background:var(--surface,currentColor);background:color-mix(in srgb,currentColor 4%,transparent)}
.pruszcz-bus-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}
.pruszcz-bus-line{font-size:1.15rem;font-weight:800}
.pruszcz-bus-time{font-variant-numeric:tabular-nums;font-weight:800}
.pruszcz-bus-meta,.pruszcz-bus-reference{margin:.3rem 0 0;font-size:.9rem}
.pruszcz-bus-live{font-size:.78rem;font-weight:700;opacity:.75}
.pruszcz-closer-badge{display:inline-flex;margin-left:.45rem;padding:.12rem .4rem;border-radius:999px;background:color-mix(in srgb,#238636 18%,transparent);font-size:.75rem;font-weight:700}
.pruszcz-bus-details{margin-top:.55rem}
.pruszcz-bus-details summary{cursor:pointer;font-weight:650}
.pruszcz-stop-sequence{margin:.5rem 0 0;padding-left:1.25rem;font-size:.86rem}
.pruszcz-stop-sequence li{margin:.22rem 0}
.pruszcz-stop-sequence .boarding{font-weight:800}
.pruszcz-local-continuation{margin-bottom:1rem}
.pruszcz-filter-btn{font-size:.82rem}

/* 1.28 Pruszcz Local Transit experience */
.pruszcz-handoff,.pruszcz-local-entry{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-top:1rem;padding:1rem;border:1px solid var(--border-subtle,rgba(127,127,127,.24));border-radius:1rem;background:color-mix(in srgb,currentColor 4%,transparent)}
.pruszcz-handoff[hidden],.pruszcz-local-entry[hidden]{display:none!important}
.pruszcz-handoff h2,.pruszcz-local-entry h2{margin:.15rem 0 .25rem;font-size:1.05rem}
.pruszcz-handoff-actions,.pruszcz-local-actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.local-transit-view{display:grid;gap:1rem;max-width:52rem;margin:0 auto;padding-bottom:2rem}
.local-transit-view[hidden]{display:none!important}
.local-transit-head{display:flex;gap:.9rem;align-items:flex-start;padding:.5rem 0 .25rem}
.local-transit-head h1{margin:.15rem 0 .2rem;font-size:clamp(1.45rem,5vw,2rem)}
.local-transit-route{margin:0;color:var(--text-muted,currentColor);font-weight:650}
.local-transit-fare-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;margin:0;padding:0;border:0}
.local-transit-fare-filter legend{grid-column:1/-1;margin-bottom:.25rem;font-size:.8rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;opacity:.7}
.local-transit-filter-option{display:flex;align-items:center;justify-content:center;min-height:2.9rem;padding:.6rem .8rem;border:1px solid var(--border-subtle,rgba(127,127,127,.24));border-radius:.8rem;cursor:pointer;text-align:center;font-weight:700}
.local-transit-filter-option:has(input:checked){border-color:currentColor;background:color-mix(in srgb,currentColor 8%,transparent)}
.local-transit-filter-option input{position:absolute;inline-size:1px;block-size:1px;opacity:0}
.local-transit-filter-option:focus-within{outline:2px solid currentColor;outline-offset:2px}
.local-transit-help{margin:-.35rem 0 0;color:var(--text-muted,currentColor);font-size:.86rem}
.local-transit-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.local-transit-toolbar .pruszcz-continuation-status{margin:0}
.local-transit-list{display:grid;gap:.75rem}
.local-transit-course{padding:1rem}
.local-transit-alight{display:grid;gap:.12rem;margin-top:.7rem;padding:.7rem .8rem;border-radius:.75rem;background:color-mix(in srgb,currentColor 7%,transparent)}
.local-transit-alight>span{font-size:.76rem;font-weight:800;letter-spacing:.02em;text-transform:uppercase;opacity:.72}
.local-transit-alight>strong{font-size:1rem}
.local-transit-alight>small{color:var(--text-muted,currentColor)}
.local-transit-stop-sequence{list-style:none;padding:0;margin:.65rem 0 0;display:grid;gap:.35rem}
.local-transit-stop-sequence li{display:grid;gap:.08rem;padding:.45rem .6rem;border-left:3px solid color-mix(in srgb,currentColor 18%,transparent)}
.local-transit-stop-sequence li span{font-size:.78rem;color:var(--text-muted,currentColor)}
.local-transit-stop-sequence li.boarding{border-left-color:currentColor;background:color-mix(in srgb,currentColor 5%,transparent)}
.local-transit-stop-sequence li.best-stop{border-left-color:#2a8f55;background:color-mix(in srgb,#2a8f55 9%,transparent)}
.local-transit-stop-sequence li.reference-stop{border-left-width:5px}
.local-transit-mode .global-shell-main{min-height:70vh}
@media (max-width:620px){.pruszcz-handoff,.pruszcz-local-entry{display:grid}.pruszcz-handoff-actions,.pruszcz-local-actions{width:100%}.pruszcz-handoff-actions .ui-button,.pruszcz-local-actions .ui-button{flex:1}.local-transit-fare-filter{grid-template-columns:1fr}.local-transit-toolbar{align-items:flex-start;flex-direction:column}.local-transit-toolbar .ui-button{align-self:stretch}}

.pruszcz-reference-picker{border:0;margin:0;padding:0;min-width:0}
.pruszcz-reference-picker legend{font-weight:700}
.pruszcz-reference-radio-list .station-option{justify-content:flex-start}
