/* ============================================================================
   ENS 360 — styles.css
   Sistema de diseño: tipografía editorial (Literata) + interfaz (Source Sans 3),
   paleta institucional azul marino con acento dorado de uso contenido.
   Líneas, espacio y color en lugar de cajas.
   ========================================================================== */

/* ---------------------------------------------------------------- fuentes */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

/* ----------------------------------------------------------------- tokens */
:root {
  --serif: "Source Sans 3", "Calibri", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --navy: #1f4e79;
  --blue: #2e75b6;
  --blue-soft: #deeaf6;
  --sky: #bdd7ee;
  --gold: #1f4e79;
  --gold-soft: #deeaf6;
  --gold-ink: #ffffff;
  --side-accent: #9dc3e6;
  --on-navy: #ffffff;

  --paper: #ffffff;
  --paper-2: #f3f7fb;
  --ink: #1f2933;
  --ink-2: #44546a;
  --ink-3: #7b8794;
  --line: #d3dde8;
  --line-2: #e6edf4;

  --side-bg: #1f4e79;
  --side-ink: #dbe8f5;
  --side-ink-2: #9dc3e6;
  --side-line: rgba(255,255,255,.12);
  --side-on: rgba(255,255,255,.1);

  --shadow: 0 18px 50px rgba(15,47,78,.22);
  --radius: 4px;

  --sidebar-w: 300px;
  --rail-w: 220px;
  --topbar-h: 60px;
  --measure: 46rem;

  color-scheme: light;
}

/* Tema oscuro: forzado con data-theme="dark" o automático salvo data-theme="light". */
:root[data-theme="dark"] {
  --navy: #bdd7ee; --blue: #7fb3dc; --blue-soft: #16283a; --sky: #24486a;
  --gold: #9dc3e6; --gold-soft: #1d3550; --gold-ink: #0b1620; --side-accent: #9dc3e6; --on-navy: #0b1620;
  --paper: #0f161e; --paper-2: #151f29; --ink: #e5ecf2; --ink-2: #a9b8c5; --ink-3: #7b8b99; --line: #2a3945; --line-2: #1d2a35;
  --side-bg: #0a1622; --side-ink: #d6e2ec; --side-ink-2: #7f97ab; --side-line: rgba(255,255,255,.07); --side-on: rgba(255,255,255,.07);
  --shadow: 0 18px 50px rgba(0,0,0,.55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #bdd7ee; --blue: #7fb3dc; --blue-soft: #16283a; --sky: #24486a;
    --gold: #9dc3e6; --gold-soft: #1d3550; --gold-ink: #0b1620; --side-accent: #9dc3e6; --on-navy: #0b1620;
    --paper: #0f161e; --paper-2: #151f29; --ink: #e5ecf2; --ink-2: #a9b8c5; --ink-3: #7b8b99; --line: #2a3945; --line-2: #1d2a35;
    --side-bg: #0a1622; --side-ink: #d6e2ec; --side-ink-2: #7f97ab; --side-line: rgba(255,255,255,.07); --side-on: rgba(255,255,255,.07);
    --shadow: 0 18px 50px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .15em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--sans); font-weight: 700; line-height: 1.2; letter-spacing: -.005em; color: var(--blue); }
p { margin: 0; }
ol, ul, dl { margin: 0; padding: 0; }
kbd { font-family: var(--sans); font-size: .78em; padding: .1em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; color: var(--ink-2); background: var(--paper-2); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: .4rem .8rem; border-radius: 3px; font-weight: 600; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------ shell */
.shell { min-height: 100vh; }
.main-col { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 0 clamp(1.25rem, 4vw, 3.5rem) 4rem; }
.foot { padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem) 2rem; color: var(--ink-3); font-size: .85rem; border-top: 1px solid var(--line-2); }

