* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  color: #1d3557;
}

/* Main page area sits below the sticky nav */
.page-body { padding: 20px; }

/* ---- Navigation bar (mirrors the home page) ---- */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #000000;
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  font-size: 1.8em;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 6px 12px rgba(102, 126, 234, 0.4));
}
.nav-logo .logo-icon { width: 32px; height: 28px; flex-shrink: 0; }
.nav-center {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
  justify-content: center;
}
.nav-links { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; justify-content: center; }
.nav-links a {
  text-decoration: none;
  white-space: nowrap;
  color: #fff;
  font-weight: 600;
  font-size: 1.05em;
  position: relative;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:hover { transform: translateY(-2px); }
.nav-links a:hover::after,
.nav-links a.active::after { width: calc(100% - 32px); }
.nav-links a.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}

/* "Live" dropdown — groups Live Departures + Live Status without widening the nav */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-drop-toggle {
  color: #fff;
  font-weight: 600;
  font-size: 1.05em;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.drop-caret { font-size: 0.7em; margin-left: 5px; opacity: 0.75; }
.nav-dropdown:hover .nav-drop-toggle,
.nav-dropdown:focus-within .nav-drop-toggle,
.nav-drop-toggle.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}
.nav-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  padding: 8px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 1200;
}
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu { display: flex; }
.nav-links .nav-drop-menu a { display: block; font-size: 1em; padding: 10px 14px; white-space: nowrap; }
.nav-links .nav-drop-menu a::after { display: none; }
.nav-links .nav-drop-menu a:hover {
  transform: none;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.hamburger-btn:hover { background: rgba(255, 255, 255, 0.1); }
.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger-btn span:nth-child(1) { margin-bottom: 5px; }
.hamburger-btn span:nth-child(3) { margin-top: 5px; }
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 12px 0;
}
.mobile-nav.show { display: block; animation: slideDown 0.3s ease-out; }
.mobile-nav a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 1.1em;
  border-left: 4px solid transparent;
}
.mobile-nav a:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
  color: #fff;
  border-left-color: rgba(255,255,255,0.8);
}
.mobile-nav a.active { border-left-color: #667eea; background: rgba(255,255,255,0.06); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .nav-container { padding: 12px 16px; gap: 8px; }
  .nav-logo { font-size: 1.3em; gap: 6px; }
  .nav-center { display: none; }
  .hamburger-btn { display: flex; }
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px 50px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #667eea;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 600;
  transition: color 0.2s;
}
.back-link:hover { color: #764ba2; text-decoration: underline; }

/* Row holding "All lines" and the live-departures cross-link */
.page-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.page-links .back-link { margin-bottom: 20px; }

/* Line header card with line-colour gradient overlay */
.line-header {
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
  position: relative;
  overflow: hidden;
}
.line-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.line-header h1 {
  margin: 0 0 6px;
  font-size: 1.8em;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.line-header .subtitle {
  margin: 0;
  font-size: 1.05em;
  opacity: 0.92;
  font-weight: 400;
}

/* Meta info row */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.9em;
  color: #555;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #eef0f3;
}
.meta strong { color: #1d3557; font-weight: 700; }

/* Pill control groups */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.btn {
  border: 2px solid #e8e8e8;
  background: #fff;
  color: #1d3557;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
}
.btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn:focus { outline: none; box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2); }

/* ---- Route map layout ---- */
.route-map-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 12px 60px;
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d3557;
  border: 1px solid #eef0f3;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}
.route-map-header span:last-child {
  text-align: right;
}

.route-map {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.route-branch-label {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 16px 6px 60px;
  font-weight: 700;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  background: none;
  border: none;
}

.route-branch-label::before {
  content: '';
  position: absolute;
  left: 24px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-color, #667eea);
  z-index: 2;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line-color, #667eea);
}

.route-branch-label::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  background: var(--line-color, #667eea);
  z-index: 1;
}

.station-row {
  display: flex;
  align-items: center;
  padding: 0 16px 0 0;
  position: relative;
  transition: background 0.15s;
}

.station-row:hover {
  background: rgba(102, 126, 234, 0.04);
}

.marker-col {
  position: relative;
  width: 48px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.marker-col::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  background: var(--line-color, #667eea);
}

.station-row.first-in-route .marker-col::before {
  top: 50%;
}

.station-row.last-in-route .marker-col::before {
  bottom: 50%;
}

.station-row.first-in-route.last-in-route .marker-col::before {
  display: none;
}

.station-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-color, #667eea);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--line-color, #667eea);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.station-dot.terminus {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 2.5px var(--line-color, #667eea), 0 2px 4px rgba(0,0,0,0.15);
}

.station-dot.interchange {
  background: #fff;
  border: 3px solid var(--line-color, #667eea);
}

.station-name {
  flex: 1;
  padding: 12px 12px;
  font-size: 0.95em;
  color: #1e293b;
  font-weight: 500;
}

.station-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1d3557;
  font-size: 1.02em;
  white-space: nowrap;
  padding: 12px 0;
  min-width: 50px;
  text-align: right;
}

.station-time.none {
  color: #9ca3af;
  font-style: italic;
  font-weight: 400;
}

.station-dest {
  display: block;
  font-size: 0.7em;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.01em;
  margin-top: 1px;
}

/* ---- Per-destination breakdown (short-turn services) ---- */
/* A station with 2+ last destinations swaps its single time for a small
   "towards X — HH:MM" list. The marker column stays put; name + list share
   the remaining width. */
.station-row.has-destinations { align-items: stretch; }

.station-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 12px 0;
}
.station-body .station-name { padding: 0; }

.dest-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dest-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 10px;
  background: #f8fafc;
  border-radius: 8px;
}
.dest-line-name {
  font-size: 0.82em;
  color: #475569;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dest-line-name::before {
  content: "towards ";
  color: #94a3b8;
  font-weight: 500;
}
.dest-line-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1d3557;
  font-size: 0.98em;
  white-space: nowrap;
}

