@font-face {
  font-family: "Reddit Sans";
  src: url("/dcmetro/fonts/RedditSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Reddit Sans";
  src: url("/dcmetro/fonts/RedditSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Reddit Sans";
  src: url("/dcmetro/fonts/RedditSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Reddit Sans";
  src: url("/dcmetro/fonts/RedditSans-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --metro-navy: #022b50;
  --metro-navy-hover: #063c6d;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --foreground: #09090b;
  --muted-foreground: #686871;
  --border: #dedee3;
  --border-strong: #bfc0c7;
  --focus: #006fb9;
  --danger: #d92d3f;
  --live: #00a26a;
  --header-height: 138px;
  --panel-width: clamp(380px, 30vw, 470px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-float: 0 16px 48px rgb(2 43 80 / 0.14);
  --shadow-control: 0 5px 18px rgb(2 43 80 / 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  font-family: "Reddit Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--foreground);
  background: var(--background);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: 2px;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--metro-navy);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.metro-app {
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  background: var(--background);
}

.app-header {
  position: relative;
  z-index: 50;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 0.96);
  box-shadow: 0 1px 0 rgb(2 43 80 / 0.02);
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) auto minmax(220px, 0.8fr);
  align-items: center;
  min-height: 76px;
  padding: 12px 24px 10px;
  gap: 24px;
}

.metro-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  color: var(--foreground);
  text-decoration: none;
}

.metro-brand img {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand-copy {
  display: grid;
  margin-left: 12px;
  line-height: 1.05;
}

.brand-copy strong {
  color: var(--metro-navy);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
}

.view-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
}

.view-button,
.mobile-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: var(--muted-foreground);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.view-button svg,
.mobile-view-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view-button:hover {
  color: var(--metro-navy);
}

.view-button.is-active {
  color: var(--metro-navy);
  background: var(--surface);
  box-shadow: 0 1px 4px rgb(2 43 80 / 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a1a1aa;
  box-shadow: 0 0 0 4px rgb(161 161 170 / 0.13);
}

.network-status.is-live .status-dot {
  background: var(--live);
  box-shadow: 0 0 0 4px rgb(0 162 106 / 0.12);
}

.network-status.is-stale .status-dot,
.network-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgb(217 45 63 / 0.11);
}

.network-status.is-connecting .status-dot {
  animation: status-pulse 1.25s ease-in-out infinite;
}

@keyframes status-pulse {
  50% { opacity: 0.38; }
}

.site-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--metro-navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.site-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.site-link:hover svg {
  transform: translateX(3px);
}

.control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  align-items: center;
  gap: 24px;
  min-height: 62px;
  padding: 9px 24px 13px;
}

.line-filter {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.line-filter::-webkit-scrollbar {
  display: none;
}

.line-filter-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #3f3f46;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.line-filter-button::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-color, transparent);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
  content: "";
}

.line-filter-button[data-line="all"]::before {
  display: none;
}

.line-filter-button:hover {
  border-color: var(--border-strong);
}

.line-filter-button.is-active {
  border-color: var(--metro-navy);
  color: #fff;
  background: var(--metro-navy);
}

.line-filter-button.is-active::before {
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.45);
}

.line-filter-loading {
  width: 360px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(90deg, #f1f1f3 25%, #fafafa 45%, #f1f1f3 68%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s linear infinite;
}

.station-search {
  position: relative;
}

.station-search > .search-icon,
.directory-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #777780;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.station-search input,
.directory-search input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.station-search input::placeholder,
.directory-search input::placeholder {
  color: #85858e;
}

.station-search input:focus,
.directory-search input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(0 111 185 / 0.12);
}

.station-search kbd {
  position: absolute;
  top: 50%;
  right: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 5px;
  color: #777780;
  background: #f8f8f9;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transform: translateY(-50%);
}

.search-results {
  position: absolute;
  z-index: 100;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(440px, 65vh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-float);
}

.search-result {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-highlighted {
  background: var(--surface-muted);
}

.search-result-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-left: 10px;
}

.search-result-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy span {
  color: var(--muted-foreground);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-width);
  height: calc(100dvh - var(--header-height));
  min-height: calc(620px - var(--header-height));
  overflow: hidden;
}