/* ---------------------------------------------------------------- sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; z-index: 40; }
.brand { display: block; padding: .5rem 1.1rem 1rem; border-bottom: 1px solid var(--side-line); }
.brand img { display: block; width: 100%; max-width: 165px; height: auto; }
.brand:hover { text-decoration: none; opacity: .92; }
.nav-filter { margin: .85rem 1.25rem .35rem; padding: .45rem .7rem; width: calc(100% - 2.5rem); background: rgba(255,255,255,.06); border: 1px solid var(--side-line); border-radius: var(--radius); color: #fff; font-size: .9rem; }
.nav-filter::placeholder { color: var(--side-ink-2); }
.nav-filter:focus { outline: none; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.09); }
.nav { flex: 1; overflow-y: auto; padding: .35rem 0 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav a { color: var(--side-ink); }
.nav a:hover { text-decoration: none; color: #fff; }
.nav-top { display: block; padding: .38rem 1.25rem .38rem 1.75rem; font-size: .95rem; font-weight: 500; border-left: 3px solid transparent; }
.nav-top.is-on { color: #fff; border-left-color: var(--side-accent); background: var(--side-on); }
.nav-group { margin: 1.1rem 1.25rem .35rem 1.75rem; padding-top: .9rem; border-top: 1px solid var(--side-line); color: var(--side-ink-2); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.nav-ch { border-left: 3px solid transparent; }
.nav-ch.is-on { border-left-color: var(--side-accent); background: var(--side-on); }
.nav-ch-row { display: flex; align-items: stretch; }
.nav-ch-row > a { flex: 1; display: grid; grid-template-columns: 2rem 1fr; gap: .35rem; align-items: baseline; padding: .4rem .5rem .4rem 1.75rem; font-size: .95rem; line-height: 1.3; }
.nav-ch.is-on > .nav-ch-row > a { color: #fff; font-weight: 600; }
.nav-num { font-variant-numeric: tabular-nums; color: var(--side-ink-2); font-size: .85em; }
.nav-ch.is-on .nav-num, .nav-items .is-on .nav-num { color: var(--side-accent); }
.nav-tgl { flex: none; width: 2.4rem; display: grid; place-items: center; color: var(--side-ink-2); }
.nav-tgl::before { content: ""; width: .5rem; height: .5rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .18s; }
.nav-ch.is-open .nav-tgl::before { transform: rotate(45deg); }
.nav-tgl:hover { color: #fff; }
.nav-items { list-style: none; padding: 0 0 .4rem; }
.nav-items a { display: grid; grid-template-columns: 2.6rem 1fr; gap: .35rem; align-items: baseline; padding: .28rem 1rem .28rem 2.35rem; font-size: .88rem; line-height: 1.3; color: var(--side-ink-2); }
.nav-items a:hover { color: #fff; }
.nav-items .is-on a { color: #fff; }
.scrim { display: none; }

/* ----------------------------------------------------------------- topbar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 clamp(1.25rem, 4vw, 3.5rem); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.menu-btn { display: none; width: 2.4rem; height: 2.4rem; place-items: center; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 1.25rem; height: 2px; background: var(--ink); border-radius: 2px; content: ""; position: relative; }
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }
.search-btn { display: flex; align-items: center; gap: .55rem; height: 2.3rem; padding: 0 .8rem 0 .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); background: var(--paper); min-width: 0; }
.search-btn:hover { border-color: var(--ink-3); color: var(--ink-2); }
.search-ico { width: .95rem; height: .95rem; border: 2px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.search-ico::after { content: ""; position: absolute; width: 2px; height: .45rem; background: currentColor; right: -.28rem; bottom: -.36rem; transform: rotate(-45deg); border-radius: 2px; }
.search-ph { font-size: .92rem; white-space: nowrap; }
.search-btn kbd { margin-left: .35rem; }
.mode-switch, .lens-switch { display: flex; align-items: center; height: 2.3rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.mode-switch button, .lens-switch button { height: 100%; padding: 0 .85rem; border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.mode-switch button.is-on { background: var(--blue); color: #fff; }
.lens-switch { margin-left: auto; }
.lens-label { padding: 0 .6rem 0 .8rem; font-size: .85rem; color: var(--ink-3); }
.lens-switch button.is-on { background: var(--blue); color: #fff; }
.icon-btn { width: 2.3rem; height: 2.3rem; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: var(--paper); }
.icon-btn:hover { border-color: var(--ink-3); }
.theme-ico { width: .95rem; height: .95rem; border-radius: 50%; border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme-ico[data-t="dark"] { background: currentColor; }
.theme-ico[data-t="light"] { background: transparent; }
.print-ico { width: .95rem; height: .75rem; border: 2px solid currentColor; border-radius: 2px; position: relative; }
.print-ico::before { content: ""; position: absolute; left: 2px; right: 2px; top: -5px; height: 3px; border: 2px solid currentColor; border-bottom: 0; }

/* -------------------------------------------------------- páginas simples */
.page { max-width: 1120px; margin: 0 auto; padding-top: 2.5rem; }
.page-head { max-width: var(--measure); margin-bottom: 2.25rem; }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin: .25rem 0 .75rem; }
.page-lede { font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; color: var(--ink-2); }
.hero-kicker { font-size: .9rem; font-weight: 600; color: var(--blue); }

/* ------------------------------------------------------------------- home */
.home { max-width: 1120px; margin: 0 auto; padding-top: 2.5rem; }
.hero { max-width: 62rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.hero-title { font-size: clamp(2.2rem, 4.4vw, 3.3rem); font-weight: 700; margin: .35rem 0 .25rem; color: var(--navy); }
.hero-sub { font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 500; color: var(--blue); margin: 0 0 1rem; }
.topbar-mark { display: none; }
.hero-lede { font-family: var(--serif); font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); max-width: 44rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 2rem; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--blue); }
.hero-stats dd { margin: .3rem 0 0; color: var(--ink-3); font-size: .9rem; }
.home-block { padding: 2.75rem 0; border-bottom: 1px solid var(--line); }
.home-block:last-child { border-bottom: 0; }
.home-chain .vz { margin: 0; max-width: 64rem; }
.block-head { margin-bottom: 1.25rem; max-width: var(--measure); }
.block-head h2 { font-size: 1.65rem; }
.block-head p { margin-top: .45rem; color: var(--ink-2); }
.role-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin: 1.25rem 0 1.75rem; }
.role-btn { text-align: left; padding: .85rem 1rem .9rem; border-top: 3px solid var(--line); transition: border-color .15s, background .15s; }
.role-btn b { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-bottom: .3rem; }
.role-btn span { display: block; font-size: .9rem; line-height: 1.4; color: var(--ink-2); }
.role-btn:hover { border-top-color: var(--blue); }
.role-btn.is-on { border-top-color: var(--blue); background: var(--blue-soft); }
.itinerary, .toc, .tour-list { list-style: none; }
.itinerary li, .toc li, .tour-list li { border-top: 1px solid var(--line-2); }
.itinerary li:last-child, .toc li:last-child, .tour-list li:last-child { border-bottom: 1px solid var(--line-2); }
.itinerary a, .toc a, .tour-list a { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: .85rem .25rem; color: var(--ink); align-items: baseline; }
.itinerary a:hover, .toc a:hover, .tour-list a:hover { text-decoration: none; background: var(--paper-2); }
.it-num, .toc-num, .tour-num { font-family: var(--serif); font-variant-numeric: tabular-nums; color: var(--blue); font-weight: 600; font-size: 1.05rem; }
.it-text b, .toc-text b, .tour-text b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.it-text > span, .toc-text > span, .tour-text > span { display: block; margin-top: .25rem; color: var(--ink-2); font-size: .95rem; line-height: 1.45; max-width: 60rem; }
.toc-text small { display: block; margin-top: .3rem; color: var(--ink-3); font-size: .8rem; }
.toc-annex a { padding: .6rem .25rem; }
.toc-annex .toc-text b { font-size: 1rem; }

