:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --paper-strong: #fffdf8;
  --ink: #1c2023;
  --muted: #687278;
  --rust: #a24732;
  --rust-dark: #743323;
  --pine: #315c52;
  --pine-dark: #183c35;
  --stone: #d7d1c7;
  --stone-soft: #e8e3da;
  --map-blue: #cad9dc;
  --success: #2f6e58;
  --warning: #a76b22;
  --error: #9f3f32;
  --shadow: 0 20px 50px rgba(28, 32, 35, 0.1);
  --header-height: 76px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(28, 32, 35, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 32, 35, 0.022) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.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;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 200;
  transform: translateY(-140%);
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
}

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

:focus-visible {
  outline: 3px solid rgba(162, 71, 50, 0.5);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: 250px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  border-bottom: 1px solid var(--stone);
  background: rgba(244, 241, 234, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--pine-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font: 10px/1.2 "Avenir Next", sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  border-bottom: 3px solid var(--pine);
}

.brand-mark i {
  display: block;
  width: 8px;
  border: 2px solid var(--pine);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(3) {
  height: 20px;
}

.brand-mark i:nth-child(2) {
  height: 32px;
}

.main-nav {
  display: flex;
  justify-content: center;
  align-self: stretch;
  gap: clamp(8px, 2vw, 32px);
}

.nav-link {
  position: relative;
  min-width: 52px;
  border: 0;
  background: transparent;
  color: #3f484d;
  font-size: 14px;
  font-weight: 700;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  transform: scaleX(0);
  background: var(--rust);
  transition: transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--rust);
}

.nav-link.active::after {
  transform: scaleX(1);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pilot-label {
  padding: 7px 10px;
  border: 1px solid var(--stone);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
}

.language-switch,
.menu-button {
  border: 0;
  background: transparent;
}

.language-switch {
  padding: 8px;
  font-weight: 800;
}

.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  padding: 9px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--ink);
}

main {
  min-height: calc(100vh - var(--header-height));
}

.view {
  display: none;
  min-height: calc(100vh - var(--header-height));
}

.view.active {
  display: block;
}

.section-kicker,
.eyebrow {
  color: var(--rust);
  font: 800 11px/1.4 "Avenir Next", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 5px;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

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

.button.primary {
  border: 1px solid var(--rust);
  background: var(--rust);
  color: #fff;
}

.button.primary:hover {
  background: var(--rust-dark);
}

.button.secondary {
  border: 1px solid var(--stone);
  background: rgba(255, 255, 255, 0.48);
}

.button.full {
  width: 100%;
}

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rust);
  font-weight: 800;
}

.reveal {
  animation: reveal 600ms both;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 180ms;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home */
.home-view {
  max-width: 1520px;
  margin: 0 auto;
  padding: 44px clamp(24px, 5vw, 84px) 72px;
}

.home-view.active {
  display: block;
}

.home-hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.45fr);
  align-items: stretch;
  border: 1px solid var(--stone);
  background: rgba(255, 253, 248, 0.58);
}

.home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 6vw, 90px);
  border-right: 1px solid var(--stone);
}

.home-copy h1 {
  margin-top: 18px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(54px, 6vw, 88px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.home-lead {
  max-width: 500px;
  margin-top: 26px;
  color: #4f595f;
  font-size: 17px;
  line-height: 1.85;
}

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

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--stone);
  color: var(--muted);
  font-size: 12px;
}

.hero-note span::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--pine);
}

.hero-atlas {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  background: #ebe8df;
}

.atlas-topline,
.atlas-caption {
  position: absolute;
  z-index: 4;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.atlas-topline {
  top: 22px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.atlas-caption {
  bottom: 22px;
  padding: 17px 18px;
  border: 1px solid rgba(28, 32, 35, 0.14);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.atlas-caption button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-size: 20px;
}

.atlas-map,
.route-story-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(23deg, transparent 46%, rgba(255,255,255,.7) 47% 49%, transparent 50%),
    linear-gradient(112deg, transparent 47%, rgba(255,255,255,.7) 48% 49%, transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(104,114,120,.1) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(104,114,120,.1) 55px 56px),
    #e9e6de;
}

.embedded-baidu-map,
.map-fallback-layer {
  position: absolute;
  inset: 0;
}

.embedded-baidu-map {
  z-index: 2;
  opacity: 0;
  transition: opacity 260ms ease;
}

.map-fallback-layer {
  z-index: 1;
}

.atlas-map.live-map .embedded-baidu-map,
.route-story-map.live-map .embedded-baidu-map {
  opacity: 1;
}

.atlas-map.live-map .map-fallback-layer,
.route-story-map.live-map .map-fallback-layer {
  opacity: 0;
  pointer-events: none;
}

.schematic-river {
  position: absolute;
  left: -8%;
  right: -8%;
  top: 51%;
  height: 86px;
  transform: rotate(-7deg);
  border-radius: 50%;
  background: var(--map-blue);
  opacity: 0.9;
}

.schematic-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.schematic-route polyline {
  fill: none;
  stroke: var(--rust);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.map-node {
  position: absolute;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid var(--rust);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--rust);
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(28, 32, 35, 0.12);
}

.map-node.active,
.map-node:hover {
  background: var(--rust);
  color: #fff;
}

.narrative-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 18px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.narrative-stop {
  position: relative;
  min-height: 112px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-right: 1px solid var(--stone);
}

.narrative-stop:last-child {
  border-right: 0;
}

.narrative-stop span {
  color: var(--rust);
  font: 700 25px/1 Georgia, serif;
}

.narrative-stop strong,
.narrative-stop small {
  display: block;
}

.narrative-stop strong {
  font-size: 14px;
}

.narrative-stop small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.home-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}

