/* SubWait — NYC Subway Signage Dark Theme (zero external dependencies) */
:root {
  --bg: #0b0d10;
  --surface: #14181f;
  --surface-2: #1b212b;
  --border: #262f3d;
  --text: #f3f6fa;
  --muted: #9aa6b8;
  --dim: #6f7c8f;

  --smooth: #19c37d;
  --smooth-bg: rgba(25, 195, 125, 0.13);
  --clearing: #22d3ee;
  --clearing-bg: rgba(34, 211, 238, 0.14);
  --watch: #f59e0b;
  --watch-bg: rgba(245, 158, 11, 0.15);
  --stuck: #ef4444;
  --stuck-bg: rgba(239, 68, 68, 0.15);
  --crawl: #c084fc;
  --crawl-bg: rgba(192, 132, 252, 0.16);
  --accent: #38bdf8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}

.hidden { display: none !important; }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 13, 16, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 14px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00933c;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.freshness-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.freshness-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.freshness-pill.live::before { background: var(--smooth); box-shadow: 0 0 8px var(--smooth); }
.freshness-pill.sample::before { background: var(--watch); }
.freshness-pill.stale::before { background: var(--stuck); }

.icon-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.95); }

/* Tabs */
.tabs {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  padding: 0 14px;
  gap: 6px;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 6px;
  cursor: pointer;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Main Container */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 12px 36px;
}

.banner {
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.banner.stale {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

/* Controls Card */
.controls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

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

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0039a6;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn:hover { filter: brightness(1.1); }
.primary-btn:disabled { opacity: 0.65; cursor: wait; }

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 32px 10px 12px;
  font-size: 14px;
  outline: none;
}
.search-wrap input:focus { border-color: var(--accent); }

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.location-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.chip-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-top: 9px;
  scrollbar-width: none;
}
.chip-bar::-webkit-scrollbar { display: none; }

.chip-label {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
}

