/* Salud Milagro · sitio web.
   Estructura y estilo tomados de inflect.co.uk: portada a pantalla completa con degradado vivo,
   cabecera fija con menú de pantalla completa, contenido sobre blanco con títulos en azul,
   tarjetas de imagen + bloque de color, panel de cristal sobre degradado y pie grande.
   Colores propios: salud pública en Colombia (azul profundo, verde clínico, menta). */
:root {
  --noche: #04122e;
  --azul: #0d3ad6;
  --azul-2: #4d6bff;
  --clinico: #0a7f70;
  --menta: #3fe6b4;
  --menta-oscura: #063c33;
  --amarillo: #ffd23f;
  --texto: #0b1a33;
  --gris: #556377;
  --linea: #dfe6ef;
  --suave: #eef3fb;
  --blanco: #ffffff;
  --rojo: #c6352b;
  --rojo-suave: #fde8e5;
  --ambar: #a35f00;
  --ambar-suave: #fdf1d8;
  --verde: #1d7a3d;
  --verde-suave: #e2f5e8;
  --contorno: #c8f3e5;
  --fuente: "Host Grotesk", "Segoe UI", system-ui, sans-serif;
  --fuente-ley: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --ancho: 1840px;
  --cabecera: 112px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--blanco); color: var(--texto);
  font-family: var(--fuente); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--azul); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--menta); outline-offset: 3px; border-radius: 4px; }
.contenedor { max-width: var(--ancho); margin: 0 auto; padding-inline: clamp(16px, 3.7vw, 72px); }