.view-stack {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-view {
  width: 100%;
  height: 100%;
}

.map-view {
  background: #eef1f2;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #eef1f2;
  background-image: radial-gradient(circle, rgb(2 43 80 / 0.13) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-stage.is-dragging {
  cursor: grabbing;
}

.map-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90%, calc((100dvh - var(--header-height) - 48px) * 0.92));
  aspect-ratio: 3090 / 3357;
  transform: translate(calc(-50% + var(--map-x, 0px)), calc(-50% + var(--map-y, 0px))) scale(var(--map-scale, 1));
  transform-origin: center;
  will-change: transform;
}

.map-canvas::after {
  position: absolute;
  z-index: -1;
  inset: 1.5% 1.5% 0;
  border-radius: 3px;
  box-shadow: 0 12px 45px rgb(2 43 80 / 0.12);
  content: "";
}

.map-canvas > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.station-hotspots {
  position: absolute;
  inset: 0;
}

.station-hotspot {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--metro-navy);
  background: transparent;
  transform: translate(-50%, -50%) scale(var(--marker-scale, 1));
  cursor: pointer;
}

.station-hotspot::before {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--metro-navy);
  box-shadow: 0 1px 4px rgb(2 43 80 / 0.45);
  content: "";
  opacity: 0;
  transition: width 120ms ease, height 120ms ease, opacity 120ms ease, background-color 120ms ease;
}

.station-hotspot:hover,
.station-hotspot:focus-visible,
.station-hotspot.is-selected,
.station-hotspot.is-nearest {
  z-index: 8;
}

.station-hotspot:hover::before,
.station-hotspot:focus-visible::before,
.station-hotspot.is-selected::before,
.station-hotspot.is-nearest::before {
  width: 12px;
  height: 12px;
  opacity: 1;
}

.station-hotspot.is-selected::before {
  background: var(--danger);
}

.station-hotspot.is-nearest::after {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--focus);
  border-radius: 50%;
  content: "";
  animation: nearest-pulse 1.8s ease-out infinite;
}

@keyframes nearest-pulse {
  0% { opacity: 0.85; transform: scale(0.45); }
  100% { opacity: 0; transform: scale(1.45); }
}

.station-hotspot.is-dimmed {
  pointer-events: none;
  opacity: 0.16;
}

.hotspot-label {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  max-width: 170px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--metro-navy);
  box-shadow: 0 3px 12px rgb(2 43 80 / 0.24);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.station-hotspot:hover .hotspot-label,
.station-hotspot:focus-visible .hotspot-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.map-caption {
  position: absolute;
  z-index: 12;
  top: 18px;
  left: 18px;
  display: grid;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 10px;
  background: rgb(2 43 80 / 0.92);
  box-shadow: var(--shadow-control);
  color: #fff;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.map-caption strong {
  font-size: 14px;
  font-weight: 800;
}

.map-caption span {
  margin-top: 3px;
  color: rgb(255 255 255 / 0.73);
  font-size: 11px;
  line-height: 1.35;
}

.map-controls {
  position: absolute;
  z-index: 12;
  right: 18px;
  bottom: 18px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-control);
}

.map-controls button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--metro-navy);
  background: transparent;
  cursor: pointer;
}

.map-controls button:last-child {
  border-bottom: 0;
}

.map-controls button:hover {
  background: var(--surface-muted);
}

.map-controls svg,
.locate-map-button svg,
.primary-button svg,
.panel-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.locate-map-button {
  position: absolute;
  z-index: 12;
  right: 76px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--metro-navy);
  background: #fff;
  box-shadow: var(--shadow-control);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.locate-map-button:hover {
  background: var(--surface-muted);
}

