/* ==========================================================================
   PassingTrains — Generic Illustrated Brio + Modular Regional Biomes
   Mobile-first storybook craft, data-driven train liveries, 7 rail networks
   ========================================================================== */

:root {
  --paper-bg: #faf5ea;
  --paper-card: #fffdf8;
  --paper-elevated: #fff9ec;
  --paper-border: #dfd4be;
  --ink-primary: #1c2733;
  --ink-secondary: #4c5a68;
  --ink-muted: #697583;

  --stop-blue: #0052a5;
  --stop-soft: #eef6ff;
  --stop-badge-bg: #dbeafe;
  --stop-border: #93c5fd;

  --express-gold: #d97706;
  --express-soft: #fff8e4;
  --express-badge-bg: #fde68a;
  --express-ink: #78350f;
  --express-border: #f3c15b;

  --amtrak-navy: #005288;
  --amtrak-red: #c81e1e;
  --meadow-green: #2f6f3e;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-body);
  color: var(--ink-primary);
  background-color: var(--paper-bg);
  background-image:
    radial-gradient(rgba(166, 146, 114, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, #faf5ea 0%, #f4ecdc 100%);
  background-size: 22px 22px, 100% 100%;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

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

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

/* ==========================================================================
   Dynamic Sky & Biome Switching
   ========================================================================== */

.diorama-stage {
  --sky-top: #5eaee4;
  --sky-mid: #a7d9f7;
  --sky-bottom: #f7f2de;
  --cloud-color: #fffefb;
  --cloud-opacity: 0.93;
  --hill-far-top: #79aa88;
  --hill-far-bottom: #5d8f6d;
  --hill-mid-top: #6da358;
  --hill-mid-bottom: #4b7e3e;
  --meadow-top: #5c9449;
  --meadow-bottom: #3f6e33;
  --water-top: #4eb4e3;
  --water-bottom: #2286c2;
  --sun-opacity: 1;
  --night-opacity: 0;
  --lantern-opacity: 0.25;
  --city-window-opacity: 0.35;
  --moon-cutout: #1d2d54;

  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom: 3px solid #3c5f32;
  box-shadow: 0 5px 16px rgba(42, 54, 41, 0.12);
}

.diorama-stage[data-sky="dawn"] {
  --sky-top: #7e94c8;
  --sky-mid: #e6a9a1;
  --sky-bottom: #fce2b6;
  --cloud-color: #fff3e6;
  --cloud-opacity: 0.88;
  --hill-far-top: #73948a;
  --hill-far-bottom: #55786c;
  --sun-opacity: 0.95;
  --lantern-opacity: 0.55;
  --city-window-opacity: 0.6;
}

.diorama-stage[data-sky="morning"] {
  --sky-top: #6db8ea;
  --sky-mid: #b2dff8;
  --sky-bottom: #fdf5df;
  --cloud-color: #ffffff;
}

.diorama-stage[data-sky="day"] {
  --sky-top: #5eaee4;
  --sky-mid: #a7d9f7;
  --sky-bottom: #f7f2de;
}

.diorama-stage[data-sky="dusk"] {
  --sky-top: #4b5c96;
  --sky-mid: #d68572;
  --sky-bottom: #f9cc86;
  --cloud-color: #fde4cf;
  --cloud-opacity: 0.86;
  --hill-far-top: #5e746e;
  --hill-far-bottom: #405650;
  --hill-mid-top: #537a47;
  --hill-mid-bottom: #385a31;
  --meadow-top: #47703b;
  --meadow-bottom: #2f5228;
  --water-top: #3e7aa8;
  --water-bottom: #1e4b73;
  --sun-opacity: 0.88;
  --night-opacity: 0.18;
  --lantern-opacity: 0.85;
  --city-window-opacity: 0.85;
}

.diorama-stage[data-sky="night"] {
  --sky-top: #152140;
  --sky-mid: #243866;
  --sky-bottom: #3c5482;
  --cloud-color: #6b81ac;
  --cloud-opacity: 0.42;
  --hill-far-top: #2c454a;
  --hill-far-bottom: #1e3338;
  --hill-mid-top: #2b4c39;
  --hill-mid-bottom: #1d3828;
  --meadow-top: #2a4d30;
  --meadow-bottom: #1c3621;
  --water-top: #1f486e;
  --water-bottom: #112a44;
  --sun-opacity: 0;
  --night-opacity: 1;
  --lantern-opacity: 1;
  --city-window-opacity: 0.95;
  --moon-cutout: #1d2d54;
}

.sky-stop-top { stop-color: var(--sky-top); transition: stop-color 0.6s ease; }
.sky-stop-mid { stop-color: var(--sky-mid); transition: stop-color 0.6s ease; }
.sky-stop-bottom { stop-color: var(--sky-bottom); transition: stop-color 0.6s ease; }
.hill-far-top { stop-color: var(--hill-far-top); }
.hill-far-bottom { stop-color: var(--hill-far-bottom); }
.hill-mid-top { stop-color: var(--hill-mid-top); }
.hill-mid-bottom { stop-color: var(--hill-mid-bottom); }
.meadow-top { stop-color: var(--meadow-top); }
.meadow-bottom { stop-color: var(--meadow-bottom); }
.water-top { stop-color: var(--water-top); }
.water-bottom { stop-color: var(--water-bottom); }
.cloud-fill { fill: var(--cloud-color); opacity: var(--cloud-opacity); }
.celestial-sun { opacity: var(--sun-opacity); transition: opacity 0.6s ease; }
.celestial-night { opacity: var(--night-opacity); transition: opacity 0.6s ease; }
.moon-cutout { fill: var(--moon-cutout); }
.lantern-glow { opacity: var(--lantern-opacity); }
.city-windows { opacity: var(--city-window-opacity); }

/* Biome Layer Toggles */
.biome-layer { display: none; }
.diorama-stage[data-biome="brio"] .biome-brio { display: inline; }
.diorama-stage[data-biome="suburb"] .biome-suburb { display: inline; }
.diorama-stage[data-biome="city"] .biome-city { display: inline; }
.diorama-stage[data-biome="coast"] .biome-coast { display: inline; }

.coast-sub-bay,
.coast-sub-harbor { display: none; }
.diorama-stage[data-coast-variant="bay"] .coast-sub-bay { display: inline; }
.diorama-stage[data-coast-variant="harbor"] .coast-sub-harbor { display: inline; }

.brio-rail-track,
.track-brio-bed { display: none; }
.diorama-stage[data-biome="brio"] .brio-rail-track,
.diorama-stage[data-biome="brio"] .track-brio-bed { display: inline; }
.diorama-stage[data-biome="brio"] .steel-rail-track,
.diorama-stage[data-biome="brio"] .track-ballast { display: none; }

/* ==========================================================================
   Floating Top Bar
   ========================================================================== */

.diorama-topbar {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  pointer-events: none;
}

.diorama-topbar > * {
  pointer-events: auto;
}

.station-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 60%;
  min-height: 42px;
  padding: 5px 12px 5px 7px;
  border: 2px solid #2b3847;
  border-radius: var(--radius-pill);
  background: rgba(255, 252, 244, 0.96);
  color: var(--ink-primary);
  box-shadow: 0 3px 0 rgba(28, 39, 51, 0.25);
  cursor: pointer;
}

.station-pill-btn:hover {
  background: #ffffff;
}

.agency-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--stop-blue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.station-pill-text {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.station-pill-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-pill-lines {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.line-mini-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(28, 39, 51, 0.22);
}

.station-pill-caret {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--ink-secondary);
}

.sky-status-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sky-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 10px;
  border: 2px solid #2b3847;
  border-radius: var(--radius-pill);
  background: rgba(255, 252, 244, 0.95);
  box-shadow: 0 3px 0 rgba(28, 39, 51, 0.22);
  font-size: 0.82rem;
  font-weight: 800;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
}

.live-dot.is-offline {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.sky-clock-badge {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: #dcfce7;
  color: #166534;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sky-clock-badge.is-offline {
  background: #fef3c7;
  color: #92400e;
}

.icon-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid #2b3847;
  border-radius: 50%;
  background: rgba(255, 252, 244, 0.95);
  box-shadow: 0 3px 0 rgba(28, 39, 51, 0.22);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .icon-refresh-btn.is-spinning svg {
    animation: spin 0.75s linear infinite;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   SVG Diorama Sizing & Interactive Signpost
   ========================================================================== */

.diorama-canvas-wrap {
  width: 100%;
  height: 356px;
  background: var(--sky-bottom);
}

.railway-diorama {
  width: 100%;
  height: 100%;
  display: block;
}

.svg-signpost-btn {
  cursor: pointer;
}

.signpost-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  fill: #1c2733;
}

.signpost-hint {
  font-family: var(--font-body);
  font-size: 6.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  fill: #6b4423;
}

.train-badge-text {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 900;
}

.diorama-train-group {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .cloud-1 { animation: cloudDrift 48s ease-in-out infinite alternate; }
  .cloud-2 { animation: cloudDrift 62s ease-in-out infinite alternate-reverse; }
  .cloud-3 { animation: cloudDrift 54s ease-in-out infinite alternate; }
  .cloud-4 { animation: cloudDrift 44s ease-in-out infinite alternate-reverse; }
  .diorama-train-group { transition: transform 0.6s ease; }
}

@keyframes cloudDrift {
  from { transform: translateX(-16px); }
  to { transform: translateX(18px); }
}

/* ==========================================================================
   Compact Diorama Guide & Scene Mode Switcher Bar
   ========================================================================== */

.diorama-legend {
  background: #2b4a26;
  color: #f4f8ef;
  border-top: 2px solid #213a1d;
  padding: 7px 12px;
}

.diorama-legend-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.legend-directions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.legend-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  margin-right: 4px;
  font-weight: 900;
}

.legend-divider {
  opacity: 0.55;
}

.legend-live-count {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.76rem;
  font-weight: 800;
}

.diorama-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.diorama-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 5px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #f4f8ef;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.diorama-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.diorama-tool-btn.is-active {
  background: #fde68a;
  border-color: #f59e0b;
  color: #1c2733;
}

