:root {
  --paper: #f1f0e9;
  --ink: #202a2c;
  --navy: #203b46;
  --route: #e88a32;
  --green: #4d7961;
  --line: #c9c8bf;
  --paper-2: #e6e5dc;
  --navy-ink: #173038;
  --warn: #8c3d22;
  --focus: #e88a32;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rail: 232px;
  --detail: 320px;
  --header: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.6;
  min-width: 0;
}

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

a { color: var(--navy); text-underline-offset: 0.15em; }

a:hover { color: var(--warn); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--navy);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
  z-index: 20;
}

.skip:focus { top: 0.5rem; }

#route-trace,
#mechanics,
#industries,
#field-notes,
#glossary,
#ask,
.glossary-entry,
.clause,
.letter-block {
  scroll-margin-top: calc(var(--header) + 8px);
}

.mast {
  background: var(--navy);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 3px solid var(--route);
}

.mast-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header);
  padding: 0.4rem 1rem;
  max-width: 1440px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--paper);
  text-decoration: none;
  min-width: 0;
}

.brand:hover { color: var(--paper); }

.logo-mark { width: 64px; height: 32px; flex: 0 0 auto; display: block; }

.brand-name {
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  opacity: 0.82;
  font-weight: 400;
}

.nav-toggle,
.index-toggle {
  display: none;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: auto;
  min-width: 0;
}

.primary-nav a {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
  border-left: 1px solid rgba(241, 240, 233, 0.28);
  display: flex;
  align-items: center;
  min-height: 44px;
}

.primary-nav a[aria-current="page"] {
  background: rgba(241, 240, 233, 0.08);
  box-shadow: inset 0 -3px 0 var(--route);
}

.nav-cta {
  margin-left: 0.75rem;
  border: 1px solid var(--route);
  color: var(--paper);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 650;
  background: transparent;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--route); color: var(--navy-ink); }

.console {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  min-width: 0;
}

.index-rail,
.detail-rail {
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.route-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: start;
  margin: 0 0 0.4rem;
}

.route-work { min-width: 0; padding-right: 0.9rem; }

.detail-rail {
  border-right: 0;
  border-left: 1px solid var(--line);
  position: sticky;
  top: var(--header);
  max-height: calc(100vh - var(--header));
  overflow: auto;
  padding: 0.2rem 0 1.2rem 0.9rem;
}

.index-rail {
  position: sticky;
  top: var(--header);
  max-height: calc(100vh - var(--header));
  overflow: auto;
  padding: 0.75rem 0 1.5rem;
}

.index-label,
.rail-kicker,
.fig-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0.8rem 0.9rem 0.35rem;
}

.index-rail ol,
.footer-index ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-rail a {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.45rem 0.9rem;
  border-top: 1px solid transparent;
  min-height: 44px;
  align-items: center;
}

.index-rail a:hover,
.index-rail a[aria-current="page"] {
  background: var(--paper-2);
  border-top-color: var(--line);
}

.index-rail .idx {
  font-family: var(--mono);
  color: var(--route);
  font-size: 0.78rem;
}

.console-main {
  min-width: 0;
  padding: 1.1rem 1.25rem 3rem;
  border-right: 0;
}

.board-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  align-items: end;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}

.plate {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--ink);
  padding: 0.35rem 0.45rem;
  line-height: 1.35;
}

.plate strong { display: block; color: var(--navy); }

h1 {
  font-size: 1.85rem;
  line-height: 1.15;
  font-weight: 720;
  margin: 0;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.08rem;
  max-width: 42rem;
  margin: 0.7rem 0 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--paper);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.btn:hover { background: var(--navy-ink); color: var(--paper); }

.btn-line {
  background: transparent;
  color: var(--navy);
}

.btn-line:hover { background: var(--paper-2); color: var(--navy); }

.section-rule {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  margin: 2rem 0 0.8rem;
  padding-top: 0.45rem;
}

.section-rule h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-rule span,
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }

.notice {
  font-family: var(--mono);
  font-size: 0.78rem;
  border-left: 3px solid var(--route);
  padding: 0.25rem 0.6rem;
  margin: 0.6rem 0 0.8rem;
}

.route-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin: 0 0 0.8rem;
}

.route-switcher button {
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  min-height: 52px;
  cursor: pointer;
  color: var(--ink);
}

.route-switcher button:nth-child(3n) { border-right: 0; }

.route-switcher button[aria-selected="true"] {
  background: var(--navy);
  color: var(--paper);
}

.route-switcher .code {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--route);
}

.route-switcher button[aria-selected="true"] .code { color: #f2c48a; }

.trace {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  position: relative;
}

.trace::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.6rem;
  top: 1.55rem;
  height: 2px;
  background: var(--route);
}

