:root {
  --bg: #07131d;
  --panel: rgba(7, 22, 34, 0.88);
  --panel-border: rgba(155, 208, 255, 0.14);
  --panel-soft: rgba(14, 33, 48, 0.88);
  --ink: #ebf6ff;
  --muted: #8da7bc;
  --accent: #7ecbff;
  --accent-strong: #23b5ff;
  --map-frame: #0d1117;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(31, 126, 201, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 196, 75, 0.14), transparent 22%),
    linear-gradient(180deg, #08111a, #061019 45%, #040b12);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background:
    linear-gradient(98deg, rgba(3, 8, 14, 0.44), rgba(8, 17, 28, 0.2) 58%, rgba(8, 17, 28, 0.54)),
    linear-gradient(90deg, rgba(49, 132, 193, 0.1), rgba(255, 187, 73, 0.04)),
    url("../../../images/bg.jpg");
  background-position: center 38%;
  background-size: cover;
  border-bottom: 1px solid rgba(126, 203, 255, 0.14);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 72px;
  padding: 6px 10px;
  position: relative;
  z-index: 10;
}

body.header-collapsed .site-header {
  gap: 6px;
  min-height: 52px;
  padding-bottom: 6px;
  padding-top: 6px;
}

body.header-collapsed .eyebrow {
  display: none;
}

body.header-collapsed .logo-link {
  font-size: 1.02rem;
}

body.header-collapsed #header-toggle-btn svg {
  transform: rotate(180deg);
}

.site-header::after {
  background: linear-gradient(90deg, rgba(90, 166, 237, 0.35), rgba(227, 32, 23, 0.22), transparent);
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.eyebrow {
  color: #8fcfff;
  font-family: "Oswald", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  margin: 2px 0 0;
  text-transform: uppercase;
}

.site-mark {
  backdrop-filter: blur(6px);
  background: linear-gradient(90deg, rgba(5, 13, 21, 0.68), rgba(5, 13, 21, 0.16));
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 4px 8px 5px;
}

.logo-link {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-family: "Taviraj", serif;
  font-size: clamp(0.92rem, 1.18vw, 1.24rem);
  font-weight: 600;
  gap: 8px;
  line-height: 1.05;
  text-decoration: none;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.32);
}

.logo-credit {
  color: rgba(255, 255, 255, 0.62);
  font-family: "Oswald", sans-serif;
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-left: 2px;
  text-transform: uppercase;
}

.apple-emoji {
  display: inline-block;
  flex-shrink: 0;
  font-size: 1.22em;
  line-height: 1;
  transform: translateY(1px);
}

.header-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  position: relative;
  justify-content: flex-end;
  max-width: 520px;
}

body.cute-mode #cute-mode-btn,
body.cute-mode-dessert #cute-mode-btn,
body.cute-mode-animal #cute-mode-btn {
  background: rgba(255, 214, 230, 0.18);
  border-color: rgba(255, 214, 230, 0.36);
}

.status-pill,
.icon-btn,
.toolbar-btn,
.ghost-btn,
.legend-item {
  border: 1px solid transparent;
}

.status-pill,
.icon-btn,
.toolbar-btn,
.ghost-btn {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.status-pill {
  align-items: center;
  display: inline-flex;
  font-size: 0.67rem;
  gap: 3px;
  padding: 5px 9px;
}

.status-dot {
  background: #ffb648;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 182, 72, 0.6);
  height: 8px;
  width: 8px;
}

.status-pill.status-live .status-dot {
  background: #35e58c;
  box-shadow: 0 0 10px rgba(53, 229, 140, 0.7);
}

.status-pill.status-error .status-dot {
  background: #ff6478;
  box-shadow: 0 0 10px rgba(255, 100, 120, 0.7);
}

.icon-btn,
.toolbar-btn,
.ghost-btn {
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover,
.toolbar-btn:hover,
.ghost-btn:hover,
.legend-item:hover {
  background: rgba(126, 203, 255, 0.14);
  border-color: rgba(126, 203, 255, 0.3);
}

.icon-btn:active,
.toolbar-btn:active,
.ghost-btn:active {
  transform: translateY(1px);
}

.icon-btn {
  min-height: 28px;
  padding: 5px 8px;
}

.icon-btn svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.mobile-only-btn {
  display: none;
}

#legend-toggle-btn {
  display: none;
}

#sidebar-desktop-toggle-btn {
  display: inline-flex;
}

