:root {
  --map-paper: var(--paper);
  --map-panel: var(--panel);
  --map-ink: var(--ink);
  --map-muted: var(--muted);
  --map-border: var(--line);
  --map-blue: var(--blue);
  --map-blue-soft: #eaf1ff;
  --map-radius: var(--card-radius);
  --map-shadow: var(--card-shadow);
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

.map-page-shell {
  width: min(100%, 1180px);
  padding-inline: clamp(14px, 3vw, 30px);
}

.map-page-shell .detail-topbar {
  margin-right: calc(-1 * clamp(14px, 3vw, 30px));
  margin-left: calc(-1 * clamp(14px, 3vw, 30px));
  padding-inline: clamp(14px, 3vw, 30px);
}

.map-topbar svg,
.map-toolbar svg,
.map-actions svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map-page-shell .visual-breadcrumbs {
  margin-top: 18px;
}

.map-hero {
  max-width: 850px;
  padding: 24px 0 22px;
}

.map-hero h1 {
  max-width: 780px;
  margin: 5px 0 10px;
  color: var(--map-ink);
  font-size: clamp(1.85rem, 4.5vw, 3.55rem);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.map-hero > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--map-muted);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  line-height: 1.6;
}

.network-map {
  position: relative;
  margin: 0 0 38px;
}

.map-heading,
.map-section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
}

.map-heading {
  margin-bottom: 12px;
}

.map-heading span,
.map-section-heading p {
  display: block;
  margin: 0 0 4px;
  color: var(--map-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.map-heading h2,
.map-section-heading h2,
.map-editorial h2,
.map-download h2,
.map-faq h2 {
  margin: 0;
  color: var(--map-ink);
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-weight: 820;
  letter-spacing: -0.025em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.map-updated {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  margin: 0 0 2px;
  color: var(--map-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.map-updated span {
  width: 8px;
  height: 8px;
  margin: 0;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.12);
}

.map-status-flags {
  display: flex;
  gap: 8px;
  min-height: 0;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.map-status-flags:empty {
  display: none;
}

.map-status-flags::-webkit-scrollbar {
  display: none;
}

.map-status-flag {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #f5c5bf;
  border-radius: 999px;
  color: #912018;
  background: #fff4f2;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.map-status-flag::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d92d20;
  content: "";
}

.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--map-border);
  border-radius: var(--map-radius);
  background: #ffffff;
  box-shadow: var(--map-shadow);
}

.map-toolbar {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
  backdrop-filter: blur(10px);
}

.map-toolbar button {
  display: inline-flex;
  gap: 6px;
  min-height: 38px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #344054;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 750;
}

.map-toolbar button:hover {
  color: var(--map-blue);
  background: var(--map-blue-soft);
}

.map-toolbar svg {
  width: 18px;
  height: 18px;
}

.map-viewport {
  position: relative;
  height: clamp(500px, 75vh, 820px);
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: none;
}

.map-viewport:active {
  cursor: grabbing;
}

.map-viewport:focus-visible {
  box-shadow: inset 0 0 0 3px var(--map-blue);
}

.map-canvas {
  width: 100%;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: top center;
  will-change: transform;
}

.map-canvas img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.map-gesture-hint {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  border-radius: 999px;
  color: #475467;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.map-popover {
  position: absolute;
  z-index: 6;
  top: 62px;
  left: 12px;
  width: min(280px, calc(100% - 24px));
  padding: 14px;
  border: 1px solid var(--map-border);
  border-radius: 13px;
  color: #344054;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
}

.map-popover[hidden] {
  display: none;
}

.map-popover > :is(strong, .u-strong),
.map-popover > span {
  display: block;
}

.map-popover > :is(strong, .u-strong) {
  padding-right: 24px;
  color: #101828;
  font-size: 0.9rem;
}

.map-popover > span {
  margin: 5px 0 11px;
  color: #667085;
  font-size: 0.74rem;
}

.map-popover > a {
  color: var(--map-blue);
  font-size: 0.78rem;
  font-weight: 780;
}

.map-popover > button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: #475467;
  background: #f2f4f7;
  cursor: pointer;
}

.map-frame.is-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  border: 0;
  border-radius: 0;
}

.map-frame.is-fullscreen .map-viewport {
  height: 100dvh;
}

body.has-fullscreen-map {
  overflow: hidden;
}

.map-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 11px;
}