/* ==========================================================================
   Main Content: Welcome Nudge + Hero + Spotter + Best Window + Schedule
   ========================================================================== */

.storybook-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.first-visit-banner {
  background: #eff6ff;
  border: 2px solid #93c5fd;
  border-radius: var(--radius-md);
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.first-visit-banner[hidden] {
  display: none;
}

.first-visit-copy {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #143d73;
}

.first-visit-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.first-visit-btn {
  min-height: 38px;
  padding: 5px 12px;
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #143d73;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.first-visit-btn--primary {
  border-color: #166534;
  background: #dcfce7;
  color: #166534;
}

.first-visit-dismiss {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 61, 115, 0.1);
  color: #143d73;
  font-weight: 900;
  cursor: pointer;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-card {
  background: var(--paper-card);
  border: 2.5px solid #2b3847;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 5px 0 var(--paper-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.2s ease;
}

.hero-card.is-refreshing {
  opacity: 0.72;
}

.hero-card--stop {
  border-color: var(--stop-blue);
  box-shadow: 0 5px 0 #c6dcf7;
}

.hero-card--stop.hero-card--imminent {
  box-shadow: 0 0 0 3px rgba(0, 82, 165, 0.24), 0 5px 0 #93c5fd;
}

.hero-card--pass {
  background: linear-gradient(180deg, #fffdf6 0%, #fff7df 100%);
  border-color: var(--express-gold);
  box-shadow: 0 5px 0 #f4d28b;
}

.hero-card--pass.hero-card--imminent {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.34), 0 5px 0 #f59e0b;
}

.imminent-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #dc2626;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-card--imminent .lookout-pill {
    animation: gentlePulse 1.8s ease-in-out infinite;
  }
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.hero-countdown-num {
  font-variant-numeric: tabular-nums;
}

