:root {
  --ink: #16110c;
  --muted: #6a6156;
  --line: rgba(22, 17, 12, 0.12);
  --paper: #efe8dc;
  --asphalt: #1a1d21;
  --lane: #f0c850;
  --lane-solid: #e8b84a;
  --sidewalk: #cfc7bb;
  --bulb: #d9e4d4;
  --muni: #c8102e;
  --purple: #6f2dbd;
  --accent: #0d6e5c;
  --card: #fffcf7;
  --shadow: 0 18px 40px rgba(22, 17, 12, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(232, 184, 74, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(111, 45, 189, 0.06), transparent 50%),
    #ebe3d4;
  min-height: 100vh;
}

a { color: var(--accent); }

.shell {
  width: min(1180px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 252, 247, 0.62);
}

.eyebrow.dark { color: var(--muted); }

.hero {
  position: relative;
  padding: 0 0 4.25rem;
  color: #fffcf7;
  background:
    radial-gradient(ellipse 55% 70% at 88% 18%, rgba(232, 184, 74, 0.22), transparent 58%),
    radial-gradient(ellipse 40% 50% at 8% 90%, rgba(111, 45, 189, 0.18), transparent 60%),
    linear-gradient(180deg, #121418 0%, #1c2128 58%, #252b33 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--muni) 0 38%, var(--lane-solid) 38% 72%, var(--purple) 72%);
  z-index: 3;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 72px,
      rgba(255, 252, 247, 0.025) 72px 73px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 44px,
      rgba(255, 252, 247, 0.03) 44px 45px
    );
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
  z-index: 0;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0 2.4rem;
}

.nav-links {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: #fffcf7;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.brand span {
  color: var(--lane-solid);
  font-style: italic;
}

.nav-link {
  color: rgba(255, 252, 247, 0.72);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 252, 247, 0.08);
}

.nav-link.quiet {
  color: rgba(255, 252, 247, 0.48);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 22.5rem);
  gap: 2.4rem;
  align-items: start;
}

.hero-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lane-solid);
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-family: var(--display);
  font-size: clamp(2.35rem, 4.4vw, 3.55rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--lane-solid);
}

.hero h1 em.unscheduled {
  color: #d4b4f2;
}

.hero-copy {
  margin: 0;
  max-width: 34rem;
  font-size: 1.14rem;
  line-height: 1.55;
  color: rgba(255, 252, 247, 0.78);
}

.hero-copy + .hero-copy {
  margin-top: 0.9rem;
}

.hero-claim em {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  color: var(--lane-solid);
}

.hero-claim em.unscheduled {
  color: #d4b4f2;
}