.trace li { flex: 1 1 0; min-width: 0; position: relative; z-index: 1; }

.trace button {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--navy);
  min-height: 78px;
  padding: 0.35rem 0.3rem 0.45rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
}

.trace button[aria-pressed="true"] {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}

.trace .n {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--route);
  display: block;
}

.trace .node-name {
  display: block;
  font-size: 0.86rem;
  font-weight: 680;
  line-height: 1.25;
  margin-top: 0.2rem;
}

.station-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--navy);
  background: var(--paper);
  display: inline-block;
  margin-bottom: 0.2rem;
}

.trace button[aria-pressed="true"] .station-dot {
  background: var(--route);
  border-color: var(--route);
}

.trace li:last-child button .node-name { padding-right: 0.1rem; }

.awning {
  width: 28px;
  height: 16px;
  display: block;
  margin-top: 0.15rem;
}

.node-panel h3 { margin: 0.2rem 0 0.45rem; font-size: 1.2rem; }

.node-panel h4 {
  margin: 0.75rem 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
}

.node-panel p { margin: 0.2rem 0 0.45rem; font-size: 0.95rem; }

body.is-enhanced [data-route-panel]:not(.is-active),
body.is-enhanced [data-node-panel]:not(.is-active) { display: none; }

.route-block + .route-block {
  margin-top: 1.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--line);
}

.mech-board { border-top: 1px solid var(--line); }

.mech-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.mech-row h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }

.mech-row p { margin: 0.25rem 0; }

.bay-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.bay {
  border: 1px solid var(--navy);
  min-height: 64px;
  padding: 0.35rem;
  font-size: 0.82rem;
  background: var(--paper-2);
}

.bay b {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
}

.steps {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.45rem;
  margin: 0.28rem 0;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  color: var(--route);
  font-size: 0.8rem;
  padding-top: 0.15rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.55rem;
  border-top: 2px solid var(--green);
}

.timeline div {
  padding: 0.45rem 0.45rem 0.2rem 0;
  border-right: 1px solid var(--line);
  font-size: 0.88rem;
}

.timeline div:last-child { border-right: 0; }

.timeline strong { display: block; font-size: 0.92rem; }

.rel {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.35rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.rel span.arrow {
  align-self: center;
  font-family: var(--mono);
  color: var(--route);
}

.rel article {
  border: 1px solid var(--line);
  padding: 0.4rem;
  background: var(--paper-2);
  font-size: 0.88rem;
}

details.fold {
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0;
}

details.fold summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 680;
}

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

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--green);
}

.system-index { width: 100%; border-collapse: collapse; }

.system-index th,
.system-index td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.5rem 0.7rem 0;
}

.system-index th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--navy);
}

.system-index a { font-weight: 700; }

.catalog {
  width: 100%;
  border-collapse: collapse;
}

.catalog th,
.catalog td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.6rem 0.75rem 0;
}

.catalog th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0 0.8rem;
}

.filters button {
  font: inherit;
  background: transparent;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.term-grid {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.term-grid dt,
.term-grid dd {
  margin: 0;
  padding: 0.7rem 0.5rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.term-grid dt { font-weight: 720; }

.alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.4rem 0 1rem;
}

.alpha a {
  min-width: 2rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--mono);
}

.glossary-entry {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
  scroll-margin-top: 80px;
}

.glossary-entry h2 { font-size: 1.2rem; margin: 0 0 0.3rem; }

.form-panel {
  border: 1px solid var(--navy);
  padding: 0.9rem;
  margin-top: 0.6rem;
  background: var(--paper);
}

.form-grid {
  display: grid;
  gap: 0.7rem;
}

label { display: block; font-weight: 650; }

input, select, textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  color: var(--ink);
  background: #f7f6f1;
  border: 1px solid var(--navy);
  padding: 0.55rem 0.6rem;
  min-height: 44px;
}

textarea { min-height: 140px; resize: vertical; }

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 450;
}

.check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: 0.2rem; flex: 0 0 auto; }

.field-error {
  color: var(--warn);
  font-size: 0.88rem;
  min-height: 0;
  margin: 0.2rem 0 0;
}

.form-note { font-size: 0.92rem; }

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(32, 42, 44, 0.45);
}

.modal-card {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--navy);
  width: min(520px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
}

.modal-card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }

body:has(.cookie:not([hidden])) {
  padding-bottom: 8.5rem;
}

.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--paper);
  border-top: 2px solid var(--navy);
  padding: 0.8rem 1rem;
}

.cookie-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
}

.cookie p { margin: 0; font-size: 0.95rem; }