.best-window-card {
  background: linear-gradient(90deg, #eefaf1 0%, #fffbeb 100%);
  border: 2px solid #86efac;
  border-radius: var(--radius-md);
  padding: 9px 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.best-window-card[hidden] {
  display: none;
}

.best-window-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.best-window-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.best-window-text {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #1c2733;
}

.best-window-jump {
  min-height: 38px;
  padding: 5px 13px;
  border: 1.5px solid #166534;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #166534;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.hero-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hero-badges-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.lookout-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: #1c2733;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 900;
}

.type-pill--stop {
  background: var(--stop-badge-bg);
  color: #143d73;
  border: 1.5px solid var(--stop-border);
}

.type-pill--pass {
  background: var(--express-badge-bg);
  color: var(--express-ink);
  border: 1.5px dashed var(--express-gold);
}

.operator-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--amtrak-navy);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.hero-main-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.38rem, 3.2vw, 1.95rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-primary);
}

.hero-countdown-box {
  flex-shrink: 0;
  min-width: 84px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--stop-border);
  background: var(--stop-soft);
  text-align: center;
}

.hero-card--pass .hero-countdown-box {
  border-color: var(--express-gold);
  background: #fef3c7;
}

.hero-countdown-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--stop-blue);
}

.hero-card--pass .hero-countdown-num {
  color: var(--express-ink);
}