/* -------------------------------------------------------------- capítulo */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 3.5rem; max-width: 1180px; margin: 0 auto; align-items: start; }
.reading { max-width: var(--measure); padding: 2.5rem 0 0 4.25rem; position: relative; min-width: 0; }
.cover-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; padding-bottom: .8rem; margin-bottom: 1.25rem; }
.cover-kicker::before { content: ""; display: inline-block; width: 2.1rem; height: .5rem; margin-right: .7rem; vertical-align: middle; background: radial-gradient(circle, var(--blue) 0 .18rem, transparent .2rem) 0 0 / .7rem .5rem repeat-x; }
.is-cover .sec-head { background: var(--sky); padding: 1.1rem 1.5rem 1.15rem; margin: 0 0 1.5rem; border-left: 6px solid var(--blue); }
.cover-kicker { font-weight: 600; color: var(--blue); }
.cover-stats { color: var(--ink-3); font-size: .9rem; }

.sec { position: relative; padding: 2.25rem 0 2.5rem; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.sec.is-cover { border-top: 0; padding-top: 0; padding-bottom: 1.5rem; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: 1rem; }
.sec-num { position: absolute; left: -4.25rem; top: 2.2rem; min-width: 2.6rem; height: 2.6rem; padding: 0 .55rem; display: grid; place-items: center; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sec-title { font-size: 1.55rem; color: var(--blue); }
.is-cover .sec-title { font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 700; line-height: 1.15; color: var(--navy); }
.sec-lens { font-size: .8rem; font-weight: 600; color: var(--blue); padding: .15rem .6rem; border: 1px solid var(--sky); border-radius: 999px; background: var(--blue-soft); }
.sec.is-relevant::before { content: ""; position: absolute; left: -1.35rem; top: 2.5rem; bottom: 2.5rem; width: 4px; background: var(--gold); }
.sec.is-dimmed > .sec-head, .sec.is-dimmed > .sec-thesis, .sec.is-dimmed > .vz, .sec.is-dimmed > .keys, .sec.is-dimmed > .keys-plain, .sec.is-dimmed > .doc-fig, .sec.is-dimmed > .sec-meta { opacity: .55; transition: opacity .2s; }
.sec.is-dimmed:hover > * { opacity: 1; }

.sec-thesis { font-size: 1.16rem; line-height: 1.5; color: var(--ink); max-width: 66ch; padding-left: 1rem; border-left: 3px solid var(--sky); }
.is-cover .sec-thesis { font-size: 1.25rem; }
.keys-head { margin: 1.75rem 0 .6rem; font-size: .85rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: 1rem 1.5rem; }
.key { border-top: 3px solid var(--sky); padding-top: .6rem; }
.key b { display: block; color: var(--blue); font-size: .95rem; font-weight: 700; margin-bottom: .25rem; line-height: 1.3; }
.key p { font-size: .95rem; line-height: 1.5; color: var(--ink-2); }
.callouts { margin-top: 1.5rem; display: grid; gap: .75rem; }
.callout { margin: 0; padding: .9rem 1.2rem; background: var(--blue-soft); border-left: 5px solid var(--blue); color: var(--navy); font-weight: 600; font-size: 1.02rem; line-height: 1.5; }
.keys-plain { margin-top: 1.25rem; padding-left: 1.2rem; font-family: var(--serif); line-height: 1.5; }
.keys-plain li { margin: .4rem 0; }
.keys-plain li::marker { color: var(--blue); }

.tour { margin: .5rem 0 2rem; padding-top: 1.25rem; }
.it-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 0 0 .5rem; }
.tour-title { font-family: var(--sans); font-size: .95rem; font-weight: 600; color: var(--ink-2); margin-bottom: .5rem; }
.tour-list a { padding: .7rem .25rem; }
.tour-list .is-relevant .tour-num { color: var(--gold); }
.tour-list .is-dimmed a { color: var(--ink-3); }
.tour-list .is-dimmed .tour-num { color: var(--ink-3); }

.doc-fig { margin: 1.75rem 0 0; }
.doc-fig-btn { display: block; width: 100%; cursor: zoom-in; }
.doc-fig img { display: block; width: 100%; border: 1px solid var(--line-2); }
.doc-fig figcaption, .lightbox figcaption, .fig-cap { margin-top: .5rem; font-size: .88rem; color: var(--ink-2); line-height: 1.4; }

.sec-meta { margin-top: 1.75rem; display: grid; gap: .55rem; font-size: .9rem; }
.meta-label { display: inline-block; min-width: 6.5rem; color: var(--ink-3); font-weight: 600; }
.refs, .rel, .terms { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; }
.refs-list, .terms-list { display: inline-flex; flex-wrap: wrap; gap: .3rem .5rem; flex: 1; min-width: 0; }
.rel-list { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.ref { color: var(--ink-2); }
.ref + .ref::before { content: "·"; margin-right: .5rem; color: var(--ink-3); }
.rel-list a { color: var(--ink); }
.rel-num { color: var(--blue); font-weight: 600; margin-right: .35rem; font-variant-numeric: tabular-nums; }
.term { padding: .1rem .55rem; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink-2); background: var(--paper); }
.term:hover { border-color: var(--blue); color: var(--blue); }
.term.is-open { background: var(--blue); border-color: var(--blue); color: var(--on-navy); }
.term-pop { flex-basis: 100%; margin: .35rem 0 0; padding: .6rem 0 .6rem 1rem; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: .98rem; line-height: 1.5; }
.term-pop b { font-weight: 600; margin-right: .3rem; }

.sec-full-bar { margin-top: 1.75rem; }
.btn-full { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .75rem 0 .25rem; border-top: 1px solid var(--line); color: var(--blue); font-weight: 600; text-align: left; }
.btn-full:hover { color: var(--ink); }
.btn-full small { font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.btn-full.is-on { color: var(--ink-2); }
.btn-full:disabled { cursor: default; color: var(--ink-3); }
.btn-full-l::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .6rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.btn-full.is-on .btn-full-l::before { transform: translateY(1px) rotate(-135deg); }
.btn-full:disabled .btn-full-l::before { display: none; }

/* --------------------------------------------- texto íntegro del documento */
.doc { font-family: var(--serif); font-size: 1.05rem; line-height: 1.68; padding-top: .5rem; }
.doc p { margin: 0 0 1.05em; }
.doc strong { font-weight: 600; }
.doc ul, .doc ol { margin: 0 0 1.05em; padding-left: 1.4em; }
.doc li { margin: .3em 0; }
.doc li p { margin: 0 0 .4em; }
.doc blockquote { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-family: var(--sans); font-size: .92rem; line-height: 1.4; }
.doc th, .doc td { padding: .55rem .7rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line-2); }
.doc thead th { background: var(--blue-soft); color: var(--ink); border-bottom: 2px solid var(--sky); font-weight: 600; }
.doc tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.doc td p, .doc th p { margin: 0 0 .5em; }
.doc td p:last-child { margin-bottom: 0; }
.doc td ol, .doc td ul { margin: .25em 0 .5em; }
.doc .callout-table { border-left: 4px solid var(--blue); background: var(--blue-soft); font-family: var(--serif); font-size: 1rem; }
.doc .callout-table th { background: none; border: 0; padding: .9rem 1.1rem; color: var(--ink); font-weight: 400; }
.doc .callout-table th strong { font-weight: 600; }
.doc .callout-table td { border: 0; padding: 0 1.1rem .9rem; }
.doc .document-figure { margin: 1.5rem 0 1.75rem; }
.doc .document-figure img { display: block; width: 100% !important; height: auto !important; max-width: 100%; border: 1px solid var(--line-2); cursor: zoom-in; }
.doc .document-figure figcaption { margin-top: .5rem; font-family: var(--sans); font-size: .88rem; color: var(--ink-2); }
.vz-scroll { overflow-x: auto; }

/* --------------------------------------------------- navegación capítulo */
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.chapter-nav a { display: block; color: var(--ink); }
.chapter-nav a:hover { text-decoration: none; color: var(--blue); }
.chapter-nav small { display: block; color: var(--ink-3); font-size: .8rem; margin-bottom: .2rem; }
.chapter-nav span { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.cn-next { text-align: right; grid-column: 2; }

/* ------------------------------------------------------------------- rail */
.rail { position: sticky; top: calc(var(--topbar-h) + 1.5rem); padding: 1.25rem 0 1rem 1.25rem; border-left: 1px solid var(--line-2); max-height: calc(100vh - var(--topbar-h) - 2rem); overflow-y: auto; font-size: .84rem; scrollbar-width: thin; }
.rail-progress { height: 3px; width: 100%; background: var(--line-2); margin-bottom: 1rem; position: relative; border-radius: 2px; }
.rail-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--blue); border-radius: 2px; }
.rail-list { list-style: none; }
.rail-list li { position: relative; }
.rail-list a { display: grid; grid-template-columns: 2.4rem 1fr; gap: .3rem; padding: .3rem 0; color: var(--ink-3); line-height: 1.3; }
.rail-list a:hover { text-decoration: none; color: var(--ink); }
.rail-num { font-variant-numeric: tabular-nums; }
.rail-list .is-active a { color: var(--ink); font-weight: 600; }
.rail-list .is-active .rail-num { color: var(--blue); }
.rail-list .is-active::before { content: ""; position: absolute; left: -1.25rem; top: .45rem; bottom: .45rem; width: 3px; background: var(--blue); }
.rail-list .is-relevant .rail-num { color: var(--gold); font-weight: 700; }