.nearby-view,
.stations-view {
  padding: clamp(24px, 3vw, 44px);
  overflow-y: auto;
  background: var(--background);
  scrollbar-gutter: stable;
}

.content-view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto 28px;
}

.content-view-header .eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--metro-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.content-view-header h1 {
  margin: 0;
  color: var(--metro-navy);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.content-view-header p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: 1.45;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--metro-navy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}

.primary-button:hover {
  background: var(--metro-navy-hover);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.location-message {
  max-width: 1320px;
  margin: -10px auto 20px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.location-message:empty {
  display: none;
}

.location-message.is-error {
  padding: 12px 14px;
  border: 1px solid rgb(217 45 63 / 0.22);
  border-radius: 9px;
  color: #a7192c;
  background: rgb(217 45 63 / 0.06);
}

.nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  align-items: start;
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
}

.nearby-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.nearby-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nearby-card-header:hover {
  background: #fafafa;
}

.nearby-card-header h2 {
  margin: 0;
  color: var(--metro-navy);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nearby-card-header p {
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.distance-label {
  margin-left: 12px;
  color: var(--metro-navy);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.nearby-board {
  padding: 14px 16px 16px;
}

.station-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto;
}

.directory-search {
  position: relative;
  display: block;
  width: min(100%, 340px);
}

.directory-search input {
  padding-right: 14px;
}

.station-directory-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 72px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.station-directory-button:hover {
  border-color: var(--border-strong);
  background: #fff;
  transform: translateY(-1px);
}

.station-directory-button.is-selected {
  border-color: var(--metro-navy);
  box-shadow: inset 0 0 0 1px var(--metro-navy);
}

.station-directory-copy {
  min-width: 0;
}

.station-directory-copy strong {
  display: block;
  overflow: hidden;
  color: var(--metro-navy);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-directory-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-dots {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 10px;
}

.line-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid rgb(0 0 0 / 0.12);
  border-radius: 50%;
  background: var(--line-color, #a1a1aa);
}

.line-dot + .line-dot {
  margin-left: -3px;
  box-shadow: 0 0 0 2px #fff;
}

.station-panel {
  position: relative;
  z-index: 30;
  min-width: 0;
  height: 100%;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.station-panel-content {
  height: 100%;
  padding: 24px 20px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.panel-close,
.panel-drag-handle {
  display: none;
}

.station-heading {
  padding-right: 12px;
}

.station-heading h2 {
  margin: 0;
  color: var(--metro-navy);
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.station-line-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.line-badge {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 50%;
  color: var(--line-text-color, #fff);
  background: var(--line-color, #a1a1aa);
  font-size: 12px;
  font-weight: 800;
}

.station-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.station-address {
  margin: 0;
  color: #27272a;
  font-size: 13px;
  line-height: 1.4;
}

.station-address span {
  color: var(--muted-foreground);
}

.station-map-link {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 5px;
  color: var(--metro-navy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.station-map-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-distance {
  margin-top: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.amenity {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 6px;
  color: #5e5e67;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 600;
}

.panel-section {
  margin-top: 25px;
}

.panel-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-section-heading h3 {
  margin: 0;
  color: var(--metro-navy);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-section-heading span,
.panel-section-heading button {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
}

.refresh-button {
  padding: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.refresh-button:hover {
  color: var(--metro-navy);
}

.departure-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.departure-line {
  padding: 13px 14px;
  background: #fff;
}

.departure-line + .departure-line {
  border-top: 1px solid var(--border);
}

.departure-line-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #27272a;
  font-size: 14px;
  font-weight: 800;
}

.departure-line-title .line-dot {
  width: 13px;
  height: 13px;
  margin: 0;
  box-shadow: none;
}

.direction-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, auto);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 0;
}

.direction-row + .direction-row {
  border-top: 1px solid #ececef;
}

.direction-name {
  overflow: hidden;
  color: var(--metro-navy);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.departure-times {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 5px;
}

.departure-time {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 35px;
  height: 31px;
  padding: 0 6px;
  border-radius: 6px;
  color: #27272a;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.departure-time small {
  margin-left: 2px;
  color: var(--muted-foreground);
  font-size: 8px;
  font-weight: 600;
}

.departure-time.is-arriving {
  color: #b0162c;
  background: rgb(217 45 63 / 0.1);
  animation: arrival-pulse 1.8s ease-in-out infinite;
}

@keyframes arrival-pulse {
  50% { box-shadow: 0 0 0 3px rgb(217 45 63 / 0.08); }
}

.board-empty,
.board-error {
  padding: 24px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.board-error {
  border-color: rgb(217 45 63 / 0.22);
  color: #9e2132;
  background: rgb(217 45 63 / 0.04);
}

.schedule-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.schedule-tab {
  min-height: 31px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-foreground);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.schedule-tab.is-active {
  color: var(--metro-navy);
  background: #fff;
  box-shadow: 0 1px 3px rgb(2 43 80 / 0.1);
}

.schedule-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 11px;
}

.schedule-table th {
  padding: 7px 5px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 9px;
  font-weight: 700;
  text-align: left;
}

.schedule-table th:nth-child(n + 2),
.schedule-table td:nth-child(n + 2) {
  text-align: right;
}

.schedule-table td {
  padding: 8px 5px;
  border-bottom: 1px solid #eeeeef;
  color: #3f3f46;
  font-variant-numeric: tabular-nums;
}

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

.schedule-destination {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  text-align: left;
}

.schedule-code {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--line-text-color, #fff);
  background: var(--line-color, #a1a1aa);
  font-size: 8px;
  font-weight: 800;
}

.schedule-disclaimer {
  margin: 8px 0 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.4;
}

.panel-loading {
  padding-top: 8px;
}

.skeleton {
  border-radius: 9px;
  background: linear-gradient(90deg, #eeeef0 25%, #fafafa 46%, #eeeef0 68%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.35s linear infinite;
}

@keyframes skeleton-wave {
  to { background-position: -200% 0; }
}

.skeleton-title {
  width: 70%;
  height: 38px;
}

.skeleton-lines {
  width: 42%;
  height: 30px;
  margin-top: 13px;
}

.skeleton-info {
  width: 100%;
  height: 112px;
  margin-top: 22px;
}

.skeleton-board {
  width: 100%;
  height: 210px;
  margin-top: 28px;
}

.skeleton-board-short {
  height: 160px;
  margin-top: 16px;
}

.empty-directory {
  grid-column: 1 / -1;
  padding: 64px 20px;
  color: var(--muted-foreground);
  font-size: 14px;
  text-align: center;
}

.mobile-view-switcher {
  display: none;
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 24px;
  max-width: min(90vw, 460px);
  padding: 11px 14px;
  border-radius: 9px;
  color: #fff;
  background: var(--metro-navy);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  font-weight: 600;
  transform: translateX(-50%);
}

@media (max-width: 1180px) {
  :root {
    --panel-width: 380px;
  }

  .brand-row {
    grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  }

  .header-actions {
    gap: 10px;
  }

  .site-link span,
  .status-label {
    display: none;
  }

  .network-status {
    width: 28px;
    height: 28px;
    justify-content: center;
  }

  .view-button {
    min-width: 92px;
  }

  .nearby-view,
  .stations-view {
    padding-inline: 24px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 128px;
  }

  .metro-app {
    min-height: 100dvh;
  }

  .brand-row {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    padding: 10px 16px 8px;
  }

  .view-switcher,
  .network-status,
  .site-link span {
    display: none;
  }

  .site-link {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 9px;
  }

  .site-link svg {
    transform: rotate(180deg);
  }

  .control-row {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 43vw);
    min-height: 60px;
    padding: 8px 16px 10px;
    gap: 12px;
  }

  .workspace {
    display: block;
    height: calc(100dvh - var(--header-height) - 68px);
  }

  .view-stack {
    width: 100%;
    height: 100%;
  }

  .station-panel {
    position: fixed;
    z-index: 120;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(82dvh, 760px);
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 60px rgb(2 43 80 / 0.2);
    transform: translateY(calc(100% + 16px));
    visibility: hidden;
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 240ms;
  }

  .station-panel.is-open {
    transform: translateY(0);
    visibility: visible;
  }

  .station-panel-content {
    padding: 38px 18px calc(32px + env(safe-area-inset-bottom));
  }

  .panel-drag-handle {
    position: absolute;
    z-index: 2;
    top: 9px;
    left: 50%;
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 10px;
    background: #d4d4d8;
    transform: translateX(-50%);
  }

  .panel-close {
    position: absolute;
    z-index: 4;
    top: 17px;
    right: 15px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--metro-navy);
    background: #fff;
    cursor: pointer;
  }

  .mobile-view-switcher {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 5px 14px env(safe-area-inset-bottom);
    border-top: 1px solid rgb(255 255 255 / 0.13);
    background: var(--metro-navy);
  }

  .mobile-view-button {
    display: grid;
    align-content: center;
    justify-items: center;
    justify-self: stretch;
    gap: 3px;
    min-width: 0;
    height: auto;
    padding: 2px 0;
    border-radius: 7px;
    color: rgb(255 255 255 / 0.62);
    font-size: 11px;
  }

  .mobile-view-button svg {
    width: 21px;
    height: 21px;
  }

  .mobile-view-button.is-active {
    color: #fff;
  }

  .mobile-view-button.is-active svg {
    color: #ffd200;
  }

  .map-caption {
    top: 12px;
    left: 12px;
    max-width: 250px;
    padding: 9px 11px;
  }

  .map-caption span {
    display: none;
  }

  .map-controls {
    right: 12px;
    bottom: 12px;
  }

  .locate-map-button {
    right: 70px;
    bottom: 12px;
  }

  .nearby-view,
  .stations-view {
    padding: 24px 18px 40px;
  }

  .content-view-header {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  :root {
    --header-height: 118px;
  }

  .brand-row {
    min-height: 58px;
    padding-block: 8px 5px;
  }

  .metro-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .brand-copy {
    margin-left: 9px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .brand-copy span {
    margin-top: 3px;
    font-size: 10px;
  }

  .site-link {
    width: 36px;
    height: 36px;
  }

  .control-row {
    grid-template-columns: minmax(0, 1fr);
    min-height: 60px;
    padding: 6px 12px 9px;
  }

  .line-filter {
    order: 2;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .line-filter-button {
    height: 31px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 11px;
  }

  .line-filter-loading {
    height: 31px;
  }

  .station-search {
    position: absolute;
    top: 8px;
    right: 58px;
    left: 170px;
  }

  .station-search input {
    height: 36px;
    padding: 0 34px 0 34px;
    font-size: 13px;
  }

  .station-search > .search-icon {
    left: 11px;
    width: 16px;
    height: 16px;
  }

  .station-search kbd {
    display: none;
  }

  .search-results {
    position: fixed;
    top: 57px;
    right: 10px;
    left: 10px;
    max-height: 55vh;
  }

  .workspace {
    height: calc(100dvh - var(--header-height) - 68px);
  }

  .map-canvas {
    width: min(95%, calc((100dvh - var(--header-height) - 92px) * 0.92));
  }

  .locate-map-button span {
    display: none;
  }

  .locate-map-button {
    width: 42px;
    padding: 0;
  }

  .content-view-header {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
  }

  .content-view-header h1 {
    font-size: 34px;
  }

  .content-view-header p {
    font-size: 13px;
  }

  .primary-button {
    justify-self: start;
  }

  .stations-header .directory-search {
    width: 100%;
  }

  .nearby-grid {
    grid-template-columns: 1fr;
  }

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

  .station-directory-button {
    min-height: 62px;
  }

  .direction-row {
    grid-template-columns: minmax(86px, 1fr) minmax(0, auto);
    gap: 7px;
  }

  .departure-time:nth-child(n + 4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