.archive-preview,
.principle-card {
  min-height: 310px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.archive-preview {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) 1fr;
}

.archive-image {
  position: relative;
  overflow: hidden;
}

.archive-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.45) contrast(0.9);
}

.archive-image span {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 9px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 11px;
}

.archive-preview > div:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px;
}

.archive-preview h2 {
  margin-top: 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.archive-preview p:not(.section-kicker) {
  margin: 16px 0 20px;
  color: var(--muted);
  line-height: 1.8;
}

.principle-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 34px;
  background: var(--pine-dark);
  color: #fff;
}

.principle-card .index-number {
  margin-bottom: auto;
  color: rgba(255, 255, 255, 0.55);
  font: 40px/1 Georgia, serif;
}

.principle-card h3 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 32px;
}

.principle-card p {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.75;
}

/* Map */
.map-view.active {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

.map-sidebar {
  position: relative;
  z-index: 5;
  padding: 34px 24px;
  border-right: 1px solid var(--stone);
  background: rgba(255, 253, 248, 0.9);
  overflow-y: auto;
}

.panel-heading h1 {
  margin: 10px 0 9px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.panel-heading p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.route-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stone);
  color: var(--muted);
  font-size: 12px;
}

.route-progress strong {
  color: var(--rust);
  font-family: Georgia, serif;
  font-size: 16px;
}

.segment-navigator {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(162, 71, 50, 0.34);
  background: #fffaf2;
  box-shadow: inset 4px 0 0 var(--rust);
}

.segment-navigator header,
.segment-navigator .segment-meta,
.segment-navigator footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.segment-navigator header {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segment-navigator header strong {
  color: var(--rust);
  font: 800 18px Georgia, serif;
}

.segment-navigator > p {
  margin: 10px 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.segment-navigator > p b { color: var(--rust); }

.segment-meta {
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--stone-soft);
}

.segment-meta strong { font-size: 14px; }
.segment-meta span, .segment-meta small { color: var(--muted); font-size: 10px; }
.segment-meta small { width: 100%; color: var(--warning); }

.segment-navigator footer { margin-top: 12px; }
.segment-navigator footer button {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
  font-size: 10px;
  font-weight: 800;
}
.segment-navigator footer button[data-segment-focus] { border-color: var(--rust); background: var(--rust); color: #fff; }
.segment-navigator footer button:disabled { opacity: 0.35; cursor: default; }

.stop-list {
  position: relative;
  margin-bottom: 18px;
}

.stop-list::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: var(--stone);
}

.stop-list-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--stone-soft);
  background: transparent;
  text-align: left;
}

.stop-list-button .stop-num {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rust);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--rust);
  font: 700 14px Georgia, serif;
}

.stop-list-button.active .stop-num {
  background: var(--rust);
  color: #fff;
}

.stop-list-button strong,
.stop-list-button small {
  display: block;
}

.stop-list-button strong {
  font-size: 14px;
}

.stop-list-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.stop-list-button .arrow {
  color: var(--muted);
  font-size: 20px;
}

.map-stage {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  overflow: hidden;
  background: #e9e6de;
}

#baidu-map,
.fallback-map {
  position: absolute;
  inset: 0;
}

#baidu-map {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.map-stage.live-map #baidu-map {
  opacity: 1;
  pointer-events: auto;
}

.map-stage.live-map .fallback-map {
  opacity: 0;
  pointer-events: none;
}

.route-disclaimer {
  position: absolute;
  z-index: 10;
  left: 18px;
  top: 18px;
  padding: 8px 11px;
  border: 1px solid rgba(28, 32, 35, 0.14);
  background: rgba(255, 253, 248, 0.92);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 18px rgba(28, 32, 35, 0.08);
  backdrop-filter: blur(10px);
}

.fallback-map {
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(16deg, transparent 48%, rgba(255,255,255,.72) 49% 50%, transparent 51%),
    linear-gradient(102deg, transparent 47%, rgba(255,255,255,.72) 48% 49%, transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(104,114,120,.11) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 52px, rgba(104,114,120,.11) 53px 54px),
    #e7e5de;
  transition: opacity 240ms ease;
}

.fallback-map::before {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: 50%;
  height: 110px;
  transform: rotate(-5deg);
  border-radius: 50%;
  background: var(--map-blue);
}

.fallback-map .map-node {
  width: 44px;
  height: 44px;
}

.map-toolbar {
  position: absolute;
  z-index: 10;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
}