.hero-countdown-sub {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.hero-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--paper-border);
  background: var(--paper-elevated);
  font-size: 0.8rem;
  font-weight: 800;
}

.meta-chip--gps {
  background: #e9f5ec;
  border-color: #86efac;
  color: #166534;
}

.meta-chip--delay {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.route-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-runnerup {
  padding-top: 8px;
  border-top: 1.5px dashed var(--paper-border);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-secondary);
  font-weight: 700;
}

.hero-runnerup-main {
  min-width: 0;
}

.hero-runnerup-time {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Compact Interactive Spotter Strip
   ========================================================================== */

.spotter-strip {
  background: var(--paper-card);
  border: 2px solid var(--paper-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 3px 0 var(--paper-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.spotted-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 14px;
  border: 2px solid #143d73;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #1668c4 0%, #0052a5 100%);
  color: #ffffff;
  box-shadow: 0 3px 0 #0f2f5b;
  cursor: pointer;
  flex: 1 1 210px;
}

.spotted-cta-btn.is-express {
  border-color: #92400e;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 3px 0 #78350f;
}

.spotted-cta-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0f2f5b;
}

.spotted-cta-star {
  font-size: 1.2rem;
  color: #fde047;
}

.spotted-cta-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}

.spotted-cta-main {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.spotted-cta-sub {
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.92;
}

.spotter-counts-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spotter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--stop-border);
  background: var(--stop-soft);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.spotter-pill--pass {
  border-color: var(--express-border);
  background: var(--express-soft);
  color: var(--express-ink);
}

.tally-reset-btn {
  min-height: 38px;
  padding: 5px 11px;
  border: 1.5px solid var(--paper-border);
  border-radius: var(--radius-pill);
  background: var(--paper-elevated);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-secondary);
  cursor: pointer;
}

.tally-toast {
  margin: 0;
  flex: 1 1 100%;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--meadow-green);
}