/* ------------------------------------------------- gramática visual (vz) */
.vz { margin: 1.75rem 0 0; font-family: var(--sans); }
.vz-title { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; font-size: .92rem; font-weight: 700; color: var(--blue); }
.vz-title::before { content: ""; width: .55rem; height: .55rem; background: var(--blue); flex: none; }
.vz-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vz-note { margin-top: .75rem; font-size: .88rem; color: var(--ink-2); font-style: italic; }
.vz h4 { font-family: var(--sans); font-size: .95rem; font-weight: 600; }
.vz ul { list-style: none; }

/* flow: pasos sobre una línea */
.vz-flow { list-style: none; display: flex; flex-wrap: wrap; counter-reset: step; }
.vz-flow li { flex: 1 1 8.5rem; position: relative; padding: 1.55rem .85rem .9rem 0; counter-increment: step; min-width: 8rem; }
.vz-flow li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--navy); color: var(--on-navy); font-size: .72rem; font-weight: 600; display: grid; place-items: center; z-index: 1; }
.vz-flow li::after { content: ""; position: absolute; left: 1.35rem; right: 0; top: .62rem; height: 1px; background: var(--line); }
.vz-flow li:last-child::after { display: none; }
.vz-flow-l { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.vz-flow-s { display: block; margin-top: .2rem; font-size: .84rem; color: var(--ink-2); line-height: 1.35; }

/* layers: estratos que se ensanchan hacia la base */
.vz-layers { display: grid; gap: 3px; }
.vz-layer { display: grid; grid-template-columns: 2rem 1fr; gap: .1rem .8rem; padding: .55rem .8rem .55rem .6rem; background: var(--blue-soft); border-left: 3px solid var(--navy); }
.vz-layer:nth-child(1) { background: color-mix(in srgb, var(--sky) 35%, var(--paper)); }
.vz-layer:nth-child(2) { background: color-mix(in srgb, var(--sky) 55%, var(--paper)); }
.vz-layer:nth-child(3) { background: color-mix(in srgb, var(--sky) 75%, var(--paper)); }
.vz-layer:nth-child(4) { background: color-mix(in srgb, var(--sky) 95%, var(--paper)); }
.vz-layer:nth-child(n+5) { background: var(--sky); }
.vz-layer-bar { grid-row: 1 / span 2; align-self: center; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vz-layer-l { font-weight: 600; font-size: .95rem; grid-column: 2; }
.vz-layer-s { grid-column: 2; font-size: .84rem; color: var(--ink-2); }

/* matrix */
.vz-matrix { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.35; }
.vz-matrix th, .vz-matrix td { padding: .55rem .65rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.vz-matrix thead th { color: var(--blue); font-weight: 600; border-bottom: 2px solid var(--sky); }
.vz-matrix tbody th { font-weight: 600; }
.vz-matrix td { color: var(--ink-2); }

/* compare: columnas separadas por regla */
.vz-compare { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 0 1.5rem; }
.vz-col { padding: 0 0 0 1rem; border-left: 2px solid var(--sky); }
.vz-col h4 { margin-bottom: .55rem; color: var(--navy); }
.vz-col li { font-size: .92rem; line-height: 1.4; color: var(--ink-2); padding: .3rem 0; border-top: 1px solid var(--line-2); }

/* scale: escalones de exigencia creciente */
.vz-scale { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 1rem; align-items: end; }
.vz-level { display: flex; flex-direction: column; }
.vz-level-bar { display: block; height: calc(1.5rem + 4rem * var(--h, 1)); background: var(--sky); border-top: 3px solid var(--blue); margin-bottom: .6rem; order: -1; }
.vz-level.is-top .vz-level-bar { border-top-color: var(--gold); background: color-mix(in srgb, var(--gold-soft) 60%, var(--sky)); }
.vz-level-l { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.vz-level-s { font-size: .84rem; color: var(--blue); font-weight: 600; margin-top: .15rem; }
.vz-level-d { font-size: .86rem; color: var(--ink-2); margin-top: .3rem; line-height: 1.4; }

/* cycle: anillo SVG con leyenda */
.vz-cycle { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 1.5rem; align-items: center; }
.vz-cycle svg { width: 100%; height: auto; }
.vz-arc { fill: none; stroke: var(--blue); stroke-width: 6; stroke-linecap: round; }
.vz-arrow { fill: var(--blue); }
.vz-arc-n { font-size: 15px; font-weight: 600; fill: var(--ink); font-family: var(--sans); }
.vz-core { fill: var(--sky); }
.vz-core-t { font-family: var(--serif); font-size: 15px; font-weight: 600; fill: var(--ink); }
.vz-cycle-list { list-style: decimal; padding-left: 1.4rem; font-size: .92rem; }
.vz-cycle-list li { padding: .3rem 0; border-top: 1px solid var(--line-2); }
.vz-cycle-list li::marker { color: var(--blue); font-weight: 600; }
.vz-cycle-list b { display: block; font-weight: 600; }
.vz-cycle-list span { color: var(--ink-2); }

/* timeline */
.vz-timeline svg { width: 100%; height: 44px; display: block; }
.vz-tl-line { stroke: var(--line); stroke-width: 2; }
.vz-tl-dot { fill: var(--paper); stroke: var(--blue); stroke-width: 3; }
.vz-tl-labels { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 1rem; text-align: center; }
.vz-tl-ev b { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--blue); }
.vz-tl-l { display: block; font-weight: 600; font-size: .92rem; margin-top: .2rem; }
.vz-tl-s { display: block; font-size: .84rem; color: var(--ink-2); margin-top: .15rem; line-height: 1.35; }

/* overlap: A · común · B */
.vz-overlap { display: grid; grid-template-columns: 1fr 1.1fr 1fr; }
.vz-ov { padding: .85rem 1rem; }
.vz-ov h4 { margin-bottom: .5rem; }
.vz-ov li { font-size: .9rem; line-height: 1.4; color: var(--ink-2); padding: .25rem 0; border-top: 1px solid var(--line-2); }
.vz-ov-a { border-right: 1px solid var(--line); padding-left: 0; }
.vz-ov-b { border-left: 1px solid var(--line); padding-right: 0; }
.vz-ov-both { background: var(--blue-soft); }
.vz-ov-both h4 { color: var(--blue); }

/* ledger: pares etiqueta / descripción */
.vz-ledger { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; border-top: 1px solid var(--line); }
.vz-ledger dt { padding: .65rem 1rem .65rem 0; font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--line-2); line-height: 1.35; }
.vz-ledger dd { margin: 0; padding: .65rem 0; font-size: .92rem; color: var(--ink-2); border-bottom: 1px solid var(--line-2); line-height: 1.45; }
.vz-k { display: inline-block; min-width: 1.6rem; margin-right: .5rem; padding: 0 .35rem; border-radius: 3px; background: var(--gold); color: var(--gold-ink); font-size: .78rem; text-align: center; line-height: 1.5; vertical-align: middle; }

/* tree: raíz y ramas */
.vz-tree { text-align: center; }
.vz-root { display: inline-block; padding: .5rem 1rem .6rem; border-bottom: 3px solid var(--navy); }
.vz-root b { display: block; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.vz-root span { display: block; font-size: .85rem; color: var(--ink-2); }
.vz-branches { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; position: relative; text-align: left; }
.vz-branches::before { content: ""; position: absolute; left: 50%; top: -1.5rem; width: 1px; height: 1.5rem; background: var(--line); }
.vz-branch { padding-top: .6rem; border-top: 2px solid var(--sky); }
.vz-branch b { display: block; font-weight: 600; }
.vz-branch-s { display: block; font-size: .84rem; color: var(--blue); }
.vz-branch li { font-size: .9rem; color: var(--ink-2); padding: .25rem 0 .25rem .85rem; position: relative; }
.vz-branch li::before { content: ""; position: absolute; left: 0; top: .85rem; width: .4rem; height: 1px; background: var(--ink-3); }

/* stats: cifras/letras grandes */
.vz-stats { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 1rem; }
.vz-stat b { display: block; font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--navy); }
.vz-stat span { display: block; margin-top: .35rem; font-size: .9rem; color: var(--ink-2); padding-top: .35rem; border-top: 1px solid var(--line); }

/* actors */
.vz-actor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem; }
.vz-actor { padding-top: .6rem; border-top: 2px solid var(--blue); }
.vz-actor b { display: block; font-weight: 600; font-size: .98rem; }
.vz-actor span { display: block; font-size: .9rem; color: var(--ink-2); margin-top: .2rem; line-height: 1.4; }

/* grid: mosaico de conceptos */
.vz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1rem 1.5rem; }
.vz-grid li { padding-top: .55rem; border-top: 1px solid var(--line); }
.vz-grid b { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.vz-grid span { display: block; font-size: .86rem; color: var(--ink-2); margin-top: .2rem; line-height: 1.4; }

/* ------------------------------------------------------------------- mapa */
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); gap: 2rem 3.5rem; }
.map-grid .vz { margin: 0; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.map-grid .vz-title { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.map-grid .vz-title::after { display: none; }

/* ---------------------------------------------------------------- figuras */
.fig-gallery { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2rem 1.75rem; }
.fig-gallery img { display: block; width: 100%; border: 1px solid var(--line-2); }
.fig-link { display: block; margin-top: .3rem; font-size: .85rem; }

/* --------------------------------------------------------------- glosario */
.glossary-q { margin-top: 1rem; width: min(100%, 24rem); padding: .5rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.glossary { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; border-top: 1px solid var(--line); max-width: 68rem; }
.glossary dt { padding: .8rem 1rem .8rem 0; font-family: var(--serif); font-weight: 600; border-bottom: 1px solid var(--line-2); }
.glossary dd { margin: 0; padding: .8rem 0; border-bottom: 1px solid var(--line-2); font-family: var(--serif); line-height: 1.5; }
.gl-uses { display: block; margin-top: .35rem; font-family: var(--sans); font-size: .85rem; }
.gl-uses::before { content: "Ver apartados"; color: var(--ink-3); margin-right: .5rem; }
.gl-uses a { margin-right: .5rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(9,22,35,.55); display: grid; place-items: start center; padding: 9vh 1rem 2rem; overflow-y: auto; }
.search-box { width: min(100%, 44rem); background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); padding: .75rem; }
.search-box input { width: 100%; padding: .75rem .9rem; font-size: 1.15rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.search-box input:focus { outline: none; }
.search-results { list-style: none; max-height: 55vh; overflow-y: auto; margin-top: .35rem; }
.search-results a { display: block; padding: .6rem .85rem; color: var(--ink); border-radius: 4px; }
.search-results a:hover, .search-results .is-sel a { background: var(--paper-2); text-decoration: none; }
.search-results small { display: block; color: var(--ink-3); font-size: .78rem; }
.search-results b { display: block; font-family: var(--serif); font-weight: 600; }
.search-results span { display: block; color: var(--ink-2); font-size: .9rem; line-height: 1.4; }
.search-empty { padding: 1rem .85rem; color: var(--ink-2); }
.search-hint { padding: .6rem .85rem .2rem; font-size: .8rem; color: var(--ink-3); }
.search-hint kbd { margin-right: .2rem; }
.modal-fig { place-items: center; padding: 2rem; }
.lightbox { margin: 0; position: relative; max-width: min(96vw, 1200px); background: var(--paper); padding: 1rem; border-radius: 6px; box-shadow: var(--shadow); }
.lightbox img { display: block; max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
.lightbox figcaption { text-align: center; }
.lb-close { position: absolute; top: .35rem; right: .5rem; width: 2rem; height: 2rem; font-size: 1.5rem; line-height: 1; color: var(--ink-2); }

/* ------------------------------------------------------------- responsive */
/* ------------------------------------------------------- menú de perfil */
.lang-switch { display: inline-flex; align-items: center; height: 2.3rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); flex: none; }
.lang-switch button { display: inline-flex; align-items: center; gap: .4rem; height: 100%; padding: 0 .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.lang-switch button svg { width: 20px; height: 13px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); display: block; }
.lang-switch button.is-on { background: var(--blue); color: #fff; }
.lens-wrap { position: relative; margin-left: auto; }
.lens-btn { display: flex; align-items: center; gap: .5rem; height: 2.3rem; padding: 0 .9rem 0 .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; font-weight: 500; color: var(--ink-2); background: var(--paper); white-space: nowrap; }
.lens-btn.is-on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.lens-btn::after { content: ""; width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.lens-menu { position: absolute; right: 0; top: calc(100% + .5rem); width: 21rem; max-width: 92vw; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: .4rem; z-index: 35; }
.lens-menu button { display: grid; grid-template-columns: 1fr; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 4px; }
.lens-menu button:hover { background: var(--paper-2); }
.lens-menu button.is-on { background: var(--blue-soft); }
.lens-menu button b { font-size: .92rem; font-weight: 600; color: var(--ink); }
.lens-menu button.is-on b { color: var(--blue); }
.lens-menu button span { font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.lens-menu .lens-all { border-bottom: 1px solid var(--line-2); margin-bottom: .3rem; border-radius: 4px 4px 0 0; }


/* ------------------------------------------------------ síntesis ejecutiva */
.hero-links { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin-top: 1.25rem; font-weight: 600; }
.hero-links a::after { content: ""; display: inline-block; width: .4rem; height: .4rem; margin-left: .45rem; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg) translateY(-1px); }
.brief { max-width: 1120px; margin: 0 auto; padding-top: 2.5rem; position: relative; }
.brief-hero { max-width: 62rem; padding-bottom: 2rem; margin-bottom: 1rem; }
.brief-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.3rem); font-weight: 700; color: var(--navy); margin: .25rem 0 .9rem; }
.brief-index { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .4rem .9rem; margin-top: 1.5rem; }
.brief-index a { display: flex; align-items: center; gap: .6rem; padding: .45rem .3rem; color: var(--ink); border-top: 1px solid var(--line-2); font-size: .92rem; font-weight: 500; }
.brief-index a:hover { text-decoration: none; color: var(--blue); }
.brief-idx-n { width: 1.55rem; height: 1.55rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: .78rem; font-weight: 700; }
.brief-panel { padding: 3rem 0 3.25rem; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.brief-panel:nth-child(even) { background: linear-gradient(90deg, var(--paper-2), transparent 70%); margin: 0 calc(-1 * clamp(1.25rem, 4vw, 3.5rem)); padding-left: clamp(1.25rem, 4vw, 3.5rem); padding-right: clamp(1.25rem, 4vw, 3.5rem); }
.brief-head { display: flex; align-items: flex-start; gap: 1.1rem; }
.brief-num { flex: none; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 1.15rem; font-weight: 700; }
.brief-kicker { font-size: .85rem; font-weight: 700; color: var(--blue); letter-spacing: .02em; margin-bottom: .2rem; }
.brief-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; color: var(--navy); line-height: 1.15; }
.brief-lede { margin: 1.25rem 0 0 4.1rem; max-width: 60ch; font-size: 1.15rem; line-height: 1.55; color: var(--ink); padding-left: 1rem; border-left: 3px solid var(--sky); }
.brief-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr); gap: 2.5rem 3rem; align-items: start; margin: 1.5rem 0 0 4.1rem; }
.brief-body .vz { margin: .5rem 0 0; }
.brief-points { display: grid; gap: 1rem; }
.brief-refs { margin: 1.75rem 0 0 4.1rem; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; }
.brief-refs a { padding: .1rem .6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--blue); font-weight: 600; font-variant-numeric: tabular-nums; }
.brief-refs a:hover { border-color: var(--blue); text-decoration: none; background: var(--blue-soft); }
.brief-dots { position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%); display: grid; gap: .55rem; z-index: 20; }
.brief-dots button { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); transition: background .15s, transform .15s; }
.brief-dots button:hover { background: var(--sky); }
.brief-dots button.is-on { background: var(--blue); transform: scale(1.35); }
@media (max-width: 1120px) { .brief-body { grid-template-columns: 1fr; } }
@media (max-width: 840px) {
  .brief-lede, .brief-body, .brief-refs { margin-left: 0; }
  .brief-dots { display: none; }
  .brief-panel:nth-child(even) { margin: 0; padding-left: 0; padding-right: 0; background: none; }
}
@media print { .brief-dots, .brief-index { display: none; } .brief-panel { break-inside: avoid; } }