.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.cookie-actions button {
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.cookie-actions .reject {
  background: var(--paper);
  color: var(--navy);
}

.site-footer {
  border-top: 2px solid var(--navy);
  background: var(--paper-2);
  padding: 1.2rem 1rem 2rem;
}

.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer h2 { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.4rem; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.site-footer li { margin: 0.25rem 0; }

.site-footer a { text-decoration: none; }

.site-footer a:hover { text-decoration: underline; }

.fine {
  max-width: 1440px;
  margin: 1rem auto 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.prose h2 { font-size: 1.28rem; margin: 1.4rem 0 0.4rem; }

.prose h3 { font-size: 1.05rem; margin: 1rem 0 0.3rem; }

.prose p { margin: 0.55rem 0; max-width: 44rem; }

.prose ul, .prose ol { max-width: 44rem; padding-left: 1.2rem; }

.reading-head {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.7rem;
  margin-bottom: 0.8rem;
}

.reading-head h1 { font-size: 1.7rem; }

.path-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.8rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.path-mini span {
  border: 1px solid var(--line);
  padding: 0.25rem 0.4rem;
  background: var(--paper);
}

.clause { scroll-margin-top: 80px; }

.margin-note {
  border-left: 3px solid var(--green);
  padding-left: 0.7rem;
  margin: 1rem 0;
  max-width: 44rem;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  margin: 0.6rem 0 0.8rem;
}

.compare section { padding: 0.7rem; }

.compare section + section { border-left: 1px solid var(--line); }

.compare h3 { margin: 0 0 0.35rem; font-size: 1rem; }

.letter-block { scroll-margin-top: 76px; }

.hidden-tools { display: none; }

@media (max-width: 1100px) {
  .console { grid-template-columns: 200px minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .timeline, .bay-row { grid-template-columns: 1fr 1fr; }
  .rel { grid-template-columns: 1fr; }
  .rel span.arrow { transform: rotate(90deg); justify-self: start; }
}

@media (max-width: 860px) {
  .nav-toggle, .index-toggle { display: inline-flex; }

  .mast-inner { flex-wrap: wrap; padding: 0.45rem 0.75rem 0.55rem; }

  .primary-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    order: 5;
    border-top: 1px solid rgba(241, 240, 233, 0.28);
  }

  .primary-nav.is-open { display: flex; }

  .primary-nav a, .nav-cta {
    border-left: 0;
    border-top: 1px solid rgba(241, 240, 233, 0.2);
    margin-left: 0;
    width: 100%;
  }

  .brand-sub { display: none; }

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

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

  .route-work { padding-right: 0; }

  .detail-rail {
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0.8rem 0 0;
    margin-top: 0.6rem;
  }

  .index-rail {
    display: none;
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .index-rail.is-open { display: block; }

  .index-toggle {
    margin: 0.6rem 0.75rem 0;
    color: var(--ink);
  }

  .console-main { padding: 0.4rem 0.85rem 2.4rem; }

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

  h1 { font-size: 1.55rem; }

  .trace {
    flex-direction: column;
    gap: 0;
    padding-left: 0.2rem;
  }

  .trace::before {
    left: 1.15rem;
    top: 0.4rem;
    bottom: 0.4rem;
    right: auto;
    width: 2px;
    height: auto;
  }

  .trace li { width: 100%; }

  .trace button {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "dot name" "dot code";
    column-gap: 0.7rem;
    min-height: 64px;
    margin: 0.28rem 0 0.28rem 0.35rem;
    width: calc(100% - 0.35rem);
  }

  .station-dot { grid-area: dot; align-self: center; }
  .trace .node-name { grid-area: name; }
  .trace .n { grid-area: code; }
  .awning { grid-area: name; justify-self: end; }

  .route-switcher { grid-template-columns: 1fr 1fr; }
  .route-switcher button:nth-child(3n) { border-right: 1px solid var(--line); }
  .route-switcher button:nth-child(2n) { border-right: 0; }

  .cookie-inner, .footer-grid, .compare, .term-grid { grid-template-columns: 1fr; }
  .term-grid dt { padding-bottom: 0; border-bottom: 0; }
  .system-index, .catalog { display: block; }
  .system-index thead, .catalog thead { display: none; }
  .system-index tbody, .catalog tbody, .system-index tr, .catalog tr, .system-index td, .catalog td { display: block; width: 100%; }
  .system-index tr, .catalog tr { border-bottom: 1px solid var(--line); padding: 0.45rem 0; }
  .system-index td, .catalog td { border-bottom: 0; padding: 0.15rem 0; }

  .mech-row { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body:has(.cookie:not([hidden])) { padding-bottom: 16rem; }
}

.page-home .board-head {
  display: block;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0.2rem;
}

.page-home .board-head .mono { color: var(--navy); }

.page-home .home-lead {
  max-width: 40rem;
  margin-top: 0.35rem;
}

.page-home .route-stage {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 34%);
  gap: 1.4rem;
  align-items: start;
  margin-top: 0.8rem;
  padding-bottom: 0.4rem;
}

.page-home .route-work { padding-right: 0; }

.page-home .route-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  margin: 0 0 0.7rem;
}

.page-home .route-switcher button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  min-height: 48px;
  margin: 0;
  padding: 0.4rem 0.75rem 0.45rem 0;
  text-align: left;
}

.page-home .route-switcher button:nth-child(3n),
.page-home .route-switcher button:nth-child(2n) { border-right: 0; }

.page-home .route-switcher button[aria-selected="true"] {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--route);
}

.page-home .route-switcher button[aria-selected="true"] .code { color: var(--route); }

.page-home .trace {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.85rem 0 0.2rem;
}

.page-home .trace::before {
  top: 1.15rem;
  left: 4%;
  right: 4%;
}

.page-home .trace button {
  border: 0;
  background: transparent;
  min-height: 0;
  padding: 0 0.15rem 0.35rem;
  text-align: center;
  color: var(--ink);
}

.page-home .trace button[aria-pressed="true"] {
  background: transparent;
  color: var(--ink);
}

.page-home .trace .station-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 0.45rem;
  border-radius: 50%;
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.page-home .trace button[aria-pressed="true"] .station-dot {
  background: var(--route);
  border-color: var(--route);
}

.page-home .trace .n,
.page-home .trace .node-name { text-align: center; }

.page-home .trace .node-name {
  font-size: 0.84rem;
  font-weight: 650;
}

.page-home .trace button[aria-pressed="true"] .node-name { color: var(--navy); }

.page-home .awning { margin: 0.25rem auto 0; }

.page-home .detail-rail {
  position: sticky;
  top: calc(var(--header) + 10px);
  max-height: 24rem;
  overflow: auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--route);
  padding: 0.75rem 0.9rem 0.9rem;
}

