/* ==========================================================================
   Схема метро Санкт-Петербурга — local, dependency-free stylesheet
   ========================================================================== */

:root {
  --ink: #0d1424;
  --ink-soft: #2a3448;
  --muted: #6b768c;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --line: #e4e8f1;
  --line-strong: #d3d9e6;
  --red: #e23744;
  --red-rgb: 226, 55, 68;
  --red-dark: #bd1f2e;
  --blue: #2f6fed;
  --blue-rgb: 47, 111, 237;
  --green: #0f9d67;
  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 8px 24px rgba(13, 20, 36, 0.06);
  --shadow: 0 24px 60px rgba(13, 20, 36, 0.09);
  --container: 1200px;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(var(--blue-rgb), 0.07), transparent 60%),
    radial-gradient(50rem 30rem at 30% 5%, rgba(var(--red-rgb), 0.05), transparent 60%);
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(var(--blue-rgb), 0.35);
  outline-offset: 2px;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(228, 232, 241, 0.8);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--red) 0%, var(--red-dark) 100%);
  box-shadow: 0 10px 20px rgba(var(--red-rgb), 0.28);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-nav a:hover {
  background: #f0f3fa;
  color: var(--ink);
}

.site-nav .nav-gift {
  color: var(--red);
}

.site-nav .nav-gift:hover {
  background: #fff1f2;
  color: var(--red-dark);
}

.mobile-menu__gift {
  color: var(--red) !important;
  font-weight: 700 !important;
}

.footer-gift {
  color: #ff9da4 !important;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease;
}

.header-cta:hover {
  background: #1b2740;
  transform: translateY(-1px);
}

.mobile-menu {
  display: none;
  position: relative;
  flex: 0 0 auto;
}