.location-button,
.map-tool {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(28, 32, 35, 0.16);
  border-radius: 5px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 25px rgba(28, 32, 35, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.location-button.tracking {
  background: var(--pine);
  color: #fff;
}

.location-dot {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.location-button.tracking .location-dot {
  background: #fff;
  box-shadow: 0 0 0 7px rgba(255,255,255,.18);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 13px rgba(255,255,255,0); }
}

.map-status {
  position: absolute;
  z-index: 10;
  left: 18px;
  bottom: 18px;
  max-width: min(430px, calc(100% - 36px));
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(28, 32, 35, 0.14);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.status-indicator {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--warning);
}

.map-status.success .status-indicator { background: var(--success); }
.map-status.error .status-indicator { background: var(--error); }
.map-status.loading .status-indicator { background: var(--rust); animation: pulse-dot 1s infinite; }

@keyframes pulse-dot { 50% { opacity: 0.35; } }

.map-status strong {
  font-size: 13px;
}

.map-status p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.selected-stop-card {
  position: absolute;
  z-index: 10;
  right: 18px;
  bottom: 84px;
  width: min(330px, calc(100% - 36px));
  padding: 18px;
  border: 1px solid rgba(28, 32, 35, 0.15);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.selected-stop-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selected-stop-card .card-index {
  color: var(--rust);
  font: 700 25px Georgia, serif;
}

.selected-stop-card .role-chip {
  padding: 5px 7px;
  background: #eee9df;
  color: var(--pine);
  font-size: 11px;
  font-weight: 800;
}

.selected-stop-card h2 {
  margin-top: 14px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
}

.selected-stop-card p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.selected-stop-card footer {
  display: flex;
  gap: 8px;
}

.selected-stop-card footer button {
  flex: 1;
  min-height: 39px;
  border: 1px solid var(--stone);
  background: transparent;
  font-weight: 800;
}

.selected-stop-card footer button:last-child {
  border-color: var(--rust);
  background: var(--rust);
  color: #fff;
}

.baidu-marker-label {
  border: 0 !important;
  background: transparent !important;
}

.baidu-point-marker,
.user-location-marker {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.baidu-point-marker {
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  background: var(--rust);
  box-shadow: 0 5px 14px rgba(28, 32, 35, 0.3);
}

.baidu-point-marker.active {
  width: 44px;
  height: 44px;
  background: var(--pine);
}

.user-location-marker {
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  background: #187e69;
  box-shadow: 0 0 0 7px rgba(24, 126, 105, 0.22);
}

/* Route */
.route-view {
  max-width: 1480px;
  margin: 0 auto;
  padding: 46px clamp(24px, 5vw, 78px) 64px;
}

.route-view.active { display: block; }

.route-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--stone);
}

.route-heading h1 {
  margin: 10px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(40px, 5vw, 68px);
}

.route-heading p:last-child {
  color: var(--muted);
}

.route-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}

.route-meta strong {
  color: var(--rust);
  font: 700 24px Georgia, serif;
}

.route-layout {
  height: 580px;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  margin-top: 22px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.route-timeline {
  position: relative;
  padding: 24px 28px;
  border-right: 1px solid var(--stone);
  overflow-y: auto;
}

.route-timeline::before {
  content: "";
  position: absolute;
  top: 54px;
  bottom: 54px;
  left: 48px;
  width: 1px;
  background: var(--rust);
}

.route-step {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--stone-soft);
  background: transparent;
  text-align: left;
}

.route-leg {
  position: relative;
  z-index: 2;
  width: calc(100% - 56px);
  min-height: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  margin: -4px 0 2px 56px;
  padding: 4px 10px;
  border: 1px solid var(--stone-soft);
  background: #f7f4ed;
  color: var(--muted);
  text-align: left;
  font-size: 10px;
}

.route-leg > span { color: var(--rust); font-weight: 900; }
.route-leg > strong { font-size: 11px; }
.route-leg > small { grid-column: 1 / -1; color: var(--warning); }
.route-leg.active { border-color: var(--rust); background: #fff7ef; box-shadow: inset 3px 0 0 var(--rust); }

.route-step .route-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rust);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--rust);
  font-family: Georgia, serif;
}

.route-step.active .route-number {
  background: var(--rust);
  color: #fff;
}

.route-step strong,
.route-step small {
  display: block;
}

.route-step small {
  margin-top: 6px;
  color: var(--muted);
}

.route-story-map {
  position: relative;
}

.route-notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.route-notes article {
  padding: 22px 24px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.route-notes span {
  color: var(--pine);
  font-weight: 900;
}

.route-notes p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.7;
}

/* Guide */
.guide-view.active {
  display: grid;
  place-items: center;
  padding: 40px;
}

.guide-shell {
  width: min(1460px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.2fr) 340px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.guide-visual {
  position: relative;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--stone);
  background: linear-gradient(145deg, #e3e0d9, #f2efe8);
}

.guide-visual > span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 7px 9px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font-size: 11px;
}

.guide-line-art {
  position: relative;
  width: 220px;
  height: 250px;
  border: 2px solid rgba(104,114,120,.35);
  border-top-left-radius: 110px;
  border-top-right-radius: 110px;
  opacity: 0.65;
  box-shadow:
    -70px 50px 0 -28px transparent,
    70px 50px 0 -28px transparent;
}