.map-actions a {
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--map-border);
  border-radius: 11px;
  color: #344054;
  background: var(--map-panel);
  font-size: 0.82rem;
  font-weight: 750;
}

.map-actions a:first-child {
  color: #ffffff;
  border-color: var(--map-blue);
  background: var(--map-blue);
}

.map-actions svg {
  width: 18px;
  height: 18px;
}

.map-text-alternative {
  margin-top: 12px;
  color: var(--map-muted);
  font-size: 0.82rem;
}

.map-text-alternative summary {
  width: fit-content;
  color: #344054;
  cursor: pointer;
  font-weight: 700;
}

.map-text-alternative p {
  max-width: 720px;
  margin: 8px 0 0;
  line-height: 1.6;
}

.map-text-alternative a,
.map-editorial a,
.map-faq a {
  color: var(--map-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-section {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--map-border);
  border-radius: var(--map-radius);
  background: var(--map-panel);
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.045);
  scroll-margin-top: 90px;
}

.map-section-heading > a {
  flex: 0 0 auto;
  color: var(--map-blue);
  font-size: 0.82rem;
  font-weight: 750;
}

.section-intro {
  max-width: 700px;
  margin: 9px 0 18px;
  color: var(--map-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.network-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.network-status-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-height: 74px;
  align-items: center;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--map-border);
  border-radius: 13px;
  background: #ffffff;
}


.network-status-card:hover {
  border-color: #b9c9e8;
  transform: translateY(-1px);
}

.network-status-card__number,
.map-line-card__number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--badge-ink);
  background: var(--line-color);
  font-size: 0.82rem;
  font-weight: 850;
}

.network-status-card__copy {
  min-width: 0;
}

.network-status-card :is(strong, .u-strong),
.network-status-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-status-card :is(strong, .u-strong) {
  color: var(--map-ink);
  font-size: 0.82rem;
}

.network-status-card small {
  position: relative;
  margin-top: 5px;
  padding-left: 13px;
  color: var(--status-ink, #344054);
  font-size: 0.72rem;
  font-weight: 650;
}

.network-status-card small::before {
  position: absolute;
  top: 0.34em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-dot, #667085);
  content: "";
}

.status-timestamp {
  margin: 13px 0 0;
  color: var(--map-muted);
  font-size: 0.74rem;
  text-align: right;
}

.map-line-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 19px;
}

.map-line-group h3 {
  margin: 0 0 9px;
  color: var(--map-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-line-group ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-line-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--map-border);
  border-radius: 12px;
  background: #ffffff;
}

.map-line-card:hover {
  border-color: #b9c9e8;
  background: #fbfcff;
}

.map-line-card__number {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.map-line-card span:nth-child(2) {
  min-width: 0;
}

.map-line-card :is(strong, .u-strong),
.map-line-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-line-card :is(strong, .u-strong) {
  color: var(--map-ink);
  font-size: 0.81rem;
}

.map-line-card small {
  margin-top: 3px;
  color: var(--map-muted);
  font-size: 0.7rem;
}

.map-line-card :is(b, .u-b) {
  color: #98a2b3;
  font-size: 1.25rem;
}

.station-link-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.station-link-cloud a {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--map-border);
  border-radius: 999px;
  color: #344054;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 680;
}

.station-link-cloud a:hover {
  color: var(--map-blue);
  border-color: #b9c9e8;
  background: var(--map-blue-soft);
}

.map-editorial > p:not(.detail-kicker) {
  max-width: 850px;
  margin: 12px 0 0;
  color: var(--map-muted);
  line-height: 1.7;
}