.tally-reset-btn[hidden],
.tally-toast[hidden],
.filter-pill[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .is-pop {
    animation: spotPop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@keyframes spotPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Schedule Filter Bar & Train Cards
   ========================================================================== */

.schedule-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.schedule-subtitle {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.rt-notice {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #fbbf24;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.86rem;
  font-weight: 800;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--paper-border);
  background: var(--paper-card);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 4px 11px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-secondary);
  cursor: pointer;
}

.filter-pill.is-active {
  background: #1c2733;
  color: #ffffff;
}

.filter-pill--stop.is-active {
  background: var(--stop-blue);
}

.filter-pill--pass.is-active {
  background: var(--express-gold);
}

.filter-pill--amtrak {
  border: 1.5px solid var(--amtrak-navy);
  background: var(--paper-card);
  color: var(--amtrak-navy);
}

.filter-pill--amtrak.is-active {
  background: var(--amtrak-navy);
  color: #ffffff;
}

.filter-group--date {
  align-items: center;
}

.date-pill-input {
  min-height: 38px;
  padding: 2px 9px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
}

.pill-count {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.74rem;
}

.train-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.train-card {
  background: var(--paper-card);
  border: 2px solid var(--paper-border);
  border-left: 6px solid var(--train-stripe, var(--stop-blue));
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--paper-border);
  overflow: hidden;
}

.train-card--pass {
  border-left: 6px dashed var(--express-gold);
  background: #fffdf7;
}

.train-card--amtrak {
  border-left: 6px dashed var(--amtrak-red);
}

.train-card--passed {
  opacity: 0.65;
}

.train-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(98px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
}

.train-card-summary::-webkit-details-marker {
  display: none;
}

.train-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.train-time-main {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.train-time-eta {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--stop-blue);
}

.train-card--pass .train-time-eta {
  color: var(--express-ink);
}

.train-time-sched {
  font-size: 0.74rem;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.train-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.train-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.train-dest-title {
  font-weight: 900;
  font-size: 0.98rem;
  line-height: 1.2;
}

.train-sub-line {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.train-status-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.train-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.card-chevron {
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.train-card[open] .card-chevron {
  transform: rotate(180deg);
}

/* Route Timeline Inside Expanded Card */
.train-stops-panel {
  padding: 10px 14px 14px;
  border-top: 1.5px dashed var(--paper-border);
  background: var(--paper-elevated);
}

.stops-caption {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.stops-ol {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
  border-left: 2px solid var(--paper-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stop-li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 700;
}

.stop-li::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--ink-muted);
}

.stop-li--here {
  background: var(--stop-badge-bg);
  color: #143d73;
  font-weight: 900;
}

.stop-li--here::before {
  background: var(--stop-blue);
  border-color: var(--stop-blue);
}

.stop-li--past {
  opacity: 0.5;
}

.stop-li--past::before {
  border-color: var(--paper-border);
  background: var(--paper-elevated);
}

.stop-li--pass {
  background: var(--express-badge-bg);
  border: 1.5px dashed var(--express-gold);
  color: var(--express-ink);
  font-weight: 900;
}

.stop-li--pass::before {
  background: var(--express-gold);
  border-color: var(--express-gold);
}

.empty-board {
  padding: 24px 16px;
  border: 2px dashed var(--paper-border);
  border-radius: var(--radius-md);
  background: var(--paper-card);
  text-align: center;
  font-weight: 700;
  color: var(--ink-secondary);
}

.empty-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.storybook-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 4px 14px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: center;
}

.storybook-footer p {
  margin: 0;
}

.footer-support-row {
  display: flex;
  justify-content: center;
}

.kofi-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--express-border);
  background: var(--express-soft);
  color: var(--express-ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.kofi-link:hover {
  background: var(--express-badge-bg);
  border-color: var(--express-gold);
  transform: translateY(-1px);
}

/* ==========================================================================
   Multi-Agency Station Chooser Dialog
   ========================================================================== */

.station-dialog {
  width: min(700px, calc(100vw - 20px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  padding: 0;
  border: 2.5px solid #2b3847;
  border-radius: var(--radius-lg);
  background: var(--paper-card);
  color: var(--ink-primary);
  box-shadow: 0 20px 50px rgba(20, 30, 45, 0.35);
}

.station-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
}

.station-dialog-shell {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: hidden;
}

.dialog-top-fixed {
  flex-shrink: 0;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper-card);
  border-bottom: 1.5px solid var(--paper-border);
}

.dialog-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.station-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dialog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.15;
}

.dialog-eyebrow {
  margin: 3px 0 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--stop-blue);
}