.guide-line-art::before,
.guide-line-art::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 150px;
  bottom: 188px;
  border: 2px solid rgba(104,114,120,.28);
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
}

.guide-line-art::before { transform: translateX(-78px); }
.guide-line-art::after { transform: translateX(204px); }

.guide-content {
  padding: 58px 48px;
}

.guide-heading {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 22px;
  align-items: start;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--stone);
}

.big-index {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--rust);
  color: #fff;
  font: 700 28px Georgia, serif;
}

.guide-heading h1 {
  margin: 8px 0 14px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(34px, 4vw, 52px);
}

.guide-heading p:last-child,
.guide-modules p {
  color: var(--muted);
  line-height: 1.8;
}

.guide-modules {
  display: grid;
  gap: 28px;
  margin-top: 34px;
}

.guide-modules section {
  padding-left: 20px;
  border-left: 3px solid var(--stone);
}

.guide-modules h2 {
  margin-bottom: 10px;
  color: var(--pine);
  font-size: 18px;
}

.guide-tools {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  padding: 34px 28px;
  border-left: 1px solid var(--stone);
  background: #f1eee7;
}

.audio-panel,
.source-panel {
  padding: 20px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.audio-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.audio-panel small,
.source-panel small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.audio-panel button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
}

.audio-wave {
  grid-column: 1 / -1;
  height: 26px;
  background: repeating-linear-gradient(90deg, var(--stone) 0 2px, transparent 2px 7px);
  mask-image: linear-gradient(0deg, transparent, #000 30% 70%, transparent);
}

.source-panel strong {
  display: block;
  margin-top: 12px;
  color: var(--rust);
}

.next-stop {
  align-self: end;
  min-height: 92px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--rust);
  background: var(--paper-strong);
  text-align: left;
}

.next-stop .next-index {
  display: grid;
  place-items: center;
  height: 52px;
  background: var(--rust);
  color: #fff;
  font: 700 22px Georgia, serif;
}

.next-stop small,
.next-stop strong { display: block; }
.next-stop small { color: var(--muted); margin-bottom: 4px; }
.next-stop .next-arrow { color: var(--rust); font-size: 26px; }

/* Task */
.task-view.active {
  max-width: 1450px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(430px, 1fr) 360px;
  gap: 0;
  padding: 48px clamp(24px, 5vw, 78px);
}

.task-sidebar,
.task-main,
.task-result {
  min-height: 620px;
  padding: 40px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.task-sidebar {
  border-right: 0;
}

.task-sidebar > strong {
  display: block;
  margin: 12px 0 28px;
  color: var(--rust);
  font: 700 32px Georgia, serif;
}

.task-sidebar ol {
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
}

.task-sidebar li {
  padding: 14px 0 14px 10px;
  border-bottom: 1px solid var(--stone-soft);
}

.task-sidebar li.active {
  color: var(--rust);
  font-weight: 900;
}

.task-main h1 {
  margin: 14px 0 36px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 44px;
}

.task-question {
  padding: 20px 22px;
  border-left: 4px solid var(--rust);
  background: #f0ece4;
  font-size: 17px;
  line-height: 1.7;
}

.task-options {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.task-options button {
  min-height: 62px;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  border: 1px solid var(--stone);
  background: #fff;
  text-align: left;
}

.task-options button span {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--stone);
  font-family: Georgia, serif;
}

.task-options button b { font-weight: 600; }

.language-ru .brand strong { letter-spacing: 0.04em; }
.language-ru .admin-link { display: none; }
.language-ru .route-heading h1,
.language-ru .panel-heading h1,
.language-ru .selected-stop-card h2,
.language-ru .guide-heading h1 { font-family: Georgia, "Times New Roman", serif; }

.task-options button.selected {
  border-color: var(--pine);
  box-shadow: inset 4px 0 0 var(--pine);
}

.task-options button.correct {
  border-color: var(--success);
  background: #edf6f0;
}

.task-options button.wrong {
  border-color: var(--error);
  background: #fbefec;
}

.task-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 0;
  background: var(--pine-dark);
  color: #fff;
}

.result-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  font: 700 30px Georgia, serif;
}

.task-result h2 {
  margin: 24px 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
}

.task-result p {
  color: rgba(255,255,255,.68);
  line-height: 1.8;
}

.task-result.error { background: #6e2f28; }

/* AI */
.ai-view.active {
  max-width: 1540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(500px, 1fr) 290px;
  min-height: calc(100vh - var(--header-height));
  padding: 30px clamp(20px, 4vw, 60px);
}

.source-index,
.evidence-panel {
  padding: 30px 24px;
  border: 1px solid var(--stone);
  background: rgba(255,253,248,.88);
}

.source-index h2,
.evidence-panel h2 {
  margin: 9px 0 20px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
}

.source-item {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--rust);
  background: var(--rust);
  color: #fff;
  text-align: left;
}

.source-item > span {
  font: 700 22px Georgia, serif;
}

.source-item strong,
.source-item small { display: block; }
.source-item small { margin-top: 3px; color: rgba(255,255,255,.7); }

.source-placeholder {
  height: 58px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--stone-soft) 18%, transparent 18% 25%, var(--stone-soft) 25% 74%, transparent 74%);
  opacity: 0.7;
}