.page-home .node-panel p { line-height: 1.5; margin: 0.15rem 0 0.35rem; }
.page-home .node-panel h4 { margin-top: 0.55rem; }

.page-home .steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.page-home .steps li {
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.page-home .catalog p,
.page-home .system-index p {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.page-home .section-rule { margin-top: 2.5rem; }

@media (max-width: 1100px) {
  .page-home .steps { grid-template-columns: 1fr 1fr; }
  .page-home .route-stage { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .page-home .route-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); }
  .page-home .route-switcher button {
    margin: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0.6rem;
  }
  .page-home .route-switcher button:nth-child(2n) { border-right: 0; }
  .page-home .route-switcher button[aria-selected="true"] {
    background: var(--navy);
    color: var(--paper);
    border-bottom-color: var(--line);
  }
  .page-home .route-switcher button[aria-selected="true"] .code { color: #f2c48a; }
  .page-home .trace {
    display: flex;
    flex-direction: column;
    padding-left: 0.2rem;
  }
  .page-home .trace::before {
    top: 0.4rem;
    bottom: 0.4rem;
    left: 1.15rem;
    right: auto;
    width: 2px;
    height: auto;
  }
  .page-home .trace button {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "dot name" "dot code";
    text-align: left;
    min-height: 64px;
    margin: 0.28rem 0 0.28rem 0.35rem;
    width: calc(100% - 0.35rem);
    column-gap: 0.7rem;
    border: 1px solid var(--navy);
    background: var(--paper);
    padding: 0.4rem 0.55rem;
  }
  .page-home .trace button[aria-pressed="true"] {
    background: var(--navy);
    color: var(--paper);
  }
  .page-home .trace .station-dot { grid-area: dot; margin: 0; align-self: center; border-radius: 0; }
  .page-home .trace .node-name { grid-area: name; text-align: left; }
  .page-home .trace .n { grid-area: code; text-align: left; }
  .page-home .trace button[aria-pressed="true"] .node-name { color: var(--paper); }
  .page-home .awning { grid-area: name; justify-self: end; margin: 0; }
  .page-home .detail-rail {
    position: static;
    max-height: none;
    top: auto;
  }
  .page-home .steps { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .route-switcher { grid-template-columns: 1fr; }
  .route-switcher button { border-right: 0; }
  .page-home .route-switcher { grid-template-columns: 1fr; }
  .page-home .route-switcher button { border-right: 0; }
  .bay-row, .timeline { grid-template-columns: 1fr; }
  .timeline div { border-right: 0; border-bottom: 1px solid var(--line); }
  .cookie-actions, .cookie-actions button { width: 100%; }
}