.chip {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip.fav {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}
.chip:active { transform: scale(0.97); }

.filter-bar {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.muted-meta {
  font-size: 12px;
  color: var(--dim);
}

/* 4-Tab Card Layout Prototype Switcher */
.proto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.proto-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.proto-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 5px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  font-variant-numeric: tabular-nums;
}

.proto-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.proto-tab:active {
  transform: scale(0.98);
}

.proto-tab-kicker {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.proto-tab-sep {
  display: none;
}

.proto-tab-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  line-height: 1.15;
  white-space: nowrap;
}

.proto-tab.active[data-proto="p1"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.48);
  color: #e0f2fe;
}
.proto-tab.active[data-proto="p1"] .proto-tab-sub { color: #7dd3fc; }

.proto-tab.active[data-proto="p2"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}
.proto-tab.active[data-proto="p2"] .proto-tab-sub { color: #fcd34d; }

.proto-tab.active[data-proto="p3"] {
  background: rgba(25, 195, 125, 0.15);
  border-color: rgba(25, 195, 125, 0.45);
  color: #d1fae5;
}
.proto-tab.active[data-proto="p3"] .proto-tab-sub { color: #6ee7b7; }

.proto-tab.active[data-proto="current"] {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.45);
  color: #f1f5f9;
}
.proto-tab.active[data-proto="current"] .proto-tab-sub { color: #cbd5e1; }

.proto-caption {
  margin-top: 7px;
  padding: 0 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.proto-caption strong { color: var(--text); }
.proto-caption .proto-adj-stat { color: #fbbf24; font-weight: 600; }

@media (min-width: 600px) {
  .proto-tab {
    flex-direction: row;
    gap: 0;
    min-height: 36px;
    padding: 6px 8px;
  }
  .proto-tab-kicker { font-size: 12px; }
  .proto-tab-sep { display: inline; font-size: 11.5px; opacity: 0.65; }
  .proto-tab-sub { font-size: 12px; font-weight: 700; color: inherit; }
  .proto-tab-sub-muted { display: none; }
}

@media (max-width: 400px) {
  .proto-tab-kicker { font-size: 10.5px; letter-spacing: -0.02em; }
  .proto-tab-sub { font-size: 9.5px; letter-spacing: -0.02em; }
}

/* Unified Single-Story Prototype Cards (Proto 1, 2, 3) */
.p-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.p-head-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.p-head-left .bullet.lg,
.line-left .bullet.lg {
  margin-top: 1px;
}

.p-head-status {
  flex-shrink: 0;
  margin-top: 2px;
}

.p1-next-row {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.p1-next-row strong { color: var(--text); }

.eta-board-muted {
  color: var(--muted);
  font-weight: 600;
}

.eta-arrow {
  color: var(--dim);
  margin: 0 2px;
}

.eta-ours {
  color: #fbbf24;
  font-weight: 800;
}

.eta-ours-early {
  color: #34d399;
  font-weight: 800;
}

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

.eta-reason {
  margin-top: 2px;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.25;
}

.fc-val.fc-dash {
  color: var(--dim);
  font-weight: 500;
}

/* Proto 2: Hero ETA right column */
.hero-eta-col {
  text-align: right;
  flex-shrink: 0;
  max-width: 45%;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.hero-eta-val {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-eta-val.hero-adjusted {
  color: #fbbf24;
}

.hero-eta-val.hero-adjusted-early {
  color: #34d399;
}

.hero-eta-val span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.hero-eta-val.hero-muted {
  color: var(--dim);
}

.hero-eta-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.hero-eta-sub .mta-paren {
  font-size: 1em;
}

@media (max-width: 420px) {
  .hero-eta-sub { white-space: normal; }
}

@media (max-width: 400px) {
  .hero-eta-val { font-size: 18px; }
  .hero-eta-sub { font-size: 10px; }
}

/* Proto 3: Compact Text-Only Strip */
.p3-lines {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.38;
}

.p3-lines strong {
  color: var(--text);
  font-weight: 700;
}

.p3-lines .p3-muted {
  color: var(--dim);
}

.p3-lines .p3-warn { color: #fbbf24; }
.p3-lines .p3-ride-warn { color: #d8b4fe; }
.p3-lines .p3-sev { color: #fca5a5; }

.p3-row-compact {
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Official MTA Route Bullets */
.bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.bullet.xs { width: 17px; height: 17px; font-size: 9.5px; }
.bullet.sm { width: 20px; height: 20px; font-size: 11px; }
.bullet.lg { width: 30px; height: 30px; font-size: 16px; }

.r-1, .r-2, .r-3 { background: #ee352e; }
.r-4, .r-5, .r-6 { background: #00933c; }
.r-7 { background: #b933ad; }
.r-A, .r-C, .r-E { background: #0039a6; }
.r-B, .r-D, .r-F, .r-M { background: #ff6319; }
.r-G { background: #6cbe45; }
.r-J, .r-Z { background: #996633; }
.r-L { background: #8e9297; }
.r-N, .r-Q, .r-R, .r-W { background: #fccc0a; color: #111317; }
.r-S { background: #808183; }

/* Station Cards */
.stations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.station-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.station-head {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent);
}

.station-title-wrap {
  min-width: 0;
}

.station-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.station-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.dist-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
}

.fav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.fav-btn.active {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.1);
}

/* Fixed Physical Platform & Track Groups Inside Station */
.line-rows {
  display: flex;
  flex-direction: column;
}

.plat-group {
  border-top: 1px solid var(--border);
}
.plat-group:first-child { border-top: none; }

.plat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(38, 47, 61, 0.9);
}

.plat-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plat-bullets {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.track-group {
  border-bottom: 1px solid rgba(38, 47, 61, 0.72);
}
.plat-group:last-child .track-group:last-child { border-bottom: none; }

.track-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  background: rgba(11, 13, 16, 0.52);
  border-bottom: 1px solid rgba(38, 47, 61, 0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
}

.track-dir { color: var(--muted); }
.track-sep { color: var(--dim); }
.track-tag.exp { color: #7dd3fc; }
.track-tag.loc { color: #94a3b8; }
.track-tag.shared { color: #9aa6b8; }

.line-row {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.65);
}
.line-row:last-child { border-bottom: none; }
.line-row.is-track-next {
  box-shadow: inset 2px 0 0 rgba(25, 195, 125, 0.62);
}

.line-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.line-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.line-dir-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.line-dir {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dir-next {
  color: var(--text);
  font-weight: 700;
}

.dir-mta {
  color: #b7c4d6;
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.dir-arrow {
  color: var(--dim);
  font-weight: 600;
  margin: 0 2px;
}

.dir-term {
  color: var(--muted);
  font-weight: 500;
}

.line-dir .track-next-badge {
  margin-left: 6px;
  vertical-align: 1px;
}

.track-next-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.35;
  color: #34d399;
  background: rgba(25, 195, 125, 0.14);
  border: 1px solid rgba(25, 195, 125, 0.4);
  white-space: nowrap;
}

.track-next-dot {
  display: inline-block;
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: #19c37d;
  box-shadow: 0 0 6px rgba(25, 195, 125, 0.8);
}

.line-next {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.line-right {
  text-align: right;
  flex-shrink: 0;
}

.wait-big {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wait-range {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Calm 2-Row Forward Curve Instrument Panel (Exp 28) */
.fc-box {
  margin-top: 8px;
  padding: 7px 9px 6px;
  background: rgba(11, 13, 16, 0.72);
  border: 1px solid rgba(38, 47, 61, 0.85);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.fc-arr-row {
  display: flex;
  align-items: baseline;
  gap: 6px 8px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.55);
  line-height: 1.35;
}

.fc-arr-lbl {
  flex: 0 0 auto;
  min-width: 78px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.fc-arr-vals {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

.fc-arr-lead,
.fc-arr-item {
  white-space: nowrap;
}

.fc-arr-first {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.fc-arr-adj {
  color: #fbbf24;
  font-weight: 800;
}

.fc-arr-adj.is-early,
.fc-arr-adj-rest.is-early {
  color: #34d399;
}

.fc-arr-adj-rest {
  color: #fbbf24;
  font-weight: 700;
}

.fc-arr-rest,
.fc-arr-sep {
  color: var(--muted);
  font-weight: 500;
}

.mta-paren {
  font-size: 0.8em;
  font-weight: 500;
  color: #8a97aa;
  letter-spacing: 0;
  white-space: nowrap;
}

.fc-arr-reason {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--dim);
}

.fc-arr-empty {
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}

.fc-grid {
  display: grid;
  grid-template-columns: minmax(78px, 1.35fr) repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 3px 4px;
}

.fc-head {
  font-size: 10px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  padding: 0 4px 2px;
  white-space: nowrap;
}

.fc-head.fc-lbl {
  text-align: left;
  padding-left: 0;
}

.fc-row-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 2px;
}

.fc-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  padding: 2px 5px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.25;
}

.fc-usual-col {
  border-left: 1px solid rgba(38, 47, 61, 0.7);
  padding-left: 6px;
}

.fc-val.fc-usual {
  color: var(--muted);
  font-weight: 600;
  border-radius: 0;
}

.fc-val.fc-mild {
  color: #e5c88c;
  background: rgba(245, 158, 11, 0.09);
}

.fc-val.fc-warn {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

.fc-val.fc-ride-mild {
  color: #cbb7e6;
  background: rgba(192, 132, 252, 0.09);
}

.fc-val.fc-ride-warn {
  color: #d8b4fe;
  background: rgba(192, 132, 252, 0.17);
}

.fc-val.fc-sev {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.17);
}

.fc-sub {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(38, 47, 61, 0.5);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.3;
}

@media (max-width: 390px) {
  .fc-box {
    padding: 6px 7px 5px;
  }
  .fc-arr-row {
    gap: 4px 6px;
    padding-bottom: 5px;
    margin-bottom: 5px;
  }
  .fc-arr-lbl {
    min-width: 70px;
    font-size: 10.5px;
    letter-spacing: -0.01em;
  }
  .fc-arr-vals {
    font-size: 12px;
  }
  .fc-arr-reason {
    font-size: 10.5px;
  }
  .fc-arr-empty {
    font-size: 11px;
  }
  .fc-grid {
    grid-template-columns: minmax(70px, 1.25fr) repeat(4, minmax(0, 1fr));
    gap: 2px 3px;
  }
  .fc-head {
    font-size: 9.5px;
    padding: 0 3px 2px;
  }
  .fc-row-lbl {
    font-size: 10.5px;
    letter-spacing: -0.01em;
  }
  .fc-val {
    font-size: 11.5px;
    padding: 2px 3px;
  }
  .fc-usual-col {
    padding-left: 4px;
  }
}

/* Status & Experience Pills */
.pills-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.st-smooth { color: var(--smooth); background: var(--smooth-bg); }
.st-clearing { color: var(--clearing); background: var(--clearing-bg); }
.st-lingering, .st-watch, .st-watch_hi { color: var(--watch); background: var(--watch-bg); }
.st-stuck { color: var(--stuck); background: var(--stuck-bg); }
.st-crawl { color: var(--crawl); background: var(--crawl-bg); }

.exp-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.exp-pill.follower { border-color: rgba(34, 211, 238, 0.4); color: #a5f3fc; }
.exp-pill.crawl { border-color: rgba(192, 132, 252, 0.45); color: #e9d5ff; }
.exp-pill.branch { border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.exp-pill.phantom { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.exp-pill.sliding { background: rgba(249, 115, 22, 0.14); border-color: rgba(249, 115, 22, 0.45); color: #fdba74; }
.exp-pill.stale-clock { background: rgba(245, 158, 11, 0.13); border-color: rgba(245, 158, 11, 0.42); color: #fde68a; }
.exp-pill.unassigned { background: rgba(148, 163, 184, 0.11); border-color: rgba(148, 163, 184, 0.32); color: #cbd5e1; }
.exp-pill.cascade { background: rgba(244, 63, 94, 0.16); border-color: rgba(244, 63, 94, 0.5); color: #fda4af; }

.wait-unit {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}

.surv-strip {
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.surv-strip strong { color: #a5f3fc; }

.row-actions {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row-actions-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row-actions .acc-toggle { margin-top: 0; }

.pace-toggle {
  background: none;
  border: none;
  padding: 0;
  color: #c084fc;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pace-lab {
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pace-opt {
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.7);
}
.pace-opt:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.pace-opt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pace-one-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pace-one-line-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.pace-inline-bar {
  display: inline-flex;
  width: 36px;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  overflow: hidden;
  flex-shrink: 0;
}
.pace-inline-bar > span {
  height: 100%;
  flex-shrink: 0;
}
.pace-muted {
  color: #94a3b8;
}
.pace-extra {
  color: #c084fc;
  font-weight: 700;
}
.pace-extra.sev {
  color: #ff6b4a;
}
.pace-ok {
  color: var(--smooth);
  font-weight: 600;
}
.pace-unit {
  color: #7d8ba0;
  font-size: 11px;
  font-weight: 500;
}
@media (max-width: 420px) {
  .pace-one-line {
    font-size: 11.5px;
    letter-spacing: -0.01em;
    gap: 6px;
  }
  .pace-unit {
    font-size: 10.5px;
  }
}
.pace-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  margin-bottom: 5px;
}
.pace-bar-smooth {
  background: var(--smooth);
  height: 100%;
  opacity: 0.75;
}
.pace-bar-rush {
  background: #64748b;
  height: 100%;
}
.pace-bar-extra {
  background: #c084fc;
  height: 100%;
}
.pace-bar-extra.sev {
  background: #ef4444;
}
.pace-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pace-bar-legend strong { color: var(--text); }
.pace-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.pace-dot.rush { background: #64748b; }
.pace-dot.extra { background: #c084fc; }
.pace-dot.smooth { background: var(--smooth); }

.pace-quiet-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.pace-seg-ctrl {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.pace-seg-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.pace-seg-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
}
.pace-plain-lines {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.pace-plain-lines strong { color: var(--text); }
.pace-hint {
  font-size: 11px;
  color: var(--dim);
}

.fb-btn {
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.fb-btn:hover { color: var(--text); border-color: var(--accent); }

.footer-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-fb-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.footer-fb-btn:hover { color: var(--text); border-color: var(--accent); }
.fb-queue-badge {
  font-size: 11px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
}

/* Field Feedback Bottom Sheet Modal */
.fb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.fb-modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.fb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.fb-head h3 { margin: 0; font-size: 16px; }
.fb-ctx-label { font-size: 12px; color: var(--accent); margin-top: 2px; }
.fb-tags-label {
  margin: 8px 0 5px;
  font-size: 11px;
  color: var(--dim);
}
.fb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.fb-tag {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.fb-tag.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent);
  color: #e0f2fe;
}
.fb-note {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  outline: none;
}
.fb-note:focus { border-color: var(--accent); }
.fb-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fb-status { font-size: 11.5px; color: var(--muted); flex: 1; min-width: 160px; }

.eta-warn { color: #fca5a5; }
.eta-slide { color: #fdba74; }

/* Live Station ADA Elevator & Escalator Outage Strip */
.ene-strip {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.7);
  background: rgba(15, 20, 28, 0.7);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ene-item {
  font-size: 11.5px;
  line-height: 1.35;
}
.ene-item span { color: var(--muted); }
.ene-item.ada-nr { color: #fca5a5; }
.ene-item.ada { color: #fde68a; }
.ene-item.esc { color: #cbd5e1; }

/* LIRR & Metro-North Live Rail Tab */
.rail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.rail-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.rail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rail-name {
  font-size: 14px;
  font-weight: 800;
}
.rail-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rail-meta strong { color: var(--text); }

.live-oos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.live-oos-grid strong { color: var(--text); }

.line-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.mta-alert-box {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}
.mta-alert-box.sev {
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.escape-row {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.acc-toggle {
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.acc-inline {
  margin-top: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px 10px;
}
.acc-inline strong { color: var(--text); }

/* Express vs Local Races */
.section-intro {
  margin-bottom: 14px;
}
.section-intro h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.section-intro p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.races-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.race-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.race-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.race-name { font-size: 15px; font-weight: 800; }

.race-verdict {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.race-verdict.local { color: var(--clearing); background: var(--clearing-bg); }
.race-verdict.express { color: var(--smooth); background: var(--smooth-bg); }
.race-verdict.tie { color: #fde68a; background: rgba(245, 158, 11, 0.16); }

.race-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent);
  color: #e0f2fe;
}
.race-sub {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}
.race-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.race-tag.choke { border-color: rgba(245, 158, 11, 0.4); color: #fde68a; }
.race-tag.hop { border-color: rgba(56, 189, 248, 0.4); color: #bae6fd; }

.race-board {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.race-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-variant-numeric: tabular-nums;
}
.race-col.winner {
  border-color: rgba(34, 211, 238, 0.48);
  background: rgba(34, 211, 238, 0.06);
}
.race-col.winner-exp {
  border-color: rgba(25, 195, 125, 0.48);
  background: rgba(25, 195, 125, 0.06);
}
.race-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.race-col-bullets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.race-total {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.race-breakdown {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.race-reason {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.station-race-bar {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.7);
  background: rgba(56, 189, 248, 0.055);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.station-race-head {
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.station-race-btn {
  background: rgba(15, 20, 28, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.4;
}
.station-race-btn:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.11);
}
.station-race-btn.xover {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.08);
}
.station-race-btn .srb-body {
  min-width: 0;
}
.station-race-btn .srb-dir {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  margin-right: 6px;
  vertical-align: 1px;
}
.station-race-btn.xover .srb-dir {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}
.station-race-btn .srb-chev {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 11px;
}

/* Multi-Stop Crossover Ladder Cards (Exp 24) */
.ladder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
}
.ladder-card.has-xover {
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12) inset;
}
.ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.ladder-origin {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ladder-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  margin-left: 6px;
  vertical-align: middle;
}
.ladder-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}
.ladder-verdict-banner {
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}
.ladder-verdict-banner.xover {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(25, 195, 125, 0.14));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}
.ladder-verdict-banner.local {
  background: var(--clearing-bg);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #cffafe;
}
.ladder-verdict-banner.express {
  background: var(--smooth-bg);
  border: 1px solid rgba(25, 195, 125, 0.35);
  color: #bbf7d0;
}
.ladder-verdict-banner.tie {
  background: var(--watch-bg);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.ladder-wait-bar {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.ladder-wait-side {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.ladder-wait-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex-wrap: wrap;
}
.ladder-wait-val {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.ladder-wait-val strong {
  color: var(--text);
  font-size: 13px;
}

.ladder-table {
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
.ladder-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1.45fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(38, 47, 61, 0.65);
}
.ladder-row:last-child { border-bottom: none; }
.ladder-row.is-xover {
  background: rgba(25, 195, 125, 0.08);
  border-top: 1px solid rgba(25, 195, 125, 0.35);
}
.ladder-row.is-tail {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.015);
}
.lr-stop-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.lr-stop-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-right: 5px;
  vertical-align: 1px;
}
.lr-stop-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.xover-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.lr-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  text-align: center;
}
.lr-badge.local { color: var(--clearing); background: var(--clearing-bg); }
.lr-badge.express { color: var(--smooth); background: var(--smooth-bg); }
.lr-badge.tie { color: #fde68a; background: rgba(245, 158, 11, 0.16); }

.lr-nums {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.lr-num-line {
  white-space: nowrap;
}
.lr-num-line .lr-lbl {
  display: inline-block;
  width: 24px;
  text-align: left;
  font-weight: 700;
  color: var(--dim);
}
.lr-num-line strong {
  color: var(--text);
  font-weight: 800;
}
.lr-num-line.win-loc strong { color: var(--clearing); }
.lr-num-line.win-exp strong { color: var(--smooth); }

.ladder-tail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px dashed rgba(56, 70, 92, 0.85);
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.ladder-tail-row.exp-tail { color: #86efac; }
.ladder-tail-row.loc-tail { color: #a5f3fc; }
.ladder-tail-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ladder-tail-toggle:hover { border-color: var(--accent); }

@media (max-width: 540px) {
  .ladder-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
  }
  .lr-nums {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding-top: 3px;
    border-top: 1px solid rgba(38, 47, 61, 0.35);
    font-size: 11px;
  }
  .lr-num-line .lr-lbl { width: auto; margin-right: 3px; }
}

.race-metrics {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.race-metrics strong { color: var(--text); }

/* Track Record & KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.kpi-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-val.good { color: var(--smooth); }
.kpi-val.cyan { color: var(--clearing); }

.kpi-lbl {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.card-panel h3 {
  margin: 0 0 4px;
  font-size: 15.5px;
}
.panel-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 10-bin Calibration Charts */
.calib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.calib-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
}

.calib-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mini-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--smooth);
  background: var(--smooth-bg);
  padding: 2px 7px;
  border-radius: 999px;
}

.calib-row {
  display: grid;
  grid-template-columns: 54px 1fr 78px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.calib-track {
  position: relative;
  height: 12px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.calib-actual {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-radius: 4px;
  opacity: 0.85;
}

.calib-pred-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
}

.calib-nums {
  text-align: right;
  color: var(--muted);
}

/* Route Table */
.table-wrap {
  overflow-x: auto;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.acc-table th, .acc-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.acc-table th:first-child, .acc-table td:first-child {
  text-align: left;
}

.acc-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  font-size: 13.5px;
}

.footer {
  text-align: center;
  padding: 12px 14px 28px;
  font-size: 11.5px;
  color: var(--dim);
}

@media (max-width: 520px) {
  .line-main { align-items: flex-start; }
  .wait-big { font-size: 14px; }
}