.source-placeholder.short { opacity: 0.42; }

.ai-boundary {
  margin-top: 34px;
  padding: 16px;
  border-left: 3px solid var(--pine);
  background: #edf1ed;
}

.ai-boundary p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.qa-stage {
  padding: 34px 42px;
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
  background: var(--paper-strong);
}

.qa-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.qa-heading h1 {
  margin-top: 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 42px;
}

.qa-heading > span {
  padding: 7px 9px;
  border: 1px solid var(--stone);
  color: var(--pine);
  font-size: 11px;
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 18px;
}

.suggested-questions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--stone);
  background: transparent;
  font-size: 12px;
}

.suggested-questions button:hover {
  border-color: var(--rust);
  color: var(--rust);
}

.answer-card {
  min-height: 340px;
  padding: 30px;
  border: 1px solid var(--stone);
  background: #f7f4ee;
}

.answer-state {
  display: inline-flex;
  padding: 6px 8px;
  background: var(--pine);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.answer-card h2 {
  margin: 22px 0 14px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.answer-card p {
  color: #4e585e;
  line-height: 1.9;
}

.answer-source {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--stone);
  color: var(--rust);
  font-size: 12px;
}

.question-form {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-top: 14px;
  border: 1px solid var(--stone);
  background: #fff;
}

.question-form input {
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
}

.question-form button {
  margin: 5px;
  padding: 0 18px;
  border: 0;
  background: var(--pine);
  color: #fff;
  font-weight: 800;
}

.evidence-card {
  min-height: 88px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--stone);
}

.evidence-card span {
  color: var(--rust);
  font: 700 24px Georgia, serif;
}

.evidence-card p {
  color: var(--muted);
  font-size: 12px;
}

.evidence-card.muted { opacity: 0.55; }

.state-sample {
  margin-top: 14px;
  padding: 12px;
  border-left: 3px solid var(--warning);
  background: #f7f1e5;
  color: #6f552c;
  font-size: 12px;
}

.state-sample.error {
  border-left-color: var(--error);
  background: #f9ece9;
  color: var(--error);
}

/* Admin */
.admin-view.active {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}

.admin-sidebar {
  padding: 34px 20px;
  background: var(--pine-dark);
  color: #fff;
}

.admin-sidebar > strong {
  display: block;
  padding: 0 12px 26px;
  border-bottom: 1px solid rgba(255,255,255,.16);
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.admin-sidebar button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.68);
  text-align: left;
}