.dialog-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dialog-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--paper-border);
  background: var(--paper-elevated);
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
}

.near-me-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 12px;
  border: 2px solid var(--meadow-green);
  border-radius: var(--radius-pill);
  background: #e9f5ec;
  color: #166534;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.near-me-status {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.near-me-status[hidden] {
  display: none;
}

.dialog-loading-stage[hidden],
.dialog-favorites-section[hidden],
.dialog-quick-section[hidden],
.dialog-line-section[hidden],
.dialog-results-meta[hidden],
.station-groups[hidden] {
  display: none;
}

/* ==========================================================================
   Animated Train Loader When Switching Networks
   ========================================================================== */

.dialog-loading-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 360px;
}

.dialog-loading-card {
  background: var(--paper-elevated);
  border: 2px dashed var(--paper-border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.loader-train-svg {
  width: min(320px, 100%);
  height: auto;
  display: block;
  border: 2px solid #2b3847;
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(28, 39, 51, 0.16);
}

.dialog-loading-heading {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dialog-loading-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.dialog-loading-subtitle {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.dialog-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skeleton-chip {
  height: 32px;
  width: 84px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--paper-border);
  background: var(--paper-elevated);
}

.skeleton-chip:nth-child(2) { width: 108px; }
.skeleton-chip:nth-child(3) { width: 92px; }
.skeleton-chip:nth-child(4) { width: 76px; }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 7px;
}

.skeleton-row {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--paper-border);
  background: #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
  .loader-train-runner {
    animation: loaderTrainRun 2.1s linear infinite;
  }

  .loader-train-bob {
    animation: loaderTrainBob 0.42s ease-in-out infinite alternate;
  }

  .loader-puff-1 {
    animation: loaderPuff 0.9s ease-in-out infinite alternate;
  }

  .loader-puff-2 {
    animation: loaderPuff 0.9s ease-in-out 0.25s infinite alternate;
  }

  .loader-puff-3 {
    animation: loaderPuff 0.9s ease-in-out 0.5s infinite alternate;
  }

  .skeleton-chip,
  .skeleton-row {
    animation: skeletonPulse 1.2s ease-in-out infinite alternate;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-train-runner {
    transform: translateX(132px);
  }
}

@keyframes loaderTrainRun {
  from { transform: translateX(-125px); }
  to { transform: translateX(355px); }
}

@keyframes loaderTrainBob {
  from { transform: translateY(45px); }
  to { transform: translateY(43.5px); }
}

@keyframes loaderPuff {
  from { opacity: 0.35; }
  to { opacity: 0.92; }
}

@keyframes skeletonPulse {
  from { opacity: 0.45; }
  to { opacity: 0.9; }
}

.fav-chip-wrap {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--express-border);
  border-radius: var(--radius-pill);
  background: var(--express-soft);
  overflow: hidden;
}

.fav-chip-wrap.is-current {
  border-color: var(--stop-blue);
  background: var(--stop-badge-bg);
}

.fav-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-primary);
  cursor: pointer;
}

.fav-chip-agency {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  color: #ffffff;
}

.fav-chip-remove {
  min-height: 36px;
  padding: 4px 9px 4px 4px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.dialog-section-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.agency-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 0 20px 2px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
}

.agency-pills::-webkit-scrollbar {
  display: none;
}

.agency-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1.5px solid var(--paper-border);
  border-radius: var(--radius-pill);
  background: var(--paper-elevated);
  color: var(--ink-primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.agency-pill.is-active {
  border-color: #1c2733;
  background: #1c2733;
  color: #ffffff;
}

.agency-pill.is-loading {
  border-color: var(--pill-accent, #1c2733);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pill-accent, #0052a5) 28%, transparent);
}

.agency-pill-spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .agency-pill-spinner {
    animation: spin 0.7s linear infinite;
  }
}

.agency-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agency-pill.is-active .agency-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}

