:root {
  --paper: #f2f1eb;
  --surface: #fbfaf6;
  --ink: #141414;
  --muted: #65645f;
  --line: #141414;
  --soft-line: #cbc9bf;
  --accent: #f7a800;
  --accent-2: #84c6e3;
  --accent-3: #f54129;
  --accent-4: #ffd166;
  --accent-5: #a9c8ff;
  --radius: 6px;
  --shell: 1180px;
  --route-cycle: 5.2s;
  --font-sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

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

button {
  color: inherit;
}

mark {
  color: var(--ink);
  background: var(--accent);
  border-radius: 3px;
  padding: 0 0.08em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 8px 12px;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--radius);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  padding: 0 max(24px, calc((100% - var(--shell)) / 2));
  background: rgba(242, 241, 235, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  font-size: 21px;
  font-weight: 700;
}

.brand mark {
  margin-left: 4px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a,
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.site-nav a::before,
.header-link::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--accent);
  border: 1px solid var(--ink);
  border-radius: 50%;
  content: "";
}

.site-nav a,
.site-footer a {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

.header-link {
  justify-self: end;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.header-link:hover,
.secondary-action:hover,
.copy-command:hover {
  background: var(--accent);
}

.hero {
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-top: 42px;
  padding-bottom: 24px;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: 68px;
  font-weight: 700;
  line-height: 1.03;
}

h2 {
  margin-bottom: 18px;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
}

.hero-lede {
  max-width: 720px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 18px;
}

.install-line {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 46px;
  padding: 0 6px 0 16px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.install-line code,
.code-workbench code,
.evidence-core code {
  font-family: var(--font-mono);
}

.copy-command {
  min-width: 66px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.route-lab {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.route-lab-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  min-height: 84px;
  padding-block: 14px;
}

.route-lab-head h2 {
  margin: 0;
  font-size: 24px;
}

.route-tabs,
.code-tabs {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.route-tabs {
  overflow: hidden;
}

.code-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}

.route-tabs button,
.code-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.route-tabs button {
  overflow: hidden;
}

.route-tabs button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
}

.route-lab.is-cycling .route-tabs button[aria-selected="true"]::after {
  animation: route-progress var(--route-cycle) linear forwards;
}

.route-tabs button:last-child,
.code-tabs button:last-child {
  border-right: 0;
}

.route-tabs button[aria-selected="true"],
.code-tabs button[aria-selected="true"] {
  background: var(--accent);
  font-weight: 500;
}

.model-pool {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding-block: 7px;
  border-top: 1px solid var(--soft-line);
}

.model-pool > span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.model-pool ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0 0 2px;
  list-style: none;
}

.model-pool li {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: var(--surface);
}

.model-pool li::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.model-pool li.is-selected { background: var(--accent); border-color: var(--line); }
.model-pool li.is-selected::before { background: var(--ink); }
.model-pool li.is-orchestrator { background: var(--accent-2); border-color: var(--line); }
.model-pool li.is-orchestrator::before { background: var(--accent-5); }
.model-pool li.is-fallback { background: var(--accent-4); }
.model-pool li.is-filtered { border-style: dashed; opacity: 0.58; }

.model-pool li.is-selected small,
.model-pool li.is-orchestrator small,
.model-pool li.is-fallback small {
  color: var(--ink);
}

.model-pool strong,
.model-pool small {
  font-family: var(--font-mono);
  line-height: 1.2;
}

.model-pool strong {
  font-size: 12px;
  font-weight: 500;
}

.model-pool small {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.graph-scroll {
  overflow: hidden;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.graph-stage {
  position: relative;
  width: 100%;
  height: 370px;
  background: var(--paper);
}

#route-canvas,
.route-nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-nodes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-node {
  --node-width: clamp(156px, 14vw, 178px);

  position: absolute;
  left: clamp(calc(var(--node-width) / 2 + 6px), var(--x), calc(100% - var(--node-width) / 2 - 6px));
  top: var(--y);
  width: var(--node-width);
  min-height: 82px;
  transform: translate(-50%, -50%);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  animation: route-node-enter 360ms ease both;
  animation-delay: var(--delay);
}

.route-node small,
.route-node span {
  display: block;
}

.route-node small {
  margin-bottom: 5px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  text-transform: uppercase;
}

.route-node strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.route-node span {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
}

.route-node.is-router { background: var(--accent); }
.route-node.is-success { background: var(--accent-2); }
.route-node.is-failure { background: var(--accent-3); }
.route-node.is-review { background: var(--accent-4); }
.route-node.is-output { color: var(--paper); background: var(--ink); }
.route-node.is-output small { color: #c9c7be; }
.route-node.is-skipped { background: var(--paper); border-style: dashed; box-shadow: none; opacity: 0.72; }
.route-node.is-tool { background: var(--accent-5); }

.route-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 0;
  margin-bottom: 0;
}

.route-metrics div {
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
  animation: route-metric-enter 280ms ease both;
  animation-delay: var(--delay);
}

.route-metrics div:last-child {
  border-right: 1px solid var(--line);
}

.route-metrics dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.route-metrics dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 500;
}

.runtime-band {
  padding: 78px 0 84px;
  color: var(--paper);
  background: var(--ink);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 46px;
}

.section-heading > p:last-child {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.section-heading.inverted > p:last-child {
  color: #b7b5ac;
}

.runtime-flow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding-left: 0;
  list-style: none;
  border-top: 1px solid #4c4b47;
  border-bottom: 1px solid #4c4b47;
}

.runtime-flow li {
  position: relative;
  min-height: 145px;
  padding: 18px 12px;
  border-right: 1px solid #4c4b47;
}

.runtime-flow li:first-child {
  border-left: 1px solid #4c4b47;
}

.runtime-flow span,
.runtime-flow small,
.runtime-flow strong {
  display: block;
}

.runtime-flow span,
.runtime-flow small {
  font-family: var(--font-mono);
}

.runtime-flow span {
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.runtime-flow strong {
  margin-bottom: 7px;
  font-size: 15px;
}

.runtime-flow small {
  color: #96948d;
  font-size: 12px;
  line-height: 1.4;
}

.evidence-section,
.strategies-section,
.api-section,
.boundaries-section {
  padding-block: 100px;
}

.evidence-map {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  max-width: 980px;
  margin-inline: auto;
  background: var(--line);
  border: 1px solid var(--line);
}

.evidence-source,
.evidence-core {
  min-height: 184px;
  padding: 22px;
  background: var(--surface);
}

.evidence-source span,
.evidence-core span {
  display: block;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.evidence-source strong,
.evidence-core strong {
  display: block;
  margin-bottom: 9px;
  font-size: 18px;
}

.evidence-source p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.evidence-core {
  grid-column: 1 / -1;
  min-height: 160px;
  color: var(--paper);
  background: var(--ink);
  text-align: center;
}

.evidence-core span {
  color: var(--accent);
}

.evidence-core strong {
  font-size: 28px;
}

.evidence-core code {
  color: var(--accent-2);
  font-size: 12px;
}

.source-task { border-top: 8px solid var(--accent); }
.source-card { border-top: 8px solid var(--accent-2); }
.source-live { border-bottom: 8px solid var(--accent-3); }
.source-local { border-bottom: 8px solid var(--accent-4); }

.strategies-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.strategy-card {
  min-height: 330px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.strategy-card > p:last-child {
  color: var(--muted);
}

.strategy-card.accent-naranja { border-top: 8px solid var(--accent); }
.strategy-card.accent-celeste { border-top: 8px solid var(--accent-2); }
.strategy-card.accent-rojo { border-top: 8px solid var(--accent-3); }
.strategy-card.accent-ambar { border-top: 8px solid var(--accent-4); }
.strategy-card.accent-azul { border-top: 8px solid var(--accent-5); }
.strategy-card.accent-ink { border-top: 8px solid var(--ink); }

.mini-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  margin-bottom: 24px;
  padding-inline: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.mini-route i,
.mini-route b,
.mini-route em,
.mini-route span {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.mini-route b { background: var(--accent); }
.mini-route em { background: var(--accent-3); border-radius: 3px; }
.mini-route span { background: var(--ink); }

.mini-route > *:not(:last-child)::after {
  position: absolute;
  top: 10px;
  left: 21px;
  width: 54px;
  height: 1px;
  background: var(--ink);
  content: "";
}

.mini-route.fusion b,
.mini-route.tools b {
  background: var(--accent-2);
}

.mini-route.critique b:last-child {
  background: var(--accent-4);
}

.api-section {
  color: var(--paper);
  background: var(--ink);
}

.api-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(520px, 1.2fr);
  gap: 70px;
  align-items: start;
}

.api-section .section-heading {
  margin-bottom: 0;
}

.api-section .section-heading > p:last-of-type {
  color: #b7b5ac;
}

.api-contracts {
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #4c4b47;
}

.api-contracts li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  color: #b7b5ac;
  border-bottom: 1px solid #4c4b47;
  font-size: 13px;
}

.api-contracts .contract-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.api-contracts .contract-copy {
  min-width: 0;
}

.code-workbench {
  min-width: 0;
  background: #20201e;
  border: 1px solid #68665f;
  border-radius: var(--radius);
}

.code-tabs {
  border: 0;
  border-bottom: 1px solid #68665f;
  border-radius: 0;
}

.code-tabs button {
  color: var(--paper);
  background: #20201e;
  border-color: #68665f;
}

.code-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px 0 18px;
  color: #9f9d94;
  border-bottom: 1px solid #45443f;
  font-family: var(--font-mono);
  font-size: 12px;
}

.code-workbench pre {
  min-height: 390px;
  margin: 0;
  overflow: auto;
  padding: 24px;
  color: #e8e6dc;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  tab-size: 4;
}

.boundary-table {
  width: 100%;
  border-top: 1px solid var(--line);
  border-collapse: collapse;
}

.boundary-row {
  display: grid;
  grid-template-columns: 1.1fr 0.55fr 2fr;
  gap: 22px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-row th,
.boundary-row td {
  padding: 0;
  text-align: left;
  vertical-align: top;
}

.boundary-row th {
  font-weight: 700;
}

.boundary-row td:last-child {
  color: var(--muted);
}

.boundary-head {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.state {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.state.live { background: var(--accent); }
.state.bounded { background: var(--accent-4); }
.state.planned { background: var(--accent-3); }

.final-cta {
  padding: 96px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.final-cta h2 {
  font-size: 58px;
}

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

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 500;
}

.primary-action {
  color: var(--paper);
  background: var(--ink);
}

.primary-action:hover {
  color: var(--ink);
  background: var(--accent);
}

.secondary-action {
  background: var(--surface);
}

.site-footer {
  padding: 36px 0 48px;
}

.site-footer {
  border-top: 1px solid var(--soft-line);
}

.site-footer .page-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.site-footer strong {
  font-size: 18px;
}

.footer-meta {
  display: grid;
  gap: 4px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.footer-meta p:last-child {
  color: var(--ink);
}

.footer-meta a {
  text-decoration: underline;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
}

.copy-toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  min-width: 140px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--paper);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
.graph-scroll:focus-visible,
[role="tabpanel"]:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 3px;
}

@keyframes route-progress {
  to { transform: scaleX(1); }
}

@keyframes route-node-enter {
  from {
    transform: translate(-50%, -44%) scale(0.98);
  }

  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes route-metric-enter {
  from { transform: translateY(3px); }
  to { transform: translateY(0); }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  h1 {
    font-size: 58px;
  }

  .route-lab-head {
    display: block;
    padding-block: 12px;
  }

  .route-lab-head > div:first-child {
    margin-bottom: 10px;
  }

  .route-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .route-tabs button {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

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

  .route-tabs button:nth-last-child(-n + 4) {
    border-bottom: 0;
  }

  .runtime-flow {
    grid-template-columns: repeat(4, 1fr);
  }

  .runtime-flow li:nth-child(4) {
    border-right: 0;
  }

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

  .api-layout {
    grid-template-columns: 1fr;
  }

}

@media (min-width: 761px) and (max-width: 980px) {
  .route-node {
    --node-width: clamp(138px, 18.5vw, 156px);
  }

  .route-node[data-column="start"] { left: 10%; }
  .route-node[data-column="router"] { left: 30%; }
  .route-node[data-column="workers"] { left: 50%; }
  .route-node[data-column="review"] { left: 70%; }
  .route-node[data-column="output"] { left: 90%; }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .site-header {
    min-height: 58px;
    padding-inline: 14px;
  }

  .header-link {
    padding: 6px 10px;
  }

  .hero-copy {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 34px;
  }

  .hero-lede,
  .section-heading > p:last-child {
    font-size: 16px;
  }

  .install-line {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .route-lab-head .eyebrow {
    margin-bottom: 6px;
  }

  .model-pool ul {
    flex-wrap: wrap;
    overflow: visible;
  }

  .model-pool {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .graph-stage {
    width: 100%;
    height: auto;
  }

  #route-canvas {
    display: none;
  }

  .route-nodes {
    position: relative;
    inset: auto;
    display: grid;
    width: auto;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .route-node {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    min-height: 92px;
    transform: none;
    padding: 10px 12px;
    animation: route-metric-enter 280ms ease both;
  }

  .route-node.is-output {
    grid-column: 1 / -1;
  }

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

  .route-metrics div {
    min-width: 0;
    border-right: 1px solid var(--line);
  }

  .route-metrics div:last-child {
    grid-column: 1 / -1;
    border-right: 1px solid var(--line);
  }

  .runtime-band,
  .evidence-section,
  .strategies-section,
  .api-section,
  .boundaries-section {
    padding-block: 72px;
  }

  .runtime-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .runtime-flow li,
  .runtime-flow li:nth-child(4) {
    border-right: 1px solid #4c4b47;
  }

  .runtime-flow li:nth-child(2n) {
    border-right: 0;
  }

  .strategy-grid,
  .evidence-map {
    grid-template-columns: 1fr;
  }

  .evidence-core {
    grid-column: 1;
  }

  .strategy-card {
    min-height: 300px;
  }

  .api-layout {
    gap: 42px;
  }

  .code-workbench pre {
    min-height: 430px;
    font-size: 12px;
  }

  .boundary-head {
    display: none;
  }

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

  .boundary-row > :last-child {
    grid-column: 1 / -1;
  }

  .final-cta h2 {
    font-size: 44px;
  }

  .cta-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .site-footer nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 360px) {
  .hero-copy {
    padding-top: 18px;
    padding-bottom: 14px;
  }

  h1 {
    margin-bottom: 16px;
    font-size: 42px;
  }

  .hero-lede {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
  }

  .install-line {
    min-height: 42px;
  }

  .install-line code {
    font-size: 14px;
  }

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

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

  .route-tabs button:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .route-tabs button:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

/* ── Hero asimétrico: copy + panel de red ───────────────────────────── */

.hero-split {
  padding-bottom: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: end;
  padding: 46px 0 40px;
}

.hero-split .hero-copy {
  padding: 0;
}

/* Reveal escalonado en la carga */
.hero-split .eyebrow { animation: rise 0.6s 0.02s both; }
.hero-split h1 { animation: rise 0.6s 0.08s both; }
.hero-split .hero-lede { animation: rise 0.6s 0.16s both; }
.hero-split .install-line { animation: rise 0.6s 0.24s both; }
.net-panel { animation: rise 0.7s 0.3s both; }

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

.net-panel {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.net-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.net-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: net-pulse 2.4s ease-out infinite;
}

@keyframes net-pulse {
  0% { box-shadow: 0 0 0 0 rgba(247, 168, 0, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(247, 168, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(247, 168, 0, 0); }
}

.net-stats {
  margin: 0;
  padding: 4px 0;
}

.net-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.net-stats dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.net-stats dd {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.net-panel-foot {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ── Ticker: banda tipo teletipo de parada ──────────────────────────── */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  padding: 11px 0;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
  animation: ticker-scroll 34s linear infinite;
}

.ticker-track span {
  padding-left: 22px;
}

.ticker-track i {
  font-style: normal;
  color: var(--accent);
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── Tablón de llegadas (sección "En vivo") ─────────────────────────── */

.board-section {
  padding: 64px 0 24px;
  border-top: 1px solid var(--soft-line);
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.board-note {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.stop-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.stop-board > header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.stop-board > header strong {
  display: block;
  font-size: 15px;
}

.stop-board > header small {
  color: rgba(242, 241, 235, 0.7);
  font-family: var(--font-mono);
  font-size: 12px;
}

.stop-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  color: var(--ink);
  background: var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
}

.arrivals {
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.arrival {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--soft-line);
  animation: arrival-in 0.45s ease both;
}

.arrival:last-child {
  border-bottom: 0;
}

.arrival-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 7px;
  color: #fff;
  background: var(--line-color, var(--ink));
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.arrival-dest {
  font-size: 15px;
}

.arrival-min {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.board-request {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.board-request pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.board-request p {
  margin: 0;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes arrival-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Cómo funciona: línea de tiempo vertical ────────────────────────── */

.flow-section {
  padding: 60px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.flow-head {
  max-width: 640px;
  margin-bottom: 34px;
}

.flow-head h2 {
  margin-bottom: 12px;
}

.flow-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.flow-rail {
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-rail li {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--soft-line);
}

.flow-rail li:last-child {
  border-bottom: 1px solid var(--soft-line);
}

/* Línea vertical que conecta los números.
   La columna del número mide 92px y el círculo (52px) se centra en ella con
   justify-self, así que su centro cae exactamente en 46px; la línea se dibuja
   ahí para pasar por el centro de cada número. */
.flow-rail li::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 46px;
  width: 2px;
  transform: translateX(-1px);
  background: var(--soft-line);
}

.flow-rail li:first-child::before { top: 22px; }
.flow-rail li:last-child::before { bottom: auto; height: 22px; }

.flow-num {
  position: relative;
  z-index: 1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  transition: background 0.35s ease;
}

/* Al hacer scroll, cada paso que ya has alcanzado se ilumina en naranja
   (lo activa un IntersectionObserver en app.js). El hover mantiene el efecto. */
.flow-rail li.is-active .flow-num,
.flow-rail li:hover .flow-num {
  background: var(--accent);
}

.flow-rail li.is-active::before {
  background: var(--accent);
  transition: background 0.35s ease;
}

.flow-body strong {
  display: block;
  margin-bottom: 5px;
  font-size: 19px;
}

.flow-body p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* ── Resiliencia: comparativa problema / respuesta ──────────────────── */

.resil-section {
  padding: 66px 0;
}

.resil-compare {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.resil-colhead,
.resil-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.resil-colhead {
  border-bottom: 1px solid var(--line);
}

.resil-tag {
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resil-tag.bad {
  color: var(--paper);
  background: var(--ink);
}

.resil-tag.good {
  color: var(--ink);
  background: var(--accent);
}

.resil-row {
  border-bottom: 1px solid var(--soft-line);
}

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

.resil-problem,
.resil-solution {
  padding: 18px;
}

.resil-problem {
  border-right: 1px solid var(--soft-line);
  background: var(--paper);
}

.resil-solution {
  background: var(--surface);
}

.resil-problem strong,
.resil-solution strong {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

.resil-problem p,
.resil-solution p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.resil-solution strong {
  padding-left: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3' fill='none' stroke='%23f7a800' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left 0.35em no-repeat;
}

/* ── Endpoints: panel de salidas ────────────────────────────────────── */

.ep-section {
  padding: 6px 0 66px;
}

.ep-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

.ep-featured {
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.ep-featured-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ep-featured h3 {
  margin-bottom: 12px;
  font-size: 26px;
}

.ep-featured h3 code {
  font-family: var(--font-mono);
}

.ep-featured > p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15.5px;
}

.ep-badge {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.ep-featured-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--soft-line);
}

.ep-featured-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 14.5px;
}

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

.ep-featured-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.ep-board {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ep-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "method path"
    "method desc";
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--soft-line);
  transition: background 0.15s ease;
}

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

.ep-row:hover {
  background: var(--surface);
}

.ep-method {
  grid-area: method;
  align-self: center;
  padding: 3px 9px;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.ep-method.get { background: #008431; }
.ep-method.post { background: var(--accent-3); }

.ep-path {
  grid-area: path;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}

.ep-desc {
  grid-area: desc;
  color: var(--muted);
  font-size: 14px;
}

.ep-access {
  grid-area: method;
  justify-self: end;
  align-self: center;
}

/* El acceso se apila bajo el método en la fila; lo mostramos como etiqueta */
.ep-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "method path access"
    "method desc access";
}

.ep-access {
  grid-area: access;
  justify-self: end;
  padding: 2px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ep-access.key {
  border-color: var(--line);
  background: var(--accent);
  color: var(--ink);
}

.ep-more {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.ep-more a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ep-more a:hover {
  color: var(--accent-3);
}

/* ── Integración: cabecera con contratos + código a ancho completo ──── */

.int-section {
  padding: 60px 0;
  background: var(--ink);
  color: var(--paper);
}

.int-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 26px;
}

.int-head .eyebrow {
  color: var(--accent);
}

.int-head h2 {
  margin: 0;
  color: var(--paper);
}

.int-contracts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.int-contracts li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(242, 241, 235, 0.16);
  font-size: 15px;
  color: rgba(242, 241, 235, 0.82);
}

.int-contracts li span:first-child {
  flex: 0 0 66px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.int-contracts code {
  font-family: var(--font-mono);
  color: var(--paper);
}

.int-code {
  border-color: rgba(242, 241, 235, 0.22);
}

/* ── CTA: panel a ancho completo ────────────────────────────────────── */

.cta-section {
  padding: 66px 0;
}

.cta-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.cta-panel h2 {
  margin: 8px 0 0;
  font-size: 40px;
}

/* ── Responsive de las secciones nuevas ─────────────────────────────── */

@media (max-width: 880px) {
  .hero-grid,
  .ep-layout,
  .int-head {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .net-panel {
    justify-self: stretch;
  }
}

@media (max-width: 620px) {
  .resil-colhead,
  .resil-row {
    grid-template-columns: 1fr;
  }

  .resil-problem {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .ep-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "method path"
      "desc desc"
      "access access";
  }

  .ep-access {
    justify-self: start;
  }

  .flow-rail li {
    grid-template-columns: 64px 1fr;
    gap: 16px;
  }

  .flow-rail li::before {
    left: 32px;
  }

  .flow-num {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .cta-panel {
    padding: 28px;
  }
}

/* ── Página de documentación (docs.html) ────────────────────────────── */

.docs-body {
  scroll-padding-top: 84px;
}

.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 48px;
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
  padding: 40px 0 80px;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.docs-nav-title {
  margin: 18px 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.docs-nav-title:first-child {
  margin-top: 0;
}

.docs-sidebar a {
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.docs-sidebar a:hover {
  color: var(--ink);
  background: var(--surface);
}

.docs-content {
  min-width: 0;
}

.docs-content section {
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.docs-h1 {
  margin-bottom: 16px;
  font-size: 46px;
  line-height: 1.05;
}

.docs-lede {
  max-width: 720px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 18px;
}

.docs-h2 {
  margin: 12px 0 16px;
  padding-top: 20px;
  font-size: 30px;
  border-top: 1px solid var(--soft-line);
}

.docs-h3 {
  margin: 22px 0 10px;
  font-size: 17px;
}

.docs-content p {
  max-width: 760px;
  margin-bottom: 14px;
}

.docs-list {
  max-width: 760px;
  margin: 0 0 16px;
  padding-left: 20px;
}

.docs-list li {
  margin-bottom: 8px;
}

.docs-content code,
.docs-sidebar code {
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--soft-line);
  border-radius: 4px;
}

.docs-callout {
  max-width: 760px;
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
}

.docs-callout code {
  background: var(--paper);
}

.docs-table {
  width: 100%;
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-collapse: collapse;
  font-size: 14px;
  overflow: hidden;
}

.docs-table th,
.docs-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--soft-line);
}

.docs-table thead th {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-table td code {
  background: var(--surface);
}

.req {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  color: var(--ink);
  background: var(--accent);
  border-radius: 3px;
  border: 1px solid var(--line) !important;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.code-block {
  max-width: 760px;
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: var(--paper);
  background: var(--ink);
}

.code-block pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

.endpoint {
  padding: 22px 0 8px;
  border-top: 1px solid var(--soft-line);
}

.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.method {
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.method.get {
  background: #008431;
}

.method.post {
  background: var(--accent-3);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.badge-public,
.badge-key {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.badge-public {
  background: var(--accent-2);
}

.badge-key {
  background: var(--accent);
}

.docs-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.docs-footer p {
  margin-bottom: 4px;
}

@media (max-width: 860px) {
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--soft-line);
    padding-bottom: 16px;
  }

  .docs-sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-h1 {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Página del mapa de paradas (paradas.html) ──────────────────────── */

.map-body {
  height: 100vh;
  overflow: hidden;
}

/* La cabecera es fija (66px); el mapa ocupa el resto de la ventana.
   Tres columnas: filtros (izquierda), mapa (centro) y lista de paradas (derecha). */
.map-page {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  height: calc(100vh - 67px);
}

.map-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

/* Columna derecha: lista de paradas encontradas, prominente y con scroll. */
.map-results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--soft-line);
}

.map-intro {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--soft-line);
}

.map-intro h1 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.05;
}

.map-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.map-controls {
  padding: 16px 22px;
  border-bottom: 1px solid var(--soft-line);
}

.map-search input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.map-search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-group {
  margin-top: 16px;
}

.filter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.filter-reset {
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.filter-reset:hover {
  background: var(--accent);
}

/* Chips de línea: fila con scroll vertical acotado. */
.line-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
  padding-right: 4px;
}

.line-chip {
  --c: #141414;
  --t: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 30px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--c);
  border-radius: 4px;
  cursor: pointer;
}

.line-chip:hover {
  background: #efeee7;
}

/* Activo: NO monocolor. La franja de color de la línea (border-left) se conserva
   y se ensancha; la selección se marca con el resto del borde en tinta, fondo
   tenue y negrita. Se fijan los bordes por lado para no pisar el color izquierdo. */
/* Activo: la pastilla se rellena con el color de la línea y el número usa el
   color contrastado. Nada de franja lateral. */
.line-chip.is-active {
  color: var(--t);
  background: var(--c);
  border-color: var(--ink);
  font-weight: 700;
}

.zone-select {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.results-count {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* Lista de resultados: ocupa el espacio restante y hace scroll. */
.stop-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 12px 16px;
  list-style: none;
  overflow-y: auto;
}

.stop-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.stop-item:hover {
  background: var(--paper);
}

.stop-item-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--accent);
  border-radius: 4px;
}

.stop-item-body strong {
  display: block;
  font-size: 14.5px;
  line-height: 1.25;
}

.stop-item-body small {
  display: block;
  margin: 2px 0 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.stop-item-lines,
.popup-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Número de línea: pastilla con el color oficial de la línea de fondo y el
   número en color contrastado (como los indicadores de bus). Sin franja lateral. */
.mini-line {
  --c: #141414;
  --t: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--t);
  background: var(--c);
  border-radius: 4px;
}

.stop-item-more {
  padding: 12px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.map-canvas {
  width: 100%;
  height: 100%;
  background: var(--paper);
}

/* Ficha (popup) de Leaflet con el estilo del sistema. */
.leaflet-popup-content-wrapper {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.popup-stop {
  font-family: var(--font-sans);
}

.popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.popup-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--accent);
  border-radius: 4px;
}

.popup-head strong {
  font-size: 15px;
}

.popup-dir {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.popup-endpoint {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-3);
}

@media (max-width: 980px) {
  .map-body {
    height: auto;
    overflow: auto;
  }

  /* Se apilan las tres zonas: filtros, mapa y lista de resultados. */
  .map-page {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-results {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stop-list {
    max-height: 380px;
  }

  .map-canvas {
    height: 60vh;
    min-height: 380px;
  }
}