.admin-sidebar button.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.admin-main {
  padding: 42px clamp(26px, 5vw, 70px);
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.admin-heading h1 {
  margin-top: 8px;
  font-size: 38px;
}

.admin-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.admin-summary article {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

.admin-summary span {
  color: var(--muted);
  font-size: 12px;
}

.admin-summary strong {
  color: var(--pine);
  font-size: 22px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 17px 18px;
  border-bottom: 1px solid var(--stone-soft);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

td {
  font-size: 13px;
}

.status-chip {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 3px;
  background: #f3ede2;
  color: var(--warning);
  font-size: 11px;
  font-weight: 800;
}

.status-chip.content {
  background: #e9f0eb;
  color: var(--success);
}

.table-action {
  border: 0;
  background: transparent;
  color: var(--rust);
  font-weight: 800;
}

/* Dialog */
.location-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 35px 90px rgba(28, 32, 35, 0.28);
}

.location-dialog::backdrop {
  background: rgba(28, 32, 35, 0.5);
  backdrop-filter: blur(4px);
}

.location-dialog form {
  padding: 34px;
}

.dialog-index {
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.location-dialog h2 {
  margin: 12px 0 16px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.location-dialog p {
  color: var(--muted);
  line-height: 1.8;
}

.privacy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  font-size: 12px;
}

.privacy-links a {
  color: var(--rust);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 220px 1fr auto;
    padding: 0 20px;
  }

  .main-nav { gap: 4px; }
  .nav-link { min-width: 46px; font-size: 12px; }
  .admin-link { display: none; }
  .pilot-label { display: none; }

  .home-hero { grid-template-columns: 0.9fr 1.1fr; }
  .home-copy { padding: 50px 36px; }
  .home-copy h1 { font-size: 58px; }
  .narrative-stop { grid-template-columns: 1fr; }
  .narrative-stop span { font-size: 20px; }

  .guide-shell { grid-template-columns: 0.75fr 1.25fr; }
  .guide-tools { grid-column: 1 / -1; grid-template-columns: 1fr 1fr 1fr; border-left: 0; border-top: 1px solid var(--stone); }

  .task-view.active { grid-template-columns: 240px 1fr; }
  .task-result { grid-column: 1 / -1; min-height: 280px; border-left: 1px solid var(--stone); border-top: 0; }

  .ai-view.active { grid-template-columns: 230px 1fr; }
  .evidence-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .evidence-panel h2 { grid-column: 1 / -1; }
  .evidence-card, .state-sample { margin: 0; }
}

@media (max-width: 820px) {
  :root { --header-height: 66px; }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: var(--header-height);
  }

  .brand small { display: none; }
  .brand strong { font-size: 20px; }
  .brand-mark { width: 30px; height: 34px; }
  .language-switch { font-size: 12px; }
  .menu-button { display: block; }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 110;
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
    border-bottom: 1px solid var(--stone);
    background: var(--paper-strong);
    box-shadow: var(--shadow);
  }

  .main-nav.open { display: grid; }
  .nav-link { min-height: 46px; }
  .nav-link::after { display: none; }
  .admin-link { display: block; }

  .home-view { padding: 18px 16px 42px; }
  .home-hero { grid-template-columns: 1fr; }
  .home-copy { min-height: 520px; border-right: 0; border-bottom: 1px solid var(--stone); }
  .home-copy h1 { font-size: clamp(50px, 16vw, 76px); }
  .hero-atlas { min-height: 520px; }
  .narrative-strip { grid-template-columns: 1fr; }
  .narrative-stop { min-height: 78px; grid-template-columns: 40px 1fr; border-right: 0; border-bottom: 1px solid var(--stone); }
  .home-lower { grid-template-columns: 1fr; }
  .archive-preview { grid-template-columns: 1fr; }
  .archive-image { min-height: 280px; }

  .map-view.active { display: block; }
  .map-sidebar {
    position: absolute;
    z-index: 20;
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-height: 48vh;
    padding: 18px;
    border: 1px solid var(--stone);
    border-radius: 12px 12px 4px 4px;
    box-shadow: var(--shadow);
  }
  .panel-heading { display: none; }
  .route-progress { margin-top: 0; }
  .stop-list { max-height: 240px; overflow-y: auto; }
  .stop-list-button { min-height: 62px; }
  .map-stage { min-height: calc(100vh - var(--header-height)); }
  .selected-stop-card { top: 78px; bottom: auto; right: 10px; width: min(300px, calc(100% - 20px)); }
  .map-status { left: 10px; right: 10px; bottom: auto; top: 10px; max-width: none; }
  .map-toolbar { top: 88px; left: 10px; right: auto; }

  .route-view { padding: 28px 16px 44px; }
  .route-heading { align-items: flex-start; flex-direction: column; }
  .route-meta { width: 100%; flex-wrap: wrap; }
  .route-layout { height: auto; grid-template-columns: 1fr; }
  .route-timeline { max-height: 520px; border-right: 0; border-bottom: 1px solid var(--stone); }
  .route-story-map { min-height: 480px; }
  .route-notes { grid-template-columns: 1fr; }

  .guide-view.active { display: block; padding: 18px 16px 42px; }
  .guide-shell { grid-template-columns: 1fr; }
  .guide-visual { min-height: 420px; border-right: 0; border-bottom: 1px solid var(--stone); }
  .guide-content { padding: 36px 26px; }
  .guide-tools { grid-column: auto; grid-template-columns: 1fr; }

  .task-view.active { display: block; padding: 18px 16px 42px; }
  .task-sidebar { min-height: auto; border-right: 1px solid var(--stone); border-bottom: 0; }
  .task-sidebar ol { display: none; }
  .task-main { min-height: auto; }
  .task-result { min-height: 260px; }

  .ai-view.active { display: block; padding: 18px 16px 42px; }
  .source-index { display: none; }
  .qa-stage { padding: 28px 20px; border: 1px solid var(--stone); }
  .qa-heading { flex-direction: column; }
  .qa-heading h1 { font-size: 34px; }
  .evidence-panel { display: grid; grid-template-columns: 1fr 1fr; }

  .admin-view.active { display: block; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 28px 16px 44px; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .admin-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .site-header { padding: 0 12px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 17px; letter-spacing: 0.08em; }
  .header-actions { gap: 4px; }

  .home-copy { min-height: 490px; padding: 44px 24px; }
  .home-copy h1 { font-size: 54px; }
  .hero-actions { display: grid; }
  .button { width: 100%; }
  .hero-atlas { min-height: 460px; }
  .atlas-caption { left: 12px; right: 12px; bottom: 12px; }
  .archive-preview > div:last-child { padding: 28px 22px; }

  .map-tool { display: none; }
  .selected-stop-card { width: calc(100% - 20px); }
  .selected-stop-card p { display: none; }
  .map-sidebar { max-height: 44vh; }
  .stop-list { max-height: 190px; }

  .route-heading h1 { font-size: 43px; }
  .route-meta span { display: none; }

  .guide-heading { grid-template-columns: 54px 1fr; }
  .big-index { width: 50px; height: 50px; font-size: 22px; }
  .guide-heading h1 { font-size: 34px; }

  .task-sidebar { padding: 24px; }
  .task-main { padding: 28px 20px; }
  .task-main h1 { font-size: 34px; }
  .task-result { padding: 30px 24px; }

  .suggested-questions { display: grid; }
  .evidence-panel { grid-template-columns: 1fr; }
  .question-form { grid-template-columns: 1fr; }
  .question-form button { min-height: 44px; }

  .admin-summary { grid-template-columns: 1fr 1fr; }
  .admin-summary article { min-height: 88px; }

  .dialog-actions { flex-direction: column-reverse; }
  .location-dialog form { padding: 26px 22px; }
}

@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;
  }
}

/* V1.1 — full-screen entry, route workspace, and journey guidance */
:root {
  --journey-height: 60px;
}

