:root {
  --brand: #00594e;
  --brand-2: #0d7a6b;
  --gold: #b5a160;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 600px at 10% 0%, rgba(0, 89, 78, 0.14), transparent 60%),
    radial-gradient(900px 600px at 92% 10%, rgba(181, 161, 96, 0.12), transparent 58%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 52%, #f8fafc 100%);
}

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

.docs-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 8px;
}

.docs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

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

.docs-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 89, 78, 0.08);
  border: 1px solid rgba(0, 89, 78, 0.14);
  color: var(--brand);
  flex: 0 0 auto;
}

.docs-brand-copy {
  min-width: 0;
}

.docs-brand-kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 2px;
}

.docs-brand-title {
  display: block;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.docs-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.docs-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #334155;
  font-size: 0.92rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.docs-links a:hover,
.docs-links a.is-active {
  background: rgba(0, 89, 78, 0.08);
  color: var(--brand);
  transform: translateY(-1px);
}

.docs-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(0, 89, 78, 0.18);
  white-space: nowrap;
}

.page-wrap {
  padding-top: 22px;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumb strong {
  color: var(--ink);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 34px;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 360px at 0% 0%, rgba(0, 89, 78, 0.16), transparent 62%),
    radial-gradient(700px 320px at 100% 0%, rgba(181, 161, 96, 0.12), transparent 58%);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.48rem 0.84rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-lead {
  margin: 0;
  max-width: 980px;
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.75;
}

.tag-row,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.48rem 0.84rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 16px 34px rgba(0, 89, 78, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-6 {
  grid-column: span 6;
}

.span-4 {
  grid-column: span 4;
}

.card {
  height: 100%;
  border-radius: 24px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  padding: 24px;
}

.card h2,
.card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: #475569;
  line-height: 1.75;
}

.list {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  line-height: 1.75;
}

.list li + li {
  margin-top: 8px;
}

.faq-stack {
  display: flex;
  flex-direction: column;
}

.faq-item + .faq-item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: var(--ink);
}

.faq-item p {
  margin: 0;
  color: #475569;
  line-height: 1.75;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 1));
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 18px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

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

.module-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(0, 89, 78, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 1));
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: rgba(0, 89, 78, 0.08);
  border: 1px solid rgba(0, 89, 78, 0.12);
}

.module-card h3 {
  margin: 0;
  font-size: 1rem;
}

.module-card p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
  font-size: 0.92rem;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.58rem 0.84rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 700;
}

.chip-link:hover {
  background: rgba(0, 89, 78, 0.08);
  color: var(--brand);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  vertical-align: top;
}