.hero-board {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.hero-ticket {
  position: relative;
  padding: 1.2rem 1.25rem 1.15rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fff8ea 0%, #f4ead6 100%);
  color: var(--ink);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.hero-ticket::before,
.hero-ticket::after {
  content: "";
  position: absolute;
  top: 5.85rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1c2128;
}

.hero-ticket::before { left: -9px; }
.hero-ticket::after { right: -9px; }

.ticket-route {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ticket-route span {
  display: inline-grid;
  place-items: center;
  min-width: 2.3rem;
  height: 1.85rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: var(--muni);
  color: #fff;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

.ticket-od {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.ticket-runs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.85rem 0.85rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px dashed rgba(22, 17, 12, 0.18);
}

.ticket-runs span {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ticket-runs b {
  display: block;
  margin: 0.2rem 0 0.15rem;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ticket-runs p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
}

.bart-compare {
  padding: 0.95rem 1.1rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.06);
  border: 1px solid rgba(255, 252, 247, 0.1);
  color: #fffcf7;
}

.bart-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lane-solid);
}

.bart-lede {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.78rem;
  color: rgba(255, 252, 247, 0.58);
}

.bart-compare ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.bart-compare li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem 0.55rem;
  align-items: baseline;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.bart-compare li span:nth-child(2),
.bart-compare li span:nth-child(3),
.bart-compare li span:nth-child(4) {
  min-width: 3.4rem;
  text-align: right;
  font-weight: 600;
}

.bart-compare li span:nth-child(2),
.bart-compare li span:nth-child(3) {
  color: rgba(255, 252, 247, 0.62);
}

.bart-compare li span:nth-child(4) {
  color: var(--lane-solid);
}

.bart-compare li.bart-head {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 252, 247, 0.42);
}

.bart-compare li.bart-head span {
  font-weight: 700;
  color: rgba(255, 252, 247, 0.42);
}

.bart-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.bart-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.bart-dot.yellow { background: #f9d616; }
.bart-dot.orange { background: #f8a400; }
.bart-dot.green { background: #4db848; }
.bart-dot.red { background: #e31d1a; }
.bart-dot.blue { background: #00aeef; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--lane-solid);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
  background: #f2c85a;
  transform: translateY(-1px);
}

.hero-visual {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.bulb-gif {
  margin: 0;
  background: rgba(255, 252, 247, 0.06);
  border: 1px solid rgba(255, 252, 247, 0.12);
  border-radius: 18px;
  overflow: hidden;
}

.bulb-gif img {
  display: block;
  width: 100%;
  height: auto;
  background: #1a1f24;
}

.bulb-gif figcaption {
  padding: 0.65rem 0.85rem 0.8rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(255, 252, 247, 0.78);
}

.bulb-gif figcaption .fig-seconds {
  color: #fff;
  font-weight: 600;
}

.bulb-gif figcaption a {
  color: rgba(255, 252, 247, 0.92);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bulb-diagram,
.problem-card {
  background: rgba(255, 252, 247, 0.06);
  border: 1px solid rgba(255, 252, 247, 0.12);
  border-radius: 18px;
  padding: 1rem 1rem 1.1rem;
  backdrop-filter: blur(6px);
}

.problem-stat {
  margin: 0.35rem 0 0.75rem;
}

.problem-stat strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--lane-solid);
}

.problem-stat span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.diagram-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--lane-solid);
  margin-bottom: 0.65rem;
}

.street {
  position: relative;
  height: 150px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, var(--sidewalk) 0 18%, transparent 18%),
    repeating-linear-gradient(
      90deg,
      #3a4047 0 28px,
      #343a41 28px 56px
    );
  overflow: hidden;
}

.sidewalk {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  background: linear-gradient(180deg, #d8d0c4, #c4bcb0);
}

.bulb {
  position: absolute;
  left: 10%;
  top: 18%;
  bottom: 18%;
  width: 22%;
  border-radius: 10px 18px 18px 10px;
  background: linear-gradient(135deg, #e7efe2, #c9d8c2);
  box-shadow: inset 0 0 0 1px rgba(20, 17, 14, 0.08);
  animation: bulb-in 1.1s ease both;
}

.bus {
  position: absolute;
  left: 28%;
  top: 50%;
  transform: translateY(-50%);
  width: 78px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(180deg, #e11d2e, #a50d1c);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  animation: bus-slide 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.lane-mark {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: rgba(240, 200, 80, 0.85);
  transform: translateY(-50%);
}

.lane-mark.one { right: 28%; }
.lane-mark.two { right: 18%; }
.lane-mark.three { right: 8%; }

.arrow {
  position: absolute;
  right: 1rem;
  bottom: 0.7rem;
  color: rgba(255, 252, 247, 0.7);
  font-size: 1.2rem;
  animation: pulse 2s ease-in-out infinite;
}

.diagram-note {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: rgba(255, 252, 247, 0.78);
  line-height: 1.35;
}

@keyframes bus-slide {
  from { opacity: 0; transform: translate(-24px, -50%); }
  to { opacity: 1; transform: translate(0, -50%); }
}

@keyframes bulb-in {
  from { opacity: 0; transform: scaleX(0.7); transform-origin: left center; }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(4px); }
}

.section {
  padding: 4rem 0;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.6rem;
  margin-bottom: 1.75rem;
  align-items: start;
}

.section-lede {
  margin: 0.65rem 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.section-lede a { font-weight: 600; }

.problem-section {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.55), rgba(255, 248, 236, 0.88));
  border-block: 1px solid var(--line);
}

.fix-section {
  padding-bottom: 3.5rem;
}

.route-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.95rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.route-bar label {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-bar select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 500;
}

.status-inline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.table-status {
  margin: 0 0 0.85rem;
}

.problem-panel {
  position: relative;
  padding: 1.35rem 1.4rem 1.35rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #fffdf8, #f7f0e4);
  border: 1px solid rgba(22, 17, 12, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.problem-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--muni), var(--lane-solid) 55%, var(--purple));
}

.problem-lead {
  margin: 0.35rem 0 0.9rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.problem-lead strong {
  color: #a50d1c;
}

.problem-lead strong.unscheduled {
  color: #6f2dbd;
}

.problem-lead span {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.unplanned-lead {
  margin: -0.45rem 0 0.95rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.unplanned-lead strong {
  color: #6f2dbd;
  font-weight: 700;
}

.compare-bars {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem 0.75rem;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.compare-bars .stack-row {
  grid-template-columns: 7.2rem 1fr 4.6rem;
  margin-bottom: 0.45rem;
}

.compare-note {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.delay-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: start;
}

.delay-col {
  padding: 0.95rem 1rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.planned-col {
  box-shadow: inset 3px 0 0 var(--muni);
}

.unplanned-col {
  box-shadow: inset 3px 0 0 var(--purple);
}

.delay-stat {
  margin: 0.15rem 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.delay-stat span {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.planned-col .delay-stat {
  color: #a50d1c;
}

.unplanned-col .delay-stat {
  color: #6f2dbd;
}

.delay-detail {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.delay-mix .stack-row {
  grid-template-columns: 6.6rem 1fr 3.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  .delay-cols {
    grid-template-columns: 1fr;
  }
}

.direction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.direction-list li {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.85);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.direction-list li.is-on {
  border-color: rgba(200, 16, 46, 0.45);
  box-shadow: 0 0 0 1px rgba(200, 16, 46, 0.18);
}

.direction-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
}

.direction-list strong {
  min-width: 0;
}

.direction-gap {
  color: var(--muni);
  font-weight: 600;
  font-size: 0.88rem;
}

.direction-runs {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.5rem;
  color: var(--ink);
  line-height: 1.4;
}

.direction-list .vs {
  color: var(--muted);
  font-size: 0.8rem;
}

.hop-legend {
  gap: 0.65rem 0.9rem;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.swatch.hop-green { background: #2f9e62; }
.swatch.hop-yellow { background: #e0b03a; }
.swatch.hop-red { background: #c8102e; }
.swatch.hop-purple { background: #6f2dbd; }
.swatch.hop-gray { background: #6a6156; }

.panel-note {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.panel-note[hidden] {
  display: none;
}

.section-number {
  font-family: var(--display);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-style: italic;
  font-weight: 700;
  color: rgba(200, 16, 46, 0.18);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.section-head h2,
.sources h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 110, 92, 0.15);
  flex-shrink: 0;
}

.controls,
.results,
.map-card,
.formula-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.controls {
  padding: 1.15rem 1.2rem 1.3rem;
}

.controls label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.controls select {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 500;
  margin-bottom: 1.1rem;
}

.range-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.range-heading.second { margin-top: 1rem; }

.range-heading output {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.simple-note {
  margin: 1rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.results {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.math-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.math-lines li {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(20, 17, 14, 0.03);
  border: 1px solid var(--line);
}

.math-lines li.math-roi {
  background:
    linear-gradient(135deg, rgba(13, 110, 92, 0.14), rgba(232, 184, 74, 0.16));
  border-color: rgba(13, 110, 92, 0.18);
}

.math-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.math-eq {
  display: grid;
  gap: 0.35rem;
}

.math-steps {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.math-steps em {
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.math-answer {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.math-lines li.math-problem {
  background:
    linear-gradient(135deg, rgba(200, 16, 46, 0.08), rgba(232, 184, 74, 0.14));
  border-color: rgba(200, 16, 46, 0.16);
}

.math-problem .math-answer {
  color: #a50d1c;
}

.controls-lead {
  margin: 0.15rem 0 0.85rem !important;
  font-weight: 700;
  color: var(--ink) !important;
}

.method {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 2rem;
  padding: 1rem 0 2.5rem;
}

.method-copy {
  grid-column: 2;
  margin: 0;
}

.method .formula-card {
  grid-column: 2;
}

.caveat {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.map-card {
  margin-top: 1.15rem;
  padding: 1rem 1rem 0.85rem;
}

.map-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.map-heading-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.map-metric {
  margin: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
}

.speed-lede {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.selected { background: var(--muni); box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.18); }
.dot.other { background: #8a847a; }

#map,
#system-map,
#lane-map,
#tsp-map,
#stop-type-map,
#ticket-map {
  height: min(52vh, 420px);
  border-radius: 14px;
  background: #d8d2c8;
  border: 1px solid var(--line);
}

.map-card.is-system #system-map,
.map-card.is-system #lane-map,
.map-card.is-system #tsp-map,
.map-card.is-system #stop-type-map,
.map-card.is-system #ticket-map {
  height: min(72vh, 640px);
}

.map-note {
  margin: 0.65rem 0 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.formula-card {
  padding: 1.1rem 1.2rem;
  display: grid;
  gap: 0.85rem;
}

.formula-card > div {
  display: grid;
  gap: 0.25rem;
}

.formula-card span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.formula-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(20, 17, 14, 0.04);
  border: 1px solid var(--line);
}

.formula-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ranking-section {
  background: transparent;
}

.idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.idea-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.idea-fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.idea-summary {
  display: grid;
  grid-template-columns: 2rem minmax(7.5rem, auto) 1fr;
  gap: 0.35rem 1rem;
  align-items: start;
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.25rem 1.1rem;
}

.idea-summary::-webkit-details-marker,
.idea-summary::marker {
  display: none;
}

.idea-rank {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.45rem;
}

.idea-summary .idea-pct {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.idea-copy h3 {
  margin: 0.1rem 0 0.35rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.idea-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.idea-more {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muni);
}

.idea-fold .idea-more.is-open { display: none; }
.idea-fold[open] .idea-more.is-closed { display: none; }
.idea-fold[open] .idea-more.is-open { display: inline-block; }

.idea-nest {
  padding: 0 1.15rem 1.35rem;
  border-top: 1px solid var(--line);
}

.nested-head {
  margin: 1.1rem 0 0.85rem;
}

.idea-subfold {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf8f2;
}

.idea-sub-summary {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.1rem 0.95rem;
}

.idea-sub-summary::-webkit-details-marker,
.idea-sub-summary::marker {
  display: none;
}

.idea-sub-summary h3 {
  margin: 0.2rem 0 0.25rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.idea-sub-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.idea-sub-summary .idea-more {
  margin-top: 0;
  flex-shrink: 0;
}

.idea-subfold .idea-more.is-open { display: none; }
.idea-subfold[open] .idea-more.is-closed { display: none; }
.idea-subfold[open] .idea-more.is-open { display: inline-block; }

.idea-sub-nest {
  padding: 0 1.1rem 1.2rem;
  border-top: 1px solid var(--line);
}

.idea-card {
  padding: 1.2rem 1.25rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.idea-card h3 {
  margin: 0.55rem 0 0.35rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.idea-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.idea-pct {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--muni);
}

.idea-stops .idea-pct { color: var(--lane-solid); }
.idea-bulbs .idea-pct { color: var(--accent); }
.idea-signals .idea-pct { color: var(--purple); }
.idea-weighted.is-better .idea-pct { color: var(--accent); }
.idea-weighted.is-worse .idea-pct { color: var(--muni); }
.forward-grid {
  grid-template-columns: 1fr 1fr 1fr;
  margin: 0 0 1.1rem;
}

.why-story {
  margin: 1.2rem 0 1.35rem;
  max-width: 40rem;
}

.why-story p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.why-story p:last-child { margin-bottom: 0; }

.rank-table.is-static tbody tr {
  cursor: default;
}

.rank-table.is-static tbody tr:hover {
  background: transparent;
}

.delta-better { color: var(--accent); font-weight: 600; }
.delta-worse { color: var(--muni); font-weight: 600; }

.gap-chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.2rem 1.25rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}

.run-metric {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

.run-metric button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.run-metric button.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff8ea;
}

.run-chart {
  width: 100%;
  min-height: 560px;
}

.run-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.ticket-year-card {
  margin-top: 0.35rem;
}

.ticket-window {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
  justify-content: flex-end;
}

.ticket-window label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.ticket-window select {
  padding: 0.32rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 500;
}

.ticket-window button,
#ticket-year-all {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.ticket-year-chart {
  width: 100%;
  min-height: 220px;
}

.ticket-year-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.ticket-year-hit { fill: transparent; }
.ticket-year-lane { fill: #c8102e; }
.ticket-year-zone { fill: #e0b03a; }
.ticket-year-bar { cursor: pointer; }
.ticket-year-bar.is-off { opacity: 0.28; }
.ticket-year-bar:hover,
.ticket-year-bar:focus {
  opacity: 1;
  outline: none;
}

.run-axis {
  stroke: var(--line);
  stroke-width: 1;
  fill: none;
}

.run-grid {
  stroke: var(--line);
  stroke-width: 1;
  fill: none;
  opacity: 0.7;
}

.run-tick {
  font-size: 10px;
  fill: var(--muted);
  font-family: inherit;
}

.run-axis-title {
  font-size: 10px;
  fill: var(--muted);
  font-family: inherit;
  font-weight: 600;
}

.run-series {
  cursor: pointer;
}

.run-line {
  fill: none;
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.75;
}

.run-dot {
  stroke: none;
  opacity: 0.88;
}

.run-label {
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  pointer-events: none;
}

.run-series.is-dim .run-line,
.run-series.is-dim .run-dot {
  opacity: 0.14;
}

.run-series.is-dim .run-label {
  opacity: 0.35;
}

.run-series.is-on .run-line {
  stroke: var(--muni);
  stroke-width: 2.6;
  opacity: 1;
}

.run-series.is-on .run-dot {
  fill: var(--muni);
  opacity: 1;
}

.run-series.is-on .run-label {
  fill: var(--muni);
  opacity: 1;
}

.run-series:hover .run-line {
  stroke-width: 2.3;
  opacity: 1;
}

.run-series:hover .run-dot {
  opacity: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.table-expand {
  appearance: none;
  display: block;
  margin: 0.85rem auto 0;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.table-expand:hover {
  background: #fff;
}

.route-pill {
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  padding: 0.12rem 0.38rem;
  margin-right: 0.45rem;
  border-radius: 6px;
  background: var(--muni);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.rank-table th,
.rank-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.rank-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(20, 17, 14, 0.03);
  white-space: nowrap;
}

.rank-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.rank-table th[data-sort]:hover,
.rank-table th[data-sort]:focus-visible {
  color: var(--ink);
  outline: none;
}

.rank-table th[data-sort]::after {
  content: " ↕";
  opacity: 0.28;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.rank-table th[aria-sort="ascending"]::after {
  content: " ↑";
  opacity: 1;
  color: var(--ink);
}

.rank-table th[aria-sort="descending"]::after {
  content: " ↓";
  opacity: 1;
  color: var(--ink);
}

.rank-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.rank-table tbody tr:hover {
  background: rgba(232, 184, 74, 0.14);
}

.rank-table tbody tr.is-active {
  background: rgba(200, 16, 46, 0.08);
}

.rank-table tbody tr:last-child td {
  border-bottom: 0;
}

.rank-table thead th[rowspan] {
  vertical-align: bottom;
}

.rank-table th.group {
  text-align: center;
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.rank-table th.group-planned {
  color: #a50d1c;
}

.rank-table th.group-unplanned {
  color: #6f2dbd;
}

.rank-table td.planned {
  font-weight: 700;
  color: #a50d1c;
}

.rank-table td.unplanned {
  font-weight: 700;
  color: #5b21b6;
}

.hero-grid-solo {
  grid-template-columns: 1fr;
}

.rank-table strong {
  margin-right: 0.25rem;
}

.lane-share-title {
  margin: 2.4rem 0 0.4rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.lane-share-wrap {
  margin-top: 1rem;
}

.rank-table td.spacing-denser {
  font-weight: 700;
  color: #a50d1c;
}

.rank-table td.spacing-farther {
  font-weight: 700;
  color: #2f9e62;
}

.sources {
  padding: 3.5rem 0 3.75rem;
  background: #1a1d21;
  color: #fffcf7;
  border-top: 0;
}

.sources .eyebrow.dark {
  color: var(--lane-solid);
}

.sources h2 {
  color: #fffcf7;
}

.sources-body p {
  color: rgba(255, 252, 247, 0.72) !important;
}

.sources-body strong { color: #fff8ea !important; }

.sources .formula-card {
  background: rgba(255, 252, 247, 0.05);
  border-color: rgba(255, 252, 247, 0.1);
  box-shadow: none;
}

.sources .formula-card span {
  color: var(--lane-solid);
}

.sources .formula-card code {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 252, 247, 0.1);
  color: #fff8ea;
}

.sources a { color: var(--lane-solid); }

.sources-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 2rem;
  align-items: start;
}

.sources-body {
  display: grid;
  gap: 0.85rem;
}

.sources-body .formula-card {
  margin-bottom: 0.35rem;
}

.sources-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.sources-body strong { color: var(--ink); }

.attribution {
  font-size: 0.82rem !important;
  opacity: 0.9;
}

footer {
  padding: 1.15rem 0 1.6rem;
  background: #121418;
  border-top: 1px solid rgba(255, 252, 247, 0.08);
  font-size: 0.88rem;
  color: rgba(255, 252, 247, 0.55);
}

footer a { color: var(--lane-solid); }

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer a {
  font-weight: 600;
  text-decoration: none;
}

.nav-link.is-current {
  color: #fff;
  font-weight: 700;
}

.delay-hero {
  align-items: end;
}

.delay-hero-stat .problem-stat span {
  color: rgba(255, 252, 247, 0.72);
}

.kpi-row {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}

.kpi-row li {
  padding: 0.85rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.kpi-row strong {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-row span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.split-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  align-items: start;
}

.stack-bars,
.hour-chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
}

.stack-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr 4.2rem;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
}

.stack-row:last-child { margin-bottom: 0; }

.stack-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.08);
  overflow: hidden;
}

.stack-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.stack-row b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.mini-table th,
.mini-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.mini-table th {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.mini-table tbody tr:last-child th,
.mini-table tbody tr:last-child td {
  border-bottom: 0;
}

.hour-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 0.28rem;
  align-items: end;
  height: 180px;
}

.hour-col {
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  height: 100%;
  gap: 0.35rem;
}

.hour-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: rgba(200, 16, 46, 0.35);
}

.hour-col.is-peak .hour-bar {
  background: var(--muni);
}

.hour-col span {
  font-size: 0.62rem;
  color: var(--muted);
  writing-mode: horizontal-tb;
}

.delay-table th button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}

.delay-table th button.is-sorted {
  color: var(--ink);
}

.delay-table tbody tr {
  cursor: default;
}

.delay-table td:last-child {
  color: var(--ink);
  font-weight: 500;
}

.delay-table td:nth-child(6) {
  font-weight: 700;
  color: #a50d1c;
}

@media (max-width: 900px) {
  .hero-grid,
  .calculator-grid,
  .sources-grid,
  .section-head,
  .kpi-row,
  .split-row,
  .delay-hero,
  .idea-grid {
    grid-template-columns: 1fr;
  }

  .idea-summary {
    grid-template-columns: 1.6rem 1fr;
  }

  .idea-summary .idea-pct {
    grid-column: 2;
  }

  .route-bar {
    grid-template-columns: 1fr;
  }

  .stack-row {
    grid-template-columns: 1fr auto;
  }

  .stack-track { grid-column: 1 / -1; }

  .nav-links { gap: 0.15rem; flex-wrap: wrap; justify-content: flex-end; }

  .hero {
    padding-bottom: 3rem;
  }

  .hero-board {
    margin-top: -0.5rem;
  }

  .ticket-runs {
    grid-template-columns: 1fr 1fr auto;
  }

  .map-heading,
  .map-heading-tools {
    align-items: stretch;
  }

  .map-heading-tools {
    align-items: flex-start;
  }
}