.journey-guide {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  height: var(--journey-height);
  display: grid;
  place-items: center;
  padding: 7px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--stone);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 26px rgba(28, 32, 35, 0.06);
  backdrop-filter: blur(16px);
}

.journey-guide[hidden] {
  display: none;
}

.journey-track {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.journey-track button {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.journey-track button:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  width: 16px;
  height: 1px;
  background: var(--stone);
}

.journey-track button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--stone);
  background: var(--paper-strong);
  color: var(--muted);
  font: 700 11px Georgia, serif;
}

.journey-track button strong {
  white-space: nowrap;
}

.journey-track button.active {
  color: var(--rust-dark);
}

.journey-track button.active span {
  border-color: var(--rust);
  background: var(--rust);
  color: #fff;
  box-shadow: 0 5px 14px rgba(162, 71, 50, 0.22);
}

.journey-track button.completed span {
  border-color: var(--pine);
  background: var(--pine);
  color: #fff;
}

.journey-current {
  display: none;
}

main,
.view {
  min-height: calc(100vh - var(--header-height) - var(--journey-height));
  min-height: calc(100svh - var(--header-height) - var(--journey-height));
}

.journey-hidden main,
.journey-hidden .view {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
}

.button.primary {
  box-shadow: 0 8px 20px rgba(162, 71, 50, 0.16);
}

.guided-cta {
  min-height: 52px;
  gap: 10px;
  padding-inline: 18px;
}

.guided-cta > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  font: 700 11px Georgia, serif;
}

.guided-cta > strong {
  margin-left: 6px;
  font-size: 20px;
  transition: transform 160ms ease;
}

.guided-cta:hover > strong {
  transform: translateX(3px);
}

.nav-link.active {
  color: var(--rust-dark);
  font-weight: 900;
}

/* Homepage: the hero and guide together occupy the complete first viewport. */
.home-view {
  max-width: none;
  padding: 0 0 72px;
}

.home-hero {
  min-height: calc(100vh - var(--header-height) - var(--journey-height));
  min-height: calc(100svh - var(--header-height) - var(--journey-height));
  border-width: 0 0 1px;
}

.home-copy,
.hero-atlas {
  min-height: inherit;
}

.narrative-strip {
  margin-top: 0;
  border-width: 0 0 1px;
}

.home-lower {
  width: min(1420px, calc(100% - 48px));
  margin-inline: auto;
}

/* Map: subtract the persistent journey guide from the available height. */
.map-view.active,
.map-stage {
  min-height: calc(100vh - var(--header-height) - var(--journey-height));
  min-height: calc(100svh - var(--header-height) - var(--journey-height));
}

.selected-stop-card footer .card-primary-action {
  border-color: var(--rust);
  background: var(--rust);
  color: #fff;
  font-weight: 900;
}

.selected-stop-card footer .card-secondary-action {
  background: var(--paper-strong);
  color: var(--ink);
}

/* Route: fixed-height workspace with no page-level scrolling. */
.route-view {
  max-width: none;
  margin: 0;
  padding: 16px 22px 20px;
}

