:root {
  --bg: #e9ecef;
  --ink: #132032;
  --muted: #60748a;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(13, 34, 63, 0.12);
  --shadow: 0 28px 60px rgba(15, 36, 60, 0.16);
  --header-bg: linear-gradient(120deg, rgba(9, 25, 49, 0.92), rgba(10, 70, 136, 0.88));
  --accent: #0b5cab;
  --accent-soft: rgba(11, 92, 171, 0.14);
  --map-glow: rgba(11, 92, 171, 0.25);
  --ok: #1fa971;
  --warn: #ffb03a;
  --bad: #ea4c5f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 166, 0, 0.18), transparent 24%),
    radial-gradient(circle at right center, rgba(11, 92, 171, 0.2), transparent 28%),
    linear-gradient(180deg, #eef3f8, #dde5ee 44%, #d8e1eb);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Aptos", "Segoe UI", sans-serif;
}

body.theme-night {
  --bg: #08111c;
  --ink: #e7f1fb;
  --muted: #8ea4ba;
  --panel: rgba(11, 20, 33, 0.82);
  --panel-strong: rgba(12, 23, 38, 0.95);
  --panel-border: rgba(154, 202, 255, 0.14);
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  --header-bg: linear-gradient(120deg, rgba(4, 11, 19, 0.96), rgba(11, 53, 99, 0.9));
  --accent-soft: rgba(89, 181, 255, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 175, 62, 0.12), transparent 24%),
    radial-gradient(circle at right center, rgba(74, 171, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #08111c, #091420 44%, #07111b);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.site-header {
  align-items: center;
  background: linear-gradient(180deg, rgba(8, 20, 34, 0.96), rgba(10, 41, 78, 0.92));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}

body:not(.theme-night) .site-header {
  background:
    linear-gradient(180deg, rgba(246, 249, 252, 0.96), rgba(228, 236, 244, 0.94)),
    linear-gradient(120deg, rgba(11, 92, 171, 0.08), rgba(218, 41, 28, 0.05));
  border-bottom: 1px solid rgba(18, 37, 61, 0.08);
  box-shadow: 0 10px 24px rgba(20, 36, 58, 0.08);
}

.brand-lockup {
  align-items: baseline;
  display: flex;
  gap: 0;
  min-width: 0;
  text-decoration: none;
}

.brand-lockup:hover {
  opacity: 0.96;
}

.brand-inline-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.26em;
  justify-content: center;
  margin-right: 0.56rem;
  overflow: hidden;
  padding: 0.12em;
  vertical-align: -0.18em;
  width: 2.26em;
}

.brand-inline-badge svg {
  display: block;
  height: 100%;
  width: 100%;
}

.brand-title-row,
.brand-wordmark {
  align-items: center;
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
}

.eyebrow,
.kicker,
.stat-label,
.board-label,
.section-meta {
  color: #99c8f5;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-copy h1,
.hero-copy h2,
.map-card-head h3,
.section-head h2 {
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.02em;
  margin: 0;
}

.brand-copy h1 {
  color: #fff;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 0.98;
}

body:not(.theme-night) .brand-copy h1 {
  color: #132032;
}

.brand-copy .eyebrow {
  font-size: 0.56rem;
  margin: 0 0 1px;
}

.brand-wordmark {
  gap: 0.38rem;
}

.subhead {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.77rem;
  margin: 1px 0 0;
  max-width: 42ch;
}

body:not(.theme-night) .subhead {
  color: #5f7185;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.route-panel-top {
  align-items: center;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.status-pill,
.icon-btn,
.panel,
.station-chip,
.station-form button {
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.status-pill,
.icon-btn {
  backdrop-filter: blur(12px);
  border-radius: 999px;
}

.status-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: inline-flex;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
}

.route-status-pill {
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
  border-color: color-mix(in srgb, var(--panel-border) 86%, transparent);
  box-shadow: 0 12px 24px rgba(10, 22, 36, 0.08);
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  min-height: 28px;
  padding: 0 10px;
  text-transform: uppercase;
}

body.theme-night .route-status-pill {
  background: rgba(16, 27, 43, 0.92);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.status-dot {
  background: var(--warn);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 176, 58, 0.65);
  height: 9px;
  width: 9px;
}

.status-pill.is-live .status-dot {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(31, 169, 113, 0.75);
}

.status-pill.is-error .status-dot {
  background: var(--bad);
  box-shadow: 0 0 12px rgba(234, 76, 95, 0.75);
}

.icon-btn,
.station-form button {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  min-height: 32px;
  padding: 0 12px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover,
.station-form button:hover,
.station-chip:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.34);
}

.icon-btn:active,
.station-form button:active,
.station-chip:active {
  transform: translateY(1px);
}

.dashboard {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.62fr) minmax(280px, 336px);
  height: calc(100vh - 70px);
  min-height: 0;
  padding: 14px;
}

.panel {
  background: var(--panel);
  border-color: var(--panel-border);
  border-radius: 28px;
  color: var(--ink);
  overflow: hidden;
}

.hero-panel {
  display: grid;
  min-height: 0;
}

.section-head .kicker {
  color: var(--accent);
  font-size: 0.74rem;
  margin: 0 0 4px;
}

.route-panel,
.board-panel,
.alerts-panel {
  padding: 14px;
}

.map-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.map-card-head,
.section-head,
.board-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.map-card-head {
  padding: 12px 14px 10px;
}

.map-card-head h3 {
  font-size: 1.25rem;
}

.map-toolbar {
  align-items: flex-end;
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.focus-indicator {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.focus-indicator span,
.board-note,
.section-meta,
.route-summary-copy,
.alert-meta,
.departure-meta {
  color: var(--muted);
}

.focus-indicator strong {
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 1rem;
}

.focus-indicator em {
  color: var(--ink-soft);
  display: block;
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.1;
  margin-top: 2px;
}

.map-controls {
  align-items: center;
  display: flex;
  gap: 6px;
}

.map-control-btn {
  background: rgba(8, 20, 34, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  min-height: 30px;
  min-width: 30px;
  padding: 0 10px;
  touch-action: manipulation;
  user-select: none;
}

.map-control-btn-wide {
  min-width: 56px;
}

.zoom-level {
  background: rgba(8, 20, 34, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.8rem;
  justify-content: center;
  min-width: 60px;
  padding: 6px 10px;
}

.map-frame {
  background:
    radial-gradient(circle at 25% 20%, var(--map-glow), transparent 28%),
    linear-gradient(180deg, rgba(8, 20, 34, 0.06), rgba(8, 20, 34, 0));
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  position: relative;
}

.map-glow {
  background: radial-gradient(circle, var(--map-glow), transparent 60%);
  filter: blur(9px);
  inset: 12% auto auto 12%;
  opacity: 0.68;
  position: absolute;
  width: 48%;
  aspect-ratio: 1;
}

.map-viewport {
  height: 100%;
  overflow: auto;
  position: relative;
  scrollbar-gutter: stable;
}

.map-stage {
  margin: 0 auto;
  backface-visibility: hidden;
  position: relative;
  transition: none;
  will-change: transform;
  width: 100%;
}

.map-svg-host {
  min-height: 100%;
  position: relative;
}

.map-svg-host > svg {
  display: block;
  height: auto;
  width: 100%;
}

.train-canvas {
  height: 100%;
  inset: 0;
  pointer-events: auto;
  position: absolute;
  width: 100%;
}

.t-map-diagram {
  display: block;
  height: auto;
  max-width: none;
  position: relative;
  width: 100%;
}

.t-map-diagram .route-line,
.t-map-diagram .station-nodes,
.t-map-diagram .station-labels,
.t-map-diagram .branch-labels,
.t-map-diagram .live-markers {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.t-map-diagram .line-red,
.t-map-diagram .line-orange,
.t-map-diagram .line-blue,
.t-map-diagram .line-green {
  fill: none;
  filter: url(#lineGlow);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 18;
}

.t-map-diagram .line-red {
  stroke: #da291c;
}

.t-map-diagram .line-orange {
  stroke: #ed8b00;
}

.t-map-diagram .line-blue {
  stroke: #003da5;
}

.t-map-diagram .line-green {
  stroke: #00843d;
}

.t-map-diagram .station-nodes circle {
  fill: #ffffff;
  stroke: #112138;
  stroke-width: 4;
}

.t-map-diagram .station-nodes .interchange {
  stroke-width: 5;
}

.map-svg-host > .t-map-diagram text {
  fill: #17263b;
  font: 1px Helvetica;
  font-weight: 600;
}

.t-map-diagram.focused .route-line,
.t-map-diagram.focused .station-nodes,
.t-map-diagram.focused .station-labels,
.t-map-diagram.focused .branch-labels {
  opacity: 0.16;
}

.t-map-diagram.focus-red .route-red,
.t-map-diagram.focus-orange .route-orange,
.t-map-diagram.focus-blue .route-blue,
.t-map-diagram.focus-silver .route-silver,
.t-map-diagram.focus-green-b .route-green-b,
.t-map-diagram.focus-green-c .route-green-c,
.t-map-diagram.focus-green-d .route-green-d,
.t-map-diagram.focus-green-e .route-green-e {
  opacity: 1;
}

.t-map-diagram .live-markers .train-marker {
  cursor: pointer;
  pointer-events: auto;
  transform-box: fill-box;
  transform-origin: center;
}

.t-map-diagram .selected-stop-highlight {
  pointer-events: none;
}

.t-map-diagram .selected-stop-ring {
  animation: stationPulse 1.8s ease-in-out infinite;
  fill: rgba(255, 255, 255, 0.18);
  stroke: #0b5cab;
  stroke-width: 0.55;
}

.t-map-diagram .selected-stop-core {
  fill: #0b5cab;
  stroke: #ffffff;
  stroke-width: 0.24;
}

body.theme-night .t-map-diagram .selected-stop-ring {
  fill: rgba(153, 200, 245, 0.14);
  stroke: #9fd0ff;
}

body.theme-night .t-map-diagram .selected-stop-core {
  fill: #9fd0ff;
  stroke: #08111d;
}

@keyframes stationPulse {
  0% { transform: scale(0.94); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(0.94); opacity: 0.8; }
}

.t-map-diagram .live-markers .train-halo {
  opacity: 0.12;
}

.t-map-diagram .live-markers .train-core {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 1.8;
}

.t-map-diagram .live-markers .train-badge {
  fill: rgba(255, 255, 255, 0.12);
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 0.8;
}

.t-map-diagram .live-markers .train-marker text {
  display: none;
}

.t-map-diagram .live-markers .train-arrow {
  fill: none;
  opacity: 0.95;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.t-map-diagram .live-markers .train-marker.is-dimmed {
  opacity: 0.18;
}

.t-map-diagram .live-markers .train-badge {
  display: none;
}

.tooltip {
  backdrop-filter: blur(16px);
  background: rgba(6, 18, 30, 0.95);
  border: 1px solid rgba(126, 203, 255, 0.18);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ebf6ff;
  max-width: 420px;
  min-width: 320px;
  padding: 14px 16px;
  pointer-events: none;
  position: fixed;
  z-index: 30;
}

.tooltip-route {
  color: #99c8f5;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tooltip-heading {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tooltip-trip,
.tooltip-detail,
.tooltip-meta {
  color: #b4c7da;
  font-size: 0.92rem;
}

.tooltip-trip {
  margin-bottom: 4px;
}

.tooltip-detail {
  color: #f2f7fd;
  line-height: 1.45;
  white-space: pre-line;
}

.tooltip-meta {
  margin-top: 5px;
}

body.theme-night .tooltip {
  background: rgba(6, 18, 30, 0.95);
}

.sidebar {
  display: grid;
  gap: 12px;
  height: calc(100vh - 108px);
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(96, 116, 138, 0.35);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.section-head h2 {
  font-size: 1.25rem;
}

.route-swatch {
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 1rem;
  justify-content: center;
  min-width: 34px;
  padding: 7px 10px;
}

.route-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.route-summary-item,
.departure-item,
.alert-item {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px;
}

.route-summary-item {
  appearance: none;
  cursor: pointer;
  display: grid;
  gap: 4px;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  width: 100%;
}

.route-summary-item:hover {
  background: rgba(126, 203, 255, 0.1);
  border-color: rgba(126, 203, 255, 0.24);
}

.route-summary-item:active {
  transform: translateY(1px);
}

.route-summary-item.is-focused {
  background: rgba(126, 203, 255, 0.12);
  border-color: rgba(126, 203, 255, 0.32);
}

.route-summary-item.is-muted {
  opacity: 0.42;
}

.route-summary-head,
.departure-head,
.alert-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.route-summary-title,
.departure-line {
  font-weight: 700;
}

.station-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
}

.station-form input {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  color: var(--ink);
  min-height: 46px;
  outline: none;
  padding: 0 14px;
}

.station-form input:focus {
  border-color: rgba(11, 92, 171, 0.35);
  box-shadow: 0 0 0 4px rgba(11, 92, 171, 0.1);
}

.station-form button {
  background: var(--accent);
  border-color: transparent;
  min-width: 92px;
}

.station-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.station-chip {
  background: var(--panel-strong);
  border-color: var(--panel-border);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

.board-heading {
  margin-top: 12px;
}

.departures-board,
.alerts-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.route-summary-title,
.departure-line,
.section-head h2 {
  line-height: 1.05;
}

.route-summary-copy,
.alert-meta,
.departure-meta,
.board-note,
.section-meta {
  font-size: 0.84rem;
}

body.focus-mode .route-summary-item.is-muted {
  opacity: 0.28;
}

.eta-pill,
.severity-pill {
  border-radius: 999px;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  text-transform: uppercase;
}

.eta-pill {
  background: rgba(11, 92, 171, 0.12);
  color: var(--accent);
}

.severity-pill {
  background: rgba(234, 76, 95, 0.12);
  color: #ba1c33;
}

body.theme-night .severity-pill {
  color: #ff9dab;
}

.empty-state {
  background: var(--panel-strong);
  border: 1px dashed var(--panel-border);
  border-radius: 20px;
  color: var(--muted);
  padding: 18px;
}

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

@media (max-width: 1120px) {
  .dashboard {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-frame {
    min-height: 520px;
  }

  .sidebar {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .site-header,
  .brand-lockup,
  .map-card-head,
  .section-head,
  .board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .brand-badge {
    flex-basis: 40px;
    height: 40px;
  }

  .dashboard {
    gap: 12px;
    padding: 12px;
  }

  .route-panel,
  .board-panel,
  .alerts-panel,
  .map-card-head {
    padding: 14px;
  }

  .subhead {
    font-size: 0.72rem;
  }

  .header-actions {
    width: 100%;
  }

  .status-pill {
    flex: 1 1 auto;
    width: 100%;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
    margin-left: 0;
    width: 100%;
  }

  .map-controls {
    flex-wrap: wrap;
  }

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

  .map-frame {
    min-height: 360px;
    padding: 8px;
  }

  .t-map-diagram text {
    font-size: 18px;
  }

  .t-map-diagram .branch-labels text {
    font-size: 24px;
  }

  .tooltip {
    border-radius: 10px;
    max-width: 184px;
    min-width: 184px;
    padding: 7px 9px;
  }

  .tooltip-route {
    font-size: 0.68rem;
    margin-bottom: 3px;
  }

  .tooltip-heading {
    font-size: 0.78rem;
    margin-bottom: 3px;
  }

  .tooltip-detail,
  .tooltip-meta {
    font-size: 0.72rem;
    line-height: 1.22;
  }
}

/* 2026-03-26 layout and marker refresh */
.utility-cache {
  display: none;
}

.icon-only-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.icon-only-btn svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.header-search-form {
  display: flex;
  max-width: min(34vw, 320px);
}

.header-search-row {
  align-items: center;
  display: flex;
  gap: 6px;
}

.header-search-row input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  min-height: 34px;
  padding: 0 12px;
  width: 100%;
}

.header-search-row input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.header-search-row button {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  min-height: 34px;
  padding: 0 12px;
}

.dashboard {
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 262px;
  padding: 10px;
}

.site-header {
  gap: 12px;
  padding: 8px 10px;
}

.brand-badge {
  border-radius: 12px;
  flex-basis: 38px;
  height: 38px;
}

.brand-copy h1 {
  font-size: 1.25rem;
}

.subhead {
  font-size: 0.72rem;
}

.header-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.status-pill {
  min-height: 34px;
  padding: 0 12px;
}

.map-card {
  border-radius: 24px;
}

.map-card-head {
  padding: 10px 12px 8px;
}

.map-frame {
  padding: 6px 8px 8px;
}

.map-viewport {
  display: flex;
  justify-content: center;
  overflow: auto;
}

.map-stage {
  margin: 0 auto;
  transform-origin: top center;
}

.map-svg-host {
  align-items: flex-start;
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.map-svg-host > .t-map-diagram {
  max-height: none;
}

.map-svg-host > .t-map-diagram text {
  paint-order: stroke fill;
  stroke: rgba(244, 248, 252, 0.95);
  stroke-linejoin: round;
  stroke-width: 0.42px;
}

body.theme-night .map-svg-host > .t-map-diagram text {
  fill: #ecf5ff;
  stroke: rgba(7, 15, 24, 0.95);
  stroke-width: 0.56px;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  display: flex;
  height: calc(100vh - 84px);
  overflow: hidden auto;
  padding: 8px;
  position: relative;
}

.route-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 10px;
}

.route-summary {
  flex: 0 0 auto;
  margin-top: 10px;
  min-height: auto;
  overflow: visible;
  padding-right: 4px;
}

.route-summary::-webkit-scrollbar {
  width: 8px;
}

.route-summary::-webkit-scrollbar-thumb {
  background: rgba(112, 132, 158, 0.32);
  border-radius: 999px;
}

.route-summary-card {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  display: grid;
  gap: 4px;
  overflow: hidden;
  padding: 6px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.route-summary-row {
  align-items: flex-start;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.route-summary-item {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 3px;
  text-align: left;
  width: 100%;
}

.route-summary-item .route-summary-title {
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.route-summary-head {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto auto;
  width: 100%;
}

.route-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  min-width: 1.45rem;
  text-align: right;
}

.route-summary-label {
  align-self: center;
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-summary-copy {
  font-size: 0.64rem;
  line-height: 1.28;
}

.route-summary-card.is-focused {
  background: color-mix(in srgb, var(--panel-strong) 68%, #d9ebfb 32%);
  border-color: rgba(65, 134, 204, 0.28);
  transform: translateX(-1px);
}

body.theme-night .route-summary-card.is-focused {
  background: rgba(21, 38, 59, 0.96);
  border-color: rgba(121, 190, 255, 0.22);
}

.route-summary-card:hover {
  background: rgba(126, 203, 255, 0.08);
  border-color: rgba(126, 203, 255, 0.24);
}

.route-summary-card.is-muted {
  opacity: 0.44;
}

body.focus-mode .route-summary-card.is-muted {
  opacity: 0.28;
}

.board-panel,
.alerts-panel {
  display: none !important;
}

.sidebar-backdrop {
  background: rgba(3, 10, 18, 0.48);
  inset: 0;
  position: fixed;
  z-index: 6;
}

body.sidebar-collapsed .dashboard {
  grid-template-columns: minmax(0, 1fr) 0;
}

body.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  width: 0;
}

#sidebar-toggle-btn svg {
  transition: transform 0.18s ease;
}

body.sidebar-collapsed #sidebar-toggle-btn svg {
  transform: rotate(180deg);
}

.t-map-diagram .live-markers .train-halo {
  opacity: 0.18;
}

.t-map-diagram .live-markers .train-core {
  filter: drop-shadow(0 1px 3px rgba(2, 9, 14, 0.32));
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 0.55;
}

.t-map-diagram .live-markers .train-shell {
  fill: rgba(255, 255, 255, 0.96);
  opacity: 0.98;
}

.t-map-diagram .live-markers .train-arrow {
  opacity: 0.92;
  stroke: rgba(9, 20, 31, 0.88);
  stroke-width: 0.68;
}

body.theme-night .t-map-diagram .live-markers .train-arrow {
  stroke: rgba(255, 255, 255, 0.86);
}

.tooltip {
  max-width: 360px;
  min-width: 280px;
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    box-shadow: var(--shadow);
    height: min(72vh, 640px);
    max-width: 320px;
    position: fixed;
    right: 10px;
    top: 64px;
    width: calc(100vw - 20px);
    z-index: 7;
  }

  body:not(.sidebar-open) .sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(14px);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  body:not(.sidebar-open) .sidebar-backdrop {
    display: none;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .status-pill {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-search-form {
    flex: 1 1 100%;
    max-width: none;
    order: 10;
    width: 100%;
  }

  .map-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar {
    justify-content: space-between;
    width: 100%;
  }

  .map-frame {
    min-height: 404px;
  }

  .sidebar {
    left: 10px;
    max-width: none;
    right: 10px;
    top: 116px;
    width: auto;
  }
}

/* 2026-03-26 late refinements */
.map-frame {
  align-items: stretch;
  cursor: grab;
  display: flex;
  touch-action: none;
}

.map-frame.is-panning,
.map-frame.is-panning * {
  cursor: grabbing;
}

.map-overlay {
  align-items: flex-end;
  display: flex;
  inset: auto 12px 18px 12px;
  justify-content: flex-start;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.map-overlay .map-controls {
  pointer-events: auto;
}

.map-overlay .focus-indicator {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 8px 10px;
}

body.theme-night .map-overlay .focus-indicator,
body.theme-night .map-controls-overlay {
  background: rgba(11, 20, 33, 0.88);
}

.map-controls-overlay {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px;
}

.map-viewport {
  display: flex;
  align-items: flex-start;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
  contain: layout paint size;
}

.map-stage {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  transform-origin: top center;
  transition: none;
}

.map-svg-host {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  contain: layout paint;
}

.map-svg-host > .t-map-diagram {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  width: auto;
}

.map-svg-host > .t-map-diagram text {
  paint-order: stroke fill;
  stroke: rgba(244, 248, 252, 0.95);
  stroke-linejoin: round;
  stroke-width: 0.42px;
}

body.theme-night .map-svg-host > .t-map-diagram text {
  fill: #eef7ff;
  stroke: rgba(5, 10, 16, 0.96);
  stroke-width: 0.56px;
}

.t-map-diagram .live-markers .train-halo {
  opacity: 0.14;
}

.t-map-diagram .live-markers .train-core {
  filter: drop-shadow(0 0.5px 1.2px rgba(2, 9, 14, 0.24));
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 0.34;
}

.t-map-diagram .live-markers .train-marker text {
  display: block;
  fill: #ffffff;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 1.34px;
  font-weight: 700;
  paint-order: stroke fill;
  stroke: rgba(15, 27, 42, 0.62);
  stroke-width: 0.32px;
  text-anchor: middle;
}

.t-map-diagram .live-markers .train-marker text:empty {
  display: none;
}

body.theme-night .t-map-diagram .live-markers .train-marker text {
  fill: #f7fbff;
  stroke: rgba(5, 10, 18, 0.92);
  stroke-width: 0.38px;
}

.t-map-diagram .live-markers .train-arrow {
  fill: rgba(255, 255, 255, 0.98);
  opacity: 0.96;
  stroke: rgba(9, 20, 31, 0.48);
  stroke-width: 0.18;
}

body.theme-night .t-map-diagram .live-markers .train-arrow {
  stroke: rgba(255, 255, 255, 0.84);
}

.route-summary-alert-trigger {
  align-items: center;
  background: rgba(8, 20, 34, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  gap: 8px;
  justify-content: space-between;
  line-height: 1.3;
  padding: 8px 10px;
  width: 100%;
}

body.theme-night .route-summary-alert-trigger {
  background: rgba(255, 255, 255, 0.04);
}

.route-summary-alert-icon {
  aspect-ratio: 1;
  border-radius: 999px;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  position: relative;
  width: 28px;
}

.route-summary-alert-icon svg {
  fill: none;
  height: 11px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 11px;
}

.route-summary-alert-icon.is-quiet {
  color: rgba(108, 126, 145, 0.76);
}

.route-summary-alert-icon.has-alerts {
  color: #ff7c56;
}

.route-summary-alert-badge {
  align-items: center;
  background: currentColor;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.56rem;
  font-weight: 700;
  height: 11px;
  justify-content: center;
  min-width: 11px;
  padding: 0 2px;
  position: absolute;
  right: -2px;
  top: -2px;
}

.route-panel .section-head h2 {
  font-size: 0.84rem;
  line-height: 1;
}

.route-panel .section-meta {
  display: none;
}

.route-swatch {
  font-size: 0.74rem;
  min-width: 24px;
  padding: 4px 7px;
}

body:not(.theme-night) .route-summary-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.theme-night .route-summary-card {
  background: rgba(16, 27, 43, 0.92);
}

body.theme-night .route-summary-copy,
body.theme-night .route-count,
body.theme-night .section-meta {
  color: #91a8c0;
}

body.theme-night .route-summary-label {
  color: #edf5fd;
}

body.theme-night .route-summary-alert-icon.is-quiet {
  color: rgba(148, 171, 198, 0.62);
}

body.theme-night .route-summary-alert-icon.has-alerts {
  color: #ff936f;
}

/* 2026-03-27 polish */
.header-actions {
  position: relative;
}

.header-search-form {
  background: rgba(10, 24, 40, 0.96);
  border: 1px solid rgba(163, 201, 243, 0.18);
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(5, 14, 24, 0.28);
  max-width: min(320px, calc(100vw - 24px));
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  z-index: 12;
}

.header-search-form[hidden] {
  display: none;
}

.header-search-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.header-search-row input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f4f8fd;
  min-height: 34px;
  outline: none;
  padding: 0 12px;
}

.header-search-row input::placeholder {
  color: rgba(232, 241, 250, 0.58);
}

.header-search-row button {
  min-width: 52px;
}

.dashboard {
  grid-template-columns: minmax(0, 1fr) 186px;
}

.sidebar {
  padding: 3px;
}

.route-panel {
  padding: 7px;
  position: relative;
}

.route-panel .section-head {
  display: none;
}

.route-panel .section-head .kicker {
  font-size: 0.58rem;
  margin: 0 0 1px;
}

.route-summary {
  gap: 6px;
  margin-top: 0;
  padding-right: 4px;
}

.route-summary::-webkit-scrollbar {
  width: 6px;
}

.route-summary-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 94%, #ffffff 6%), color-mix(in srgb, var(--panel-strong) 88%, #edf4fb 12%));
  border-radius: 16px;
  gap: 2px;
  padding: 6px;
}

.route-summary-row {
  align-items: center;
  gap: 6px;
}

.route-summary-head {
  gap: 8px;
}

.route-summary-item {
  align-items: center;
  display: flex;
  min-height: 30px;
  padding: 4px;
}

.route-summary-item .route-summary-title {
  display: none;
}

.route-summary-alert-icon {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
}

.route-summary-alert-icon svg {
  height: 13px;
  width: 13px;
}

.route-summary-alert-icon:hover {
  background: rgba(8, 20, 34, 0.08);
  border-color: transparent;
}

.route-summary-alert-badge {
  align-items: center;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  height: 7px;
  justify-content: center;
  min-width: 7px;
  padding: 0;
  right: 2px;
  top: 2px;
}

.route-summary-alert-badge.is-quiet {
  background: rgba(158, 175, 193, 0.42);
}

.route-summary-alert-badge.has-alerts {
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86);
}

body.theme-night .route-summary-alert-badge.has-alerts {
  box-shadow: 0 0 0 2px rgba(9, 18, 29, 0.92);
}

.weather-panel {
  border-top: 1px solid var(--panel-border);
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 4px 4px;
}

.weather-head {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.weather-kicker {
  color: var(--muted);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weather-head strong {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.weather-summary {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.weather-forecast {
  display: grid;
  gap: 6px;
}

.weather-day {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  grid-template-columns: 18px 30px minmax(0, 1fr) auto;
  padding: 6px 8px;
}

.weather-day-icon {
  color: var(--ink);
  display: inline-flex;
  font-size: 0.8rem;
  justify-content: center;
  line-height: 1;
}

.weather-day-label {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
}

.weather-day-code {
  color: var(--muted);
  font-size: 0.62rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-day-temp {
  color: var(--ink);
  font-size: 0.65rem;
  letter-spacing: 0.01em;
}

body:not(.theme-night) .weather-day {
  background: rgba(255, 255, 255, 0.62);
}

.t-map-diagram .live-markers .train-marker text {
  letter-spacing: -0.01em;
}

body:not(.theme-night) .t-map-diagram .live-markers .train-marker text {
  fill: #fdfefe;
  stroke: rgba(12, 23, 36, 0.78);
  stroke-width: 0.42px;
}

body:not(.theme-night) .t-map-diagram .live-markers .train-core {
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 0.42;
}

body:not(.theme-night) .t-map-diagram .live-markers .train-halo {
  opacity: 0.12;
}

@media (max-width: 720px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .site-header {
    align-items: stretch;
    display: grid;
    gap: 6px;
    padding: 6px 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-lockup {
    width: 100%;
  }

  .brand-badge {
    flex-basis: 34px;
    height: 34px;
  }

  .brand-copy h1 {
    font-size: 1.08rem;
  }

  .subhead {
    display: none;
  }

  .header-actions {
    justify-content: flex-end;
    width: 100%;
    gap: 6px;
  }

  .status-pill {
    font-size: 0.82rem;
    min-height: 28px;
    padding: 0 8px;
  }

  .status-dot {
    height: 7px;
    width: 7px;
  }

  .icon-btn {
    min-height: 28px;
    min-width: 28px;
    padding: 0 9px;
  }

  .header-search-form {
    left: 0;
    max-width: none;
    right: 0;
    top: calc(100% + 6px);
    width: auto;
  }

  .map-controls-overlay {
    padding: 3px;
  }

  .map-overlay {
    inset: 8px 8px auto 8px;
  }

  .map-control-btn {
    min-height: 24px;
    min-width: 24px;
    padding: 0 7px;
  }

  .map-control-btn-wide {
    min-width: 46px;
  }

  .zoom-level {
    font-size: 0.66rem;
    min-width: 44px;
    padding: 5px 7px;
  }

  .focus-indicator {
    font-size: 0.74rem;
  }

  .focus-indicator strong {
    font-size: 0.9rem;
  }

  .focus-indicator em {
    font-size: 0.7rem;
  }

  .map-frame {
    min-height: 332px;
  }

  .sidebar {
    top: 92px;
  }
}

.route-summary-item:focus-visible,
.route-summary-alert-trigger:focus-visible {
  outline: 2px solid rgba(39, 137, 224, 0.65);
  outline-offset: 2px;
}

.route-summary-alert-trigger strong {
  color: var(--ink);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-alert-popup {
  align-items: center;
  background: rgba(3, 10, 18, 0.52);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 40;
}

.route-alert-popup[hidden] {
  display: none;
}

.route-alert-popup-card {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  max-width: min(460px, calc(100vw - 28px));
  padding: 14px;
  width: 100%;
}

.route-alert-popup-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.route-alert-popup-body {
  color: var(--muted);
  display: grid;
  gap: 10px;
  line-height: 1.45;
}

.route-alert-popup-body strong {
  color: var(--ink);
  display: block;
  margin-bottom: 3px;
}

.route-alert-popup-close {
  color: var(--ink);
}

@media (max-width: 720px) {
  .map-overlay {
    flex-direction: column;
    gap: 8px;
  }

  .map-controls-overlay {
    align-self: flex-start;
  }
}

/* 2026-03-27 layout + motion follow-up */
.route-summary {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.route-summary-card {
  align-self: flex-start;
  max-width: 100%;
  width: auto;
}

.route-summary-row {
  grid-template-columns: auto auto;
}

.route-summary-item {
  max-width: 100%;
  width: auto;
}

.route-summary-head {
  min-width: 0;
}

.map-controls-overlay {
  backdrop-filter: none;
  box-shadow: 0 10px 24px rgba(8, 20, 34, 0.12);
}

body:not(.theme-night) .brand-lockup,
body.theme-night .brand-lockup {
  align-items: flex-start;
}

body:not(.theme-night) .brand-copy,
body.theme-night .brand-copy {
  align-items: center;
  column-gap: 0.62rem;
  display: grid;
  gap: 2px 0.62rem;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
}

body:not(.theme-night) .brand-copy .eyebrow {
  color: #20456a;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 0;
}

body:not(.theme-night) .brand-wordmark {
  gap: 0;
}

.brand-copy .brand-inline-badge {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin-right: 0;
}

.brand-copy .brand-wordmark {
  align-self: end;
  grid-column: 2;
  grid-row: 1;
}

body:not(.theme-night) .brand-inline-badge {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(19, 45, 75, 0.18);
  box-shadow: 0 8px 18px rgba(17, 33, 56, 0.08);
}

body:not(.theme-night) .subhead {
  color: #61758b;
  font-size: 0.72rem;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-width: 34ch;
}

body.theme-night .subhead {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  max-width: 34ch;
}

body:not(.theme-night) .icon-btn,
body:not(.theme-night) .station-form button {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(24, 48, 76, 0.14);
  box-shadow: 0 10px 22px rgba(19, 38, 62, 0.08);
  color: #1f3750;
}

body:not(.theme-night) .icon-btn:hover,
body:not(.theme-night) .station-form button:hover {
  background: rgba(245, 250, 255, 0.96);
  border-color: rgba(22, 76, 132, 0.22);
  color: #153c62;
}

body:not(.theme-night) .icon-only-btn svg {
  stroke-width: 1.95;
}

body:not(.theme-night) .header-search-form {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(20, 50, 84, 0.12);
  box-shadow: 0 18px 36px rgba(18, 36, 57, 0.12);
}

body:not(.theme-night) .header-search-row input {
  background: rgba(236, 243, 250, 0.9);
  border-color: rgba(23, 63, 106, 0.12);
  color: #16283b;
}

body:not(.theme-night) .header-search-row input::placeholder {
  color: #6a7d91;
}

@media (max-width: 720px) {
  .site-header {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 8px;
    row-gap: 3px;
  }

  .brand-lockup {
    align-items: center;
    display: flex;
    min-width: 0;
    width: 100%;
  }

  .brand-copy {
    align-items: center;
    column-gap: 0.44rem;
    display: grid;
    flex: 1 1 auto;
    gap: 0 0.44rem;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    min-width: 0;
  }

  .brand-copy .eyebrow {
    align-items: center;
    color: rgba(224, 237, 249, 0.9);
    display: inline-flex;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    margin: 0;
    text-transform: uppercase;
    white-space: nowrap;
  }

  body:not(.theme-night) .brand-copy .eyebrow {
    color: #275177;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
  }

  .subhead,
  body.theme-night .subhead,
  body:not(.theme-night) .subhead {
    max-width: none;
    display: none;
  }

  .brand-copy .brand-inline-badge {
    grid-column: 1;
    grid-row: 1;
    margin-right: 0;
  }

  .brand-copy .brand-wordmark {
    align-self: center;
    grid-column: 2;
    grid-row: 1;
  }

  .brand-inline-badge {
    border-width: 1px;
    height: 2.18em;
    margin-right: 0.34rem;
    width: 2.18em;
  }

  .header-actions {
    align-items: center;
    display: flex;
    gap: 2px;
    justify-content: flex-end;
    margin-left: 0;
    width: 100%;
  }

  .icon-btn {
    min-height: 25px;
    min-width: 25px;
    padding: 0 5px;
  }

  body:not(.theme-night) .icon-btn {
    background: rgba(255, 255, 255, 0.92);
    color: #25425f;
  }

  .map-frame {
    min-height: 336px;
    padding: 4px 4px 6px;
  }

  .map-viewport,
  .map-stage,
  .map-svg-host {
    align-items: center;
    justify-content: center;
  }

  .map-stage {
    transform-origin: center center;
  }

  .route-panel-top {
    margin-bottom: 6px;
  }

  .route-status-pill {
    font-size: 0.66rem;
    min-height: 24px;
    padding: 0 8px;
  }

  .map-overlay {
    display: flex;
    inset: auto 8px 14px 8px;
    justify-content: flex-start;
  }

  .map-controls-overlay {
    border-radius: 18px;
    gap: 2px;
    padding: 2px;
  }

  .map-controls {
    gap: 4px;
  }

  .map-control-btn {
    min-height: 22px;
    min-width: 22px;
    padding: 0 6px;
  }

  .map-control-btn-wide {
    min-width: 38px;
  }

  .zoom-level {
    font-size: 0.58rem;
    min-width: 36px;
    padding: 4px 6px;
  }
}

.route-line.route-silver {
  stroke: #7a7a7a;
}

.icon-btn.is-active {
  background: rgba(255, 227, 238, 0.92);
  border-color: rgba(232, 118, 163, 0.28);
  color: #b13a72;
}

body.theme-night .icon-btn.is-active {
  background: rgba(255, 216, 232, 0.14);
  border-color: rgba(255, 171, 205, 0.24);
  color: #ffc0db;
}

.route-swatch.is-cute {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1;
}

.t-map-diagram .live-markers .train-marker.is-cute .train-core {
  stroke-width: 0.42;
}

.t-map-diagram .live-markers .train-marker.is-cute .train-halo {
  opacity: 0.16;
}

.t-map-diagram .live-markers .train-marker.is-cute text {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.32px;
  font-weight: 400;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.12px;
  transform: none;
}

body.theme-night .t-map-diagram .live-markers .train-marker.is-cute text {
  stroke: rgba(5, 10, 18, 0.4);
}

.t-map-diagram .live-markers .train-marker text {
  font-size: 0.78px;
  font-weight: 600;
  stroke-width: 0.18px;
}

body.theme-night .t-map-diagram .live-markers .train-marker text {
  stroke-width: 0.22px;
}

.t-map-diagram .live-markers .train-marker.is-cute text {
  font-size: 1.12px;
}

@media (max-width: 720px) {
  .site-header {
    align-items: center;
    column-gap: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 8px;
    row-gap: 0;
  }

  .brand-lockup {
    align-items: center;
    min-width: 0;
    width: auto;
  }

  .brand-copy {
    align-items: center !important;
    column-gap: 0.46rem;
    display: flex !important;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .brand-inline-badge {
    flex: 0 0 auto;
    height: 1.9rem;
    margin-right: 0.38rem;
    width: 1.9rem;
  }

  .eyebrow.brand-wordmark {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .subhead {
    display: none;
  }

  .header-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    justify-content: flex-end;
    margin-left: auto;
    width: auto;
  }

  .icon-btn,
  .station-form button {
    min-height: 28px;
    min-width: 28px;
    padding: 0 8px;
  }

  .icon-only-btn {
    padding: 0;
    width: 28px;
  }

  .header-search-form {
    right: 0;
    top: calc(100% + 6px);
  }

  .page-shell {
    min-height: 100dvh;
  }

  .dashboard {
    align-items: stretch;
    height: calc(100dvh - 52px) !important;
    min-height: calc(100dvh - 52px);
    padding: 6px 6px 8px;
  }

  .hero-panel,
  .map-card,
  .map-frame,
  .map-viewport,
  .map-stage,
  .map-svg-host {
    height: 100%;
    min-height: 0;
  }

  .map-frame {
    min-height: 0;
    padding: 4px;
  }

  .sidebar {
    max-height: calc(100dvh - 82px);
    top: 72px;
  }

  .map-overlay {
    inset: auto 8px 14px 8px;
  }

  .map-viewport,
  .map-stage,
  .map-svg-host {
    align-items: center !important;
    justify-content: center !important;
  }

  .map-stage {
    transform-origin: center center;
  }

  .map-svg-host {
    padding-top: 0;
  }
}

.t-map-diagram .live-markers .train-marker > text {
  display: block;
  fill: #ffffff;
  font-size: 0.66px;
  font-weight: 600;
  letter-spacing: -0.01em;
  alignment-baseline: central;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(10, 18, 28, 0.55);
  stroke-width: 0.14px;
  text-anchor: middle;
  transform: none;
}

body.theme-night .t-map-diagram .live-markers .train-marker > text {
  stroke: rgba(4, 10, 18, 0.68);
  stroke-width: 0.17px;
}

@media (max-width: 720px) {
  .t-map-diagram .live-markers .train-marker > text {
    font-size: 0.58px;
  }
}

.t-map-diagram .live-markers .train-marker.is-cute > text {
  transform: none;
  dominant-baseline: middle;
  alignment-baseline: middle;
  text-anchor: middle;
}

.map-frame {
  touch-action: none;
}

.map-svg-host > .t-map-diagram {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.map-frame.is-zooming .map-glow {
  filter: blur(5px);
  opacity: 0.2;
}

.map-frame.is-zooming .map-controls-overlay {
  backdrop-filter: none;
}

.map-frame.is-zooming .map-svg-host > .t-map-diagram {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.map-frame.is-zooming .map-svg-host > .t-map-diagram text,
.map-frame.is-zooming .t-map-diagram .live-markers .train-marker > text {
  stroke-width: 0 !important;
}

.map-frame.is-zooming .t-map-diagram .live-markers .train-core {
  filter: none !important;
}

.map-frame.is-zooming .t-map-diagram .live-markers .train-halo {
  opacity: 0.05;
}

.map-frame.is-zooming .map-svg-host > .t-map-diagram .route-line,
.map-frame.is-zooming .map-svg-host > .t-map-diagram .station-nodes,
.map-frame.is-zooming .map-svg-host > .t-map-diagram .station-labels,
.map-frame.is-zooming .map-svg-host > .t-map-diagram .branch-labels,
.map-frame.is-zooming .map-svg-host > .t-map-diagram .live-markers {
  transition: none !important;
}

.map-frame.is-zooming .t-map-diagram .selected-stop-ring {
  animation: none;
}

.t-map-diagram .live-markers .train-halo {
  opacity: 0.1;
}

.t-map-diagram .live-markers .train-core {
  stroke-width: 0.34;
}

@media (max-width: 720px) {
  .map-frame:not(.is-detail-zoom) .map-glow {
    filter: blur(6px);
    opacity: 0.5;
  }
}

.t-map-diagram .live-markers .train-arrow {
  stroke-width: 0.14;
}