/* ---------- Marca ---------- */
.marca { display: inline-flex; align-items: center; gap: .32em; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: inherit; text-decoration: none; white-space: nowrap; }
/* Logo principal: símbolo + «Salud Milagro» en Outfit ExtraBold, con el brillo suave del logotipo */
.marca { gap: .1em; font-family: "Outfit", var(--fuente); font-weight: 800; letter-spacing: -.01em; filter: drop-shadow(0 0 .14em rgba(255, 255, 255, .35)); }
.marca svg.simbolo { width: 2.15em; height: 1.35em; flex: none; overflow: visible; }
.marca svg .trazo { fill: none; stroke: currentColor; stroke-width: 30; stroke-linecap: round; stroke-linejoin: round; }
.marca svg .estrella { fill: #58f6d3; stroke: #58f6d3; stroke-width: 6; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(88, 246, 211, .8)); }

/* ---------- Degradado vivo ---------- */
.degradado { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(135deg, #070d4a 0%, #0b22c9 42%, #0a1fb0 70%, #06103f 100%); z-index: 0; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: fixed; left: 0; right: 0; top: 0; z-index: 40; color: var(--blanco);
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.cabecera .fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--cabecera); transition: height .3s ease; }
.cabecera .marca { font-size: clamp(26px, 3vw, 40px); }
.cabecera.solida { background: linear-gradient(100deg, var(--noche) 0%, #0b2a9e 38%, var(--azul) 70%, #0a5fd0 100%); box-shadow: 0 6px 24px rgba(4,18,46,.18); }
.cabecera.solida .fila { height: 84px; }
.boton-menu { width: 52px; height: 52px; display: grid; place-content: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 0; }
.boton-menu i { display: block; width: 34px; height: 4px; background: var(--blanco); border-radius: 1px; transition: transform .3s ease; }
.boton-menu[aria-expanded="true"] i:first-child { transform: translateY(6px) rotate(45deg); }
.boton-menu[aria-expanded="true"] i:last-child { transform: translateY(-6px) rotate(-45deg); }


/* ---------- Pestaña lateral ---------- */
.pestana {
  position: fixed; right: 0; top: 50%; z-index: 30; transform: translateY(-50%);
  writing-mode: vertical-rl; rotate: 180deg;
  background: #000; color: var(--blanco); border: 0; cursor: pointer; text-decoration: none;
  font: 600 14px/1 var(--fuente); text-transform: uppercase; letter-spacing: .04em;
  padding: 22px 13px; border-radius: 0 10px 10px 0;
}
.pestana:hover { background: var(--azul); }

/* ---------- Portada ---------- */
.portada { position: relative; min-height: min(100svh, 940px); color: var(--blanco); display: flex; align-items: flex-end; isolation: isolate; }
.portada .rastro { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.portada .contenedor { position: relative; z-index: 2; width: 100%; padding-block: calc(var(--cabecera) + 40px) clamp(56px, 10vh, 120px); }
.ceja { margin: 0; font-size: clamp(16px, 1.4vw, 21px); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: 1.3; }
.raya { width: 138px; height: 4px; background: var(--blanco); margin: 34px 0 46px; border: 0; }
.portada h1 { margin: 0; font-size: clamp(40px, 4.6vw, 66px); font-weight: 700; line-height: .98; letter-spacing: -.01em; max-width: 17ch; text-wrap: balance; }
.portada .entrada { max-width: 62ch; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; margin: 28px 0 0; color: rgba(255,255,255,.88); }
.portada .datos { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.portada .datos li { font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); }

/* ---------- Zona blanca con contorno ---------- */
.zona { position: relative; background: var(--blanco); }
.contorno { position: absolute; top: 0; bottom: 0; right: clamp(16px, 5vw, 90px); width: 260px; pointer-events: none; z-index: 0; }
.contorno svg { position: sticky; top: 90px; width: 260px; height: auto; display: block; }
.contorno path { fill: none; stroke: var(--contorno); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 1100px) { .contorno { display: none; } }
.zona > .contenedor { position: relative; z-index: 1; }

.encabezado-seccion { padding-block: clamp(56px, 8vw, 104px) 40px; max-width: 760px; }
.encabezado-seccion h2 { margin: 0 0 22px; font-size: clamp(34px, 3.6vw, 50px); line-height: 1.1; font-weight: 700; color: var(--azul); letter-spacing: -.01em; text-wrap: balance; }
.encabezado-seccion p { margin: 0 0 12px; font-size: 18px; line-height: 1.6; color: var(--texto); }

/* ---------- Tarjetas ---------- */
.tarjetas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 46px; padding-bottom: clamp(64px, 8vw, 120px); max-width: 1480px; }
.tarjeta-doc { display: flex; flex-direction: column; text-decoration: none; color: var(--blanco); min-width: 0; }
.tarjetas > .tarjeta-doc:nth-child(3n+2) { margin-top: 24px; }
.tarjeta-doc .imagen {
  position: relative; aspect-ratio: 450 / 400; border-radius: 8px 8px 0 0; overflow: hidden; color: var(--texto);
  background:
    radial-gradient(circle at 78% 18%, rgba(63,230,180,.75), rgba(63,230,180,0) 46%),
    radial-gradient(circle at 18% 82%, rgba(255,210,63,.55), rgba(255,210,63,0) 45%),
    radial-gradient(circle at 30% 20%, #a9b8ff, rgba(169,184,255,0) 60%),
    linear-gradient(160deg, #c3cdfa, #9fb0f5);
  padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between;
  transition: filter .3s ease;
}
.tarjetas > .tarjeta-doc:nth-child(2n) .imagen {
  background:
    radial-gradient(circle at 25% 25%, rgba(63,230,180,.85), rgba(63,230,180,0) 50%),
    radial-gradient(circle at 85% 80%, rgba(77,107,255,.7), rgba(77,107,255,0) 50%),
    linear-gradient(200deg, #b9c6fb, #aee9da);
}
.tarjetas > .tarjeta-doc:nth-child(3n) .imagen {
  background:
    radial-gradient(circle at 70% 70%, rgba(255,210,63,.6), rgba(255,210,63,0) 46%),
    radial-gradient(circle at 20% 30%, rgba(77,107,255,.65), rgba(77,107,255,0) 55%),
    linear-gradient(140deg, #c9d2fb, #bfeee0);
}
.tarjeta-doc .numero { font-size: clamp(76px, 8vw, 118px); font-weight: 700; line-height: .85; letter-spacing: -.04em; color: var(--noche); font-variant-numeric: tabular-nums; }
.tarjeta-doc .tema { font-size: 19px; font-weight: 600; line-height: 1.25; max-width: 18ch; color: var(--noche); }
.tarjeta-doc .bloque { background: var(--azul); border-radius: 0 0 8px 8px; padding: 20px 20px 18px; display: grid; gap: 6px; flex: 1; align-content: start; transition: background-color .3s ease; }
.tarjetas > .tarjeta-doc:nth-child(2n) .bloque { background: var(--azul-2); }
.tarjeta-doc h3 { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; text-wrap: balance; }
.tarjeta-doc .rol { margin: 0; font-size: 15px; line-height: 1.4; opacity: .92; }
.tarjeta-doc .pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 15px; font-weight: 700; }
.tarjeta-doc .pie span:first-child { font-weight: 500; font-size: 13px; padding: 3px 9px; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; }
.tarjeta-doc:hover .imagen { filter: saturate(1.25) brightness(1.04); }
.tarjeta-doc:hover .bloque { background: var(--noche); }
.tarjeta-doc:focus-visible { outline: 3px solid var(--menta); outline-offset: 4px; border-radius: 8px; }

/* Bloques de código de la plataforma (variante de tarjeta, sin imagen) */
.bloques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 30px; padding-bottom: clamp(64px, 8vw, 120px); max-width: 1480px; }
.bloque-codigo { border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: var(--suave); }
.bloques > .bloque-codigo:nth-child(3n+2) { margin-top: 24px; }
.bloque-codigo .cab { background: var(--clinico); color: var(--blanco); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bloque-codigo .cab b { font-size: 19px; }
.bloque-codigo .cab span { font-size: 13px; font-weight: 600; background: var(--menta); color: var(--menta-oscura); padding: 3px 10px; border-radius: 999px; }
.bloque-codigo p { margin: 0; padding: 16px 18px 20px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.bloque-codigo code { font-size: .9em; background: var(--blanco); padding: 1px 5px; border-radius: 3px; }

@media (max-width: 960px) {
  .tarjetas, .bloques { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tarjetas > .tarjeta-doc:nth-child(3n+2), .bloques > .bloque-codigo:nth-child(3n+2) { margin-top: 0; }
  .tarjetas > .tarjeta-doc:nth-child(2n), .bloques > .bloque-codigo:nth-child(2n) { margin-top: 24px; }
}
@media (max-width: 620px) {
  .tarjetas, .bloques { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .tarjetas > .tarjeta-doc:nth-child(2n), .bloques > .bloque-codigo:nth-child(2n) { margin-top: 0; }
}

/* ---------- Panel de cristal + carrusel (cta) ---------- */
.cta { position: relative; color: var(--blanco); isolation: isolate; }
.cta .contenedor { position: relative; z-index: 1; padding-block: clamp(64px, 8vw, 110px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.cristal { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; backdrop-filter: blur(14px); padding: clamp(32px, 5vw, 80px) clamp(24px, 4.5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 16px; min-width: 0; }
.cristal .ceja { font-size: 14px; color: var(--menta); }
.cristal h2 { margin: 0; font-size: clamp(30px, 3vw, 42px); line-height: 1.12; font-weight: 700; text-wrap: balance; }
.cristal p { margin: 0; font-size: 16px; line-height: 1.6; max-width: 52ch; }
.cristal blockquote { margin: 0; font-size: 20px; line-height: 1.45; font-weight: 600; max-width: 40ch; }
.cristal cite { font-style: normal; font-size: 14px; opacity: .85; }
.boton { align-self: flex-start; display: inline-block; background: var(--menta); color: var(--menta-oscura); font-weight: 600; font-size: 16px; text-decoration: none; padding: 17px 30px; border-radius: 4px; border: 0; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.boton:hover { background: var(--blanco); color: var(--noche); }
.carrusel { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.carrusel .pistas { position: relative; flex: 1; min-height: 380px; border-radius: 10px; overflow: hidden; background: var(--noche); }
.carrusel .cifra { position: absolute; inset: 0; padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; opacity: 0; transition: opacity .7s ease; }
.carrusel .cifra.activa { opacity: 1; }
.carrusel .cifra:nth-child(1) { background: radial-gradient(circle at 80% 20%, rgba(63,230,180,.55), transparent 55%), linear-gradient(150deg, #0b2a9e, var(--noche)); }
.carrusel .cifra:nth-child(2) { background: radial-gradient(circle at 20% 25%, rgba(77,107,255,.8), transparent 55%), linear-gradient(200deg, var(--clinico), var(--noche)); }
.carrusel .cifra:nth-child(3) { background: radial-gradient(circle at 75% 75%, rgba(255,210,63,.45), transparent 50%), linear-gradient(160deg, var(--azul), var(--noche)); }
.carrusel .cifra:nth-child(4) { background: radial-gradient(circle at 25% 75%, rgba(63,230,180,.6), transparent 55%), linear-gradient(120deg, #0b2a9e, #0a5fd0); }
.carrusel .cifra b { font-size: clamp(64px, 8vw, 116px); line-height: .9; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.carrusel .cifra span { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.35; max-width: 26ch; }
.carrusel .fuente { font-size: 13px; opacity: .85; margin: 0; }
.puntos { display: flex; justify-content: center; gap: 10px; }
.puntos button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; }
.puntos button[aria-current="true"] { background: var(--menta); }
@media (max-width: 860px) { .cta .contenedor { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Pie ---------- */
.pie-sitio { position: relative; color: var(--blanco); isolation: isolate; }
.pie-sitio .contenedor { position: relative; z-index: 1; padding-block: clamp(64px, 8vw, 104px) 32px; }
.pie-sitio .columnas { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr) minmax(0, 1.2fr); gap: 40px 56px; }
.pie-sitio h2 { margin: 0 0 24px; font-size: 19px; font-weight: 600; }
.pie-sitio ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pie-sitio .docs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.pie-sitio a { color: var(--blanco); text-decoration: none; font-size: 16px; }
.pie-sitio a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pie-sitio .grande h2 { font-size: clamp(30px, 2.8vw, 40px); line-height: 1.1; font-weight: 700; margin-bottom: 16px; }
.pie-sitio .grande p { margin: 0 0 24px; max-width: 44ch; color: rgba(255,255,255,.9); }
.pie-sitio .legal { margin-top: clamp(56px, 7vw, 96px); padding-top: 22px; border-top: 1px solid rgba(255,255,255,.3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 13.5px; color: rgba(255,255,255,.88); }
.pie-sitio .legal p { margin: 0; }
@media (max-width: 960px) { .pie-sitio .columnas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pie-sitio .grande { grid-column: 1 / -1; } }
@media (max-width: 620px) { .pie-sitio .columnas { grid-template-columns: minmax(0, 1fr); } .pie-sitio .docs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Página de documento ---------- */
.indice-doc { padding-block: clamp(48px, 6vw, 80px) 8px; max-width: 1100px; }
.indice-doc h2 { margin: 0 0 20px; font-size: clamp(30px, 3vw, 40px); color: var(--azul); font-weight: 700; }
.indice-doc ol { margin: 0; padding: 0; list-style: none; columns: 2 280px; column-gap: 40px; counter-reset: idx; }
.indice-doc li { break-inside: avoid; counter-increment: idx; padding: 9px 0; border-bottom: 1px solid var(--linea); }
.indice-doc a { display: flex; gap: 14px; color: var(--texto); text-decoration: none; font-size: 16px; line-height: 1.35; }
.indice-doc a::before { content: counter(idx, decimal-leading-zero); color: var(--clinico); font-weight: 600; font-variant-numeric: tabular-nums; }
.indice-doc a:hover { color: var(--azul); }
.leyenda { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 14px; color: var(--gris); margin: 26px 0 0; }

.cajon { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(420px, 92vw); background: var(--noche); color: var(--blanco); transform: translateX(100%); visibility: hidden; transition: transform .35s ease, visibility .35s; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 28px) 28px 40px; box-shadow: -10px 0 40px rgba(4,18,46,.35); }
.cajon.abierto { transform: none; visibility: visible; }
.cajon .cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.cajon h2 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--menta); }
.cajon button.cerrar { background: none; border: 1px solid rgba(255,255,255,.4); color: var(--blanco); border-radius: 4px; font: 600 14px var(--fuente); padding: 8px 12px; cursor: pointer; }
.cajon ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: c; }
.cajon li { counter-increment: c; }
.cajon a { display: flex; gap: 12px; color: var(--blanco); text-decoration: none; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 15.5px; line-height: 1.35; }
.cajon a::before { content: counter(c, decimal-leading-zero); color: var(--menta); font-variant-numeric: tabular-nums; }
.cajon a:hover { color: var(--menta); }
.velo { position: fixed; inset: 0; z-index: 44; background: rgba(4,18,46,.45); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.velo.abierto { opacity: 1; visibility: visible; }

/* ---------- Contenido literal de los documentos ---------- */
.texto-doc { max-width: 1100px; padding-bottom: clamp(56px, 7vw, 100px); }
.texto-doc section { padding-block: clamp(44px, 5vw, 72px) 12px; border-bottom: 1px solid var(--linea); }
.texto-doc section:last-child { border-bottom: 0; }
.texto-doc h2 { margin: 0 0 22px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; font-weight: 700; color: var(--azul); letter-spacing: -.01em; text-wrap: balance; }
.texto-doc h2 .num { display: block; font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--clinico); margin-bottom: 10px; }
.texto-doc h3 { margin: 34px 0 10px; font-size: 23px; line-height: 1.25; font-weight: 700; color: var(--noche); text-wrap: balance; }
.texto-doc h4 { margin: 22px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--gris); }
.texto-doc p, .texto-doc li { max-width: 72ch; }
.texto-doc p { margin: 0 0 14px; }
.texto-doc ul, .texto-doc ol { padding-left: 24px; margin: 0 0 16px; }
.texto-doc li { margin-bottom: 6px; }
.texto-doc li::marker { color: var(--clinico); font-weight: 600; }
.texto-doc strong, .texto-doc b { font-weight: 700; }
.texto-doc small, .texto-doc .note { color: var(--gris); font-size: 14px; }
.texto-doc code { font-size: .88em; background: var(--suave); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.texto-doc pre { background: var(--noche); color: #dfe8ff; padding: 18px 20px; border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.texto-doc pre code { background: none; padding: 0; color: inherit; }

.texto-doc .easy { background: var(--azul); color: var(--blanco); border-radius: 8px; padding: 22px 24px; margin: 20px 0; max-width: 78ch; }
.texto-doc .easy b:first-child { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--menta); margin-bottom: 6px; }
.texto-doc .easy a { color: var(--menta); }
.texto-doc .easy code { background: rgba(255,255,255,.14); }

.tag { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; vertical-align: 2px; }
.tag.v { background: var(--verde-suave); color: var(--verde); }
.tag.p { background: var(--ambar-suave); color: var(--ambar); }
.tag.e { background: var(--rojo-suave); color: var(--rojo); }
.tag.n { background: var(--linea); color: var(--gris); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; color: var(--gris); align-items: center; }

.texto-doc .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin: 22px 0; }
.texto-doc .kpi { background: var(--azul); color: var(--blanco); border-radius: 8px; padding: 18px 20px; display: grid; gap: 6px; align-content: start; }
.texto-doc .kpi:nth-child(2n) { background: var(--azul-2); }
.texto-doc .kpi .k { font-size: 30px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.texto-doc .kpi .l { font-size: 14px; line-height: 1.45; opacity: .95; }
.texto-doc .kpi.bad { background: var(--rojo); }
.texto-doc .kpi.warn { background: var(--ambar); }
.texto-doc .kpi.ok { background: var(--clinico); }
.texto-doc .kpi .tag { background: rgba(255,255,255,.2); color: var(--blanco); }

.texto-doc .tbl { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--linea); border-radius: 8px; background: var(--blanco); }
.texto-doc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.texto-doc th, .texto-doc td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.texto-doc th { background: var(--noche); color: var(--blanco); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.texto-doc tbody tr:nth-child(2n) td { background: #f7f9fd; }
.texto-doc tr:last-child td { border-bottom: 0; }
.texto-doc td.n, .texto-doc th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.texto-doc td.st-bad { color: var(--rojo); font-weight: 700; }
.texto-doc td.st-ok { color: var(--verde); font-weight: 700; }
.texto-doc td.st-warn { color: var(--ambar); font-weight: 700; }

.texto-doc ol.findings { padding-left: 26px; display: grid; gap: 10px; }
.texto-doc ol.findings li::marker { color: var(--azul); font-weight: 700; }

.texto-doc .diagram { overflow-x: auto; margin: 20px 0; padding: 22px; background: var(--suave); border-radius: 8px; }
.texto-doc .tier { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.texto-doc .node { border: 1.5px solid var(--azul); border-radius: 8px; padding: 10px 14px; background: var(--blanco); min-width: 0; flex: 1 1 150px; max-width: 260px; }
.texto-doc .node b { display: block; font-size: 15px; color: var(--noche); }
.texto-doc .node span { display: block; font-size: 13px; color: var(--gris); line-height: 1.4; }
.texto-doc .node.key { background: var(--azul); }
.texto-doc .node.key b, .texto-doc .node.key span { color: var(--blanco); }
.texto-doc .node.ctrl { border-style: dashed; border-color: var(--clinico); }
.texto-doc .arrow { text-align: center; color: var(--clinico); font-size: 14px; font-weight: 600; padding-block: 8px; }
.texto-doc .tier-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); text-align: center; margin: 12px 0 8px; font-weight: 600; }

.texto-doc figure.chart { margin: 22px 0; background: var(--blanco); border: 1px solid var(--linea); border-radius: 8px; padding: 18px 20px 14px; }
.texto-doc figure.chart figcaption { font-weight: 700; font-size: 17px; margin-bottom: 2px; color: var(--noche); }
.texto-doc figure.chart .sub { color: var(--gris); font-size: 14px; margin-bottom: 10px; }
.texto-doc figure.chart svg { width: 100%; height: auto; display: block; }
.texto-doc figure.chart .src { font-size: 13px; color: var(--gris); margin-top: 8px; }
svg .lbl { fill: var(--texto); font: 12.5px var(--fuente); }
svg .val { fill: var(--texto); font: 600 12px var(--fuente); }
svg .axis { stroke: var(--linea); }
svg .ref { stroke: var(--rojo); stroke-dasharray: 4 3; stroke-width: 1.5; }
svg .reflbl { fill: var(--rojo); font: 11.5px var(--fuente); }
svg .b1 { fill: var(--azul); } svg .b2 { fill: var(--menta); } svg .bbad { fill: var(--rojo); }
.texto-doc .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.texto-doc .grid2 > * { min-width: 0; }
.texto-doc .sources { font-size: 14px; }
.texto-doc .sources li { word-break: break-word; }
.texto-doc .tarjeta { background: var(--suave); border-left: 4px solid var(--azul); border-radius: 0 8px 8px 0; padding: 20px 24px; margin: 18px 0; }
.texto-doc .tarjeta p, .texto-doc .tarjeta li { max-width: 74ch; }

/* ---------- Diapositivas (documento 05) ---------- */
.diapositivas { display: grid; gap: 28px; max-width: 1100px; padding-block: clamp(48px, 6vw, 80px); }
.diapositiva { scroll-margin-top: 100px; }
.diapositiva .marco { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; box-shadow: 0 10px 34px rgba(4,18,46,.16); background: #F5F3EE; }
.diapositiva .lienzo { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.diapositiva .lienzo > section { position: relative; width: 1920px; height: 1080px; box-sizing: border-box; overflow: hidden; }
.diapositiva .lienzo section * { box-sizing: border-box; }
.diapositiva .lienzo h1, .diapositiva .lienzo h2, .diapositiva .lienzo h3, .diapositiva .lienzo p, .diapositiva .lienzo ul, .diapositiva .lienzo ol { margin: 0; }
.diapositiva .lienzo aside { display: none; }
.diapositiva .lienzo table { border-collapse: collapse; width: 100%; }
.diapositiva .lienzo th, .diapositiva .lienzo td { text-align: left; padding: 0.35em 0.6em; border-bottom: 1px solid #D9D4C7; }
.diapositiva .lienzo th { font-weight: 600; }
.diapositiva .rotulo { display: flex; gap: 12px; align-items: baseline; margin: 0 0 10px; font-size: 15px; color: var(--gris); }
.diapositiva .rotulo b { color: var(--clinico); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carrusel .cifra { transition: none; }
  .menu, .menu__panel, .cajon, .velo, .cabecera { transition: none; }
}
@media (max-width: 620px) {
  :root { --cabecera: 84px; }
  .boton-menu i { width: 28px; }
  .pestana { padding: 16px 10px; font-size: 12px; }
  .raya { margin: 24px 0 30px; }
}

/* ---------- Ingresar y acciones ---------- */
.acciones-cabecera { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.boton-ingresar { color: var(--blanco); text-decoration: none; font-weight: 600; font-size: 16px; padding: 11px 22px; border: 2px solid rgba(255,255,255,.75); border-radius: 4px; transition: background-color .25s ease, color .25s ease; }
.boton-ingresar:hover { background: var(--menta); border-color: var(--menta); color: var(--menta-oscura); }
.acciones-portada { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.boton.secundario { background: transparent; color: var(--blanco); box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); }
.boton.secundario:hover { background: var(--blanco); color: var(--noche); }
.texto-doc .boton { color: var(--menta-oscura); }
.tarjeta-doc.texto .numero { font-size: clamp(40px, 3.6vw, 58px); line-height: 1; letter-spacing: -.02em; }
.tarjeta-doc .rol { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.carrusel .cifra.enlace { color: var(--blanco); text-decoration: none; }
.carrusel .cifra.enlace:hover b { color: var(--menta); }
.bloques.en-texto { padding-bottom: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bloques.en-texto > .bloque-codigo { margin-top: 0 !important; }
@media (max-width: 620px) { .boton-ingresar { padding: 8px 14px; font-size: 14px; } }
@media (max-width: 620px) { .pestana { display: none; } }


/* ---------- Cortina de entrada y de cambio de página ---------- */
.cortina { position: fixed; inset: 0; z-index: 200; background: var(--clinico); color: var(--blanco); display: grid; place-items: center; clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); visibility: hidden; pointer-events: none; }
.cortina.activa { visibility: visible; pointer-events: auto; }
.cortina .marca { font-size: clamp(36px, 5vw, 64px); }
.telon { position: fixed; inset: 0; z-index: 199; background: var(--blanco); display: none; }
html.llegando .cortina { visibility: visible; clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
html.primera-vez .cortina { visibility: visible; clip-path: polygon(0% 49.7%, 0% 49.7%, 0% 50.3%, 0% 50.3%); }
html.primera-vez .telon { display: block; }
/* Si el script no corre, la cortina se retira sola */
html.llegando .cortina, html.primera-vez .cortina, html.primera-vez .telon { animation: soltar 0s 4.5s forwards; }
@keyframes soltar { to { visibility: hidden; display: none; } }

/* ---------- Degradado líquido ---------- */
.degradado__lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Títulos palabra por palabra ---------- */
.palabra { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.palabra > span { display: inline-block; transform: translateY(110%); transition: transform 1s cubic-bezier(.22, 1, .36, 1); transition-delay: calc(var(--i) * 60ms); }
.entra .palabra > span { transform: none; }
.por-entrar:not(.entra) .palabra > span { animation: palabra-sola 0s 5s forwards; }
@keyframes palabra-sola { to { transform: none; } }
html.js .portada .raya { transform-origin: left center; transition: transform 1.1s cubic-bezier(.22, 1, .36, 1) .1s; }
html.js .portada:not(.lista) .raya { transform: scaleX(0); }
html.js .portada .ceja, html.js .portada .entrada, html.js .portada .datos, html.js .portada .acciones-portada { transition: opacity .9s ease .45s, transform 1s cubic-bezier(.22, 1, .36, 1) .45s; }
html.js .portada:not(.lista) .ceja, html.js .portada:not(.lista) .entrada, html.js .portada:not(.lista) .datos, html.js .portada:not(.lista) .acciones-portada { opacity: 0; transform: translateY(24px); }
html.js .portada:not(.lista) .ceja, html.js .portada:not(.lista) .entrada, html.js .portada:not(.lista) .datos, html.js .portada:not(.lista) .acciones-portada { animation: portada-sola 0s 5s forwards; }
html.js .portada:not(.lista) .raya { animation: raya-sola 0s 5s forwards; }
@keyframes portada-sola { to { opacity: 1; transform: none; } }
@keyframes raya-sola { to { transform: none; } }

/* ---------- Apariciones al bajar ---------- */
.aparece { opacity: 0; transform: translateY(56px); transition: opacity .9s ease var(--retraso, 0ms), transform 1.1s cubic-bezier(.22, 1, .36, 1) var(--retraso, 0ms); }
.aparece.visto { opacity: 1; transform: none; }

/* ---------- Menú: panel azul sobre fondo oscuro ---------- */
.menu { position: fixed; inset: 0; z-index: 35; background: #0a0730; color: var(--blanco); visibility: hidden; opacity: 0; transition: opacity .4s ease, visibility .4s; overflow-y: auto; padding: clamp(12px, 2.2vw, 36px); display: flex; flex-direction: column; gap: 12px; }
.menu.abierto { visibility: visible; opacity: 1; }
.menu__panel { position: relative; overflow: hidden; flex: 1 0 auto; background: var(--azul); border-radius: 10px; padding: clamp(28px, 4vw, 64px) clamp(24px, 4vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px 64px; align-content: start; transform: translateY(-24px); clip-path: inset(0 0 100% 0 round 10px); transition: transform .7s cubic-bezier(.22, 1, .36, 1), clip-path .7s cubic-bezier(.76, 0, .24, 1); }
.menu.abierto .menu__panel { transform: none; clip-path: inset(0 0 0 0 round 10px); }
.menu__panel svg.lineas { position: absolute; right: 1%; top: -10%; height: 120%; width: auto; pointer-events: none; opacity: .7; }
.menu__panel svg.lineas path { fill: none; stroke: var(--clinico); stroke-width: 7; }
.menu__panel nav { position: relative; z-index: 1; min-width: 0; }
.menu__panel ul { list-style: none; margin: 0; padding: 0; }
.menu .principal a { color: var(--blanco); text-decoration: none; font-weight: 700; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.12; letter-spacing: -.01em; transition: color .2s ease; }
.menu .principal a:hover, .menu .principal a[aria-current="page"] { color: var(--menta); }
.menu h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin: 8px 0 16px; color: var(--menta); }
.menu .docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.menu .docs a { color: var(--blanco); text-decoration: none; font-size: 18px; font-weight: 600; line-height: 1.3; display: flex; gap: 12px; }
.menu .docs a:hover, .menu .docs a[aria-current="page"] { color: var(--menta); }
.menu .docs b { color: var(--menta); font-weight: 600; font-variant-numeric: tabular-nums; }
.menu__barra { position: relative; flex: none; background: #0b2a9e; border-radius: 10px; padding: 22px clamp(24px, 4vw, 72px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; transform: translateY(24px); opacity: 0; transition: transform .7s cubic-bezier(.22, 1, .36, 1) .1s, opacity .5s ease .1s; }
.menu.abierto .menu__barra { transform: none; opacity: 1; }
.menu__barra .marca { font-size: 26px; }
.menu__barra p { margin: 0; font-size: 15px; opacity: .9; }
.cabecera.con-menu { background: transparent !important; box-shadow: none !important; }
.cabecera.con-menu .marca, .cabecera.con-menu .boton-ingresar { opacity: 0; pointer-events: none; }
.cabecera.con-menu .fila { height: var(--cabecera) !important; }
.cabecera.con-menu .boton-menu { transform: translate(-8px, 18px); }
.boton-menu { transition: transform .3s ease; }
@media (max-width: 760px) {
  .menu__panel { grid-template-columns: minmax(0, 1fr); padding-top: 72px; }
  .menu .docs { grid-template-columns: minmax(0, 1fr); }
  .menu__panel svg.lineas { display: none; }
}

/* El fondo líquido aparece con un fundido sobre un color de reserva parecido: sin saltos */
.degradado__lienzo { opacity: 0; transition: opacity .9s ease; }
.degradado__lienzo.listo { opacity: 1; }
.degradado[data-tono="noche"] { background: radial-gradient(ellipse at 70% 45%, #1a3bd0 0%, #0b1a8a 45%, #03081f 100%); }
.degradado[data-tono="azul"] { background: radial-gradient(ellipse at 65% 45%, #1f55f0 0%, #0a2bb8 45%, #050c3a 100%); }
.degradado[data-tono="menta"] { background: radial-gradient(ellipse at 65% 45%, #1a7fb0 0%, #0a3fc0 45%, #04122e 100%); }
.degradado[data-tono="clinico"] { background: radial-gradient(ellipse at 65% 45%, #0d6f9a 0%, #0a5f70 45%, #031a1f 100%); }

/* La marca de la cortina solo se ve cuando la franja ya está abierta */
.cortina .marca { opacity: 0; }
html.llegando .cortina .marca { opacity: 1; }

/* Fotos de las tarjetas: retrato sobre degradado, como el equipo de Inflect */
.tarjeta-doc .imagen.con-foto { padding: 0; background: #c9d4fa; }
.tarjeta-doc .imagen.con-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.tarjeta-doc:hover .imagen.con-foto img { transform: scale(1.04); }
.tarjeta-doc:hover .imagen.con-foto { filter: none; }
.carrusel .cifra.con-foto { color: var(--blanco); text-decoration: none; isolation: isolate; }
.carrusel .cifra.con-foto img.fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.carrusel .cifra.con-foto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4, 18, 46, 0) 35%, rgba(4, 18, 46, .78) 100%); }
.carrusel .cifra.con-foto:hover img.fondo { transform: scale(1.04); }