.dialog-search-wrap {
  position: relative;
}

.dialog-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.dialog-search-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 36px 9px 38px;
  border: 2px solid var(--paper-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.dialog-search-input::-webkit-search-cancel-button {
  display: none;
}

.dialog-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--paper-elevated);
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.dialog-search-clear[hidden] {
  display: none;
}

.quick-station-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  min-height: 36px;
  padding: 5px 12px;
  border: 1.5px solid var(--paper-border);
  border-radius: var(--radius-pill);
  background: var(--paper-elevated);
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
}

.quick-chip.is-current {
  border-color: var(--stop-blue);
  background: var(--stop-badge-bg);
  color: #143d73;
}

.line-filter-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 0 20px 2px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
}

.line-filter-pills::-webkit-scrollbar {
  display: none;
}

.line-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 11px;
  border: 1.5px solid var(--paper-border);
  border-radius: var(--radius-pill);
  background: var(--paper-elevated);
  color: var(--ink-primary);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.line-filter-pill.is-active {
  border-color: #1c2733;
  background: #1c2733;
  color: #ffffff;
}

.dialog-results-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.station-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.station-group-title {
  margin: 0 0 6px;
  font-size: 0.84rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 7px;
}

.station-row {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--paper-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease;
}

.station-row:hover {
  border-color: #94a3b8;
}

.station-row.is-current {
  border-color: var(--stop-blue);
  background: var(--stop-soft);
}

.station-row-main {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 7px 6px 7px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.station-row-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.2;
}

.station-row-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--stop-blue);
}

.station-row-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.station-star-btn {
  width: 36px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.station-star-btn.is-saved {
  color: #d97706;
}

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

/* ==========================================================================
   Mobile Responsive Polish (390px zero overflow & compact above-the-fold)
   ========================================================================== */

@media (max-width: 760px) {
  .diorama-canvas-wrap {
    height: 288px;
  }

  .train-badge-text {
    font-size: 12.5px;
  }

  .station-pill-btn {
    max-width: 58%;
    padding: 4px 10px 4px 6px;
  }

  .station-pill-lines {
    display: none;
  }

  .sky-clock-pill {
    padding: 4px 8px;
    font-size: 0.76rem;
  }

  .diorama-legend {
    padding: 6px 10px;
  }

  .legend-directions {
    font-size: 0.74rem;
    gap: 4px 7px;
  }

  .legend-divider,
  .legend-live-count {
    display: none;
  }

  .hero-card {
    padding: 13px 14px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .filter-secondary-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-right: 18px;
    mask-image: linear-gradient(to right, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
  }

  .filter-secondary-row::-webkit-scrollbar {
    display: none;
  }

  .filter-secondary-row > * {
    flex-shrink: 0;
  }

  .filter-secondary-row .filter-group {
    flex-wrap: nowrap;
  }

  .train-card-summary {
    grid-template-columns: minmax(94px, auto) 1fr;
    gap: 10px 14px;
  }

  .train-status-col {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px dashed var(--paper-border);
  }

  .train-status-stack {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .station-dialog {
    width: calc(100vw - 12px);
    max-height: 90vh;
    max-height: 90dvh;
  }

  .station-dialog-shell {
    max-height: 90vh;
    max-height: 90dvh;
  }

  .dialog-top-fixed {
    padding: 12px 12px 10px;
  }

  .dialog-title {
    font-size: 1.12rem;
  }

  .dialog-scroll-body {
    padding: 10px 12px 16px;
  }

  .dialog-quick-section .quick-station-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-right: 20px;
    mask-image: linear-gradient(to right, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
  }

  .dialog-quick-section .quick-station-chips::-webkit-scrollbar {
    display: none;
  }

  .dialog-quick-section .quick-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .station-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .dialog-loading-stage {
    min-height: 300px;
  }
}