.mobile-menu summary {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu[open] summary {
  border-color: rgba(var(--blue-rgb), 0.4);
  background: #f4f7ff;
}

.mobile-menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-menu__panel a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.mobile-menu__panel a:hover {
  background: #f2f5fb;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Shared type / layout
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.35rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  font-weight: 800;
}

h3 {
  font-size: 1.12rem;
  font-weight: 750;
}

p {
  margin: 0;
}

.section {
  padding: 72px 0;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.section--map {
  padding-top: 20px;
}

.section--narrow {
  max-width: 860px;
  margin-inline: auto;
  padding: 48px 0 72px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.section-head > p {
  max-width: 430px;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-head--center {
  justify-content: center;
  text-align: center;
}

.section--schedule {
  background: #eef2fa;
}

.section--schedule .section-head p {
  color: #5d6880;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 62px 0 54px;
  background: linear-gradient(180deg, #eef3ff 0%, #f7f9fe 55%, var(--paper) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(var(--blue-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--blue-rgb), 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -180px;
  right: -120px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--red-rgb), 0.14), transparent 65%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(420px, 0.97fr);
  align-items: center;
  gap: 54px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(var(--blue-rgb), 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #33415c;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(15, 157, 103, 0.14);
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--red);
}

.hero-lead {
  max-width: 560px;
  color: #4d5871;
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
}

.hero-points {
  display: grid;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: #38445c;
  font-size: 0.94rem;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-points span {
  color: var(--red);
  font-weight: 800;
}

.hero-card {
  position: relative;
  z-index: 5;
}

/* --------------------------------------------------------------------------
   Route search card
   -------------------------------------------------------------------------- */
.route-search {
  position: relative;
  z-index: 5;
  width: 100%;
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(228, 232, 241, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(13, 20, 36, 0.14);
}

.route-search__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.route-search__head h2 {
  margin-top: 4px;
  font-size: 1.45rem;
}

.route-search__hint {
  max-width: 170px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: right;
}

.route-search__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.search-control {
  position: relative;
  min-width: 0;
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 15px;
  margin-bottom: 6px;
}

.search-label-row .search-label {
  margin-bottom: 0;
}

.search-line-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 58%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-line-hint::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-color, #8892a6);
}

.search-input-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9fd;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 550;
  text-overflow: ellipsis;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-input::placeholder {
  color: #9aa4b7;
  font-weight: 500;
}

.search-input:hover {
  border-color: var(--line-strong);
}

.search-input:focus {
  border-color: rgba(var(--blue-rgb), 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--blue-rgb), 0.1);
  outline: none;
}

.search-pin {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(var(--red-rgb), 0.12);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-pin--to {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(var(--blue-rgb), 0.12);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8c97aa;
  transform: translateY(-50%);
}

.search-clear:hover {
  background: #eef1f8;
  color: var(--ink);
}

.search-clear::before,
.search-clear::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.search-clear::after {
  transform: rotate(-45deg);
}

.swap-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.18s ease, transform 0.25s ease, border-color 0.18s ease;
}

.swap-button:hover {
  border-color: rgba(var(--blue-rgb), 0.35);
  background: #f4f7ff;
  transform: rotate(180deg);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: 320px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.suggestion-lines {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 4px 8px;
  border-bottom: 1px solid #eef1f7;
  background: #fff;
}

.suggestion-lines-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.suggestion-line-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b768c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
}

.suggestion-line-select:focus {
  border-color: rgba(var(--blue-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.1);
  outline: none;
}

.suggestion-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggestion:hover,
.suggestion.is-active {
  background: #f1f4fb;
}

.suggestion-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-line {
  max-width: 44%;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-color, #8892a6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-color, #8892a6) 18%, transparent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 12px 26px rgba(var(--red-rgb), 0.26);
}

.button--primary:hover {
  box-shadow: 0 16px 32px rgba(var(--red-rgb), 0.32);
  transform: translateY(-1px);
}

.button--ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.button--ghost:hover {
  border-color: var(--line-strong);
  background: #f8f9fd;
}

.button--large {
  height: 54px;
  padding: 0 28px;
  font-size: 1rem;
}

.route-search__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.route-search__status {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.route-search__status.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid #d7deec;
  border-top-color: var(--blue);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Route results
   -------------------------------------------------------------------------- */
.route-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #dfe8ff;
  border-radius: 14px;
  background: #f4f7ff;
}

.route-summary__item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #40506d;
  font-size: 0.84rem;
}

.route-summary__item strong {
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.route-summary__route {
  flex-basis: 100%;
  color: #53617a;
  font-size: 0.86rem;
}

.route-summary__link {
  margin-left: auto;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-summary__link:hover {
  text-decoration: underline;
}

.route-results {
  margin-top: 10px;
}

.route-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 1px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.route-tab {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 128px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.route-tab:hover {
  border-color: var(--line-strong);
  background: #fafbff;
}

.route-tab.is-active {
  border-color: rgba(var(--blue-rgb), 0.45);
  background: #f4f7ff;
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.08);
}

.route-tab__time {
  font-size: 0.88rem;
  font-weight: 750;
  white-space: nowrap;
}

.route-tab__meta {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.route-steps {
  display: grid;
  gap: 4px;
  max-height: 300px;
  margin: 10px 0 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
  list-style: none;
}

.page-route .route-steps {
  max-height: 520px;
}

.route-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f8f9fd;
  color: #35415a;
  font-size: 0.87rem;
}

.route-step__line {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.7rem;
}

.route-step--transfer {
  background: #fff6ed;
  color: #9a5b13;
  font-weight: 650;
}

.transfer-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffd8ad;
  color: #8b4a05;
  font-size: 0.78rem;
}

.route-error {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid #f4c7c3;
  border-radius: 11px;
  background: #fef3f2;
  color: #a42a20;
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   Legend / map
   -------------------------------------------------------------------------- */
.map-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  container-type: inline-size;
}

.map-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.map-card__head > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
}

.map-card__head h2 {
  margin-top: 3px;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.map-legend {
  display: flex;
  flex: 1 1 380px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 14px;
  max-width: 640px;
}

@container (max-width: 900px) {
  .map-card__head {
    flex-direction: column;
  }

  .map-card__head > div:first-child,
  .map-legend {
    flex: 0 0 auto;
  }

  .map-legend {
    justify-content: flex-start;
    max-width: none;
  }
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.map-frame {
  position: relative;
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6fc 100%);
}

.map-viewport {
  position: relative;
  height: clamp(440px, 64vh, 690px);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

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

.map-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 10px;
}

svg#svgMap {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}

#svgMap #m_layerLegend {
  display: none;
}

#svgMap [onclick] {
  cursor: pointer;
}

.map-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(13, 20, 36, 0.08);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.map-tool:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.map-tool--wide {
  width: auto;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.map-tip {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 10;
  max-width: 420px;
  padding: 8px 12px;
  border: 1px solid rgba(228, 232, 241, 0.9);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 0.71rem;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.map-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.map-share__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.map-share__text strong {
  font-size: 0.92rem;
}

.map-share__text span {
  color: var(--muted);
  font-size: 0.78rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.share-btn:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(13, 20, 36, 0.1);
  transform: translateY(-1px);
}

.share-btn__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.share-btn--vk .share-btn__icon {
  background: #0077ff;
}

.share-btn--ok .share-btn__icon {
  background: #ee8208;
}

.ad-card {
  margin-top: 18px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fafbfe 100%);
  box-shadow: var(--shadow-sm);
}

.ad-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ad-label {
  color: #98a2b3;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-hint {
  color: #a9b2c2;
  font-size: 0.66rem;
}

.ad-card__body {
  display: flex;
  justify-content: center;
}

.ad-card__body a {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

.ad-card__body img {
  display: block;
  width: 468px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.ad-card__body a:hover img {
  filter: saturate(1.08);
}

.map-popup {
  position: fixed;
  z-index: 120;
  width: 262px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(13, 20, 36, 0.22);
}

.map-popup__item + .map-popup__item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.map-popup__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 700;
}

.map-popup__line {
  color: var(--muted);
  font-size: 0.72rem;
}

.map-popup__buttons {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.map-popup__buttons button {
  flex: 1;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fc;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 650;
}

.map-popup__buttons button:hover {
  border-color: rgba(var(--blue-rgb), 0.4);
  background: #eef4ff;
}

/* Selection highlight: fade everything except the cloned route layer. */
#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  text[id^="m_lbl"]
  tspan {
  fill: #dfe3ec;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[id^="m_p"],
#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[id^="m_t"] {
  stroke: #dfe3ec;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[id^="m_to"] {
  stroke: #fff;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[id^="m_st"] {
  fill: #dfe3ec;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[id^="m_sto"] {
  fill: #fff;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  path[stroke="#fff"] {
  stroke: #fff;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  circle {
  fill: #fff;
  stroke: #dfe3ec;
}

#svgMap.has-selection
  > g:not(#m_layerLegend):not(#m_selection_root):not(#m_layerLabelBackgrounds)
  rect {
  fill: #dfe3ec;
}

#svgMap.has-selection > g#m_layerStations path {
  fill: #dfe3ec;
  stroke: none;
}

/* --------------------------------------------------------------------------
   Station directory
   -------------------------------------------------------------------------- */
.line-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.line-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-color, var(--line));
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.line-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.line-card__head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.line-card__head h3 {
  margin-bottom: 2px;
  font-size: 1rem;
}

.line-card__head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.station-list {
  display: grid;
  gap: 1px;
  max-height: 330px;
  margin: 15px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: thin;
}

.station-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #edf0f6;
}

.station-list li:last-child {
  border-bottom: 0;
}

.station-list a {
  font-size: 0.88rem;
  font-weight: 550;
  transition: color 0.15s ease;
}

.station-list a:hover {
  color: var(--red);
}

.station-time {
  flex: 0 0 auto;
  color: #8b95a8;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Schedule
   -------------------------------------------------------------------------- */
.schedule-list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  overflow: hidden;
  border: 1px solid #dbe1ee;
  border-radius: 15px;
  background: #fff;
}

.schedule-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.schedule-item summary::-webkit-details-marker {
  display: none;
}

.schedule-item summary:hover {
  background: #fafbfe;
}

.schedule-line {
  font-size: 0.94rem;
  font-weight: 650;
}

.schedule-count {
  color: var(--muted);
  font-size: 0.76rem;
}

.schedule-chevron {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid #8792a8;
  border-bottom: 2px solid #8792a8;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.schedule-item[open] .schedule-chevron {
  transform: rotate(-135deg);
}

.schedule-table-wrap {
  overflow-x: auto;
  padding: 0 20px 16px;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.schedule-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.schedule-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f3f9;
}

.schedule-table td:nth-child(2),
.schedule-table td:nth-child(3) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-table a:hover {
  color: var(--red);
}

/* --------------------------------------------------------------------------
   Features / CTA
   -------------------------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: #eef3ff;
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 700;
}

.feature-card h3 {
  margin-bottom: 7px;
}

.feature-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.section--cta {
  padding-top: 0;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 38px 42px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(38rem 20rem at 100% 0%, rgba(var(--blue-rgb), 0.28), transparent 60%),
    linear-gradient(125deg, #0e1729 0%, #17233d 60%, #1d2c4b 100%);
  box-shadow: 0 28px 60px rgba(13, 20, 36, 0.24);
  color: #fff;
}

.cta-card .eyebrow {
  color: #ff9da4;
}

.cta-card h2 {
  margin: 7px 0 8px;
  color: #fff;
}

.cta-card p {
  color: #b9c4d8;
  font-size: 0.94rem;
}

/* --------------------------------------------------------------------------
   Station / route pages
   -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 24px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumbs a:hover {
  color: var(--red);
}

.breadcrumbs span[aria-hidden] {
  color: #b4bdcd;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 30px 0 28px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 10px 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.page-hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 0.95rem;
}

.line-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(228, 232, 241, 0.9);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: #4a556d;
  font-size: 0.78rem;
  font-weight: 650;
}

.station-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 680px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f5c2a0;
  border-radius: 12px;
  background: #fff7ed;
  color: #8a4b10;
}

.station-status__badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffd9b3;
  color: #7c3f08;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.station-status strong {
  font-size: 0.88rem;
}

.station-status p {
  margin: 3px 0 0;
  color: #91591f;
  font-size: 0.8rem;
}

.station-closed {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff1e6;
  color: #9a5b13;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(98px, auto));
  gap: 10px;
  flex: 0 0 auto;
}

.fact {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.fact dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact dd {
  margin: 2px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.route-arrow {
  color: var(--red);
  font-weight: 800;
}

.route-stats {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.route-stat {
  min-width: 92px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.route-stat strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.route-stat span {
  color: var(--muted);
  font-size: 0.72rem;
}

.route-stats--empty {
  padding: 12px 16px;
  border: 1px solid #f4c7c3;
  border-radius: 12px;
  background: #fef3f2;
  color: #a42a20;
  font-size: 0.84rem;
}

.station-layout,
.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 30px 0 0;
}

.station-main,
.route-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.station-main > *,
.route-main > * {
  min-width: 0;
}

.station-aside,
.route-aside {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.station-aside > *,
.route-aside > * {
  min-width: 0;
}

.aside-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.aside-card h2 {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.aside-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.aside-card--accent {
  border-color: #dbe6ff;
  background: #f4f7ff;
}

.aside-card--accent p {
  color: #50617d;
  font-size: 0.86rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.route-facts {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.route-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.route-facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-facts dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
  text-align: right;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafbfe;
  color: #3c4860;
  font-size: 0.78rem;
  font-weight: 550;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  border-color: var(--line-color, rgba(var(--blue-rgb), 0.45));
  background: #fff;
}

.chip--pick {
  cursor: pointer;
}

.picker-lines {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.picker-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.picker-select {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b768c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
}

.picker-select:focus {
  border-color: rgba(var(--blue-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.1);
  outline: none;
}

.picker-stations {
  gap: 8px;
  min-width: 0;
}

.mini-steps {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: #50617d;
  font-size: 0.84rem;
}

/* Route timeline in the aside */
.route-timeline {
  display: grid;
  max-height: 460px;
  margin: 14px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.route-timeline .route-step {
  position: relative;
  padding: 7px 0 7px 20px;
  border-radius: 0;
  background: transparent;
}

.route-timeline .route-step::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: #e0e5f0;
}

.route-timeline .route-step:first-child::before {
  top: 50%;
}

.route-timeline .route-step:last-child::before {
  bottom: 50%;
}

.route-timeline .line-dot {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px #fff;
}

.route-timeline .route-step--transfer {
  color: #9a5b13;
  font-size: 0.78rem;
  font-weight: 650;
}

.route-timeline .route-step--transfer::after {
  content: "⇄";
  position: absolute;
  top: 50%;
  left: -1px;
  display: grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffd8ad;
  color: #8b4a05;
  font-size: 0.5rem;
  transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Prose
   -------------------------------------------------------------------------- */
.prose h2 {
  margin-bottom: 12px;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.prose p {
  margin-bottom: 12px;
  color: #5a657b;
  font-size: 0.94rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 20px;
  padding: 48px 0 24px;
  border-top: 1px solid var(--line);
  background: #0e1626;
  color: #c4cddd;
}

.brand--footer .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1.15rem;
}

.brand--footer .brand-text strong {
  color: #fff;
}

.brand--footer .brand-text span {
  color: #8895ab;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
}

.footer-note {
  max-width: 380px;
  margin-top: 14px;
  color: #8f9bb0;
  font-size: 0.85rem;
}

.footer-title {
  margin-bottom: 12px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: #9eabc1;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #77849a;
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Error page
   -------------------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-height) - 260px);
  padding: 60px 0;
}

.error-card {
  max-width: 620px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.error-code {
  display: block;
  color: var(--red);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.error-card h1 {
  margin: 12px 0 10px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
}

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

.error-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-copy {
    max-width: 720px;
  }

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

  .station-layout,
  .route-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (min-width: 861px) and (max-width: 980px) {
  .site-nav .nav-gift {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .header-cta {
    margin-left: auto;
  }

  .map-card__head,
  .page-hero,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .map-legend {
    justify-content: flex-start;
  }

  .page-hero {
    align-items: flex-start;
  }

  .fact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .cta-card {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .hero {
    padding: 38px 0 40px;
  }

  .hero-badge {
    font-size: 0.7rem;
  }

  .route-search {
    padding: 18px;
    border-radius: 22px;
  }

  .route-search__head {
    flex-direction: column;
    gap: 4px;
  }

  .route-search__hint {
    max-width: none;
    text-align: left;
  }

  .route-search__fields {
    grid-template-columns: 1fr;
  }

  .swap-button {
    justify-self: center;
    margin: -2px 0;
    transform: rotate(90deg);
  }

  .swap-button:hover {
    transform: rotate(270deg);
  }

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

  .route-search__actions .button {
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .route-search__status {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .line-grid,
  .feature-grid,
  .station-aside,
  .route-aside,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .station-list {
    max-height: none;
    overflow: visible;
  }

  .section {
    padding: 52px 0;
  }

  .map-viewport {
    height: 58vh;
    min-height: 380px;
  }

  .map-card__head {
    padding: 18px 18px 16px;
  }

  .map-legend {
    gap: 6px 10px;
  }

  .map-tip {
    right: 12px;
    bottom: 10px;
    left: 12px;
    max-width: none;
    font-size: 0.66rem;
  }

  .map-share {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
  }

  .share-buttons {
    width: 100%;
  }

  .share-btn {
    flex: 1;
    justify-content: center;
  }

  .ad-card {
    padding: 13px 14px;
    border-radius: 14px;
  }

  .map-toolbar {
    top: 10px;
    right: 10px;
  }

  .map-tool {
    width: 36px;
    height: 36px;
  }

  .schedule-item summary {
    padding: 14px 15px;
  }

  .schedule-count {
    display: none;
  }

  .schedule-table-wrap {
    padding: 0 15px 14px;
  }

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

  .fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 9px 12px;
  }

  .fact dd {
    margin: 0;
  }

  .route-stats {
    width: 100%;
  }

  .route-stat {
    flex: 1;
    min-width: 0;
  }

  .error-card {
    padding: 30px 22px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .route-search__actions {
    grid-template-columns: 1fr;
  }

  .route-search__actions .button {
    width: 100%;
  }

  .route-search__status {
    grid-column: auto;
  }

  .share-buttons {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 700px) {
  .header-cta {
    display: none;
  }

  .mobile-menu {
    margin-left: auto;
  }

  .header-inner {
    gap: 12px;
  }
}

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