:root {
  --page: #000;
  --frame: #171717;
  --frame-edge: #303030;
  --panel: #111;
  --panel-soft: #151515;
  --label: #f4efe6;
  --muted: #bdb4a7;
  --subtle: #7f776d;
  --dot: #ffbf47;
  --dot-dim: #39280c;
  --line: rgba(255, 255, 255, 0.13);
  --screen-top: #111;
  --screen-bottom: #070707;
  --danger: #ff6b4a;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 191, 71, 0.04), transparent 320px),
    var(--page);
  color: var(--label);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--label);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--dot);
}

.hero {
  min-height: 68vh;
  display: grid;
  align-content: center;
  gap: 30px;
  padding: 56px 0;
}

.hero.compact {
  min-height: auto;
  padding-bottom: 34px;
}

.board-frame {
  background: linear-gradient(180deg, rgba(27, 27, 27, 0.98), rgba(13, 13, 13, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 26px 70px rgba(0, 0, 0, 0.48);
}

.matrix-screen {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  border: 1px solid rgba(255, 191, 71, 0.13);
  border-radius: 12px;
  background:
    radial-gradient(circle at center, rgba(255, 191, 71, 0.04), transparent 60%),
    linear-gradient(180deg, var(--screen-top), var(--screen-bottom));
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.55),
    inset 0 0 2px rgba(255, 191, 71, 0.16);
}

.matrix-screen canvas {
  display: block;
  max-width: none;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 34px;
  align-items: start;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 760px;
}

.meta-panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.meta-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meta-row strong {
  color: var(--dot);
  text-align: right;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 191, 71, 0.55);
  border-radius: 6px;
  color: var(--dot);
  text-decoration: none;
  font-weight: 700;
}

.button:hover {
  background: rgba(255, 191, 71, 0.12);
}

.section {
  padding: 52px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 22px;
}

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

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

.card {
  padding: 20px;
}

.card h2,
.card h3 {
  margin: 0 0 12px;
  font-size: 1.22rem;
  letter-spacing: 0;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: block;
  margin-bottom: 14px;
  color: var(--dot);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--dot);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.contact-link:hover {
  text-decoration: underline;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.86rem;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.error-card {
  width: min(760px, 100%);
}

.notice {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 20px 0 0;
}

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

.board-page {
  display: grid;
  gap: 24px;
}

.board-settings {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.key-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.key-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--label);
  font: inherit;
}

.key-input::placeholder {
  color: var(--subtle);
}

.key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-subtle {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--muted);
}

.button-subtle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.status-text {
  margin: 16px 0 0;
  color: var(--muted);
}

.live-board {
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.98), rgba(14, 14, 14, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 28px 60px rgba(0, 0, 0, 0.45);
}

.station-switcher {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(220px, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.board-select-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.board-select-field select {
  min-height: 44px;
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 16px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.04);
  color: var(--label);
  font: inherit;
  letter-spacing: 0;
  padding: 0 34px 0 12px;
  cursor: pointer;
}

.route-map {
  margin-top: 24px;
}

.route-map-scroll {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.18);
}

.route-map-canvas {
  width: min(var(--route-map-width, 570px), 100%);
  margin: 0 auto;
}

.route-map-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 620px;
}

.tube-map-title {
  fill: var(--label);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.tube-map-track {
  fill: none;
  stroke: var(--route-line-color, #0098d4);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tube-map-track-shadow {
  stroke: rgba(0, 0, 0, 0.62);
  stroke-width: 22;
}

.route-map-svg[class*="northern"] .tube-map-track-shadow,
.route-map-northern .tube-map-track-shadow {
  stroke: rgba(255, 255, 255, 0.72);
}

.tube-map-interchange-ring {
  fill: #111;
  stroke: #fff;
  stroke-width: 3;
}

.tube-map-node {
  cursor: pointer;
}

.tube-map-hit {
  fill: transparent;
}

.tube-map-dot {
  fill: #111;
  stroke: #fff;
  stroke-width: 3;
}

.tube-map-node.is-active .tube-map-dot,
.tube-map-node:hover .tube-map-dot {
  fill: #ffbf47;
}

.tube-map-label {
  fill: var(--label);
  font-size: 13px;
  letter-spacing: 0;
  pointer-events: none;
}

.tube-map-node.label-left .tube-map-label {
  text-anchor: end;
}

.tube-map-node.label-right .tube-map-label {
  text-anchor: start;
}

.tube-map-node.is-active .tube-map-label {
  fill: #ffbf47;
  font-weight: 700;
}

.route-map-placeholder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.route-map-placeholder span {
  color: var(--label);
  font-weight: 700;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.station-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 0.95;
  font-weight: 700;
}

.station-lines {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-line-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  cursor: pointer;
}

.station-line-chip.is-active {
  color: var(--label);
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.updated-at {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.platforms {
  display: grid;
  gap: 18px;
}

.platform-card {
  background: linear-gradient(180deg, rgba(27, 27, 27, 0.96), rgba(17, 17, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px 18px 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 45px rgba(0, 0, 0, 0.32);
}

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

.platform-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.platform-service {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.matrix-board-canvas {
  display: block;
  width: auto;
  max-width: none;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .hero-copy {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }

  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .board-settings {
    grid-template-columns: 1fr;
  }

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

  .station-header,
  .platform-meta {
    flex-direction: column;
    align-items: start;
  }

  .hero {
    min-height: auto;
  }
}