.app-shell {
  display: grid;
  gap: 10px;
  grid-template-columns: 258px minmax(0, 1fr);
  height: calc(100vh - 72px);
  padding: 12px;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  display: grid;
  gap: 10px;
  min-height: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.sidebar-collapsed .sidebar {
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-12px);
}

.sidebar-card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  padding: 2px 9px 4px;
}

.section-head h2 {
  font-family: "Archivo Expanded", sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.section-head span {
  color: var(--muted);
  font-size: 0.66rem;
}

.sidebar-weather {
  background: linear-gradient(180deg, rgba(126, 203, 255, 0.14), rgba(8, 22, 35, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: grid;
  gap: 10px;
  margin: 4px 8px 4px;
  padding: 10px 12px 6px;
}

.sidebar-weather-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.sidebar-weather-kicker {
  color: rgba(240, 246, 255, 0.68);
  font-family: "Archivo Expanded", sans-serif;
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-weather-updated {
  color: rgba(224, 239, 249, 0.52);
  font-size: 0.62rem;
}

.sidebar-weather-main {
  display: grid;
  gap: 8px;
}

.sidebar-weather-temp-wrap {
  align-items: center;
  display: flex;
  gap: 10px;
}

.sidebar-weather-icon {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}

.sidebar-weather-temp {
  color: var(--ink);
  font-family: "Taviraj", serif;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
}

.sidebar-weather-summary,
.sidebar-weather-wind {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

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

.sidebar-weather-day {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 6px;
  place-items: center;
  text-align: center;
}

.sidebar-weather-day-label {
  color: rgba(240, 246, 255, 0.72);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-weather-day-icon {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size: 1.05rem;
  line-height: 1.1;
}

.sidebar-weather-day-temp {
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.legend-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
}

.legend {
  align-content: start;
  display: grid;
  gap: 14px;
  grid-auto-rows: min-content;
  min-height: 0;
  overflow: auto;
  padding: 0 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.legend::-webkit-scrollbar {
  width: 4px;
}

.legend::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
}

.legend-section {
  display: grid;
  gap: 6px;
  padding: 0 5px;
}

.legend-section-title {
  color: rgba(240, 246, 255, 0.62);
  font-family: "Archivo Expanded", sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  padding: 0 6px;
  text-transform: uppercase;
}

.legend-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  padding: 8px 8px;
  text-align: left;
  width: 100%;
}

.legend-group {
  align-items: stretch;
  min-width: 0;
  padding: 8px 8px;
}

.legend-item.is-focused {
  background: rgba(126, 203, 255, 0.13);
}

.legend-item.is-muted {
  opacity: 0.42;
}

.route-pill {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-family: "Archivo Expanded", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  height: 27px;
  justify-content: center;
  min-width: 27px;
  padding: 0;
  flex-shrink: 0;
  border: 0;
}

.route-pill.is-focused {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92), 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.route-pill.is-cute {
  aspect-ratio: auto;
  gap: 4px;
  min-width: 40px;
  padding: 0 6px;
}

.legend-pills {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.legend-routes {
  align-items: center;
  display: flex;
  min-width: 0;
}

.route-token {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.route-token-count {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.legend-copy {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
  min-width: 0;
  text-align: right;
}

.legend-count {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.legend-status {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.legend-status.is-live {
  border-color: rgba(0, 200, 100, 0.34);
  color: #7cf0b2;
}

.legend-caption {
  color: var(--muted);
  display: block;
  font-size: 0.52rem;
  line-height: 1.4;
  max-width: none;
  text-align: right;
}

.legend-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 5px 6px;
}

.map-panel {
  min-width: 0;
  position: relative;
}

.decor-panel-bg {
  fill: rgba(8, 22, 35, 0.82);
  stroke: rgba(130, 203, 255, 0.16);
  stroke-width: 1.2;
}

.decor-panel-glow {
  fill: rgba(255, 192, 92, 0.14);
}

.decor-sky-disc {
  fill: rgba(255, 202, 109, 0.88);
  opacity: 0.95;
}

.decor-panel-line {
  stroke: rgba(126, 203, 255, 0.2);
  stroke-width: 2;
}

.decor-route-band {
  fill: none;
  stroke: rgba(255, 184, 72, 0.56);
  stroke-linecap: round;
  stroke-width: 5;
}

.decor-image-frame {
  fill: none;
  stroke: none;
}

.decor-image-shade {
  fill: url(#decor-image-shade-gradient);
  fill: rgba(0, 0, 0, 0.22);
}

.decor-art-image {
  filter: saturate(1.04) brightness(1.08) contrast(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
  opacity: 1;
}

.decor-art-tint-cyan {
  fill: transparent;
  mix-blend-mode: screen;
}

.decor-art-tint-magenta {
  fill: transparent;
  mix-blend-mode: screen;
}

.decor-route-dot {
  fill: rgba(126, 203, 255, 0.9);
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 1;
}

.decor-route-dot-label {
  fill: #061019;
  font-family: "Archivo Expanded", sans-serif;
  font-size: 9px;
  font-weight: 700;
  dominant-baseline: central;
  text-anchor: middle;
}

.decor-weather-icon {
  fill: #f7fbff;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size: 46px;
}

.decor-weather-temp {
  fill: #f7fbff;
  font-family: "Taviraj", serif;
  font-size: 44px;
  font-weight: 600;
}

.decor-weather-meta {
  fill: rgba(224, 239, 249, 0.66);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.decor-weather-forecast-icon {
  fill: #f7fbff;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size: 20px;
}

.decor-weather-forecast-temp {
  fill: #f7fbff;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.decor-harbor-wave {
  fill: none;
  stroke: rgba(126, 203, 255, 0.42);
  stroke-linecap: round;
  stroke-width: 3;
}

.decor-panel-haze {
  fill: rgba(255, 255, 255, 0.06);
}

.decor-skyline-back {
  fill: rgba(67, 109, 141, 0.34);
}

.decor-skyline-front {
  fill: rgba(126, 203, 255, 0.68);
}

.decor-bridge-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-linecap: round;
  stroke-width: 2.6;
}

.decor-bridge-deck {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-linecap: round;
  stroke-width: 3.2;
}

.decor-bridge-cable {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-linecap: round;
  stroke-width: 1.4;
}

.decor-water {
  fill: rgba(27, 69, 99, 0.72);
}

.decor-liberty {
  fill: rgba(104, 181, 214, 0.86);
  stroke: rgba(255, 255, 255, 0.22);
  stroke-linejoin: round;
  stroke-width: 1;
}

.decor-liberty-arm {
  fill: rgba(104, 181, 214, 0.86);
}

.decor-liberty-flame {
  fill: rgba(255, 196, 75, 0.96);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.8;
}

.decor-liberty-base {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 0.8;
}

.decor-empire-spire {
  fill: rgba(255, 255, 255, 0.4);
}

.decor-crown {
  fill: rgba(255, 255, 255, 0.34);
}

.decor-reflection {
  fill: none;
  stroke: rgba(255, 202, 109, 0.24);
  stroke-linecap: round;
  stroke-width: 3.2;
}

.decor-panel-kicker {
  fill: #8fcfff;
  font-family: "Oswald", sans-serif;
  font-size: 10px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.decor-panel-title {
  fill: #f5fbff;
  font-family: "Taviraj", serif;
  font-size: 28px;
  font-weight: 600;
}

.decor-panel-copy {
  fill: rgba(224, 239, 249, 0.82);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.decor-panel-bar {
  fill: rgba(126, 203, 255, 0.78);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.8;
}

.map-toolbar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(6, 20, 31, 0.72);
  border: 1px solid rgba(126, 203, 255, 0.18);
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  left: 12px;
  bottom: 14px;
  padding: 6px;
  position: absolute;
  z-index: 5;
}

.toolbar-btn {
  color: var(--ink);
  height: 34px;
  min-width: 34px;
}

.toolbar-btn-wide {
  padding: 0 16px;
}

.zoom-level {
  color: var(--muted);
  min-width: 52px;
  text-align: center;
}

.map-shell {
  background:
    linear-gradient(180deg, rgba(5, 16, 24, 0.92), rgba(4, 11, 19, 0.98)),
    radial-gradient(circle at center, rgba(22, 57, 82, 0.35), transparent 55%);
  border: 1px solid rgba(126, 203, 255, 0.12);
  border-radius: 24px;
  box-shadow: var(--shadow);
  height: 100%;
  overscroll-behavior: contain;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.map-frame {
  cursor: grab;
  height: 100%;
  position: relative;
  touch-action: none;
  transform-origin: 0 0;
  user-select: none;
  width: 100%;
}

body.map-loading .map-frame {
  opacity: 0;
  visibility: hidden;
}

body.map-ready .map-frame {
  opacity: 1;
  visibility: visible;
}

.map-frame.is-panning {
  cursor: grabbing;
}

.map-base,
.map-object,
.overlay-svg,
.train-canvas {
  inset: 0;
  position: absolute;
}

.map-base,
.map-object {
  z-index: 1;
}

.map-object,
.map-base svg,
.overlay-svg,
.train-canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.map-object {
  background: transparent;
  border: 0;
  filter: none;
  pointer-events: none;
}

.map-base svg {
  background: transparent;
  filter: none;
}

.overlay-svg {
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.train-canvas {
  cursor: inherit;
  display: none;
  pointer-events: none;
  z-index: 3;
}

.station-ring {
  fill: none;
  stroke: #ffe08a;
  stroke-width: 3;
}

.station-pin {
  fill: #ffd96a;
  stroke: #0b1620;
  stroke-width: 1.5;
}

.train-marker {
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}

.train-core {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 2.2;
}

.train-halo {
  opacity: 0.18;
}

.train-marker.is-stale {
  opacity: 0.58;
}

.train-label {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 10.2px;
  font-weight: 700;
  letter-spacing: 0;
  paint-order: normal;
  stroke: none;
  stroke-width: 0;
  text-anchor: middle;
  dominant-baseline: central;
}

.train-arrow {
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

body.focus-mode .map-base svg,
body.focus-mode .map-object {
  filter: brightness(0.12) saturate(0.18) contrast(0.92);
}

body.focus-mode .train-marker.is-muted {
  opacity: 0.015;
}

body.focus-mode .train-marker.is-focused {
  opacity: 1;
}

.focus-path-underlay,
.focus-path-stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.focus-path-underlay {
  display: none;
}

.focus-path-stroke {
  opacity: 0.98;
  filter: none;
}

.tooltip {
  backdrop-filter: blur(16px);
  background: rgba(6, 18, 30, 0.95);
  border: 1px solid rgba(126, 203, 255, 0.18);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 360px;
  min-width: 280px;
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 30;
}

.tooltip-route {
  font-family: "Archivo Expanded", sans-serif;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.tooltip-heading {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 4px;
}

.tooltip-trip,
.tooltip-detail,
.tooltip-meta {
  color: var(--muted);
  font-size: 0.83rem;
}

.tooltip-trip {
  margin-bottom: 4px;
}

.tooltip-detail {
  color: #f2f7fd;
  line-height: 1.45;
}

.tooltip-detail-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 0;
}

.tooltip-detail-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.tooltip-meta {
  margin-top: 5px;
}

.icon-only-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.icon-only-btn.is-active {
  background: rgba(126, 203, 255, 0.16);
  border-color: rgba(126, 203, 255, 0.34);
}

.icon-only-btn svg {
  fill: none;
  height: 15px;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 15px;
}

.header-search-form {
  backdrop-filter: blur(10px);
  background: rgba(9, 16, 29, 0.96);
  border: 1px solid rgba(143, 188, 241, 0.2);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  display: none;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 28px));
  z-index: 15;
}

.header-search-form label {
  display: none;
}

.header-search-row {
  align-items: center;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.header-search-form input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: #f2f7fd;
  min-height: 32px;
  min-width: 0;
  padding: 0 10px;
}

.header-search-form input::placeholder {
  color: rgba(225, 235, 247, 0.48);
}

.header-search-form input:focus {
  border-color: rgba(90, 166, 237, 0.55);
  box-shadow: 0 0 0 3px rgba(90, 166, 237, 0.12);
  outline: none;
}

.header-search-form button {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: rgba(242, 247, 253, 0.94);
  cursor: pointer;
  min-height: 32px;
  padding: 0 9px;
}

.header-search-form button:hover {
  background: rgba(90, 166, 237, 0.14);
  border-color: rgba(90, 166, 237, 0.38);
}

body.station-search-open #station-search-form {
  display: block;
}

body.theme-light {
  --bg: #f6f1e7;
  --panel: rgba(255, 251, 245, 0.9);
  --panel-border: rgba(88, 115, 138, 0.14);
  --panel-soft: rgba(246, 241, 233, 0.92);
  --ink: #182a38;
  --muted: #6c8191;
  --map-frame: #e5ddd2;
  background:
    radial-gradient(circle at top left, rgba(103, 147, 186, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(214, 160, 89, 0.13), transparent 22%),
    linear-gradient(180deg, #f8f4ec, #efe7dc 48%, #e4d9cc);
}

body.theme-light .site-header {
  background:
    linear-gradient(120deg, rgba(255, 251, 244, 0.78), rgba(241, 232, 219, 0.52)),
    linear-gradient(90deg, rgba(103, 147, 186, 0.08), rgba(214, 160, 89, 0.08)),
    url("../../../images/bg.jpg");
  background-position: center 38%;
  background-size: cover;
  border-bottom-color: rgba(85, 115, 136, 0.16);
}

body.theme-light .site-mark {
  background: linear-gradient(90deg, rgba(255, 250, 244, 0.86), rgba(255, 250, 244, 0.34));
}

body.theme-light .logo-link {
  color: #213241;
  text-shadow: none;
}

body.theme-light .logo-credit {
  color: rgba(33, 50, 65, 0.62);
}

body.theme-light .eyebrow {
  color: #5b86a8;
}

body.theme-light .status-pill,
body.theme-light .icon-btn,
body.theme-light .toolbar-btn,
body.theme-light .ghost-btn,
body.theme-light .legend-item,
body.theme-light .control-row input {
  background: rgba(255, 250, 244, 0.78);
  border-color: rgba(88, 115, 138, 0.12);
  box-shadow: 0 10px 24px rgba(120, 100, 76, 0.06);
}

body.theme-light .map-shell {
  background:
    linear-gradient(180deg, rgba(248, 243, 235, 0.98), rgba(232, 223, 212, 0.98)),
    radial-gradient(circle at center, rgba(115, 145, 171, 0.12), transparent 58%);
}

body.theme-light .map-object,
body.theme-light .map-base svg {
  background: transparent;
}

body.theme-light .map-toolbar {
  background: rgba(255, 250, 244, 0.86);
  border-color: rgba(88, 115, 138, 0.14);
}

body.theme-light .map-object,
body.theme-light .map-base svg {
  filter: invert(1) hue-rotate(180deg) brightness(1.02) saturate(0.7) contrast(0.94) sepia(0.08);
}

body.theme-light.focus-mode .map-base svg,
body.theme-light.focus-mode .map-object {
  filter: invert(1) hue-rotate(180deg) brightness(0.84) saturate(0.66) contrast(0.96) sepia(0.06);
}

body.theme-light .zoom-level {
  color: #5c7383;
}

body.theme-light .tooltip {
  background: rgba(255, 250, 244, 0.96);
  border-color: rgba(104, 133, 154, 0.18);
  box-shadow: 0 18px 44px rgba(96, 84, 70, 0.14);
}

body.theme-light .tooltip-route {
  color: #557da1;
}

body.theme-light .tooltip-heading {
  color: #213241;
}

body.theme-light .tooltip-trip,
body.theme-light .tooltip-meta {
  color: #6c8191;
}

body.theme-light .tooltip-detail {
  color: #213241;
}

body.theme-light .tooltip-detail-row {
  border-top-color: rgba(33, 50, 65, 0.08);
}

body.theme-light .icon-only-btn svg {
  stroke: rgba(33, 50, 65, 0.84);
}

body.theme-light .map-corner-story {
  color: inherit;
}

body.theme-light .decor-panel-bg {
  fill: rgba(255, 250, 244, 0.94);
  stroke: rgba(104, 133, 154, 0.16);
}

body.theme-light .sidebar-weather {
  background: linear-gradient(180deg, rgba(103, 147, 186, 0.12), rgba(255, 250, 244, 0.84));
  border-color: rgba(33, 50, 65, 0.08);
}

body.theme-light .sidebar-weather-kicker {
  color: #5b86a8;
}

body.theme-light .sidebar-weather-updated,
body.theme-light .sidebar-weather-day-label {
  color: #6c8191;
}

body.theme-light .sidebar-weather-day {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(33, 50, 65, 0.08);
}

body.theme-light .decor-panel-glow {
  fill: rgba(214, 160, 89, 0.18);
}

body.theme-light .decor-sky-disc {
  fill: rgba(214, 160, 89, 0.86);
}

body.theme-light .decor-panel-line {
  stroke: rgba(103, 147, 186, 0.2);
}

body.theme-light .decor-route-band {
  stroke: rgba(214, 160, 89, 0.62);
}

body.theme-light .decor-image-frame {
  fill: none;
  stroke: none;
}

body.theme-light .decor-image-shade {
  fill: rgba(255, 250, 244, 0.08);
}

body.theme-light .decor-art-image {
  filter: saturate(0.96) brightness(1.01) contrast(1.02);
  opacity: 0.98;
}

body.theme-light .decor-art-tint-cyan,
body.theme-light .decor-art-tint-magenta {
  fill: transparent;
}

body.theme-light .decor-route-dot {
  fill: rgba(103, 147, 186, 0.88);
  stroke: rgba(33, 50, 65, 0.16);
}

body.theme-light .decor-route-dot-label {
  fill: #f8f4ec;
}

body.theme-light .decor-weather-icon,
body.theme-light .decor-weather-temp {
  fill: #213241;
}

body.theme-light .decor-weather-meta {
  fill: #6c8191;
}

body.theme-light .decor-weather-forecast-icon,
body.theme-light .decor-weather-forecast-temp {
  fill: #213241;
}

body.theme-light .decor-harbor-wave {
  stroke: rgba(103, 147, 186, 0.46);
}

body.theme-light .decor-panel-haze {
  fill: rgba(255, 255, 255, 0.18);
}

body.theme-light .decor-skyline-back {
  fill: rgba(132, 153, 170, 0.4);
}

body.theme-light .decor-skyline-front {
  fill: rgba(103, 147, 186, 0.76);
}

body.theme-light .decor-bridge-arc,
body.theme-light .decor-bridge-deck {
  stroke: rgba(33, 50, 65, 0.24);
}

body.theme-light .decor-bridge-cable {
  stroke: rgba(33, 50, 65, 0.18);
}

body.theme-light .decor-water {
  fill: rgba(136, 166, 186, 0.54);
}

body.theme-light .decor-liberty {
  fill: rgba(103, 147, 186, 0.84);
  stroke: rgba(33, 50, 65, 0.14);
}

body.theme-light .decor-liberty-arm {
  fill: rgba(103, 147, 186, 0.84);
}

body.theme-light .decor-liberty-flame {
  fill: rgba(214, 160, 89, 0.96);
  stroke: rgba(33, 50, 65, 0.12);
}

body.theme-light .decor-liberty-base {
  fill: rgba(33, 50, 65, 0.08);
  stroke: rgba(33, 50, 65, 0.1);
}

body.theme-light .decor-empire-spire {
  fill: rgba(33, 50, 65, 0.24);
}

body.theme-light .decor-crown {
  fill: rgba(33, 50, 65, 0.2);
}

body.theme-light .decor-reflection {
  stroke: rgba(214, 160, 89, 0.22);
}

body.theme-light .decor-panel-kicker {
  fill: #5b86a8;
}

body.theme-light .decor-panel-title,
body.theme-light .decor-panel-copy {
  fill: #213241;
}

body.theme-light .decor-panel-bar {
  fill: rgba(103, 147, 186, 0.8);
  stroke: rgba(33, 50, 65, 0.14);
}

body.theme-light.cute-mode #cute-mode-btn,
body.theme-light.cute-mode-dessert #cute-mode-btn,
body.theme-light.cute-mode-animal #cute-mode-btn {
  background: rgba(240, 214, 198, 0.88);
  border-color: rgba(208, 154, 126, 0.32);
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    display: none;
    order: 1;
  }

  .tooltip {
    border-radius: 10px;
    max-width: 184px;
    padding: 7px 9px;
  }

  .tooltip-route {
    font-size: 0.68rem;
    margin-bottom: 3px;
  }

  .tooltip-heading {
    font-size: 0.78rem;
    margin-bottom: 3px;
  }

  .tooltip-detail,
  .tooltip-meta {
    font-size: 0.72rem;
    line-height: 1.22;
  }

  .tooltip-meta {
    margin-top: 4px;
  }

  .map-panel {
    height: 78vh;
    min-height: 78vh;
    order: 2;
  }

  .map-shell,
  .map-frame {
    height: 100%;
  }

  .decor-panel-copy {
    display: none;
  }

  body.mobile-legend-open .sidebar {
    display: grid;
  }

  .mobile-only-btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
  }

  #legend-toggle-btn {
    display: inline-flex;
  }

  #sidebar-desktop-toggle-btn {
    display: none;
  }

  .legend-card {
    grid-template-rows: auto auto minmax(0, auto) auto;
  }

  .sidebar-weather {
    margin: 4px 8px 4px;
    padding: 10px 12px 6px;
  }

  .legend {
    display: grid;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 10px 12px;
    scroll-snap-type: none;
  }

  .legend-section {
    flex: none;
    gap: 8px;
    padding: 0 2px;
    scroll-snap-align: none;
  }

  .legend-item {
    min-height: 58px;
  }

  .legend-foot {
    padding: 6px 10px 8px;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 102px;
  }

  .header-actions {
    max-width: none;
    width: 100%;
    flex-wrap: wrap;
  }

  #header-toggle-btn {
    display: none;
  }

  .logo-link {
    font-size: 1.08rem;
  }

  .logo-credit {
    font-size: 0.62rem;
  }

  .app-shell {
    padding: 12px;
  }

  .map-panel {
    height: 74vh;
    min-height: 74vh;
  }

  .legend {
    display: grid;
    gap: 8px;
    padding: 0 8px 10px;
  }

  .legend-section {
    flex-basis: auto;
  }

  .header-search-form {
    width: min(320px, calc(100vw - 28px));
  }

  .map-toolbar {
    left: 12px;
    bottom: 12px;
  }
}
