/* Walk to the train — platform rings on today's streets. */
body.train-page .g-head,
body.train-page .crumbs,
body.train-page .g-main,
body.train-page .g-foot {
  max-width: 1120px;
}

body.train-page .g-main { padding-bottom: 56px; }

body.train-page .g-head-mill[href="/train/"] {
  color: #c45c26;
}
body.train-page .g-head-mill[href="/train/"]:hover {
  border-bottom-color: #c45c26;
}

.train-lede {
  max-width: 44rem;
  margin: 0 0 18px;
}
.train-lede p {
  margin: 0 0 10px;
  font-size: 17.5px;
  line-height: 1.5;
}

.train-search {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  max-width: 40rem;
}
.train-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--ink);
  font: 16px var(--font-ui);
  box-shadow: 0 1px 2px rgba(21, 32, 28, .06);
}
.train-search input:focus {
  outline: 2px solid #c45c26;
  outline-offset: 1px;
}
.train-search button {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #c45c26;
  color: #fff;
  font: 650 15px var(--font-ui);
  cursor: pointer;
}
.train-search button:hover { background: #a34a1e; }

.train-towns,
.train-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.train-scenes { margin-bottom: 14px; }

@media (max-width: 879px) {
  .train-lede { margin-bottom: 12px; }
  .train-lede p { font-size: 16px; }
  .train-towns,
  .train-scenes {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .train-towns li,
  .train-scenes li { flex: 0 0 auto; }
}

.train-towns button,
.train-scenes button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink-2);
  font: 600 13.5px var(--font-ui);
  cursor: pointer;
}
.train-towns button:hover,
.train-scenes button:hover {
  border-color: #c45c26;
  color: #c45c26;
}
.train-towns button[aria-pressed="true"],
.train-scenes button[aria-pressed="true"] {
  background: #c45c26;
  border-color: #c45c26;
  color: #fff;
}

.train-theater { position: relative; }

.train-toolbar {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f7faf8;
  border: 1px solid rgba(196, 92, 38, .22);
  box-shadow: 0 6px 18px rgba(64, 32, 21, .06);
}
.train-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.train-filters button {
  flex: 1 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3a2418;
  font: 650 12.5px var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
}
.train-filters button[data-line="harlem"][aria-pressed="true"] {
  background: #0039A6;
  border-color: #0039A6;
  color: #fff;
}
.train-filters button[data-line="hudson"][aria-pressed="true"] {
  background: #009B3A;
  border-color: #009B3A;
  color: #fff;
}
.train-filters button[data-line="new-haven"][aria-pressed="true"] {
  background: #EE0034;
  border-color: #EE0034;
  color: #fff;
}
.train-edition {
  margin: 0;
  font: 500 11.5px var(--font-ui);
  color: var(--ink-muted);
}

.train-layout {
  display: grid;
  gap: 16px;
}
@media (min-width: 880px) {
  .train-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .85fr);
    align-items: stretch;
  }
}

.train-stage {
  position: relative;
  isolation: isolate;
  z-index: 0;
  min-height: min(56vh, 560px);
  height: min(56vh, 560px);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(196, 92, 38, .16), transparent 55%),
    #e8ddd3;
  box-shadow: 0 4px 16px rgba(64, 32, 21, .07);
}

#trainMap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.train-stage .leaflet-container {
  height: 100%;
  width: 100%;
  background: transparent;
  font-family: var(--font-ui);
  touch-action: none;
}
.train-stage .leaflet-control-zoom {
  border: 0;
  box-shadow: 0 2px 10px rgba(64, 32, 21, .12);
}
.train-stage .leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
  color: #3a2418;
  background: rgba(247, 250, 248, .94);
}
.train-stage .leaflet-control-attribution {
  font-size: 10.5px;
  background: rgba(247, 250, 248, .86);
  margin: 0;
  max-width: 46vw;
}
.train-stage .leaflet-top.leaflet-right {
  top: 8px;
  right: 8px;
  z-index: 5;
}

.train-hint,
.train-float {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(247, 250, 248, .94);
  border: 1px solid rgba(196, 92, 38, .28);
  color: #3a2418;
  font: 650 13px var(--font-ui);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(64, 32, 21, .08);
  max-width: calc(100% - 88px);
}