th {
  background: rgba(248, 250, 252, 0.9);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

td {
  color: #334155;
}

.notice {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(181, 161, 96, 0.1);
  border: 1px solid rgba(181, 161, 96, 0.18);
  color: #5b4f22;
  line-height: 1.7;
}

.docs-footer {
  margin-top: 28px;
  padding: 22px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ── Fórmulas ─────────────────────────────────────────────── */
.formula {
  margin: 14px 0 0;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  font-family: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.98rem;
  line-height: 1.8;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.formula-title {
  display: block;
  font-family: "Open Sans", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
  margin-bottom: 10px;
  font-weight: 700;
}

.formula-body {
  display: block;
  padding: 6px 0 10px;
  font-size: 1.02rem;
}

.formula-note {
  display: block;
  font-size: 0.82rem;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.formula + .formula {
  margin-top: 10px;
}

.formula .op { color: #f0a500; font-weight: 700; }
.formula .var { color: #4dd0e1; }
.formula .val { color: #28e4c0; font-weight: 700; }
.formula .comment { color: #64748b; font-style: italic; }
.formula .frac { display: inline-block; vertical-align: middle; text-align: center; padding: 0 6px; }
.formula .frac .num { display: block; border-bottom: 1px solid #cbd5e1; padding: 0 4px 2px; }
.formula .frac .den { display: block; padding: 2px 4px 0; }

/* ── Diagramas SVG ────────────────────────────────────────── */
.diagram {
  margin: 14px 0 0;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow-x: auto;
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.diagram-caption {
  display: block;
  margin-top: 12px;
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ── Vista en vivo (iframe documental) ────────────────────── */
.doc-live {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #0f172a;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  display: grid;
  grid-template-rows: auto 1fr;
}

.doc-live-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-live-dots {
  display: inline-flex;
  gap: 6px;
  margin-right: 6px;
}

.doc-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.doc-live-dot.is-red { background: #ef4444; }
.doc-live-dot.is-yellow { background: #f59e0b; }
.doc-live-dot.is-green { background: #10b981; }

.doc-live-url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-live-url i {
  color: #10b981;
  font-size: 0.72rem;
}

.doc-live-actions {
  display: inline-flex;
  gap: 6px;
}

.doc-live-btn {
  appearance: none;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.doc-live-btn:hover {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

.doc-live-btn.is-active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

.doc-live-frame {
  position: relative;
  background: #fff;
  height: 720px;
  max-height: 80vh;
  overflow: hidden;
}

.doc-live-frame iframe {
  border: 0;
  display: block;
  transform: scale(0.72);
  transform-origin: top left;
  width: calc(100% / 0.72);
  height: calc(100% / 0.72);
}

.doc-live.is-expanded .doc-live-frame {
  height: 90vh;
  max-height: 90vh;
}

.doc-live.is-expanded .doc-live-frame iframe {
  transform: scale(0.85);
  width: calc(100% / 0.85);
  height: calc(100% / 0.85);
}

@media (max-width: 1024px) {
  .doc-live-frame iframe {
    transform: scale(0.6);
    width: calc(100% / 0.6);
    height: calc(100% / 0.6);
  }
}

@media (max-width: 640px) {
  .doc-live-frame iframe {
    transform: scale(0.5);
    width: calc(100% / 0.5);
    height: calc(100% / 0.5);
  }
}

.doc-live-legend {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.doc-live-legend-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.9rem;
  color: #334155;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.doc-live-legend-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.doc-live-legend-item strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
  font-size: 0.88rem;
}

.doc-live-goto {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-live-goto button {
  appearance: none;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.doc-live-goto button:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.doc-live-goto button.is-active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

@media (max-width: 820px) {
  .doc-live-frame {
    height: 520px;
  }

  .doc-live-url {
    font-size: 0.7rem;
  }
}

/* ── Mockups ─────────────────────────────────────────────── */
.mockup {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

.mockup-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #e2e8f0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.mockup-dot.is-red { background: #fca5a5; }
.mockup-dot.is-yellow { background: #fcd34d; }
.mockup-dot.is-green { background: #86efac; }

.mockup-url {
  flex: 1;
  font-family: "JetBrains Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: #64748b;
  padding: 4px 10px;
  background: #fff;
  border-radius: 6px;
  margin-left: 8px;
}

.mockup-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.mockup-hero {
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #003d36 0%, #00594e 55%, #006064 100%);
  color: #fff;
}

.mockup-hero-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.mockup-hero-sub {
  font-size: 0.78rem;
  opacity: 0.8;
  margin: 0 0 12px;
}

.mockup-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mockup-kpi {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.mockup-kpi-val {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mockup-kpi-lbl {
  display: block;
  font-size: 0.68rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mockup-tabs {
  display: flex;
  gap: 6px;
  padding: 0 2px;
}

.mockup-tab {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
}

.mockup-tab.is-active {
  background: #00594e;
  color: #fff;
  border-color: #00594e;
}

.mockup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 220px;
  gap: 10px;
}

.mockup-chart {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  padding: 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mockup-chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.mockup-chart-body {
  flex: 1;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent 60%, rgba(0, 151, 167, 0.18) 60%, rgba(0, 151, 167, 0.28) 100%),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.04) 0 1px, transparent 1px 18px);
}

.mockup-chart.is-bars .mockup-chart-body {
  background:
    linear-gradient(90deg,
      transparent 0 6%, #28e4c0 6% 14%, transparent 14% 22%,
      #4dd0e1 22% 30%, transparent 30% 38%,
      #f0a500 38% 46%, transparent 46% 54%,
      #a29bfe 54% 62%, transparent 62% 70%,
      #28e4c0 70% 78%, transparent 78% 86%,
      #4dd0e1 86% 94%, transparent 94% 100%);
  background-size: 100% 60%;
  background-position: bottom;
  background-repeat: no-repeat;
}

.mockup-chart.is-map .mockup-chart-body {
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 151, 167, 0.4) 0, transparent 24%),
    radial-gradient(circle at 60% 55%, rgba(40, 228, 192, 0.4) 0, transparent 20%),
    radial-gradient(circle at 75% 35%, rgba(240, 165, 0, 0.3) 0, transparent 18%),
    #eef2f6;
}

.mockup-filters {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mockup-filter-row {
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.mockup-filter-label {
  font-size: 0.66rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

@media (max-width: 820px) {
  .mockup-grid {
    grid-template-columns: 1fr;
  }

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

  .formula {
    font-size: 0.88rem;
    padding: 14px 16px;
  }
}

@media (max-width: 1280px) {
  .docs-shell {
    width: min(1180px, calc(100% - 40px));
  }

  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 1024px) {
  .docs-shell {
    width: calc(100% - 32px);
  }

  .span-6,
  .span-4 {
    grid-column: span 12;
  }

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

  .hero-card {
    padding: 28px;
  }

  .card {
    padding: 22px;
  }

  .section-grid {
    gap: 14px;
  }

  .docs-links a {
    padding: 9px 12px;
    font-size: 0.88rem;
  }
}

@media (max-width: 820px) {
  .docs-nav {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }

  .docs-links {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .docs-links a {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .docs-cta {
    justify-content: center;
  }

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

  .hero-card {
    padding: 24px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  }

  .hero-lead {
    font-size: 1rem;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 12px 14px;
    font-size: 0.92rem;
  }
}

@media (max-width: 640px) {
  .docs-shell {
    width: calc(100% - 20px);
    padding-bottom: 32px;
  }

  .hero-card,
  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-card {
    border-radius: 22px;
  }

  .hero-title {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem);
    letter-spacing: -0.03em;
  }

  .eyebrow {
    font-size: 0.7rem;
    padding: 0.4rem 0.7rem;
  }

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

  .section-grid {
    gap: 12px;
  }

  .btn {
    padding: 11px 14px;
    font-size: 0.95rem;
  }

  .docs-brand-title {
    font-size: 0.98rem;
  }

  .docs-brand-kicker {
    font-size: 0.68rem;
  }

  .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
}

@media (max-width: 380px) {
  .docs-brand-mark {
    width: 36px;
    height: 36px;
  }

  .hero-card {
    padding: 16px;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ── Step cards (recorridos pedagógicos) ────────────────────── */
.steps {
  margin-top: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  position: absolute;
  top: -14px;
  left: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 89, 78, 0.25);
}

.step-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 89, 78, 0.08);
  border: 1px solid rgba(0, 89, 78, 0.14);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-top: 4px;
}

.step h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.step p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
  font-size: 0.92rem;
}

.step-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Tarjetas de rol (comparativa visual) ──────────────────── */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.role-card {
  position: relative;
  padding: 22px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
}

.role-card.is-secondary::before {
  background: linear-gradient(90deg, #b5a160 0%, #d4bf81 100%);
}

.role-card.is-tertiary::before {
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

.role-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(0, 89, 78, 0.08);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.role-card.is-secondary .role-icon {
  background: rgba(181, 161, 96, 0.15);
  color: #8a7430;
}

.role-card.is-tertiary .role-icon {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.role-name {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.role-tag {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
}

.role-perms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-perms li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.55;
}

.role-perms li::before {
  content: "";
  flex: 0 0 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 7.5l3 3 5-6' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

.role-perms li.deny::before {
  background: rgba(239, 68, 68, 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M4 4l6 6M10 4l-6 6' stroke='%23dc2626' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ── Anatomía del tablero (ilustración) ────────────────────── */
.anatomy {
  position: relative;
  margin-top: 14px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.anatomy svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

.anatomy-legend {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.anatomy-legend-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.55;
}

.anatomy-legend-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.anatomy-legend-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
  font-size: 0.92rem;
}

/* ── Árbol de decisión (¿por qué no veo datos?) ───────────── */
.decision {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.decision-node {
  position: relative;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.decision-node + .decision-node {
  margin-left: 22px;
}

.decision-node::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 0;
  bottom: 50%;
  width: 22px;
  border-left: 2px solid rgba(124, 58, 237, 0.4);
  border-bottom: 2px solid rgba(124, 58, 237, 0.4);
  border-bottom-left-radius: 12px;
}

.decision-node:first-child::before {
  display: none;
}

.decision-question {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.decision-question i {
  color: #7c3aed;
}

.decision-answer {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

.decision-yes,
.decision-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
}

.decision-yes {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.decision-no {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* ── Línea de tiempo (antes / durante / después) ────────── */
.timeline {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  position: relative;
}

.timeline-stage {
  position: relative;
  padding: 22px 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.timeline-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 89, 78, 0.1);
  color: var(--brand);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 12px;
}

.timeline-stage.is-during .timeline-kicker {
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
}

.timeline-stage.is-after .timeline-kicker {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.timeline-stage h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
  color: var(--ink);
}

.timeline-stage ul {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
}

.timeline-stage li + li {
  margin-top: 6px;
}

/* ── Sitemap (árbol visual de rutas) ──────────────────────── */
.sitemap {
  margin-top: 14px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-family: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.85;
  color: #334155;
  overflow-x: auto;
}

.sitemap-root {
  font-weight: 700;
  color: var(--brand);
  display: block;
  margin-bottom: 6px;
}

.sitemap-branch {
  display: block;
  padding-left: 20px;
  position: relative;
  white-space: nowrap;
}

.sitemap-branch::before {
  content: "├─";
  color: rgba(15, 23, 42, 0.3);
  margin-right: 6px;
}

.sitemap-branch.is-last::before {
  content: "└─";
}

.sitemap-branch .sitemap-leaf {
  padding-left: 20px;
  display: block;
  position: relative;
}

.sitemap-branch .sitemap-leaf::before {
  content: "│  ├─";
  color: rgba(15, 23, 42, 0.25);
  margin-right: 6px;
}

.sitemap-branch.is-last .sitemap-leaf::before {
  content: "   ├─";
}

.sitemap-branch .sitemap-leaf.is-last::before {
  content: "│  └─";
}

.sitemap-branch.is-last .sitemap-leaf.is-last::before {
  content: "   └─";
}

.sitemap code {
  background: transparent;
  padding: 0;
  color: var(--brand-2);
  font-weight: 600;
}

.sitemap-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: "Open Sans", sans-serif;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 89, 78, 0.08);
  color: var(--brand);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sitemap-tag.is-restricted {
  background: rgba(181, 161, 96, 0.18);
  color: #8a6e1f;
}

/* ── Callouts pedagógicos (tip / warn / info) ──────────── */
.callout {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid;
  align-items: flex-start;
}

.callout-icon {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.callout-body {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.65;
}

.callout-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.96rem;
}

.callout.is-tip {
  background: rgba(0, 89, 78, 0.05);
  border-color: rgba(0, 89, 78, 0.18);
}
.callout.is-tip .callout-icon { background: rgba(0, 89, 78, 0.12); color: var(--brand); }
.callout.is-tip strong { color: var(--brand); }
.callout.is-tip .callout-body { color: #134e4a; }

.callout.is-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.28);
}
.callout.is-warn .callout-icon { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.callout.is-warn strong { color: #92400e; }
.callout.is-warn .callout-body { color: #78350f; }

.callout.is-info {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.22);
}
.callout.is-info .callout-icon { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.callout.is-info strong { color: #1e3a8a; }
.callout.is-info .callout-body { color: #1e3a8a; }

/* ── Mini-cards de íconos (entradas rápidas) ──────────── */
.icon-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.icon-card {
  padding: 18px 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.icon-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(0, 89, 78, 0.18);
}

.icon-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 89, 78, 0.08);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.icon-card-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.96rem;
  margin: 0;
}

.icon-card-desc {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .step-num {
    top: -12px;
    left: 14px;
    width: 30px;
    height: 30px;
    font-size: 0.86rem;
  }

  .decision-node + .decision-node {
    margin-left: 14px;
  }

  .decision-node::before {
    left: -14px;
  }
}