/* Approximation banner */
.approx-banner {
  margin-bottom: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  font-size: 0.9em;
  color: #78350f;
  line-height: 1.55;
}
.approx-banner strong { color: #78350f; }
.approx-banner em { font-style: italic; font-weight: 600; }
.approx-banner code {
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* Info notes */
.note {
  margin-top: 22px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  font-size: 0.88em;
  color: #78350f;
  line-height: 1.55;
}
.note em { font-style: italic; font-weight: 600; }

/* Source line above CTA */
.source-line {
  margin-top: 14px;
  font-size: 0.82em;
  color: #777;
  text-align: right;
}
.source-line strong { color: #555; font-weight: 600; }

/* Bottom CTA */
.cta-card {
  margin-top: 28px;
  padding: 28px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1d3557 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(29, 53, 87, 0.25);
}
.cta-card h2 {
  margin: 0 0 8px;
  font-size: 1.3em;
  font-weight: 800;
  color: #fff;
}
.cta-card p {
  margin: 0 0 18px;
  font-size: 0.95em;
  opacity: 0.92;
  line-height: 1.5;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1em;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 44px;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(102, 126, 234, 0.45); }
.cta-btn:active { transform: translateY(0); }
.cta-card .cta-btn { margin: 4px 6px 0; }
.cta-btn-alt { background: rgba(255, 255, 255, 0.14); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.35); }
.cta-btn-alt:hover { box-shadow: none; background: rgba(255, 255, 255, 0.22); }

@media (max-width: 700px) {
  .cta-card { padding: 22px 18px; }
  .cta-card h2 { font-size: 1.15em; }
}

.error {
  padding: 16px 20px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-radius: 12px;
  font-weight: 500;
}

/* Line index list */
.line-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.line-list a {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border: 2px solid #eef0f3;
  border-radius: 14px;
  text-decoration: none;
  color: #1d3557;
  background: #fff;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}
.line-list a:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}
.line-list .swatch {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 4px;
  margin-right: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

h1.page-title {
  color: #1d3557;
  font-size: 1.8em;
  font-weight: 800;
  margin-bottom: 12px;
}
p.page-lede {
  color: #555;
  font-size: 1.05em;
  margin-bottom: 28px;
  opacity: 0.9;
}
p.footer-note {
  margin-top: 28px;
  color: #777;
  font-size: 0.85em;
}
p.footer-note code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ---- Mobile (iPhone / Android) ---- */
@media (max-width: 700px) {
  .page-body { padding: 12px; }
  .container {
    padding: 20px 16px;
    border-radius: 16px;
    margin: 12px auto;
  }
  .line-header { padding: 20px 18px; border-radius: 14px; }
  .line-header h1 { font-size: 1.35em; line-height: 1.25; }
  .line-header .subtitle { font-size: 0.95em; }

  .page-title { font-size: 1.5em; }
  .page-lede { font-size: 0.98em; }

  .meta {
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    font-size: 0.85em;
  }

  /* Stack controls into wrap-friendly rows; thumb-sized targets */
  .controls { gap: 6px; }
  .btn {
    padding: 11px 16px;
    font-size: 0.92em;
    min-height: 44px;        /* Apple HIG touch target */
    -webkit-tap-highlight-color: transparent;
  }
  .btn:hover { transform: none; }   /* hover lift is awkward on touch */
  .btn:active { transform: scale(0.97); }

  /* Route map: tighter on mobile */
  .route-map-header {
    flex-direction: column;
    gap: 2px;
    padding: 10px 10px 10px 48px;
    font-size: 0.7em;
    border-radius: 12px 12px 0 0;
  }
  .route-map-header span:last-child { text-align: left; }
  .route-map { border-radius: 0 0 12px 12px; }
  .marker-col { width: 40px; min-height: 40px; }
  .marker-col::before { width: 3px; }
  .station-dot { width: 10px; height: 10px; border-width: 2px; box-shadow: 0 0 0 1.5px var(--line-color, #667eea); }
  .station-dot.terminus { width: 14px; height: 14px; box-shadow: 0 0 0 2px var(--line-color, #667eea), 0 1px 3px rgba(0,0,0,0.12); }
  .station-name { padding: 10px 8px; font-size: 0.9em; }
  .station-time { font-size: 0.98em; padding: 10px 0; }
  .station-row:hover { background: transparent; }

  /* Destination breakdown stacks comfortably on phones */
  .station-body { padding: 10px 8px 10px 0; gap: 5px; }
  .station-body .station-name { padding: 0; }
  .dest-line { padding: 5px 8px; gap: 8px; }
  .dest-line-name { font-size: 0.8em; }
  .dest-line-time { font-size: 0.95em; }
  .route-branch-label {
    padding: 5px 10px 5px 50px;
    font-size: 0.68em;
  }
  .route-branch-label::before { left: 20px; width: 6px; height: 6px; }
  .route-branch-label::after { left: 20px; width: 3px; }
  .station-dest { font-size: 0.65em; }

  /* Line tile grid -> single column on phones */
  .line-list { grid-template-columns: 1fr; gap: 8px; }
  .line-list a {
    padding: 14px 16px;
    min-height: 56px;
    border-radius: 12px;
  }
  .line-list a:hover { transform: none; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }

  .approx-banner, .note { font-size: 0.85em; padding: 12px 14px; }
  .back-link { margin-bottom: 14px; }
}

/* iPhone notch / Dynamic Island safe area */
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .main-nav { padding-top: env(safe-area-inset-top); }
}

/* Prevent iOS from zooming on focus of buttons (no inputs here but future-proof) */
@media (max-width: 700px) {
  input, select, textarea, button { font-size: 16px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* FAQ section (static content rendered by the generator; no JS dependency) */
.faq-card {
  margin-top: 28px;
  padding: 26px 28px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.faq-card h2 {
  margin: 0 0 6px;
  font-size: 1.25em;
  font-weight: 800;
  color: #1d3557;
}
.faq-item { margin-top: 18px; }
.faq-q {
  margin: 0 0 6px;
  font-size: 1.02em;
  font-weight: 700;
  color: #0f172a;
}
.faq-a {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.6;
  color: #334155;
}
.faq-a a { color: #457b9d; }
@media (max-width: 640px) {
  .faq-card { padding: 20px 18px; }
}

/* ==== first-trains specific (appended to a copy of last-departures.css so
   this section is styled identically but fully independent) ==== */

/* Related-pages strip — same card language as the line-list tiles */
.related-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
}
.related-strip a {
  display: flex; align-items: center; gap: 10px;
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  padding: 12px 16px;
  text-decoration: none;
  color: #1d3557;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.related-strip a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(29, 53, 87, 0.12); }
.related-strip .rel-emoji { font-size: 1.35em; }
.related-strip strong { display: block; font-size: 0.92em; font-weight: 700; }
.related-strip small { display: block; color: #64748b; font-size: 0.76em; margin-top: 2px; }
@media (max-width: 640px) {
  .related-strip { grid-template-columns: 1fr; gap: 8px; }
  .related-strip a { border-radius: 12px; padding: 12px 14px; }
}

/* Direction heading — echoes the route-map's line-colour dot */
.direction-block { margin-top: 26px; }
.direction-block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12em;
  font-weight: 800;
  color: #1d3557;
  margin: 0 0 10px;
}
.dir-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--line-color, #667eea);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--line-color, #667eea);
  flex: none;
}

/* First-train tables — same card + header treatment as the route map */
.ft-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}
.ft-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.95em;
}
.ft-table thead th {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d3557;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
  white-space: nowrap;
}
.ft-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
  white-space: nowrap;
}
.ft-table tbody tr:last-child td { border-bottom: none; }
.ft-table tbody tr:hover { background: #f8fafc; }
.ft-table .ft-station { width: 100%; }
.ft-table .ft-station a {
  color: #1e293b;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted #cbd5e1;
}
.ft-table .ft-station a:hover { color: #457b9d; border-bottom-color: #457b9d; }
.ft-table td[data-day] {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1d3557;
  font-size: 1.02em;
}
.ft-table th.today-col, .ft-table td.today-col { background: #f0f5ff; }
.ft-table thead th.today-col::after { content: ' · today'; font-size: 0.85em; color: #667eea; font-weight: 700; text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) {
  .ft-table { font-size: 0.9em; }
  .ft-table thead th { padding: 10px 10px; font-size: 0.7em; }
  .ft-table td { padding: 10px 10px; }
  .ft-table-wrap { border-radius: 12px; }
}