.train-station-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(20, 20, 20, .35);
}
.train-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c45c26;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(64, 32, 21, .35);
}

.train-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 10px 28px rgba(64, 32, 21, .06);
  scroll-margin-top: 16px;
}
.train-kicker {
  margin: 0;
  font: 650 11px var(--font-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #c45c26;
}
.train-panel h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
}
.train-gauge {
  height: 6px;
  border-radius: 999px;
  background: rgba(196, 92, 38, .12);
  overflow: hidden;
}
.train-gauge span {
  display: block;
  height: 100%;
  width: 0;
  background: #c45c26;
  border-radius: 999px;
  transition: width .35s ease;
}
.train-meta {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.train-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.train-actions a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font: 650 13.5px var(--font-ui);
}
.train-actions a.primary {
  background: #c45c26;
  color: #fff;
}
.train-actions a.ghost {
  background: transparent;
  color: #c45c26;
  border: 1px solid rgba(196, 92, 38, .35);
}

.train-legend {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font: 600 12.5px var(--font-ui);
  color: var(--ink-2);
}
.train-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.train-legend .harlem { background: #0039A6; }
.train-legend .hudson { background: #009B3A; }
.train-legend .newhaven { background: #EE0034; }

.train-fine {
  margin: 14px 0 28px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.train-stats {
  list-style: none;
  margin: 12px 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
}
@media (min-width: 720px) {
  .train-stats { grid-template-columns: 1fr 1fr; }
}
.train-stats a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
}
.train-stats .t {
  font: 700 16px var(--font-ui);
  color: var(--ink);
}
.train-stats .n {
  font: 800 22px var(--font-ui);
  color: #c45c26;
  grid-row: 1 / span 2;
  align-self: center;
}
.train-stats .n span {
  font-size: 13px;
  font-weight: 650;
}
.train-stats .s {
  grid-column: 1;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.train-street-grid {
  display: grid;
  gap: 16px;
  margin: 12px 0 8px;
}
@media (min-width: 720px) {
  .train-street-grid { grid-template-columns: 1fr 1fr; }
}
.train-streets {
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
}
.train-streets h3 {
  margin: 0 0 8px;
  font-size: 17px;
}
.train-streets ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.train-streets li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.train-streets li:last-child { border-bottom: 0; }
.train-streets .m { color: var(--ink-muted); font-size: 13px; white-space: nowrap; }

@media (max-width: 879px) {
  body.train-page .g-main { display: flex; flex-direction: column; }
  body.train-page .g-main > h1 { order: 0; }
  body.train-page .train-search { order: 1; }
  body.train-page .train-towns { order: 2; }
  body.train-page .train-scenes { order: 3; }
  body.train-page .train-theater { order: 4; }
  body.train-page .train-fine { order: 4; }
  body.train-page .train-lede { order: 5; }
  body.train-page .g-main > h2,
  body.train-page .g-main > p:not(.train-fine),
  body.train-page .train-stats,
  body.train-page .train-street-grid,
  body.train-page .faq,
  body.train-page .cta { order: 6; }

  .train-theater {
    position: relative;
    z-index: 0;
    padding: 8px 0 10px;
    background: var(--bg, #eef3f1);
  }
  .train-stage {
    min-height: 220px;
    height: clamp(240px, 38dvh, 360px);
    box-shadow: none;
    border-radius: 16px 16px 0 0;
  }
  .train-toolbar {
    margin: 0 0 8px;
    padding: 8px;
    border-radius: 14px;
  }
  .train-edition { display: none; }
  .train-panel {
    background: #f7faf8;
    padding: 12px 14px;
    gap: 8px;
    border-radius: 0 0 16px 16px;
    border-top: 0;
    box-shadow: none;
  }
  .train-panel h2 { font-size: 18px; }
  .train-legend { display: none; }
  .train-hint,
  .train-float {
    left: 8px;
    top: 8px;
    font-size: 12px;
    padding: 6px 10px;
  }
  .train-stage .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .train-gauge span { transition: none; }
}