@media (max-width: 1120px) {
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .role-picker { grid-template-columns: repeat(2, 1fr); }
  .lens-label { display: none; }
}
@media (max-width: 1000px) {
  .search-ph, .search-btn kbd { display: none; }
  .search-btn { width: 2.3rem; padding: 0; justify-content: center; }
}
@media (max-width: 840px) {
  body { font-size: 16px; }
  .main-col { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: min(88vw, 340px); }
  .shell.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(9,22,35,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.sidebar-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .topbar-mark { display: block; flex: none; }
  .topbar-mark img { display: block; width: 30px; height: 30px; }
  .topbar { gap: .5rem; }
  .lens-switch { margin-left: 0; }
  .print-btn { display: none; }
  .lang-switch button span { display: none; }
  .lang-switch button { padding: 0 .45rem; }
  .reading { padding-left: 0; padding-top: 1.5rem; }
  .sec-num { position: static; display: inline-grid; margin-bottom: .5rem; }
  .sec-head { display: block; }
  .sec.is-relevant::before { left: -.75rem; }
  .keys { grid-template-columns: 1fr; }
  .keys dt { padding-bottom: .1rem; border-bottom: 0; }
  .keys dd { padding-top: .2rem; }
  .vz-cycle { grid-template-columns: 1fr; }
  .vz-cycle svg { max-width: 280px; margin: 0 auto; }
  .vz-overlap { grid-template-columns: 1fr; }
  .vz-ov-a, .vz-ov-b { border: 0; padding-left: 0; padding-right: 0; }
  .vz-ov-both { padding-left: 1rem; padding-right: 1rem; }
  .vz-compare { grid-template-columns: 1fr; gap: 1rem; }
  .vz-scale { grid-template-columns: 1fr; }
  .vz-level-bar { height: 1rem; }
  .vz-ledger, .glossary { grid-template-columns: 1fr; }
  .vz-ledger dt, .glossary dt { border-bottom: 0; padding-bottom: .1rem; }
  .vz-ledger dd, .glossary dd { padding-top: .15rem; }
  .vz-branches { grid-template-columns: 1fr; }
  .vz-branches::before { display: none; }
  .vz-tl-labels { grid-template-columns: 1fr; text-align: left; }
  .vz-timeline svg { display: none; }
  .vz-flow { flex-direction: column; }
  .vz-flow li { padding: .1rem 0 .9rem 2rem; min-width: 0; }
  .vz-flow li::after { left: .62rem; top: 1.5rem; right: auto; bottom: 0; width: 1px; height: auto; }
  .chapter-nav { grid-template-columns: 1fr; }
  .cn-next { text-align: left; grid-column: 1; }
  .map-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mode-switch button, .lens-switch button { padding: 0 .55rem; font-size: .82rem; }
  .icon-btn { display: none; }
  .hero-stats { gap: 1.25rem; }
  .itinerary a, .toc a, .tour-list a { grid-template-columns: 2.6rem 1fr; gap: .5rem; }
  .role-picker { grid-template-columns: 1fr; }
  .sec-title { font-size: 1.45rem; }
  .btn-full { flex-direction: column; align-items: flex-start; gap: .2rem; }
  .vz-stats { grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); }
  .lightbox { padding: .5rem; }
}

/* -------------------------------------------------------------- impresión */
@media print {
  :root { --paper: #fff; --ink: #111; --navy: #0f2f4e; --blue: #1c5b8e; --on-navy: #fff; }
  body { font-size: 11pt; color: #111; background: #fff; }
  .sidebar, .scrim, .topbar, .rail, .sec-full-bar, .modal, .foot, .chapter-nav, .skip, .term, .sec-lens { display: none !important; }
  .main-col { margin: 0; }
  .main { padding: 0; }
  .chapter { grid-template-columns: 1fr; }
  .reading { max-width: none; padding-left: 0; }
  .sec-num { position: static; display: inline-grid; margin-right: .5rem; }
  .sec { padding: 1.2rem 0; }
  .sec-head, .vz-title, .doc thead { break-after: avoid; }
  .vz, .doc-fig, .doc table, .keys { break-inside: avoid; }
  .doc { display: block !important; }
  a { color: inherit; }
  .sec.is-dimmed > * { opacity: 1 !important; }
}