.route-view.active {
  height: calc(100vh - var(--header-height) - var(--journey-height));
  height: calc(100svh - var(--header-height) - var(--journey-height));
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.route-heading {
  align-items: center;
  min-height: 82px;
  padding: 0 4px 12px;
}

.route-heading h1 {
  margin: 5px 0 2px;
  font-size: clamp(32px, 3.4vw, 50px);
}

.route-heading p:last-child {
  font-size: 12px;
}

.route-layout {
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  margin-top: 0;
  overflow: hidden;
}

.route-timeline {
  min-height: 0;
  display: block;
  padding: 6px 20px;
  overflow-y: auto;
}

.route-timeline::before {
  top: 9%;
  bottom: 9%;
  left: 40px;
}

.route-step {
  min-height: 52px;
  height: auto;
  grid-template-columns: 38px 1fr auto;
  padding: 4px 0;
}

.route-step .route-number {
  width: 38px;
  height: 38px;
}

.route-step small {
  margin-top: 3px;
}

.route-map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.route-map-stage > .route-story-map {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.route-map-note {
  position: absolute;
  z-index: 5;
  top: 18px;
  left: 18px;
  max-width: min(620px, calc(100% - 36px));
  padding: 11px 14px;
  border: 1px solid rgba(28, 32, 35, 0.12);
  background: rgba(255, 253, 248, 0.9);
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(12px);
}

.route-map-note strong {
  margin-right: 10px;
  color: var(--pine-dark);
}

.route-action-card {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 20px;
  width: min(580px, calc(100% - 40px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(28, 32, 35, 0.14);
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.route-action-card > div {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 12px;
  align-items: center;
}

.route-action-index {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #fff;
  font: 700 17px Georgia, serif;
}

.route-action-card p {
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
}

.route-action-card h2 {
  margin-top: 3px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
}

.task-next-button {
  width: 100%;
  margin-top: 28px;
}

@media (max-height: 620px) and (min-width: 821px) {
  .route-timeline {
    display: block;
    overflow-y: auto;
  }

  .route-step {
    min-height: 68px;
    height: auto;
  }
}

@media (max-width: 820px) {
  :root {
    --journey-height: 78px;
  }

  .journey-guide {
    padding: 6px 14px 5px;
  }

  .journey-track {
    align-self: start;
  }

  .journey-track button {
    min-width: 0;
    min-height: 35px;
    padding: 0;
  }

  .journey-track button span {
    width: 28px;
    height: 28px;
  }

  .journey-track button strong {
    display: none;
  }

  .journey-track button:not(:last-child)::after {
    right: -10px;
    width: 20px;
  }

  .journey-current {
    width: min(420px, 100%);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 10px;
  }

  .journey-current strong {
    color: var(--rust-dark);
  }

  .home-view {
    padding: 0 0 42px;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .home-copy {
    min-height: calc(100vh - var(--header-height) - var(--journey-height));
    min-height: calc(100svh - var(--header-height) - var(--journey-height));
    padding: 44px 24px;
  }

  .hero-atlas {
    min-height: 520px;
  }

  .map-view.active,
  .map-stage {
    min-height: calc(100vh - var(--header-height) - var(--journey-height));
    min-height: calc(100svh - var(--header-height) - var(--journey-height));
  }

  body:has(.map-view.active),
  body:has(.route-view.active) {
    overflow: hidden;
  }

  body:has(.map-view.active) #main-content,
  body:has(.route-view.active) #main-content {
    height: calc(100vh - var(--header-height) - var(--journey-height));
    height: calc(100svh - var(--header-height) - var(--journey-height));
    overflow: hidden;
  }

  .map-view.active {
    grid-template-rows: 42% 58%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .map-view.active .map-stage {
    grid-row: 1;
    height: 100%;
    min-height: 0;
  }

  .map-view.active .map-sidebar {
    grid-row: 2;
    height: 100%;
    padding: 12px 14px 24px;
    border-top: 1px solid var(--stone);
    background: rgba(255, 253, 248, 0.98);
    overflow-y: auto;
  }

  .map-view.active .panel-heading { display: none; }

  .map-view.active .route-progress {
    margin: 0 0 8px;
    padding: 0 0 8px;
  }

  .map-view.active .route-disclaimer {
    top: 10px;
    left: 10px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .map-view.active .map-status {
    top: 48px;
    right: 10px;
    left: 10px;
    bottom: auto;
    max-width: none;
    padding: 10px 12px;
  }

  .map-view.active .map-status p { display: none; }

  .map-view.active .map-toolbar {
    top: auto;
    right: 10px;
    bottom: 10px;
  }

  .map-view.active .selected-stop-card {
    display: none;
  }

  .map-view.active .segment-navigator { margin-top: 0; }
  .map-view.active .stop-list-button { min-height: 66px; }

  .route-view,
  .route-view.active {
    position: relative;
    height: calc(100vh - var(--header-height) - var(--journey-height));
    height: calc(100svh - var(--header-height) - var(--journey-height));
    min-height: 0;
    padding: 0;
    display: block;
    overflow: hidden;
  }

  .route-heading {
    position: absolute;
    z-index: 15;
    top: 10px;
    left: 10px;
    right: 10px;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--stone);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .route-heading .section-kicker,
  .route-heading p:last-child,
  .route-meta span {
    display: none;
  }

  .route-heading h1 {
    margin: 0;
    font-size: 25px;
  }

  .route-meta {
    width: auto;
  }

  .route-meta .button {
    width: auto;
    min-height: 38px;
    padding-inline: 12px;
    font-size: 11px;
  }

  .route-layout {
    position: absolute;
    inset: 0;
    display: block;
    border: 0;
  }

  .route-map-stage {
    position: absolute;
    inset: 0;
  }

  .route-map-note {
    display: none;
  }

  .route-action-card {
    top: 120px;
    right: 10px;
    bottom: auto;
    width: calc(100% - 20px);
    grid-template-columns: 1fr auto;
    padding: 12px 14px;
  }

  .route-action-card h2 {
    font-size: 19px;
  }

  .route-action-card .guided-cta {
    width: auto;
    min-height: 44px;
    padding-inline: 12px;
    font-size: 0;
  }

  .route-action-card .guided-cta > span {
    font-size: 11px;
  }

  .route-action-card .guided-cta > strong {
    margin-left: 0;
    font-size: 20px;
  }

  .route-timeline {
    position: absolute;
    z-index: 12;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: min(41vh, 330px);
    display: block;
    padding: 12px 18px;
    border: 1px solid var(--stone);
    border-radius: 12px 12px 4px 4px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow);
    overflow-y: auto;
    backdrop-filter: blur(14px);
  }

  .route-timeline::before {
    top: 34px;
    bottom: 34px;
    left: 37px;
  }

  .route-step {
    min-height: 58px;
    height: auto;
  }

  .route-step .route-number {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 560px) {
  .guided-cta {
    width: 100%;
  }

  .home-copy h1 {
    font-size: clamp(48px, 15vw, 60px);
  }

  .home-lower {
    width: calc(100% - 24px);
  }

  .route-action-card > div {
    grid-template-columns: 38px 1fr;
  }

  .route-action-index {
    width: 38px;
    height: 38px;
  }
}