.map-editorial aside {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  margin-top: 19px;
  padding: 15px 17px;
  border: 1px solid #c9d7f2;
  border-radius: 13px;
  color: #344054;
  background: var(--map-blue-soft);
  font-size: 0.82rem;
}

.map-editorial aside :is(strong, .u-strong) {
  color: #174ea6;
}

.map-editorial aside a {
  font-weight: 750;
  white-space: nowrap;
}

.map-download {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  gap: 24px;
  align-items: center;
}

.map-download > div:first-child > p:last-child {
  margin: 10px 0 0;
  color: var(--map-muted);
  line-height: 1.55;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.download-cards a {
  position: relative;
  display: flex;
  min-height: 150px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--map-border);
  border-radius: 14px;
  background: #ffffff;
}

.download-cards a > span {
  width: fit-content;
  margin-bottom: 18px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #174ea6;
  background: var(--map-blue-soft);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.download-cards :is(strong, .u-strong) {
  color: var(--map-ink);
  font-size: 0.88rem;
}

.download-cards small {
  margin-top: 4px;
  color: var(--map-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.download-cards :is(b, .u-b) {
  margin-top: auto;
  padding-top: 13px;
  color: var(--map-blue);
  font-size: 0.75rem;
}

.map-faq > h2 {
  margin-bottom: 16px;
}

.map-faq details {
  border-top: 1px solid var(--map-border);
}

.map-faq details:last-child {
  border-bottom: 1px solid var(--map-border);
}

.map-faq summary {
  position: relative;
  padding: 16px 38px 16px 0;
  color: var(--map-ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
  list-style: none;
}

.map-faq summary::-webkit-details-marker {
  display: none;
}

.map-faq summary::after {
  position: absolute;
  top: 13px;
  right: 2px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--map-blue);
  background: var(--map-blue-soft);
  content: "+";
  font-size: 1.1rem;
}

.map-faq details[open] summary::after {
  content: "−";
}

.map-faq details p {
  max-width: 850px;
  margin: -2px 0 17px;
  color: var(--map-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.map-page-shell .site-footer {
  margin-top: 30px;
}

button:focus-visible,
.map-page-shell a:focus-visible,
.map-page-shell summary:focus-visible {
  outline: 3px solid rgba(36, 95, 199, 0.35);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .map-hero {
    padding: 18px 0 17px;
  }

  .map-hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
  }

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

  .map-heading {
    display: block;
  }

  .map-updated {
    margin-top: 8px;
  }

  .map-toolbar {
    right: 8px;
    left: 8px;
    justify-content: center;
  }

  .map-toolbar button {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 7px;
  }

  .map-viewport {
    height: min(64vh, 560px);
    min-height: 460px;
  }

  .map-gesture-hint {
    right: 50%;
    transform: translateX(50%);
    white-space: nowrap;
  }

  .map-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-actions a {
    padding-inline: 10px;
  }

  .network-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-line-groups,
  .map-download {
    grid-template-columns: 1fr;
  }

  .map-section-heading > a {
    margin-top: 3px;
    text-align: right;
  }

  .map-editorial aside {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .map-page-shell {
    padding-inline: 12px;
  }

  .map-page-shell .detail-topbar {
    margin-right: -12px;
    margin-left: -12px;
    padding-inline: 12px;
  }

  .map-page-shell .visual-breadcrumbs {
    margin-top: 13px;
  }

  .map-section {
    padding: 18px 15px;
    border-radius: 15px;
  }

  .map-viewport {
    height: 510px;
    min-height: 0;
  }

  .map-toolbar button span {
    font-size: 0.68rem;
  }

  .map-gesture-hint {
    display: none;
  }

  .network-status-grid {
    grid-template-columns: 1fr;
  }

  .network-status-card:nth-child(n + 9) {
    display: none;
  }

  .download-cards {
    grid-template-columns: 1fr;
  }

  .download-cards a {
    min-height: 132px;
  }

  .station-link-cloud a {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .network-status-card,
  .map-canvas {
    transition: none !important;
  }
}
