/* Tokens: marca FisioIA (ver docs/DISENO.md) */
:root {
  --azul: #004aad;
  --noche: #0a1f4d;
  --tinta: #11265a;
  --azul-claro: #e8f0fc;
  --oro: #d4af37;
  --oro-suave: #fbf3dc;
  --oro-oscuro: #9c7a12;
  --papel: #faf8f3;
  --texto: #0b1730;
  --texto-2: #3d4555;
  --linea: #e3e6ee;
  --linea-2: #eef0f5;
  --ok: #1f9d55; --ok-bg: #e3f4ea; --ok-txt: #13703a;
  --mal: #d64545; --mal-bg: #fbe9e9; --mal-txt: #a32d2d;
  --aviso-bg: #fdf3dc; --aviso-txt: #7a5800;
  --nd: #8a90a0;
  --f-ui: Manrope, system-ui, sans-serif;
  --f-voz: 'Source Serif 4', Georgia, serif;
  --f-dato: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--papel); color: var(--texto); font-family: var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: var(--azul); }
.mono { font-family: var(--f-dato); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
[hidden] { display: none !important; }

/* Cabecera y búsqueda */
.top { background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px); background-size: 22px 22px; padding-bottom: 28px; overflow: hidden; }
.top.compact { background-image: none; }
.top-row { min-height: 64px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: #fff; text-decoration: none; }
.logo span { color: var(--oro); }
.by { font-size: 12px; color: #c9d6f0; }
.help-link { margin-left: auto; padding: 6px 4px; border: 0; background: none; font: 600 13px var(--f-ui); color: #c9d6f0; text-decoration: underline; text-decoration-color: rgba(201, 214, 240, 0.4); text-underline-offset: 3px; cursor: pointer; }
.help-link:hover { color: #fff; text-decoration-color: var(--oro); }
.badge-local { white-space: nowrap; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 6px; background: var(--oro); color: var(--noche); }
.hero { max-width: 880px; margin: 0 auto; padding: 56px 32px 32px; text-align: center; }
.top.compact .hero, .top.compact .examples, .top.compact .privacy, .top.compact .sources { display: none; }
.kicker { margin: 0 0 18px; font-size: 12px; letter-spacing: 0.1em; color: var(--oro); }
/* Titular con voz de revista: serif de titular, la segunda línea en cursiva dorada con barra de escala. */
.hero h1 { margin: 0 0 22px; font: 400 clamp(42px, 6.2vw, 74px)/1.04 'Instrument Serif', 'Source Serif 4', Georgia, serif; letter-spacing: -0.012em; color: #fff; }
.hero h1 .l2 { position: relative; display: inline-block; isolation: isolate; font-style: italic; color: var(--oro); padding: 0 0.1em; }
/* Trazo de subrayador: banda translúcida e irregular bajo la línea base, dibujada de un gesto. */
.marker { position: absolute; z-index: -1; left: -0.04em; right: -0.08em; bottom: -0.08em; width: calc(100% + 0.12em); height: 0.4em; transform: rotate(-1.2deg); fill: #f2c94c; opacity: 0.55; mix-blend-mode: screen; clip-path: inset(0 0 0 0); transition: clip-path 0.55s cubic-bezier(0.3, 0.6, 0.35, 1); }
.marker .pass { opacity: 0.55; }
.hero h1.pending .marker { clip-path: inset(0 100% 0 0); }
/* Titular tecleado: el texto pendiente ocupa su sitio invisible, así nada se mueve mientras se escribe. */
.tw-off { visibility: hidden; }
.caret { position: relative; display: inline-block; width: 0; }
.caret::after { content: ""; position: absolute; left: 3px; top: -0.74em; width: 2px; height: 0.82em; border-radius: 1px; background: var(--oro); animation: blink 1s steps(1) infinite; }
.typing .caret::after { animation: none; }
.caret.out::after { animation: none; opacity: 0; transition: opacity 0.4s; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 0 auto; max-width: 600px; font-family: var(--f-voz); font-size: 19px; line-height: 1.55; color: #c9d6f0; }
.search { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 8px 8px 8px 20px; box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 18px 50px rgba(0, 0, 0, 0.35); }
.top.compact .search { background: #fff; box-shadow: none; }
.top.compact .search { max-width: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: 500 17px var(--f-ui); color: var(--texto); background: transparent; height: 48px; }
.btn { font: 700 14.5px var(--f-ui); border-radius: 12px; padding: 0 20px; min-height: 48px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--tinta); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }
.btn-ghost { background: #fff; color: var(--azul); border-color: #c9d6f0; }
.btn-ghost:hover { border-color: var(--azul); }
.form-error { max-width: 880px; margin: 10px auto 0; color: #ffd6d6; font-size: 14px; }
.examples { max-width: 880px; margin: 18px auto 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ex { font: 600 13.5px var(--f-ui); padding: 9px 14px; min-height: 40px; border-radius: 999px; border: 1px solid #2a3f73; color: #c9d6f0; background: transparent; cursor: pointer; }
.ex:hover { border-color: var(--oro); color: #fff; }
.privacy { text-align: center; margin: 18px 0 0; font-size: 12.5px; color: #8fa3cc; }

/* Progreso */
.pipeline { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; color: #8fa3cc; }
.pipeline li { display: inline-flex; align-items: center; gap: 8px; }
.pipeline .dot { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #2a3f73; flex-shrink: 0; display: grid; place-items: center; color: #5d74a8; }
.pipeline li.doing { color: #fff; font-weight: 700; }
.pipeline li.doing .dot { border-color: rgba(212, 175, 55, 0.35); color: var(--oro); }
.pipeline li.doing .dot::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--oro); border-right-color: transparent; border-bottom-color: transparent; animation: spin 0.9s linear infinite; }
.pipeline li.done { color: #c9d6f0; }
.pipeline li.done .dot { background: var(--oro); border-color: var(--oro); color: var(--noche); }
.pipeline li.done.fresh .dot { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.pipeline .dot .ico { stroke-width: 2.4; }
.pipeline b { color: #fff; font-weight: 500; }
.pipeline .time { margin-left: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pipeline li.doing .dot, .mock-caret, .tour[open] { animation: none; } }

/* Resultados */
.layout { padding-top: 32px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side .source { position: sticky; top: 76px; }
.col-main > *, .col-side > * { min-width: 0; }
.card { background: #fff; border: 1px solid var(--linea); border-radius: 16px; padding: 22px 26px; }
.card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.side-h { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.chip { font: 500 11px var(--f-dato); min-width: 18px; height: 17px; padding: 0 4px; margin: 0 1px 0 2px; border: 0; border-radius: 4px; background: var(--azul-claro); color: var(--azul); cursor: pointer; vertical-align: 0.55em; line-height: 17px; }
.chip:hover, .chip.on { background: var(--azul); color: #fff; }
.more { margin-top: 8px; }
.card ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.65; color: #1c2740; }
.card li { margin-bottom: 8px; }

/* Estudios */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.filter { font: 600 13px var(--f-ui); min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer; background: #fff; color: var(--tinta); border: 1px solid #c9d6f0; }
.filter.on { background: var(--noche); color: #fff; border-color: var(--noche); }
.study { border-top: 1px solid var(--linea-2); }
.study-row { width: 100%; display: flex; gap: 16px; align-items: center; padding: 14px 4px; background: transparent; border: 0; text-align: left; cursor: pointer; font-family: var(--f-ui); color: var(--texto); }
/* Anillo de calidad: se llena según la nota (PEDro sobre 10, AMSTAR-2 por nivel de confianza). */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.ring { --rc: var(--nd); position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--linea-2) 0); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.ring > * { position: relative; }
.ring b { font-weight: 800; font-size: 16px; line-height: 1; }
.ring small { font: 10px var(--f-dato); color: var(--texto-2); }
.ring.verde { --rc: var(--ok); } .ring.amarillo { --rc: #e0a100; } .ring.rojo { --rc: var(--mal); }
.ring.nd { background: none; border: 2px dashed var(--nd); } .ring.nd::before { inset: 0; }
.play .ring { animation: ring-fill 1.1s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
@keyframes ring-fill { from { --p: 0; } }
.study-info { flex: 1; min-width: 0; }
.study-title { display: flex; gap: 8px; align-items: baseline; font-size: 15px; font-weight: 700; line-height: 1.4; }
.study-title .n { font: 12px var(--f-dato); color: var(--oro-oscuro); }
.study-meta { display: block; margin: 3px 0 7px; font-size: 12.5px; color: var(--texto-2); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: #f1f2f6; color: var(--texto-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok-txt); } .tag.mal { background: var(--mal-bg); color: var(--mal-txt); } .tag.aviso { background: var(--aviso-bg); color: var(--aviso-txt); } .tag.info { background: var(--azul-claro); color: var(--tinta); }
.chev { transition: transform 0.15s; flex-shrink: 0; }
.study.open .chev { transform: rotate(180deg); }
.study-detail { margin: 0 4px 18px 70px; padding: 16px 18px; border-radius: 12px; background: var(--papel); border: 1px solid var(--linea); font-size: 14px; line-height: 1.6; }
.study-detail h3 { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.study-detail h3:first-child { margin-top: 0; }
.study-detail p { margin: 0 0 6px; }
.item { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; }
.item .ans { flex-shrink: 0; width: 76px; text-align: center; font: 11.5px var(--f-dato); padding: 2px 0; border-radius: 5px; background: #f1f2f6; color: var(--texto-2); }
.item .ans.si { background: var(--ok-bg); color: var(--ok-txt); } .item .ans.no { background: var(--mal-bg); color: var(--mal-txt); }
.item blockquote { margin: 4px 0 0; font-family: var(--f-voz); font-size: 13.5px; color: var(--texto-2); }
.params { margin: 4px 0 8px; padding-left: 0; list-style: none; }
.params li { font: 12.5px var(--f-dato); color: var(--tinta); margin: 2px 0; }
/* Lagunas: borde discontinuo, como los huecos del mapa */
.gaps { background: transparent; border: 1.5px dashed #c9cfdd; }
.gaps ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.65; color: var(--texto-2); }
.gaps li { position: relative; margin: 0; padding-left: 26px; }
.gaps li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--nd); }

/* Lateral */
.source { border: 2px solid var(--azul); }
.source .n { font: 500 13px var(--f-dato); padding: 3px 8px; border-radius: 6px; background: var(--azul); color: #fff; }
.source-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.source-h h2 { margin: 0; font-size: 13px; color: var(--texto-2); font-weight: 700; }
.source .t { margin: 0 0 6px; font-size: 15px; font-weight: 700; line-height: 1.4; }
.source .m { margin: 0 0 12px; font-size: 12.5px; color: var(--texto-2); }
.source blockquote { margin: 0 0 12px; padding: 12px 14px; background: var(--papel); border-radius: 10px; font-family: var(--f-voz); font-size: 15px; line-height: 1.55; }
.hint { font-size: 14px; color: var(--texto-2); margin: 0; }
dl.pico { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 10px; font-size: 13px; line-height: 1.5; }
dl.pico dt { color: var(--texto-2); } dl.pico dd { margin: 0; }
.query { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #f1f2f6; font: 11.5px/1.5 var(--f-dato); color: var(--tinta); overflow-wrap: anywhere; }
.stats { margin: 10px 0 0; font-size: 12.5px; color: var(--texto-2); }
.error-box { background: #fdf1f1; border: 1px solid #f3cfcf; border-radius: 16px; padding: 22px 26px; color: #5a1a1a; flex: 1 1 100%; }

/* PDFs subidos */
.upload { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--azul-claro); color: var(--tinta); }
.upload > div { flex: 1 1 260px; }
.upload-status { flex: 1 1 100%; margin: 0; font-size: 13px; font-weight: 600; }
.upload-status.err { color: var(--mal-txt); }
.upload-hint { margin: 0 0 12px; }
.rob-pending { margin-top: 10px; font-size: 13px; }
.stale { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 16px 20px; border-radius: 12px; background: #fff; border: 1px solid #c9d6f0; }
.stale p { flex: 1 1 280px; margin: 0; font-size: 14px; line-height: 1.5; }
.stale .upload-status { flex-basis: 100%; }


/* Lenguaje visual: textura = calidad (1 sólido · 2 semitransparente · 3 rayado · 4 discontinuo) */
.tx { --c: var(--azul); display: inline-block; flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--c); margin-right: 6px; vertical-align: -1px; }
.tx-1 { background: var(--c); }
.tx-2 { background: color-mix(in srgb, var(--c) 35%, #fff); }
.tx-3 { background: repeating-linear-gradient(45deg, var(--c) 0 1.6px, #fff 1.6px 4px); }
.tx-4 { background: #fff; border-style: dashed; }
.tx-ring { border-radius: 50%; border: 1.5px solid var(--mal); background: #fff; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 6px var(--azul); }

/* Artículo: la respuesta con voz de revista */
.paper { background: #fff; border: 1px solid var(--linea); border-radius: 16px; padding: 34px 40px 26px; }
.paper-kicker { margin: 0 0 14px; font-size: 11.5px; letter-spacing: 0.1em; color: var(--oro-oscuro); }
.paper-title { margin: 0 0 22px; font: 600 clamp(26px, 3.4vw, 36px)/1.18 var(--f-voz); letter-spacing: -0.012em; color: var(--texto); max-width: 30ch; }
.paper-answer { padding: 18px 22px 20px; background: var(--oro-suave); border-left: 4px solid var(--oro); border-radius: 0 12px 12px 0; }
.paper-label { display: block; margin-bottom: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--oro-oscuro); }
.paper-answer p { margin: 0; font: 400 21px/1.55 var(--f-voz); }
.paper-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; padding-bottom: 20px; border-bottom: 1px solid var(--linea); font-size: 13px; color: var(--texto-2); }
.paper-byline b { color: var(--azul); }
.paper-h { margin: 22px 0 6px; font: 700 13px var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--texto-2); }
.card > .paper-h:first-child { margin-top: 0; }
.para { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 30px; padding: 12px 0; }
.para > p { margin: 0; font: 400 17.5px/1.7 var(--f-voz); color: #1c2740; }
.paper-h + .para > p::first-letter { float: left; font: 600 54px/0.82 var(--f-voz); margin: 6px 8px 0 0; color: var(--azul); }
.sidenotes { display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--linea); padding-left: 14px; }
.sidenotes:empty { border-left-color: transparent; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font: 12px/1.45 var(--f-ui); color: var(--texto-2); }
.note:hover, .note.on { background: var(--azul-claro); color: var(--tinta); }
.note-n { flex-shrink: 0; min-width: 18px; height: 17px; border-radius: 4px; background: var(--azul); color: #fff; font-size: 11px; text-align: center; line-height: 17px; }
.note-t { display: block; }
.notes-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.notes-row .note { margin: 0; }

/* Figuras */
.fig { margin: 0; }
.fig-head { margin-bottom: 18px; }
.fig-no { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 0.12em; color: var(--oro-oscuro); }
.fig-head h2 { margin: 0 0 6px; font: 600 23px/1.25 var(--f-voz); letter-spacing: -0.01em; }
.fig-head h2 .count { font: 500 15px var(--f-dato); color: var(--texto-2); }
.fig-head p { margin: 0; max-width: 68ch; font-size: 14px; line-height: 1.55; color: var(--texto-2); }
.fig-foot { margin: 14px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--texto-2); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legend-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--linea-2); font-size: 12px; color: var(--texto-2); }
.legend-block > span { display: inline-flex; align-items: center; }
.legend-block .legend-t { font-weight: 700; color: var(--texto); margin-left: 6px; }
.legend-block .legend-t:first-child { margin-left: 0; }
.legend-block.small { margin-top: 10px; padding-top: 0; border-top: 0; }
.hint.map-hint { margin-top: 12px; font-size: 13px; }
.picto { flex-shrink: 0; color: var(--azul); }
.pictos { display: inline-flex; gap: 4px; align-items: center; margin-right: 2px; }
.pictos.labelled { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 12.5px; color: var(--tinta); }
.pictos.labelled span { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: #f1f2f6; }
.seg-b { font: 600 13px var(--f-ui); min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--texto-2); cursor: pointer; }
.seg-b.on { background: #fff; color: var(--azul); box-shadow: 0 1px 3px rgba(11, 23, 48, 0.12); }
.fig-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
[role="button"] { cursor: pointer; }
[role="button"]:focus-visible, .map-cell:focus-visible, .note:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Mapa de la evidencia */
.map { display: grid; align-items: center; }
.map > * { border-bottom: 1px solid var(--linea-2); min-height: 56px; display: flex; align-items: center; justify-content: center; }
.map > .map-col-h { min-height: 40px; font-size: 12px; font-weight: 700; color: var(--texto-2); text-align: center; line-height: 1.3; padding: 0 4px; }
.map > .map-row-h { justify-content: flex-start; gap: 10px; padding-right: 12px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.map-row-h > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.map-gap { color: #c4c9d6; font-size: 20px; }
.map-cell { position: relative; width: 100%; height: 56px; border: 0; background: transparent; cursor: pointer; border-radius: 10px; }
.map-cell:hover, .map-cell.on { background: var(--azul-claro); }
.map-cell svg { display: block; margin: 0 auto; }
.map-cell .mono { position: absolute; left: calc(50% + 17px); bottom: 6px; font-size: 10.5px; color: var(--texto-2); }
.map-detail { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--papel); border: 1px solid var(--linea); }
.map-detail p { margin: 0 0 8px; font-size: 14px; }
.dir { font-weight: 700; }
.dir-azul { color: var(--azul); } .dir-gris { color: var(--texto-2); } .dir-rojo { color: var(--mal-txt); } .dir-oro { color: var(--oro-oscuro); }

/* Forest plot */
.mcid { display: grid; grid-template-columns: auto minmax(160px, 1fr); align-items: center; gap: 6px 16px; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; background: var(--papel); border: 1px solid var(--linea); }
.mcid label { font-size: 13px; font-weight: 700; }
.mcid label b { color: var(--azul); margin-left: 6px; }
.mcid input { width: 100%; accent-color: var(--azul); }
.mcid small { grid-column: 1 / -1; font-size: 12px; color: var(--texto-2); }
.link { border: 0; background: none; padding: 0; font: 600 12px var(--f-ui); color: var(--azul); text-decoration: underline; cursor: pointer; }
.forest { display: flex; flex-direction: column; }
.fr { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr) minmax(150px, 0.9fr); gap: 16px; align-items: center; padding: 0 6px; border-radius: 8px; }
.fr:not(.fr-axis):hover, .fr.on { background: #f3f7fe; box-shadow: inset 3px 0 0 var(--azul); }
.fr-label { padding: 8px 0; min-width: 0; }
.fr-label b { display: block; font-size: 13.5px; line-height: 1.35; }
.fr-label small, .fr-val small { display: block; font-size: 11.5px; color: var(--texto-2); line-height: 1.4; }
.fr .n { font-size: 11.5px; color: var(--oro-oscuro); font-weight: 500; }
.fr-track { position: relative; align-self: stretch; min-height: 50px; }
.fr-band { position: absolute; top: 0; bottom: 0; background: rgba(212, 175, 55, 0.16); border-left: 1px dashed rgba(156, 122, 18, 0.5); border-right: 1px dashed rgba(156, 122, 18, 0.5); }
.fr-zero { position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1.5px solid var(--texto-2); }
.fr-ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--azul); border-radius: 1px; }
.fr-pt { position: absolute; top: 50%; transform: translate(-50%, -50%); overflow: visible; }
.fr-val { font-size: 13px; padding: 8px 0; }
.fr-val .mono small { display: inline; font-size: 11.5px; }
.fr-val .tag { display: inline-block; margin-top: 4px; }
.fr-axis .fr-track { min-height: 22px; }
.fr-axis .fr-track::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--linea); }
.fr-ticks span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 10.5px; color: var(--texto-2); white-space: nowrap; }
.fr-sides { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--texto-2); padding-bottom: 4px; }

/* Dosis */
.dose { display: flex; flex-direction: column; gap: 2px; }
.dose-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.dose-row:not(.dose-axis):hover, .dose-row.on { background: var(--azul-claro); }
.dose-h { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.dose-h b { display: block; font-size: 13.5px; line-height: 1.35; }
.dose-h small { display: block; font-size: 11.5px; color: var(--texto-2); line-height: 1.5; margin-top: 2px; }
.dose-h small b { display: inline; font-size: inherit; color: var(--azul); }
.dose-h .n { font-size: 11.5px; color: var(--oro-oscuro); font-weight: 500; }
.dose-plan { position: relative; display: grid; gap: 3px; align-items: stretch; min-height: 46px; }
.wk { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; gap: 2px; padding: 3px 0; border-radius: 3px; background: #f4f6fa; }
.wk i { width: 5px; height: 5px; border-radius: 50%; background: var(--azul); }
.wk.dbl { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 4px); align-content: end; justify-content: center; gap: 2px 1px; }
.wk.dbl i { width: 4px; height: 4px; }
.wk-nd { background: repeating-linear-gradient(45deg, #c9d6f0 0 1.5px, #f4f6fa 1.5px 4.5px); }
.wk-none { grid-column: 1 / -1; align-self: center; font-size: 12px; color: var(--texto-2); padding: 8px 10px; border: 1px dashed #c9d6f0; border-radius: 8px; }
.wk-more { position: absolute; right: 0; top: -14px; font-size: 10.5px; color: var(--oro-oscuro); }
.dose-axis { padding-top: 0; }
.dose-axis .dose-plan { min-height: 0; font-size: 10px; color: var(--texto-2); text-align: center; }
.dose-axis small { font-size: 11px; color: var(--texto-2); }

/* Pirámide y riesgo de sesgo */
.appraise { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.pyramid { width: 100%; height: auto; display: block; }
.pyramid .tier polygon { fill: var(--azul-claro); stroke: #fff; stroke-width: 2; transition: fill 0.15s; }
.pyramid .tier:hover polygon { fill: #d3e1f8; }
.pyramid .tier.on polygon { fill: var(--noche); }
.pyramid .tier.empty polygon { fill: #f1f2f6; }
.pyramid .tier text { font: 700 11.5px var(--f-ui); fill: var(--tinta); text-anchor: middle; }
.pyramid .tier.on text { fill: #fff; }
.pyramid .tier.empty text { fill: var(--nd); font-weight: 600; }
.pyramid .tier:focus-visible { outline: none; }
.pyramid .tier:focus-visible polygon { stroke: var(--azul); }
.mini-h { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
.appraise-rob .seg { margin-bottom: 10px; }
.rob { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.rob th { font-weight: 600; color: var(--texto-2); }
.rob thead th { height: 92px; vertical-align: bottom; padding: 0; }
.rob thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; line-height: 1; padding-bottom: 2px; }
.rob-amstar thead th { height: 28px; }
.rob-amstar thead th span { writing-mode: horizontal-tb; transform: none; }
.rob td { padding: 0; }
.rob tr.on th .rob-n { background: var(--azul); color: #fff; }
.rob-n { font-size: 11.5px; min-height: 24px; padding: 0 6px; border: 0; border-radius: 5px; background: var(--azul-claro); color: var(--tinta); cursor: pointer; }
.rb { display: inline-block; width: 20px; height: 20px; border-radius: 4px; vertical-align: middle; }
.legend-block .rb { width: 12px; height: 12px; margin-right: 6px; }
.rb-si { background: var(--ok); }
.rb-si_parcial { background: color-mix(in srgb, var(--ok) 40%, #fff); border: 1.5px solid var(--ok); }
.rb-no { background: var(--mal); }
.rb-no_verificable { background: #fff; border: 1.5px dashed var(--nd); }
.rb-no_aplica { background: #f1f2f6; }
/* Caso límite: anillo dorado alrededor de la casilla */
.rb.dud { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--oro); }
.studies-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--linea-2); }
.studies-bar .filters { margin: 0; }
.interv { display: flex; gap: 10px; align-items: flex-start; }
.interv .picto { margin-top: 2px; }

/* Línea temporal */
.timeline { display: block; width: 100%; min-width: 560px; height: auto; }
.tl-lane { font: 600 11px var(--f-ui); fill: var(--texto-2); }
.tl-line { stroke: var(--linea); stroke-width: 1; }
.tl-grid { stroke: var(--linea-2); stroke-width: 1; stroke-dasharray: 2 4; }
.tl-year { font: 10.5px var(--f-dato); fill: var(--texto-2); text-anchor: middle; }
.tl-dot text { font: 600 10px var(--f-dato); fill: var(--oro-oscuro); text-anchor: middle; }
.tl-dot:hover circle, .tl-dot.on circle { stroke-width: 2.6; }
.tl-dot:focus-visible { outline: none; }
.tl-dot:focus-visible circle { stroke-width: 3; }

/* Botón flotante "Interpretar un artículo": solo en la portada */
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 10px; border: 0; border-radius: 999px; background: #fff; color: var(--noche); text-align: left; cursor: pointer; font-family: var(--f-ui); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.45), 0 14px 40px rgba(0, 0, 0, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--oro), 0 18px 46px rgba(0, 0, 0, 0.4); }
.fab:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.fab svg { flex-shrink: 0; width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--azul); color: #fff; }
.fab b { display: block; font-size: 15px; font-weight: 800; }
.fab small { display: block; font-size: 12.5px; color: var(--texto-2); }
.top.compact ~ .fab { display: none; }
.dropzone { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(10, 31, 77, 0.88); pointer-events: none; }
.dropzone p { margin: 0; padding: 48px 64px; border: 2px dashed var(--oro); border-radius: 24px; font: italic 400 clamp(28px, 4vw, 44px) 'Instrument Serif', Georgia, serif; color: #fff; }

/* Mini tutorial */
.tour { width: min(560px, calc(100vw - 32px)); padding: 26px 30px 22px; border: 0; border-radius: 20px; background: #fff; color: var(--texto); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.tour::backdrop { background: rgba(10, 31, 77, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.tour[open] { animation: tour-in 0.28s ease-out; }
@keyframes tour-in { from { opacity: 0; transform: translateY(12px); } }
.tour-kicker { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.12em; color: var(--oro-oscuro); }
.tour-step h2 { margin: 18px 0 8px; font: 400 32px/1.1 'Instrument Serif', 'Source Serif 4', Georgia, serif; }
.tour-step > p { margin: 0; font: 400 16px/1.6 var(--f-voz); color: #1c2740; min-height: 5.2em; }
.tour-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 168px; padding: 18px; border-radius: 14px; background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px); background-size: 18px 18px; }
.mock-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: #fff; font-size: 13.5px; color: var(--texto); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.45); }
.mock-caret { width: 2px; height: 16px; margin-left: -6px; background: var(--azul); animation: blink 1s steps(1) infinite; }
.mock-note { margin: 0; font-size: 12px; color: #8fa3cc; }
.mock-list { margin: 0; padding: 0; list-style: none; width: 100%; display: grid; gap: 8px; }
.mock-list li { padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border-left: 3px solid var(--oro); font-size: 12.5px; line-height: 1.4; color: #c9d6f0; }
.mock-list b { display: block; color: #fff; font-size: 13.5px; }
.mock-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 380px; padding: 22px; border: 2px dashed rgba(212, 175, 55, 0.6); border-radius: 14px; }
.mock-drop small { font-size: 12.5px; color: #c9d6f0; }
.mock-fab { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: #fff; font-weight: 800; font-size: 14px; color: var(--noche); }
.mock-fab svg { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--azul); color: #fff; }
.mock-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; width: 100%; max-width: 400px; font-size: 13px; color: #fff; }
.mock-legend > span { display: inline-flex; align-items: center; }
.mock-legend .mock-legend-t { grid-column: 1 / -1; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--oro); margin-top: 4px; }
.mock-legend .tx { --c: #9bb5f0; width: 14px; height: 14px; }
/* Las texturas están pensadas para fondo blanco: sobre el azul noche, el "blanco" pasa a transparente. */
.mock-legend .tx-2 { background: color-mix(in srgb, var(--c) 40%, transparent); }
.mock-legend .tx-3 { background: repeating-linear-gradient(45deg, var(--c) 0 1.6px, transparent 1.6px 4px); }
.mock-legend .tx-4 { background: transparent; }
.tour-nav { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linea); }
.tour-nav .link { font-size: 13.5px; color: var(--texto-2); }
.tour-nav .btn { min-height: 42px; }
.tour-nav .btn:disabled { opacity: 0.4; cursor: default; }

.foot { border-top: 1px solid var(--linea); }
.foot p { padding-top: 20px; padding-bottom: 32px; font-size: 12.5px; line-height: 1.6; color: var(--texto-2); }

/* Asistente: burbuja flotante y panel */
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 7px 22px 7px 7px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #0a5bd1, var(--azul) 55%, #003a8a); color: #fff; font: 800 15px var(--f-ui); cursor: pointer; box-shadow: 0 16px 40px rgba(0, 74, 173, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s; animation: fab-in 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.chat-fab:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(0, 74, 173, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.chat-fab:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.chat-fab-ico { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); }
.chat-fab-ico::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--oro); opacity: 0; animation: halo 2.6s ease-out 1.2s 3; }
.chat-fab-ico svg { color: #fff; }
body.chat-open .chat-fab { opacity: 0; pointer-events: none; transform: scale(0.85); }
@keyframes fab-in { from { opacity: 0; transform: translateY(24px) scale(0.8); } }
@keyframes halo { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
.chat-teaser { position: fixed; right: 24px; bottom: 96px; z-index: 40; max-width: 290px; padding: 14px 40px 14px 16px; border-radius: 18px 18px 6px 18px; background: #fff; color: var(--texto); box-shadow: 0 18px 50px rgba(10, 31, 77, 0.22), 0 0 0 1px rgba(10, 31, 77, 0.06); cursor: pointer; animation: teaser-in 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.chat-teaser p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.chat-teaser p span { display: block; color: var(--texto-2); font-size: 13.5px; }
.chat-teaser-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--texto-2); cursor: pointer; }
.chat-teaser-x:hover { background: #f1f2f6; }
@keyframes teaser-in { from { opacity: 0; transform: translateY(10px) scale(0.95); } }
.chat-panel { position: fixed; right: 24px; bottom: 24px; z-index: 41; width: min(420px, calc(100vw - 32px)); height: min(680px, calc(100vh - 48px)); display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(10, 31, 77, 0.32), 0 0 0 1px rgba(10, 31, 77, 0.08); transform-origin: 100% 100%; opacity: 0; visibility: hidden; transform: translateY(18px) scale(0.94); transition: opacity 0.22s, transform 0.38s cubic-bezier(0.2, 1, 0.3, 1), visibility 0s 0.38s; }
.chat-panel.open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.22s, transform 0.38s cubic-bezier(0.2, 1, 0.3, 1); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px); background-size: 16px 16px; color: #fff; }
.chat-avatar { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--oro), #b8901f); color: var(--noche); box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35); }
.chat-head-t { flex: 1; min-width: 0; }
.chat-head-t b { display: block; font-size: 15.5px; font-weight: 800; }
.chat-head-t small { display: block; font-size: 12.5px; color: #c9d6f0; }
.chat-close { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; }
.chat-close:hover { background: rgba(255, 255, 255, 0.16); }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(#f6f8fc, #fff 160px); }
.chat-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 18px 16px 8px; }
.chat-err { margin: 0 16px 6px; }
.msg { font-size: 15px; line-height: 1.6; border-radius: 16px; padding: 10px 14px; max-width: 88%; overflow-wrap: anywhere; }
.msg.new { animation: msg-in 0.3s ease-out both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg p { margin: 0 0 8px; } .msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 8px; padding-left: 18px; }
.msg-user { align-self: flex-end; background: var(--azul); color: #fff; white-space: pre-wrap; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: #fff; color: var(--texto); border: 1px solid var(--linea); border-bottom-left-radius: 4px; box-shadow: 0 2px 6px rgba(10, 31, 77, 0.04); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--azul); opacity: 0.35; animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 50% { opacity: 1; } }
.chat-sugs-h { margin: 6px 0 0; font-size: 12.5px; color: var(--texto-2); }
.chat-sugs { display: grid; gap: 8px; }
.sug { display: flex; align-items: center; gap: 10px; font: 600 13.5px var(--f-ui); color: var(--tinta); background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.sug .ico { flex-shrink: 0; color: var(--azul); }
.sug:hover { border-color: #9bb5f0; transform: translateX(2px); box-shadow: 0 4px 12px rgba(0, 74, 173, 0.08); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--linea); background: #fff; }
.chat-form textarea { flex: 1; min-width: 0; resize: none; font: 15px/1.5 var(--f-ui); color: var(--texto); border: 1px solid var(--linea); border-radius: 14px; padding: 11px 14px; min-height: 46px; box-sizing: border-box; background: #f6f8fc; }
.chat-form textarea:focus { outline: 2px solid var(--azul); outline-offset: -1px; border-color: transparent; background: #fff; }
.chat-send { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--azul); color: #fff; cursor: pointer; transition: background 0.15s, transform 0.15s; }
.chat-send:hover { background: var(--tinta); transform: translateX(1px); }
.chat-send:disabled { opacity: 0.6; cursor: progress; }
.chat-form { padding-bottom: 6px; }
.chat-note { margin: 0; padding: 0 16px 12px; font-size: 11px; color: var(--texto-2); background: #fff; }
.fr-top .fr-track::before { display: none; }
.pyramid .tier:nth-of-type(1) polygon { fill: #c9d9f5; } .pyramid .tier:nth-of-type(2) polygon { fill: #d6e2f8; } .pyramid .tier:nth-of-type(3) polygon { fill: #e2ebfb; } .pyramid .tier:nth-of-type(4) polygon { fill: #edf2fd; }
.pyramid .tier.empty polygon { fill: #f1f2f6; } .pyramid .tier:hover polygon { fill: #bfd2f3; } .pyramid .tier.on polygon { fill: var(--noche); }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: 0.7; } }
@media (max-width: 640px) { .msg { max-width: 100%; } }

@media (max-width: 640px) {
  .fab { right: 16px; bottom: 16px; padding-right: 16px; }
  .tour { padding: 20px 18px 16px; }
  .tour-step h2 { font-size: 28px; }
  .tour-art { min-height: 150px; padding: 14px; }
  .tour-nav .link { margin-right: auto; }
  .tour-nav .btn { padding: 0 16px; }
  .by { display: none; }
  .help-link { white-space: nowrap; }
  .fab small { display: none; }
  .top:not(.compact) ~ .foot p { padding-bottom: 100px; } /* que el botón flotante no tape el final de la portada */
  .wrap { padding: 0 16px; }
  .hero { padding: 36px 16px 24px; }
  .hero h1 { font-size: min(42px, 11vw); }
  .search { flex-wrap: wrap; padding: 8px; }
  .search input { flex-basis: 100%; padding: 0 8px; }
  .search svg { display: none; }
  .search .btn { width: 100%; }
  .card { padding: 18px; }
  .paper { padding: 22px 18px; }
  .paper-answer p { font-size: 18px; }
  .para { grid-template-columns: 1fr; gap: 8px; }
  .para > p { font-size: 16.5px; }
  .sidenotes { flex-direction: row; flex-wrap: wrap; border-left: 0; padding-left: 0; gap: 4px 12px; }
  .sidenotes .note { margin: 0; }
  .fr { grid-template-columns: 1fr; gap: 0; padding: 4px 6px 10px; border-bottom: 1px solid var(--linea-2); border-radius: 0; }
  .fr-axis { border-bottom: 0; }
  .fr-axis > div:empty { display: none; }
  .fr-track { min-height: 34px; }
  .dose-row { grid-template-columns: 1fr; gap: 6px; }
  .dose-axis .dose-h { display: none; }
  .appraise { grid-template-columns: 1fr; }
  .pyramid { max-width: 320px; margin: 0 auto; }  .study-detail { margin-left: 4px; }
  .studies-bar .btn { width: 100%; }
  .upload .btn, .stale .btn { width: 100%; }
}

/* ==========================================================================
   Capa visual: jerarquía, movimiento y detalle
   ========================================================================== */

html.motion { scroll-behavior: smooth; }
.ico { flex-shrink: 0; }

/* Portada: aurora lenta detrás del titular y foco dorado en el buscador */
.top { position: relative; isolation: isolate; }
.top::before { content: ""; position: absolute; z-index: -1; inset: -20% -10% auto; height: 130%; pointer-events: none; background: radial-gradient(38% 46% at 28% 30%, rgba(0, 74, 173, 0.55), transparent 70%), radial-gradient(26% 34% at 74% 22%, rgba(212, 175, 55, 0.16), transparent 70%), radial-gradient(30% 40% at 60% 80%, rgba(0, 74, 173, 0.35), transparent 70%); filter: blur(24px); animation: aurora 22s ease-in-out infinite alternate; }
.top.compact::before { opacity: 0.45; }
@keyframes aurora { to { transform: translate3d(5%, 6%, 0) scale(1.12) rotate(2deg); } }
.search { transition: box-shadow 0.3s; }
.search:focus-within { box-shadow: 0 0 0 2px var(--oro), 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 70px rgba(212, 175, 55, 0.22); }
.top.compact .search:focus-within { box-shadow: 0 0 0 2px var(--oro); }
.btn-search::after { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform 0.2s; }
.btn-search:hover::after { transform: translateX(3px); }
.btn-search:disabled::after { display: none; }
.ex { transition: border-color 0.15s, color 0.15s, transform 0.15s, background 0.15s; }
.ex:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.04); }
.sources { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #5d74a8; }
.sources span { display: inline-flex; align-items: center; gap: 18px; }
.sources span + span::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: #2a3f73; margin-left: -12px; margin-right: -6px; }

/* Transición entre pantallas: el buscador viaja a la cabecera; el resto se funde con desenfoque */
.search { view-transition-name: buscador; }
.logo { view-transition-name: logo; }
.lab-card, .paper { view-transition-name: escena; }
::view-transition-old(root) { animation: 0.5s cubic-bezier(0.4, 0, 0.2, 1) both vt-out; }
::view-transition-new(root) { animation: 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both vt-in; }
::view-transition-group(buscador), ::view-transition-group(escena) { animation-duration: 0.75s; animation-timing-function: cubic-bezier(0.65, 0, 0.15, 1); }
::view-transition-old(escena), ::view-transition-new(escena) { animation-duration: 0.75s; height: 100%; object-fit: cover; object-position: top; }
@keyframes vt-out { to { opacity: 0; filter: blur(8px); transform: translateY(-18px) scale(0.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(22px); } }

/* Laboratorio */
.lab { padding-top: 28px; padding-bottom: 64px; }
.lab-card { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 12px; min-height: 340px; border-radius: 24px; overflow: hidden; background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px), radial-gradient(60% 80% at 80% 40%, rgba(0, 74, 173, 0.45), transparent 70%); background-size: 22px 22px, auto; color: #fff; box-shadow: 0 30px 80px rgba(10, 31, 77, 0.28), 0 0 0 1px rgba(212, 175, 55, 0.18); }
.lab-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 30px 8px 36px 40px; }
.lab-kicker { margin: 0 0 14px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--oro); }
.lab-head { display: flex; align-items: center; gap: 14px; }
.lab-icon { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: rgba(212, 175, 55, 0.12); border: 1px solid rgba(212, 175, 55, 0.35); color: var(--oro); }
.lab-title { margin: 0; font: 400 clamp(30px, 3.4vw, 42px)/1.05 'Instrument Serif', 'Source Serif 4', Georgia, serif; letter-spacing: -0.01em; }
.lab-title.swap { animation: title-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes title-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
.lab-sub { margin: 14px 0 0; max-width: 40ch; font: 400 16.5px/1.55 var(--f-voz); color: #c9d6f0; min-height: 3.1em; }
.lab-meter { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.lab-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.lab-bar i { display: block; height: 100%; width: 3%; border-radius: 3px; background: linear-gradient(90deg, #9bb5f0, var(--oro)); box-shadow: 0 0 14px rgba(212, 175, 55, 0.6); transition: width 0.9s cubic-bezier(0.3, 0.7, 0.3, 1); }
.lab-time { font-size: 12.5px; color: #8fa3cc; min-width: 3.5em; text-align: right; }
.lab-tip { display: flex; gap: 10px; align-items: flex-start; margin: 26px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); font-size: 13.5px; line-height: 1.5; color: #c9d6f0; transition: opacity 0.35s, transform 0.35s; }
.lab-tip .ico { color: var(--oro); margin-top: 2px; }
.lab-tip.out { opacity: 0; transform: translateY(4px); }
.lab-viz { position: relative; min-height: 300px; }
.lab-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lab-count { position: absolute; right: 28px; bottom: 22px; display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(10, 31, 77, 0.7); border: 1px solid rgba(212, 175, 55, 0.3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: title-in 0.4s both; }
.lab-count b { font-size: 24px; font-weight: 500; color: var(--oro); }
.lab-count span { font-size: 12.5px; color: #c9d6f0; }
.lab-ghost { display: flex; gap: 28px; margin-top: 28px; }
.lab-ghost > div { display: flex; flex-direction: column; gap: 12px; padding: 26px; border-radius: 16px; background: #fff; border: 1px solid var(--linea); }
.ghost-main { flex: 999 1 640px; } .ghost-side { flex: 1 1 320px; }
.lab-ghost i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef0f5 0%, #f7f8fb 40%, #eef0f5 80%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
.lab-ghost i.tall { height: 64px; border-radius: 12px; background-color: var(--oro-suave); }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Índice de secciones */
.secnav { position: sticky; top: 0; z-index: 15; flex: 1 1 100%; min-width: 0; margin: -12px 0 -6px; padding: 8px 0; background: rgba(250, 248, 243, 0.86); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); }
.secnav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 14px; background: #fff; border: 1px solid var(--linea); box-shadow: 0 6px 20px rgba(10, 31, 77, 0.05); }
.secnav-in::-webkit-scrollbar { display: none; }
.secnav a { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--texto-2); text-decoration: none; transition: background 0.2s, color 0.2s; }
.secnav a .ico { color: #8a9ab8; transition: color 0.2s; }
.secnav a:hover { background: #f3f6fb; color: var(--tinta); }
.secnav a.on { background: var(--noche); color: #fff; }
.secnav a.on .ico { color: var(--oro); }
[data-sec] { scroll-margin-top: 76px; }

/* Tarjetas: elevación al pasar y entrada al aparecer en pantalla */
.card, .paper { transition: box-shadow 0.25s, border-color 0.25s; }
.fig:hover { box-shadow: 0 14px 40px rgba(10, 31, 77, 0.07); border-color: #d9deea; }
html.motion [data-sec]:not(.play):not(.shown) { opacity: 0; transform: translateY(26px); }
html.motion [data-sec].play { animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.3); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes fade { from { opacity: 0; } }

/* Cabecera de figura con icono */
.fig-head { display: flex; gap: 16px; align-items: flex-start; }
.fig-ico { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #eef4ff, var(--azul-claro)); color: var(--azul); box-shadow: inset 0 0 0 1px rgba(0, 74, 173, 0.08); }
.fig-ico.gold { background: linear-gradient(145deg, var(--oro), #b8901f); color: var(--noche); box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3); }
.fig-ico.ghost { background: transparent; color: var(--nd); box-shadow: inset 0 0 0 1.5px #c9cfdd; }

/* Artículo: respuesta y resumen de un vistazo */
.paper { position: relative; overflow: hidden; box-shadow: 0 20px 60px rgba(10, 31, 77, 0.06); }
.paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--azul), #4d86d9 50%, var(--oro)); }
.paper-label { display: flex; align-items: center; gap: 8px; }
.paper-label .ico { color: var(--oro); }
.paper-answer { position: relative; overflow: hidden; }
.play .paper-answer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.7) 50%, transparent 65%) -100% 0 / 250% 100% no-repeat; animation: sheen 1.4s 0.5s ease-out both; pointer-events: none; }
@keyframes sheen { to { background-position: 160% 0; } }
.paper-h { display: flex; align-items: center; gap: 8px; }
.paper-h .ico { color: var(--oro-oscuro); }
.play .para { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.play .para:nth-child(2) { animation-delay: 0.35s; } .play .para:nth-child(3) { animation-delay: 0.45s; } .play .para:nth-child(4) { animation-delay: 0.55s; } .play .para:nth-child(5) { animation-delay: 0.65s; }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--linea); }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--papel); border: 1px solid var(--linea-2); }
.kpi-ico { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--azul); box-shadow: 0 1px 3px rgba(10, 31, 77, 0.08); }
.kpi > b { font-size: 24px; font-weight: 500; line-height: 1.1; color: var(--texto); }
.kpi > b small { font-size: 14px; color: var(--texto-2); }
.kpi > b.kpi-q { font-size: 15px; line-height: 1.35; padding-top: 4px; }
.kpi > span:last-child { grid-column: 2; font-size: 12.5px; font-weight: 700; color: var(--tinta); line-height: 1.35; }
.kpi > span:last-child small { display: block; font-weight: 500; color: var(--texto-2); font-size: 11.5px; }
.kpi-dir .kpi-bar { display: flex; gap: 2px; height: 12px; margin: 6px 0 4px; border-radius: 6px; overflow: hidden; }
.kpi-bar i { min-width: 6px; transform-origin: left; }
.play .kpi-bar i { animation: grow-x 0.9s 0.3s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
.kpi-bar .dir-azul { background: var(--azul); } .kpi-bar .dir-oro { background: var(--oro); } .kpi-bar .dir-gris { background: #b8bfcd; } .kpi-bar .dir-rojo { background: var(--mal); }
.play .kpi { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.play .kpi:nth-child(2) { animation-delay: 0.08s; } .play .kpi:nth-child(3) { animation-delay: 0.16s; } .play .kpi:nth-child(4) { animation-delay: 0.24s; }

/* Mapa: iconos de desenlace, halo y aparición escalonada */
.map > .map-col-h { flex-direction: column; gap: 4px; }
.map-col-h .ico { color: var(--azul); opacity: 0.75; }
.map-cell .halo { opacity: 0; transition: opacity 0.2s; }
.map-cell:hover .halo, .map-cell.on .halo { opacity: 0.14; }
.map-cell .b { transform-box: fill-box; transform-origin: center; transition: transform 0.2s; }
.map-cell:hover .b { transform: scale(1.12); }
.play .map-cell .b { animation: pop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.25s + var(--d) * 55ms); }
.play .map-gap { animation: fade 0.6s 0.2s both; }

/* Forest plot: barras con remates, etiquetas y crecimiento desde el punto */
.fr-band { background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1)); }
.fr-zero { margin-left: -0.75px; }
.fr-ci { height: 2.5px; margin-top: -1.25px; }
.fr-ci::before, .fr-ci::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10.5px; border-radius: 1px; background: inherit; }
.fr-ci::before { left: -1px; } .fr-ci::after { right: -1px; }
.play .fr-ci { animation: grow-x 0.8s cubic-bezier(0.3, 0.7, 0.3, 1) both; animation-delay: calc(0.3s + var(--d, 0) * 90ms); }
.play .fr { animation: rise 0.5s both; animation-delay: calc(0.2s + var(--d, 0) * 90ms); }
.play .fr-pt { animation: fade 0.4s both; animation-delay: calc(0.6s + var(--d, 0) * 90ms); }
.fr-top .fr-track { min-height: 18px; }
.fr-lab { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.fr-lab-zero { color: var(--texto-2); }
.fr-lab-mcid { color: var(--oro-oscuro); }
.fr:not(.fr-axis) { transition: background 0.15s, box-shadow 0.15s; }

/* Dosis: total de sesiones y puntos que aparecen semana a semana */
.dose-tot { display: block; width: 100%; max-width: 180px; height: 4px; margin-top: 7px; border-radius: 2px; background: var(--linea-2); overflow: hidden; }
.dose-tot i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #4d86d9, var(--azul)); transform-origin: left; }
.play .dose-tot i { animation: grow-x 0.9s cubic-bezier(0.3, 0.7, 0.3, 1) both; animation-delay: calc(0.3s + var(--r, 0) * 80ms); }
.play .wk { animation: pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(0.25s + var(--r, 0) * 70ms + var(--w, 0) * 28ms); }
.dose-row { transition: background 0.15s; }

/* Pirámide, matriz y línea temporal */
.pyramid .tier { transition: transform 0.2s; }
.play .pyramid .tier { animation: rise 0.6s both; animation-delay: calc(0.2s + var(--d, 0) * 90ms); }
.play .rb { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.35s + var(--d, 0) * 22ms); }
.play .tl-dot { animation: pop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.3s + var(--d, 0) * 110ms); transform-box: fill-box; transform-origin: center; }
.play .tl-band { animation: fade 0.8s both; }

/* Aplicación en consulta: la ficha más accionable, en azul noche */
.apply { position: relative; overflow: hidden; background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px), radial-gradient(50% 70% at 100% 0%, rgba(212, 175, 55, 0.14), transparent 70%); background-size: 20px 20px, auto; border-color: transparent; color: #fff; box-shadow: 0 24px 60px rgba(10, 31, 77, 0.22); }
.apply .fig-head h2 { color: #fff; }
.apply .fig-head p { color: #c9d6f0; }
.apply .fig-no { color: var(--oro); }
.apply-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.apply-list li { display: flex; gap: 14px; align-items: flex-start; margin: 0; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 15px; line-height: 1.6; color: #e6edfb; transition: background 0.2s, border-color 0.2s; }
.apply-list li:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(212, 175, 55, 0.35); }
.apply-n { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--oro); color: var(--noche); font-size: 13px; font-weight: 500; margin-top: 1px; }
.apply .chip { background: rgba(155, 181, 240, 0.18); color: #c9d6f0; }
.apply .chip:hover, .apply .chip.on { background: var(--oro); color: var(--noche); }
.play .apply-list li { animation: rise 0.55s both; animation-delay: calc(0.25s + var(--d, 0) * 100ms); }

/* Lateral: cómo se ha buscado y fuente citada */
.side-h { display: flex; align-items: center; gap: 8px; }
.side-h .ico { color: var(--azul); }
dl.pico { grid-template-columns: minmax(0, 1fr); gap: 2px; }
dl.pico dt { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
dl.pico dd { margin: 0 0 10px 28px; font-size: 13.5px; color: var(--texto); }
.pico-l { width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px; background: var(--noche); color: var(--oro); font: 600 11px var(--f-dato); }
.pico-l-s { background: var(--linea-2); color: var(--texto-2); }
.funnel { display: grid; gap: 4px; margin: 16px 0 0; }
.funnel span { width: var(--w); margin: 0 auto; padding: 7px 10px; border-radius: 8px; background: var(--azul-claro); color: var(--tinta); font-size: 12.5px; text-align: center; transition: width 0.6s; }
.funnel span:last-child { background: var(--noche); color: #fff; }
.funnel span:last-child b { color: var(--oro); }
.funnel b { font-weight: 500; }
.query-box { margin-top: 12px; }
.query-box summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--azul); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.query-box summary::-webkit-details-marker { display: none; }
.query-box summary::before { content: ""; width: 7px; height: 7px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s; }
.query-box[open] summary::before { transform: rotate(45deg); }
.query-box .query { margin-top: 10px; }
.source { box-shadow: 0 16px 40px rgba(0, 74, 173, 0.1); }
.source.flash { animation: flash 0.7s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7), 0 16px 40px rgba(0, 74, 173, 0.1); transform: translateY(-2px); } 100% { box-shadow: 0 0 0 14px rgba(212, 175, 55, 0), 0 16px 40px rgba(0, 74, 173, 0.1); } }
.chip { transition: background 0.15s, color 0.15s, transform 0.15s; }
.chip:hover { transform: translateY(-1px); }

/* Tooltip de las gráficas */
.tip { position: absolute; z-index: 60; max-width: 260px; padding: 7px 10px; border-radius: 8px; background: var(--noche); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; pointer-events: none; box-shadow: 0 10px 24px rgba(10, 31, 77, 0.25); animation: fade 0.15s both; }

/* Pantallas anchas: el asistente se acopla a la derecha y la página se desplaza para no quedar tapada */
@media (min-width: 1280px) {
  .chat-panel { top: 16px; bottom: 16px; right: 16px; height: auto; width: 410px; }
  #results { transition: margin 0.4s cubic-bezier(0.2, 1, 0.3, 1); }
  body.chat-open #results { margin-left: max(0px, calc((100vw - 442px - 1240px) / 2)); margin-right: 442px; }
  body.chat-open .col-main { flex-basis: 560px; }
  body.chat-open .col-side { flex-basis: 260px; }
}

@media (max-width: 900px) {
  .lab-card { grid-template-columns: 1fr; }
  .lab-copy { padding: 28px 24px 0; }
  .lab-viz { min-height: 220px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-ghost .ghost-side { display: none; }
}
@media (max-width: 640px) {
  .chat-fab { right: 16px; bottom: 16px; padding-right: 7px; }
  .chat-fab-label { display: none; }
  .chat-teaser { right: 16px; bottom: 84px; }
  .chat-panel { left: 8px; right: 8px; bottom: 8px; width: auto; height: 86vh; border-radius: 22px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { grid-template-columns: 1fr; padding: 10px 12px; }
  .kpi-ico { display: none; }
  .kpi > span:last-child { grid-column: 1; }
  .fig-head { gap: 12px; }
  .fig-ico { width: 40px; height: 40px; border-radius: 12px; }
  .apply-list li { padding: 12px; }
  .lab { padding-top: 16px; }
  .lab-sub { font-size: 15.5px; }
  .lab-tip { display: none; }
  .sources { display: none; }
  .top.searching .pipeline { display: none; } /* en móvil, el laboratorio ya cuenta el progreso */
  .secnav { margin: -8px -16px -6px; padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .top::before, .chat-fab, .chat-fab-ico::after, .lab-ghost i, .msg, .chat-teaser { animation: none; }
  .chat-panel, .chat-panel.open { transition: none; }
}


/* ==========================================================================
   Relieve: mini tutorial y buscador de portada
   ========================================================================== */

/* Tarjeta del tutorial: canto, sombras en capas y una leve inclinación hacia el ratón */
.tour {
  --mx: 0; --my: 0;
  width: min(580px, calc(100vw - 32px));
  padding: 24px 30px 22px;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 55%, #f3f6fc 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -3px 0 rgba(10, 31, 77, 0.05),
    0 0 0 1px rgba(212, 175, 55, 0.4),
    0 9px 0 -2px #cfd8ea,
    0 9px 0 -1px rgba(212, 175, 55, 0.3),
    0 26px 40px -14px rgba(0, 8, 30, 0.6),
    0 70px 120px -30px rgba(0, 8, 30, 0.8),
    0 0 140px -20px rgba(0, 74, 173, 0.65);
}
.tour[open] { animation: tour-in 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.1); }
@keyframes tour-in { from { opacity: 0; transform: perspective(1400px) translateY(70px) rotateX(26deg) scale(0.9); } }
.tour::backdrop { background: radial-gradient(ellipse at 50% 40%, rgba(10, 31, 77, 0.6), rgba(4, 12, 34, 0.9)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Puntos de avance: la línea se rellena hasta el paso actual y el punto se enciende al llegar */
.tour-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.tour-head .tour-kicker { margin: 0; }
.tour-stepper { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.tour-stepper > li { display: flex; justify-content: center; }
.tour-stepper > .tour-track { position: absolute; left: 12.5%; right: 12.5%; top: 13px; height: 3px; border-radius: 3px; background: var(--linea); overflow: hidden; }
.tour-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--prog, 0)); border-radius: inherit; background: linear-gradient(90deg, var(--noche), var(--azul) 60%, var(--oro)); transition: transform 0.65s cubic-bezier(0.65, 0, 0.15, 1); }
.tour-pt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: #8a93a8; }
.tour-pt b { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--linea); font: 700 12px var(--f-ui); color: #8a93a8; transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4), background 0.3s, color 0.3s, box-shadow 0.3s; }
.tour-pt small { font: 600 11.5px var(--f-ui); letter-spacing: 0.02em; transition: color 0.3s; }
.tour-pt:not(.on, .done):hover b { box-shadow: 0 0 0 2px #c5d3ee; color: var(--texto-2); }
.tour-pt:focus-visible { outline: none; }
.tour-pt:focus-visible b { outline: 2px solid var(--oro); outline-offset: 3px; }
.tour-pt.done b { background: var(--noche); color: transparent; box-shadow: 0 0 0 2px var(--noche); }
.tour-pt.done b::after { content: ""; position: absolute; inset: 0; margin: auto; width: 13px; height: 13px; background: var(--oro); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.tour-pt.done small { color: var(--texto-2); }
.tour-pt.on b { background: var(--azul); color: #fff; transform: scale(1.14); box-shadow: 0 0 0 2px var(--azul), 0 0 0 7px rgba(0, 74, 173, 0.14); transition-delay: 0.3s; }
.tour-pt.on b::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--azul); animation: pt-pulse 2s ease-out 0.6s infinite; }
.tour-pt.on small { color: var(--noche); transition-delay: 0.3s; }
@keyframes pt-pulse { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }

/* Paso: título, muestra visual y explicación, en ese orden; entran deslizándose hacia donde avanzas */
.tour-step h2 { margin: 0 0 16px; }
.tour-step > p { margin-top: 18px; }
.tour-step.in-fwd > *, .tour-step.in-back > * { animation: step-in-fwd 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tour-step.in-back > * { animation-name: step-in-back; }
.tour-step > :nth-child(2) { animation-delay: 0.07s; }
.tour-step > :nth-child(3) { animation-delay: 0.14s; }
.tour-step.in-fwd > .tour-art { animation-name: art-in-fwd; animation-duration: 0.75s; }
.tour-step.in-back > .tour-art { animation-name: art-in-back; animation-duration: 0.75s; }
@keyframes step-in-fwd { from { opacity: 0; transform: translateX(30px); } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-30px); } }
@keyframes art-in-fwd { from { opacity: 0; transform: perspective(900px) translateX(50px) rotateY(-22deg) scale(0.94); } }
@keyframes art-in-back { from { opacity: 0; transform: perspective(900px) translateX(-50px) rotateY(22deg) scale(0.94); } }

/* La muestra visual como una pantalla hundida: el fondo se desplaza menos que lo de delante (paralaje) */
.tour-art {
  position: relative;
  min-height: 212px;
  background-color: var(--noche);
  background-image: radial-gradient(#1b3672 1px, transparent 1px), radial-gradient(70% 90% at calc(72% + var(--mx) * 14%) calc(25% + var(--my) * 14%), rgba(0, 74, 173, 0.6), transparent 70%);
  background-size: 18px 18px, auto;
  background-position: calc(var(--mx) * -5px) calc(var(--my) * -5px), 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -14px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.25), 0 20px 30px -18px rgba(10, 31, 77, 0.9);
  transition: background-position 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-art > * { translate: calc(var(--mx) * 9px) calc(var(--my) * 7px); transition: translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tour.tilt .tour-art, .tour.tilt .tour-art > * { transition-duration: 0.15s; }
.mock-search { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.55), 0 5px 0 #b7c3dc, 0 5px 0 1px rgba(212, 175, 55, 0.3), 0 22px 30px -10px rgba(0, 0, 0, 0.7); animation: float 4.5s ease-in-out infinite; }
.mock-fab { box-shadow: 0 4px 0 #b7c3dc, 0 18px 26px -10px rgba(0, 0, 0, 0.7); animation: float 4.5s ease-in-out infinite; }
.mock-list li { box-shadow: 0 10px 18px -12px rgba(0, 0, 0, 0.8); }
@keyframes float { 50% { transform: translateY(-5px); } }

/* Botones del tutorial con canto */
.tour-nav { margin-top: 20px; }
.tour-nav .link { margin-right: auto; }
.tour-nav .btn { transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.tour-nav .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 0 #00337a, 0 12px 20px -8px rgba(0, 74, 173, 0.8); transform: translateY(-2px); }
.tour-nav .btn-primary:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 5px 0 #00337a, 0 16px 24px -8px rgba(0, 74, 173, 0.85); }
.tour-nav .btn-primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 0 #00337a, 0 4px 8px -4px rgba(0, 74, 173, 0.7); }
.tour-nav .btn-ghost:not(:disabled) { box-shadow: 0 3px 0 #e1e6f0; }
.tour-nav .btn-ghost:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #e1e6f0; }

/* Buscador de portada: la misma pieza blanca de siempre, pero flotando sobre el fondo.
   Sin canto: la altura la dan sombras suaves en capas (contacto, media distancia y ambiente) y un leve halo azul. */
.top:not(.compact) .search {
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.35),
    0 2px 4px rgba(0, 4, 18, 0.3),
    0 12px 22px -4px rgba(0, 4, 18, 0.55),
    0 32px 56px -8px rgba(0, 4, 18, 0.75),
    0 70px 110px -16px rgba(0, 4, 18, 0.8),
    0 0 70px rgba(110, 155, 255, 0.22);
  transform: translateY(-6px) scale(1.005);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.top:not(.compact) .search:hover {
  transform: translateY(-9px) scale(1.008);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.5),
    0 3px 6px rgba(0, 4, 18, 0.28),
    0 16px 28px -4px rgba(0, 4, 18, 0.55),
    0 40px 66px -8px rgba(0, 4, 18, 0.75),
    0 84px 124px -16px rgba(0, 4, 18, 0.8),
    0 0 80px rgba(110, 155, 255, 0.28);
}
.top:not(.compact) .search:focus-within {
  transform: translateY(-10px) scale(1.01);
  box-shadow:
    0 0 0 2px var(--oro),
    0 3px 6px rgba(0, 4, 18, 0.28),
    0 16px 28px -4px rgba(0, 4, 18, 0.55),
    0 40px 66px -8px rgba(0, 4, 18, 0.75),
    0 84px 124px -16px rgba(0, 4, 18, 0.8),
    0 0 80px rgba(212, 175, 55, 0.22);
}
html.motion .top:not(.compact) .search { animation: search-rise 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s backwards; }
@keyframes search-rise { from { opacity: 0; transform: translateY(18px) scale(0.98); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2); } }

@media (max-width: 640px) {
  .tour { padding: 20px 18px 16px; }
  .tour-head { gap: 14px; margin-bottom: 18px; }
  .tour-pt small { font-size: 10.5px; }
  .tour-art { min-height: 150px; }
  .tour-step > p { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour, .tour[open] { transform: none; animation: none; }
  .tour-step.in-fwd > *, .tour-step.in-back > *, .tour-pt.on b::before, .mock-search, .mock-fab { animation: none; }
  .tour-art > * { translate: none; }
  .tour-fill, .tour-pt b { transition: none; }
  html.motion .top:not(.compact) .search { animation: none; }
}

/* Laboratorio: el paso, en grande y translúcido arriba a la izquierda; el título lo pisa por debajo */
.lab-big { position: relative; z-index: -1; display: flex; align-items: flex-start; gap: 0.06em; height: 0.52em; margin: 0; font: 800 clamp(150px, 15vw, 200px)/0.78 var(--f-ui); letter-spacing: -0.06em; pointer-events: none; user-select: none; }
.lab-big-n, .lab-big-of { color: transparent; -webkit-background-clip: text; background-clip: text; }
/* El fondo recortado al texto solo pinta dentro de la caja: margen interior para que no se corte la parte alta del número */
.lab-big-n { padding: 0.14em 0.04em 0.2em; margin: -0.14em -0.04em -0.2em; }
.lab-big-n { background-image: linear-gradient(180deg, rgba(150, 180, 235, 0.62) 0%, rgba(96, 132, 205, 0.3) 45%, rgba(10, 31, 77, 0) 86%); }
.lab-big-of { margin-top: 0.08em; font-size: 0.3em; letter-spacing: -0.02em; background-image: linear-gradient(180deg, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0.12)); }
.lab-big-n.swap { animation: big-in 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes big-in { from { opacity: 0; transform: translateY(22%); filter: blur(12px); } }
@media (max-width: 900px) { .lab-big { font-size: 130px; } }
@media (prefers-reduced-motion: reduce) { .lab-big-n.swap { animation: none; } }

/* Iconos ilustrados del laboratorio: la propia pieza de cristal hace de caja */
.lab-icon:has(img) { width: 64px; height: 64px; border: 0; background: none; border-radius: 16px; box-shadow: 0 14px 24px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 175, 55, 0.12); }
.lab-icon img { display: block; width: 64px; height: 64px; border-radius: 16px; }
.lab-head .lab-icon img { animation: icon-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
@keyframes icon-in { from { opacity: 0; transform: perspective(400px) rotateY(-50deg) scale(0.8); } }
@media (max-width: 640px) { .lab-icon:has(img), .lab-icon img { width: 52px; height: 52px; border-radius: 13px; } }
@media (prefers-reduced-motion: reduce) { .lab-head .lab-icon img { animation: none; } }

/* Icono ilustrado del asistente (Google Flow): comillas con sello, en la burbuja y en la cabecera del panel */
.chat-fab-ico { width: 50px; height: 50px; border-radius: 14px; background: none; box-shadow: 0 8px 16px -6px rgba(0, 10, 40, 0.6); }
.chat-fab-ico::after { border-radius: 16px; inset: -2px; }
.chat-fab-ico img, .chat-avatar img { display: block; width: 100%; height: 100%; border-radius: inherit; }
.chat-fab { padding-left: 6px; }
.chat-fab:hover .chat-fab-ico img { transform: rotate(-6deg) scale(1.06); }
.chat-fab-ico img { transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.chat-avatar { width: 44px; height: 44px; border-radius: 12px; background: none; box-shadow: 0 8px 18px -8px rgba(0, 10, 40, 0.55); }

/* Rótulo del paso: «PASO» y «DE 5» pequeños, el número enorme en medio */
.lab-big-pre, .lab-big-of { margin-top: 0.12em; font-size: 0.1em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.lab-big-pre { margin-right: 0.08em; color: rgba(212, 175, 55, 0.6); }
.lab-big-of { margin-left: 0.02em; background-image: linear-gradient(180deg, rgba(212, 175, 55, 0.65), rgba(212, 175, 55, 0.25)); }

/* Panel del chat: se nota que flota sobre la página (borde, filo dorado y sombra en capas) */
.chat-panel {
  border: 1px solid rgba(10, 31, 77, 0.14);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.7),
    0 0 0 5px rgba(212, 175, 55, 0.45),
    0 2px 6px rgba(10, 31, 77, 0.12),
    0 18px 36px -8px rgba(10, 31, 77, 0.35),
    0 50px 100px -20px rgba(10, 31, 77, 0.55);
}

/* Aviso del modo demo en la cabecera */
.demo-pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #2ecc8f; color: #052e1f; text-decoration: none; box-shadow: 0 0 0 3px rgba(46, 204, 143, 0.25); }
.demo-pill span { font-size: 15px; line-height: 1; opacity: 0.7; }
.demo-pill:hover span { opacity: 1; }

/* Iconos de sección ilustrados: el objeto solo, sin caja, con su sombra */
.fig-ico.art { width: 52px; height: 52px; background: none; box-shadow: none; border-radius: 0; }
.sec-art { display: block; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(10, 31, 77, 0.22)); }
.fig-ico.art .sec-art { width: 52px; height: 52px; }
.play .fig-ico.art .sec-art { animation: art-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
@keyframes art-in { from { opacity: 0; transform: translateY(8px) scale(0.85) rotate(-6deg); } }
.secnav a .sec-art { width: 24px; height: 24px; margin: -4px 0; filter: drop-shadow(0 2px 3px rgba(10, 31, 77, 0.25)); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.secnav a:hover .sec-art, .secnav a.on .sec-art { transform: scale(1.12) rotate(-4deg); }
@media (max-width: 640px) { .fig-ico.art, .fig-ico.art .sec-art { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .play .fig-ico.art .sec-art { animation: none; } }

/* Icono del asistente sin caja: la nube con comillas flota sobre la burbuja y la cabecera del panel */
.chat-fab-ico { width: 52px; height: 52px; border-radius: 50%; box-shadow: none; }
.chat-fab-ico::after { border-radius: 50%; inset: 2px; }
.chat-fab-ico img { filter: drop-shadow(0 6px 8px rgba(0, 10, 40, 0.45)); border-radius: 0; }
.chat-avatar { box-shadow: none; border-radius: 0; }
.chat-avatar img { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)); border-radius: 0; }

/* ==========================================================================
   La respuesta y «de un vistazo»: profundidad, jerarquía y datos dibujados
   ========================================================================== */

/* Tarjeta de la respuesta: papel crema que flota, con una comilla gigante translúcida detrás */
.paper-answer {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 6px -6px 0; padding: 28px 34px 30px;
  border: 0; border-radius: 22px;
  background: radial-gradient(120% 90% at 100% 0%, #fff7df 0%, transparent 55%), linear-gradient(180deg, #fdf7e6, #f8eccb);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(212, 175, 55, 0.35),
    0 2px 4px rgba(120, 90, 10, 0.06),
    0 18px 36px -12px rgba(120, 90, 10, 0.28),
    0 40px 80px -30px rgba(10, 31, 77, 0.25);
}
.ans-mark { position: absolute; z-index: -1; right: 22px; top: -18px; padding-top: 0.1em; font: 400 300px/1 'Instrument Serif', Georgia, serif; color: transparent; background: linear-gradient(180deg, rgba(212, 175, 55, 0.42), rgba(212, 175, 55, 0.04) 70%); -webkit-background-clip: text; background-clip: text; pointer-events: none; user-select: none; }
.paper-answer .paper-label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; letter-spacing: 0.16em; color: var(--oro-oscuro); }
.ans-ico { width: 40px; height: 40px; margin: -6px 0 -6px -4px; filter: drop-shadow(0 4px 6px rgba(120, 90, 10, 0.25)); }
.paper-answer .ans-lead { margin: 0; max-width: 30ch; font: 600 clamp(24px, 2.5vw, 31px)/1.28 var(--f-voz); letter-spacing: -0.01em; color: var(--tinta); text-wrap: balance; }
.paper-answer .ans-rest { margin: 16px 0 0; max-width: 62ch; font: 400 18.5px/1.65 var(--f-voz); color: #2b3653; }
.paper-answer em { font-style: italic; color: var(--tinta); }
.paper-answer .ans-lead em { font-weight: 600; }
.paper-answer b.em-n { font-weight: 700; color: var(--tinta); background: linear-gradient(transparent 58%, rgba(212, 175, 55, 0.45) 58%) 0 0 / 100% 100% no-repeat; padding: 0 2px; }
.paper-answer b.em-q { display: inline-block; padding: 1px 8px 2px; border-radius: 7px; font: 600 0.78em/1.4 'IBM Plex Mono', monospace; vertical-align: 0.12em; color: #fff; background: var(--noche); box-shadow: 0 3px 8px -3px rgba(10, 31, 77, 0.5); }
.paper-answer::after { z-index: 1; }

/* Entrada: la tarjeta sube, la comilla aparece desde grande y el rotulador pasa por las cifras */
.play .paper-answer { animation: ans-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes ans-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
.play .ans-mark { animation: mark-in 1.2s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes mark-in { from { opacity: 0; transform: scale(1.35) translateY(-10%); filter: blur(10px); } }
.play .ans-lead { animation: rise 0.7s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.play .ans-rest { animation: rise 0.7s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.play .paper-answer b.em-n { animation: marker 0.7s 0.9s cubic-bezier(0.6, 0, 0.2, 1) both; }
@keyframes marker { from { background-size: 0% 100%; } }

/* De un vistazo: cuatro tarjetas distintas, cada una con su dato dibujado */
.glance { grid-template-columns: 1.05fr 1fr 1fr 1.15fr; gap: 14px; margin-top: 22px; padding-bottom: 26px; }
.kpi {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px 16px; border-radius: 18px; border: 0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.07), 0 2px 4px rgba(10, 31, 77, 0.04), 0 14px 28px -14px rgba(10, 31, 77, 0.28);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.1), 0 4px 8px rgba(10, 31, 77, 0.05), 0 22px 40px -16px rgba(10, 31, 77, 0.35); }
.kpi .kpi-ico { display: none; }
.k-cap { font-size: 10.5px; letter-spacing: 0.14em; color: var(--texto-2); }
.kpi .k-big { font: 800 44px/1 var(--f-ui); letter-spacing: -0.03em; color: var(--tinta); margin-top: 4px; }
.kpi .k-big small { margin-left: 2px; font-size: 0.45em; font-weight: 700; letter-spacing: 0; color: var(--texto-2); }
.k-sub { font-size: 13.5px; font-weight: 800; line-height: 1.3; color: var(--tinta); }
.k-foot { font-size: 11.5px; line-height: 1.4; color: var(--texto-2); }
.k-foot b { color: inherit; font-weight: 800; }

/* 1 · Estudios: la tarjeta oscura, el ancla del bloque; la barra es el embudo PubMed → analizados */
.kpi.k-dark { background: radial-gradient(90% 80% at 100% 0%, rgba(0, 74, 173, 0.6), transparent 70%), var(--noche); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 18px 34px -12px rgba(10, 31, 77, 0.6); }
.k-dark .k-cap { color: var(--oro); }
.kpi.k-dark .k-big { font-size: 56px; color: #fff; }
.k-dark .k-sub { color: #fff; }
.k-dark .k-foot { color: #9fb2d8; }
.k-funnel { width: 100%; height: 6px; margin: 8px 0 2px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.k-funnel i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9bb5f0, var(--oro)); box-shadow: 0 0 10px rgba(212, 175, 55, 0.6); }
.play .k-funnel i { animation: grow-x 1s 0.4s cubic-bezier(0.3, 0.7, 0.3, 1) both; transform-origin: left; }

/* 2 · Texto completo: anillo de progreso con la fracción dentro */
.k-donut { position: relative; width: 74px; height: 74px; margin: 6px 0 4px; }
.k-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.k-donut circle { fill: none; stroke: #e8edf6; stroke-width: 7; }
.k-donut circle.fill { stroke: var(--azul); stroke-linecap: round; stroke-dasharray: var(--pct) 100; filter: drop-shadow(0 2px 4px rgba(0, 74, 173, 0.35)); }
.play .k-donut circle.fill { animation: donut 1.1s 0.3s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
@keyframes donut { from { stroke-dasharray: 0 100; } }
.k-donut b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px/1 var(--f-ui); color: var(--tinta); }
.k-donut b small { font-size: 0.55em; color: var(--texto-2); margin-left: 1px; }
.k-donut b > span, .k-donut b { display: flex; align-items: baseline; justify-content: center; align-items: center; }

/* 3 · Mejor calidad: la puntuación en dorado y una regla de 10 marcas */
.kpi.k-gold { background: linear-gradient(180deg, #fffaf0, #fff); }
.k-gold .k-cap { color: var(--oro-oscuro); }
.kpi .k-q { font-size: 40px; background: linear-gradient(180deg, #c99a1c, #8a6a0c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .k-q small { -webkit-text-fill-color: var(--texto-2); }
.k-meter { display: flex; gap: 3px; margin: 8px 0 4px; }
.k-meter i { width: 9px; height: 16px; border-radius: 3px; background: #ece6d4; }
.k-meter i.on { background: linear-gradient(180deg, #e2c25a, var(--oro)); box-shadow: 0 2px 5px -1px rgba(212, 175, 55, 0.6); }
.k-meter i.maybe { background: repeating-linear-gradient(45deg, var(--oro) 0 2px, #f3e6b8 2px 4px); }
.play .k-meter i { animation: pop 0.4s calc(0.4s + var(--i) * 0.05s) cubic-bezier(0.3, 1.6, 0.5, 1) both; }

/* 4 · Conclusiones: barra apilada más alta con su leyenda */
.kpi-dir .kpi-bar { width: 100%; height: 14px; margin: 8px 0 6px; border-radius: 7px; }
.kpi > .k-legend { grid-column: auto; font-weight: 500; line-height: 1.3; display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; color: var(--texto-2); }
.k-legend span { display: inline-flex; align-items: center; gap: 5px; }
.k-legend i { width: 8px; height: 8px; border-radius: 2px; }
.k-legend .dir-azul { background: var(--azul); } .k-legend .dir-oro { background: var(--oro); } .k-legend .dir-gris { background: #b8bfcd; } .k-legend .dir-rojo { background: var(--mal); }

@media (max-width: 900px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .paper-answer { margin: 4px -4px 0; padding: 22px 20px 24px; }
  .ans-mark { font-size: 220px; }
  .paper-answer .ans-rest { font-size: 17px; }
  .kpi .k-big { font-size: 36px; } .kpi.k-dark .k-big { font-size: 44px; }
  .k-donut { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .play .paper-answer, .play .ans-mark, .play .ans-lead, .play .ans-rest, .play .paper-answer b.em-n, .play .k-funnel i, .play .k-donut circle.fill, .play .k-meter i { animation: none; }
}

/* ==========================================================================
   Qué dice la evidencia: hallazgos numerados y fichas de estudio al margen
   ========================================================================== */
.hall-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 34px 0 14px; padding: 6px 0 14px; border-bottom: 1px solid var(--linea-2); }
.hall-t { padding-bottom: 4px; }
.hall-big { flex-shrink: 0; }
.hall-big { display: flex; align-items: flex-end; gap: 10px; user-select: none; }
.hall-n { font: 800 112px/0.75 var(--f-ui); letter-spacing: -0.06em; color: transparent; background: linear-gradient(180deg, rgba(0, 74, 173, 0.36), rgba(0, 74, 173, 0.03) 92%); -webkit-background-clip: text; background-clip: text; padding: 0.12em 0.04em 0; margin: -0.12em -0.04em 0; }
.hall-w { margin-bottom: 6px; font: 800 13px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(0, 74, 173, 0.6); }
.hall-head .paper-h { margin: 0 0 4px; font-size: 12.5px; letter-spacing: 0.14em; color: var(--oro-oscuro); }
.hall-sub { margin: 0; font: 400 15px/1.4 var(--f-voz); font-style: italic; color: var(--texto-2); }
.play .hall-big { animation: mark-in 1s cubic-bezier(0.16, 1, 0.3, 1) both; }

.para { grid-template-columns: 52px minmax(0, 1fr) 200px; gap: 0 26px; padding: 18px 16px; margin: 0 -16px; border-radius: 16px; transition: background 0.3s, box-shadow 0.3s; }
.para + .para { border-top: 1px solid var(--linea-2); }
.para:hover { background: #fff; box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.06), 0 16px 34px -18px rgba(10, 31, 77, 0.35); }
.para:hover + .para { border-top-color: transparent; }
.para-n { font: 400 46px/0.9 'Instrument Serif', Georgia, serif; color: transparent; background: linear-gradient(180deg, var(--oro), rgba(212, 175, 55, 0.25)); -webkit-background-clip: text; background-clip: text; padding-top: 0.08em; }
.paper-h + .para > p::first-letter, .hall-head + .para > p::first-letter { float: none; font: inherit; margin: 0; color: inherit; }
.para > p { font-size: 17.5px; line-height: 1.72; }
.run-in { font: 800 13px/1 var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tinta); margin-right: 2px; }
.para em { font-style: italic; color: var(--tinta); }
.para b.em-n { font-weight: 700; color: var(--tinta); background: linear-gradient(transparent 60%, rgba(212, 175, 55, 0.4) 60%); padding: 0 1px; }
.para b.em-q { display: inline-block; padding: 0 7px 1px; border-radius: 6px; font: 600 0.76em/1.5 var(--f-dato); vertical-align: 0.1em; color: #fff; background: var(--noche); }
.play .para { animation: rise 0.6s calc(0.25s + var(--d, 0) * 0.1s) cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* Fichas de estudio al margen */
.sidenotes { gap: 10px; border-left: 0; padding-left: 0; }
.note { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 10px 12px 11px; border-radius: 12px; background: #fff; color: var(--texto-2); box-shadow: inset 3px 0 0 var(--qc, var(--nd)), 0 0 0 1px rgba(10, 31, 77, 0.07), 0 8px 18px -12px rgba(10, 31, 77, 0.35); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, background 0.2s; }
.note.q-ok { --qc: var(--ok); } .note.q-aviso { --qc: var(--oro); } .note.q-mal { --qc: var(--mal); }
.note:hover { transform: translateX(-3px); background: #fff; box-shadow: inset 3px 0 0 var(--qc, var(--nd)), 0 0 0 1px rgba(10, 31, 77, 0.1), 0 14px 26px -14px rgba(10, 31, 77, 0.45); }
.note.on { background: var(--noche); color: #c9d6f0; box-shadow: inset 3px 0 0 var(--oro), 0 14px 28px -12px rgba(10, 31, 77, 0.6); }
.note-top { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.note-top b { font-weight: 800; color: var(--tinta); }
.note.on .note-top b { color: #fff; }
.note-y { margin-left: auto; font-size: 10.5px; color: var(--nd); }
.note.on .note-y { color: #9fb2d8; }
.note-n { min-width: 20px; height: 20px; line-height: 20px; border-radius: 6px; font-size: 11px; }
.note.on .note-n { background: var(--oro); color: var(--noche); }
.note-q { font: 600 11.5px/1.3 var(--f-dato); color: var(--texto-2); }
.note.on .note-q { color: #fff; }
.note-bar { height: 4px; border-radius: 2px; background: var(--linea-2); overflow: hidden; }
.note.on .note-bar { background: rgba(255, 255, 255, 0.15); }
.note-bar i { display: block; width: var(--q); height: 100%; border-radius: inherit; background: var(--qc, var(--nd)); }
.play .note-bar i { animation: grow-x 0.9s 0.5s cubic-bezier(0.3, 0.7, 0.3, 1) both; transform-origin: left; }

@media (max-width: 640px) {
  .hall-n { font-size: 80px; }
  .para { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 10px; margin: 0 -10px; }
  .para-n { font-size: 34px; }
  .para .sidenotes { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sidenotes .note { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { .play .hall-big, .play .para, .play .note-bar i { animation: none; } }
/* Con poco ancho (tableta o chat abierto al lado) las fichas pasan debajo del texto */
@media (max-width: 900px) {
  .para { grid-template-columns: 44px minmax(0, 1fr); }
  .para .sidenotes { grid-column: 2; flex-direction: row; flex-wrap: wrap; margin-top: 10px; }
  .sidenotes .note { flex: 1 1 150px; }
}
body.chat-open .para { grid-template-columns: 44px minmax(0, 1fr); }
body.chat-open .para .sidenotes { grid-column: 2; flex-direction: row; flex-wrap: wrap; margin-top: 10px; }
body.chat-open .sidenotes .note { flex: 1 1 150px; }

/* De un vistazo, segunda pasada: el contenido llena la tarjeta (cifras y gráficos más grandes, leyenda compacta) */
.kpi { justify-content: space-between; gap: 6px; padding: 18px 20px 18px; min-height: 230px; }
.kpi .k-cap { font-size: 11px; }
.kpi .k-big { font-size: 64px; }
.kpi.k-dark .k-big { font-size: 84px; }
.kpi .k-q { font-size: 64px; }
.kpi .k-big small { font-size: 0.36em; }
.kpi .k-sub { font-size: 16px; }
.kpi .k-foot { font-size: 12.5px; }
.k-funnel { height: 8px; }
.k-donut { width: 112px; height: 112px; margin: 2px 0; }
.k-donut circle { stroke-width: 8; }
.k-donut b { font-size: 34px; }
.k-meter { width: 100%; gap: 4px; margin: 2px 0; }
.k-meter i { flex: 1 1 0; width: auto; max-width: 16px; height: 26px; border-radius: 4px; }
.kpi-dir .kpi-bar { height: 18px; border-radius: 9px; margin: 2px 0; }
.kpi > .k-legend { gap: 4px 12px; font-size: 12px; font-weight: 600; color: var(--texto-2); }
.k-legend span { white-space: nowrap; }
.k-legend b { font-weight: 800; color: var(--tinta); }
@media (max-width: 1100px) {
  .kpi .k-big, .kpi .k-q { font-size: 52px; } .kpi.k-dark .k-big { font-size: 64px; }
  .k-donut { width: 92px; height: 92px; } .k-donut b { font-size: 28px; }
  .k-meter i { height: 20px; }
}
body.chat-open .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .kpi { min-height: 0; padding: 14px 14px; }
  .kpi .k-big, .kpi .k-q { font-size: 40px; } .kpi.k-dark .k-big { font-size: 48px; }
  .k-donut { width: 76px; height: 76px; } .k-donut b { font-size: 22px; }
  .k-meter i { height: 16px; }
}

/* ==========================================================================
   Columna derecha: ficha técnica de la búsqueda (oscura) y fuente citada (flotante)
   ========================================================================== */
.card.how {
  position: relative; overflow: hidden; border: 0; color: #dfe7f7;
  background: radial-gradient(120% 70% at 100% 0%, rgba(0, 74, 173, 0.55), transparent 65%), var(--noche);
  background-image: radial-gradient(120% 70% at 100% 0%, rgba(0, 74, 173, 0.55), transparent 65%), radial-gradient(#1b3672 1px, transparent 1px);
  background-size: auto, 16px 16px;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.22), 0 22px 44px -18px rgba(10, 31, 77, 0.65);
}
.how .side-h { margin-bottom: 16px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--oro); }
.how .side-h .ico { color: var(--oro); }
.how dl.pico dt { color: #8fa3cc; font-size: 10.5px; letter-spacing: 0.12em; }
.how dl.pico dd { margin: 2px 0 14px 36px; font-size: 14px; line-height: 1.45; color: #fff; }
.how .pico-l { width: 26px; height: 26px; border-radius: 8px; background: rgba(212, 175, 55, 0.14); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.4); color: var(--oro); font: 400 18px/1 'Instrument Serif', Georgia, serif; }
.how .pico-l-s { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); color: #8fa3cc; }
.how .funnel { gap: 6px; margin: 6px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.how .funnel span { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); color: #c9d6f0; font-size: 12.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.how .funnel b { font: 800 20px/1 var(--f-ui); color: #fff; }
.how .funnel span:last-child { background: linear-gradient(135deg, #e2c25a, var(--oro)); color: var(--noche); box-shadow: 0 10px 22px -10px rgba(212, 175, 55, 0.8); }
.how .funnel span:last-child b { color: var(--noche); font-size: 24px; }
.play .how .funnel span, .how .funnel span { animation: funnel-in 0.6s calc(0.3s + var(--d, 0) * 0.12s) cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes funnel-in { from { opacity: 0; width: 20%; } }
.how .query-box summary { color: #9bb5f0; }
.how .query { background: rgba(0, 0, 0, 0.25); color: #c9d6f0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.how .stats { color: #7d8fb5; }

.card.source {
  border: 0; overflow: hidden; padding-top: 22px;
  box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.08), 0 2px 6px rgba(10, 31, 77, 0.05), 0 26px 50px -20px rgba(10, 31, 77, 0.45);
}
.card.source::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--azul), #5a8be0 60%, var(--oro)); }
.source-h { gap: 12px; margin-bottom: 14px; }
.source .n { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0; border-radius: 12px; background: var(--noche); color: var(--oro); font: 400 24px/1 'Instrument Serif', Georgia, serif; box-shadow: 0 8px 16px -8px rgba(10, 31, 77, 0.7); }
.source-h h2 { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--oro-oscuro); }
.src-d { display: block; margin-top: 2px; font-size: 13px; font-weight: 800; color: var(--tinta); }
.source .t { font-size: 16px; font-weight: 800; line-height: 1.35; color: var(--tinta); letter-spacing: -0.005em; }
.source blockquote { position: relative; padding: 14px 16px 14px 18px; border-radius: 12px; background: linear-gradient(180deg, #fbf6e8, #fdfaf2); box-shadow: inset 3px 0 0 var(--oro); font-style: italic; font-size: 15.5px; color: #2b3653; }
.src-bar { display: block; height: 6px; margin: 0 0 12px; border-radius: 3px; background: var(--linea-2); overflow: hidden; }
.src-bar i { display: block; width: var(--q); height: 100%; border-radius: inherit; background: var(--nd); transition: width 0.6s cubic-bezier(0.3, 0.7, 0.3, 1); }
.src-bar.q-ok i { background: var(--ok); } .src-bar.q-aviso i { background: var(--oro); } .src-bar.q-mal i { background: var(--mal); }
.source.flash { animation: src-flash 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes src-flash { from { transform: translateY(8px) scale(0.98); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.6), 0 26px 50px -20px rgba(10, 31, 77, 0.45); } }
.source .hint { padding: 6px 0; font: italic 15px/1.5 var(--f-voz); }
@media (prefers-reduced-motion: reduce) { .how .funnel span, .source.flash { animation: none; } }

/* ==========================================================================
   Figuras: tarjetas con profundidad, número gigante translúcido y gráficos con más cuerpo
   ========================================================================== */
.card.fig { position: relative; isolation: isolate; overflow: hidden; border: 0; box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.07), 0 2px 6px rgba(10, 31, 77, 0.04), 0 24px 48px -28px rgba(10, 31, 77, 0.4); }
.fig-big { position: absolute; z-index: -1; top: -14px; right: 18px; font: 800 150px/1 var(--f-ui); letter-spacing: -0.06em; color: transparent; background: linear-gradient(180deg, rgba(0, 74, 173, 0.16), rgba(0, 74, 173, 0) 80%); -webkit-background-clip: text; background-clip: text; padding-top: 0.1em; pointer-events: none; user-select: none; }
.play .fig-big { animation: mark-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) both; }
.fig-head h2 { font-size: 27px; line-height: 1.2; }
.fig-head p { font-size: 14.5px; }

/* Mapa: celdas con más presencia, burbujas con sombra, huecos como anillos discretos */
.map-gap { display: grid; place-items: center; font-size: 0; }
.map-gap::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #d9dde7; }
.map-cell { border-radius: 14px; transition: background 0.2s, box-shadow 0.2s; }
.map-cell:hover, .map-cell.on { background: #fff; box-shadow: 0 0 0 1px rgba(0, 74, 173, 0.12), 0 10px 22px -12px rgba(10, 31, 77, 0.45); }
.map-cell .b { filter: drop-shadow(0 4px 6px rgba(10, 31, 77, 0.28)); }
.map > .map-col-h { font-size: 11.5px; letter-spacing: 0.02em; }
.map-col-h .ico { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--azul-claro); opacity: 1; }
.map > .map-row-h { font-size: 14.5px; color: var(--tinta); }

/* Relevancia: intervalos con cuerpo, punto con sombra y filas que se levantan */
.fr:not(.fr-axis) { padding: 0 10px; transition: background 0.2s, box-shadow 0.2s; }
.fr:not(.fr-axis):hover { background: #fff; box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.07), 0 12px 24px -14px rgba(10, 31, 77, 0.4); }
.fr-ci { height: 4px; margin-top: -2px; border-radius: 2px; background: linear-gradient(90deg, rgba(0, 74, 173, 0.55), var(--azul), rgba(0, 74, 173, 0.55)); }
.fr-ci::before, .fr-ci::after { top: -5px; height: 14px; width: 2.5px; background: var(--azul); }
.fr-pt { filter: drop-shadow(0 3px 4px rgba(10, 31, 77, 0.4)); }
.fr-pt rect { transform: scale(1.25); transform-box: fill-box; transform-origin: center; }
.fr-band { box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.12); }

/* Dosis: filas con relieve al pasar y semanas como fichas */
.dose-row:not(.dose-axis) { padding: 10px 10px; border-radius: 12px; transition: background 0.2s, box-shadow 0.2s; }
.dose-row:not(.dose-axis):hover, .dose-row.on { background: #fff; box-shadow: 0 0 0 1px rgba(0, 74, 173, 0.12), 0 12px 24px -14px rgba(10, 31, 77, 0.4); }

@media (max-width: 640px) { .fig-big { font-size: 96px; top: -8px; right: 10px; } .fig-head h2 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .play .fig-big { animation: none; } }

/* Cierre de la página: invitación a preguntar al asistente */
.ask-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px;
  margin-top: 6px; padding: 28px 30px; border-radius: 22px; color: #dfe7f7;
  background: radial-gradient(70% 120% at 0% 0%, rgba(0, 74, 173, 0.65), transparent 60%), radial-gradient(#1b3672 1px, transparent 1px), var(--noche);
  background-size: auto, 16px 16px, auto;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 30px 60px -24px rgba(10, 31, 77, 0.7);
}
.ask-cta::after { content: "?"; position: absolute; z-index: -1; right: 150px; top: -40px; font: 400 260px/1 'Instrument Serif', Georgia, serif; color: rgba(212, 175, 55, 0.08); pointer-events: none; }
.ask-art { width: 96px; height: 96px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45)); animation: float 4.5s ease-in-out infinite; }
.ask-k { margin: 0 0 6px; font-size: 10.5px; letter-spacing: 0.16em; color: var(--oro); }
.ask-cta h2 { margin: 0; font: 400 34px/1.1 'Instrument Serif', 'Source Serif 4', Georgia, serif; color: #fff; }
.ask-sub { margin: 8px 0 14px; max-width: 52ch; font: 400 15.5px/1.5 var(--f-voz); color: #c9d6f0; }
.ask-sugs { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-sug { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); color: #e6ecf8; font: 600 12.5px/1.3 var(--f-ui); text-align: left; cursor: pointer; transition: background 0.2s, box-shadow 0.2s, transform 0.2s; }
.ask-sug .ico { color: var(--oro); flex-shrink: 0; }
.ask-sug:hover { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.5); transform: translateY(-1px); }
.ask-btn { align-self: center; min-height: 52px; padding: 0 24px; border-radius: 14px; background: linear-gradient(135deg, #e2c25a, var(--oro)); color: var(--noche); font-weight: 800; white-space: nowrap; box-shadow: 0 14px 28px -12px rgba(212, 175, 55, 0.9); transition: transform 0.2s, box-shadow 0.2s; }
.ask-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(212, 175, 55, 1); }
body.chat-open .ask-cta { grid-template-columns: auto minmax(0, 1fr); }
body.chat-open .ask-btn { grid-column: 2; justify-self: start; }
@media (max-width: 900px) {
  .ask-cta { grid-template-columns: auto minmax(0, 1fr); }
  .ask-btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 640px) {
  .ask-cta { grid-template-columns: 1fr; gap: 14px; padding: 22px 20px; text-align: left; }
  .ask-art { width: 64px; height: 64px; }
  .ask-btn { grid-column: 1; width: 100%; }
  .ask-cta h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .ask-art { animation: none; } }

/* ==========================================================================
   Aplicación en consulta y lagunas
   ========================================================================== */
/* Recuento gigante translúcido en la esquina, con su palabra: «5 claves», «6 preguntas abiertas» */
.sec-big { position: absolute; z-index: 0; top: 18px; right: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 800 11px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; pointer-events: none; user-select: none; }
.sec-big span { font: 800 120px/0.8 var(--f-ui); letter-spacing: -0.06em; color: transparent; -webkit-background-clip: text; background-clip: text; padding-top: 0.1em; }
.apply .sec-big { color: rgba(212, 175, 55, 0.6); }
.apply .sec-big span { background-image: linear-gradient(180deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.02) 90%); }
.gaps .sec-big { color: rgba(10, 31, 77, 0.4); }
.gaps .sec-big span { background-image: linear-gradient(180deg, rgba(10, 31, 77, 0.2), rgba(10, 31, 77, 0.01) 90%); }
.apply > :not(.sec-big), .gaps > :not(.sec-big) { position: relative; z-index: 1; }
.play .sec-big { animation: mark-in 1s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Aplicación: cada clave como una ficha con su número grande en dorado */
.card.apply { border: 0; box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 30px 60px -26px rgba(10, 31, 77, 0.75); }
.apply-list { gap: 12px; margin-top: 10px; }
.apply-list li { gap: 18px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)); border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.07); font: 400 16.5px/1.6 var(--f-voz); color: #e6ecf8; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, background 0.25s; }
.apply-list li:hover { transform: translateX(4px); background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(212, 175, 55, 0.4), 0 16px 30px -18px rgba(0, 0, 0, 0.6); }
.apply-n { width: auto; height: auto; margin-top: -4px; border-radius: 0; background: none; font: 400 44px/0.9 'Instrument Serif', Georgia, serif; color: transparent; background-image: linear-gradient(180deg, #f0d77e, var(--oro) 60%, #a8841a); -webkit-background-clip: text; background-clip: text; min-width: 48px; }
.apply-list em { color: #fff; }
.apply-list b.em-n { color: #fff; font-weight: 700; background: linear-gradient(transparent 62%, rgba(212, 175, 55, 0.45) 62%); }
.apply-list b.em-q { display: inline-block; padding: 0 7px 1px; border-radius: 6px; font: 600 0.76em/1.5 var(--f-dato); vertical-align: 0.1em; background: var(--oro); color: var(--noche); }

/* Lagunas: papel gris claro con fichas de pregunta abierta */
.card.gaps { position: relative; overflow: hidden; border: 0; background: repeating-linear-gradient(-45deg, rgba(10, 31, 77, 0.025) 0 10px, transparent 10px 20px), #f4f5f8; box-shadow: inset 0 0 0 1.5px rgba(10, 31, 77, 0.08); }
.gaps .fig-head p { max-width: 52ch; }
.gaps ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.gaps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.06), 0 10px 22px -16px rgba(10, 31, 77, 0.4); font-size: 14px; line-height: 1.55; color: #3a4357; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s; }
.gaps li::before { display: none; }
.gaps li:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.1), 0 16px 30px -16px rgba(10, 31, 77, 0.45); }
.gap-q { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed #b4bccd; font: 400 20px/1 'Instrument Serif', Georgia, serif; color: var(--nd); }
.gaps li em { color: var(--tinta); }
.gaps li b.em-n { font-weight: 700; color: var(--tinta); }
.play .gaps li { animation: rise 0.55s both; animation-delay: calc(0.2s + var(--d, 0) * 80ms); }

body.chat-open .gaps ul { grid-template-columns: 1fr; }
@media (max-width: 900px) { .gaps ul { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .sec-big { display: none; }
  .apply-list li { gap: 12px; padding: 14px; font-size: 15.5px; }
  .apply-n { font-size: 34px; min-width: 36px; }
}
@media (prefers-reduced-motion: reduce) { .play .sec-big, .play .gaps li { animation: none; } }

/* ==========================================================================
   Estudios analizados y evolución
   ========================================================================== */
/* Pirámide con volumen: niveles con estudios en azules más vivos, sombra al suelo */
.pyramid { filter: drop-shadow(0 12px 16px rgba(10, 31, 77, 0.18)); }
.pyramid .tier:not(.empty):nth-of-type(1) polygon { fill: #a9c1ef; }
.pyramid .tier:not(.empty):nth-of-type(2) polygon { fill: #bccff3; }
.pyramid .tier:not(.empty):nth-of-type(3) polygon { fill: #cfdcf7; }
.pyramid .tier:not(.empty):nth-of-type(4) polygon { fill: #e0e9fa; }
.pyramid .tier:not(.empty):hover polygon { fill: #93b0ea; }
.pyramid .tier.on polygon { fill: var(--noche) !important; }
.pyramid .tier { cursor: pointer; }
.pyramid .tier text { font-size: 12px; }

/* Lista de estudios: cada estudio es una ficha que se levanta; la abierta queda destacada */
.study { border-top: 0; margin: 0 0 10px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(10, 31, 77, 0.07), 0 8px 18px -14px rgba(10, 31, 77, 0.35); transition: box-shadow 0.25s, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.study:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(0, 74, 173, 0.14), 0 16px 30px -16px rgba(10, 31, 77, 0.45); }
.study.open { transform: none; box-shadow: 0 0 0 1.5px rgba(0, 74, 173, 0.35), 0 22px 40px -20px rgba(10, 31, 77, 0.5); }
.study-row { padding: 16px 18px; }
.study-title { font-size: 15.5px; color: var(--tinta); }
.study-title .n { font: 400 20px/1 'Instrument Serif', Georgia, serif; color: var(--oro); }
.study-detail { margin: 0 18px 18px 88px; background: linear-gradient(180deg, #f8f9fc, #fff); border: 0; box-shadow: inset 0 0 0 1px rgba(10, 31, 77, 0.06); }
.play .study { animation: rise 0.5s both; }

/* Evolución: burbujas con sombra, carriles con más color y etiquetas más legibles */
.tl-dot circle { filter: drop-shadow(0 3px 5px rgba(10, 31, 77, 0.3)); transition: transform 0.2s; transform-box: fill-box; transform-origin: center; }
.tl-dot:hover circle, .tl-dot.on circle { transform: scale(1.15); }
.tl-dot text { font-size: 11px; font-weight: 700; }
.tl-lane { font-size: 11.5px; font-weight: 700; fill: var(--tinta); }
.tl-band { opacity: 1; filter: saturate(1.6); }
.tl-grid { stroke: #dfe3ec; }
.tl-year { font-size: 11px; fill: var(--tinta); }
@media (max-width: 640px) { .study-detail { margin: 0 12px 14px; } .study-row { padding: 14px 12px; } }
/* Parámetros de cada intervención como ficha clave · valor, no como código */
.params { display: grid; gap: 0; margin: 8px 0 12px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(10, 31, 77, 0.07); background: #fff; }
.params li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; margin: 0; padding: 8px 12px; font: 400 13px/1.5 var(--f-ui); color: var(--texto); }
.params li + li { border-top: 1px solid var(--linea-2); }
.params li span:first-child { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texto-2); padding-top: 2px; }
.study-title .n { font: 800 12.5px/1 var(--f-ui); color: var(--oro-oscuro); }
@media (max-width: 640px) { .params li { grid-template-columns: 1fr; gap: 2px; } }

@media (max-width: 640px) { .hall-head { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ==========================================================================
   Chat: presentación, sugerencias y conversación con jerarquía distinta
   ========================================================================== */
/* Presentación del asistente: tarjeta propia, no un mensaje más */
.chat-intro { display: flex; gap: 14px; align-items: flex-start; padding: 16px 16px 16px 14px; border-radius: 18px; background: radial-gradient(90% 120% at 0% 0%, #fff8e4, transparent 70%), linear-gradient(180deg, #fdfaf1, #fff); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 10px 24px -16px rgba(120, 90, 10, 0.4); }
.chat-intro-art { width: 56px; height: 56px; flex-shrink: 0; margin-top: -4px; filter: drop-shadow(0 6px 8px rgba(10, 31, 77, 0.25)); }
.chat-intro-h { margin: 0 0 4px; font: 400 24px/1.15 'Instrument Serif', 'Source Serif 4', Georgia, serif; color: var(--tinta); }
.chat-intro p:not(.chat-intro-h) { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--texto-2); }
.chat-intro b { color: var(--tinta); }

/* Sugerencias: un bloque aparte, claramente pulsable (icono, texto y flecha) */
.chat-sugs-box { margin-top: 6px; }
.chat-sugs-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 8px; font-size: 11.5px; color: var(--texto-2); }
.chat-sugs-h b { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--oro-oscuro); }
.chat-sugs { gap: 8px; }
.sug { gap: 12px; padding: 10px 12px 10px 10px; border: 0; border-radius: 14px; background: var(--azul-claro); box-shadow: inset 0 0 0 1px rgba(0, 74, 173, 0.1); text-align: left; transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s; }
.sug-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--azul); box-shadow: 0 2px 6px -2px rgba(0, 74, 173, 0.3); }
.sug .sug-ico .ico { color: inherit; }
.sug-t { flex: 1; min-width: 0; font: 700 13.5px/1.35 var(--f-ui); color: var(--tinta); }
.sug-go { flex-shrink: 0; color: var(--azul); opacity: 0.5; transition: transform 0.2s, opacity 0.2s; }
.sug:hover { background: var(--noche); box-shadow: 0 10px 22px -12px rgba(10, 31, 77, 0.6); transform: none; }
.sug:hover .sug-t { color: #fff; }
.sug:hover .sug-ico { background: rgba(255, 255, 255, 0.12); color: var(--oro); box-shadow: none; }
.sug:hover .sug-go { color: var(--oro); opacity: 1; transform: translateX(3px); }

/* Conversación: pregunta en azul con degradado, respuesta en blanco con filo dorado */
.msg-user { background: linear-gradient(135deg, #0a5bd1, var(--azul) 60%, #003a8a); box-shadow: 0 8px 18px -10px rgba(0, 74, 173, 0.6); }
.msg-bot { border: 0; box-shadow: inset 3px 0 0 var(--oro), 0 0 0 1px rgba(10, 31, 77, 0.07), 0 8px 18px -12px rgba(10, 31, 77, 0.3); }

/* Cajetín con micrófono dentro */
.chat-field { position: relative; flex: 1; min-width: 0; display: flex; }
.chat-field textarea { flex: 1; padding-right: 46px; }
.chat-mic { position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--texto-2); cursor: pointer; transition: background 0.2s, color 0.2s; }
.chat-mic:hover { background: var(--azul-claro); color: var(--azul); }
.chat-mic.on { background: var(--mal); color: #fff; animation: mic-pulse 1.4s ease-out infinite; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.5); } 100% { box-shadow: 0 0 0 10px rgba(214, 69, 69, 0); } }
@media (prefers-reduced-motion: reduce) { .chat-mic.on { animation: none; } }

/* Recuento con su palabra en la esquina de cada figura (sustituye al «01», «02»…) */
.fig-big { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; top: 16px; right: 22px; font: 800 11px/1 var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(0, 74, 173, 0.55); background: none; -webkit-background-clip: border-box; background-clip: border-box; padding: 0; }
.fig-big-n { font: 800 110px/0.8 var(--f-ui); letter-spacing: -0.06em; color: transparent; background: linear-gradient(180deg, rgba(0, 74, 173, 0.22), rgba(0, 74, 173, 0.01) 88%); -webkit-background-clip: text; background-clip: text; padding-top: 0.1em; }
.fig-big-w { white-space: nowrap; }
.fig-no { letter-spacing: 0.14em; }
.fig-head > div { max-width: calc(100% - 150px); }
@media (max-width: 640px) { .fig-big { display: none; } .fig-head > div { max-width: none; } }

/* Recuento dentro de la cabecera: ocupa su sitio a la derecha del título y nunca pisa el contenido */
.fig-head { display: flex; align-items: flex-start; }
.fig-head > div { flex: 1; min-width: 0; max-width: none; }
.fig-big { position: static; z-index: auto; order: 3; flex-shrink: 0; margin: -4px 0 0 auto; padding-left: 12px; }
.fig-big-n { font-size: 84px; }
.apply .fig-big { color: rgba(212, 175, 55, 0.7); }
.apply .fig-big-n { background-image: linear-gradient(180deg, rgba(212, 175, 55, 0.45), rgba(212, 175, 55, 0.04) 88%); }
.gaps .fig-big { color: rgba(10, 31, 77, 0.45); }
.gaps .fig-big-n { background-image: linear-gradient(180deg, rgba(10, 31, 77, 0.22), rgba(10, 31, 77, 0.02) 88%); }
.chat-intro { display: block; padding: 14px 16px; }
.chat-intro-h { margin-bottom: 2px; }
@media (max-width: 640px) { .fig-big { display: none; } }
/* «Qué dice la evidencia» como título de sección, a la altura de los de las figuras */
.hall-t .fig-no { display: block; margin-bottom: 6px; font-size: 11px; color: var(--oro-oscuro); }
.hall-title { margin: 0 0 6px; font: 600 30px/1.15 var(--f-voz); letter-spacing: -0.01em; color: var(--tinta); }
.hall-sub { font-size: 16px; }
@media (max-width: 640px) { .hall-title { font-size: 25px; } }

/* ---------- Cuenta, acceso y Mis búsquedas ---------- */

.account { display: flex; align-items: center; gap: 8px; }
.acct-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(201, 214, 240, 0.28); border-radius: 999px; background: rgba(255, 255, 255, 0.06); font: 700 13px var(--f-ui); color: #fff; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.acct-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--oro); }
.acct-btn svg { color: var(--oro); }
.acct-wrap { position: relative; }
.acct-me { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--oro); color: var(--noche); font: 800 14px var(--f-ui); cursor: pointer; box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22); }
.acct-me:hover, .acct-me[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.5); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 280px; padding: 8px; border-radius: 16px; background: #fff; color: var(--texto); box-shadow: 0 24px 60px rgba(10, 31, 77, 0.32), 0 0 0 1px rgba(10, 31, 77, 0.08); }
.acct-email { margin: 6px 10px 2px; font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.acct-plan { margin: 0 10px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--linea); font-size: 12.5px; line-height: 1.5; color: var(--texto-2); }
.acct-plan b { display: block; color: var(--oro-oscuro); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.acct-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 10px; background: none; font: 600 14px var(--f-ui); color: var(--texto); text-align: left; cursor: pointer; }
.acct-item:hover { background: var(--azul-claro); color: var(--azul); }
.quota-note { text-align: center; margin: 8px 0 0; font-size: 12.5px; color: #c9d6f0; }
.quota-note.empty { color: #ffd6d6; }
.top.compact .quota-note { display: none; }

/* Barra de la búsqueda guardada */
.saved-bar { margin-top: 22px; }
.saved-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 10px 10px 14px; border: 1px solid var(--linea); border-radius: 14px; background: #fff; }
.saved-in p { flex: 1 1 280px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--texto-2); }
.saved-in p b { color: var(--texto); }
.saved-ico { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--azul-claro); color: var(--azul); }
.saved-refresh { min-height: 40px; font-size: 13.5px; }
.saved-new { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.saved-new button { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px 6px 6px; border: 1px solid #c9d6f0; border-radius: 999px; background: #fff; font: 600 13px var(--f-ui); color: var(--tinta); text-align: left; cursor: pointer; }
.saved-new button:hover { border-color: var(--azul); }
.new-tag { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: var(--oro-suave); color: var(--oro-oscuro); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

/* Diálogo de acceso */
.auth { position: relative; width: min(460px, calc(100vw - 32px)); padding: 28px 30px 24px; border: 0; border-radius: 20px; background: #fff; color: var(--texto); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.auth::backdrop { background: rgba(10, 31, 77, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.auth[open] { animation: tour-in 0.28s ease-out; }
.auth-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--texto-2); cursor: pointer; }
.auth-x:hover { background: var(--linea-2); }
.auth h2 { margin: 0 0 10px; font: 400 32px/1.1 'Instrument Serif', 'Source Serif 4', Georgia, serif; }
.auth-lead { margin: 0 0 18px; font: 400 16px/1.55 var(--f-voz); color: #1c2740; overflow-wrap: anywhere; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form > label { font-size: 13px; font-weight: 700; }
.auth-form input[type="email"] { min-height: 48px; padding: 0 14px; border: 1px solid #c9d6f0; border-radius: 12px; font: 500 16px var(--f-ui); color: var(--texto); }
.auth-form input[type="email"]:focus { outline: 2px solid var(--azul); outline-offset: 1px; border-color: transparent; }
.auth-form .btn { margin-top: 6px; }
.auth-form .btn:disabled { opacity: 0.7; cursor: progress; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--mal-bg); color: var(--mal-txt); font-size: 13.5px; }
.auth-small { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--texto-2); }
.auth-dev { margin: 0 0 16px; padding: 14px; border-radius: 14px; background: var(--oro-suave); }
.auth-dev p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--aviso-txt); }
.auth-dev .btn { width: 100%; text-decoration: none; }
.auth-back { font-size: 13.5px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; }
.role-pick legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 700; }
.role-pick label { position: relative; display: block; cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; }
.role-pick span { display: block; height: 100%; padding: 12px 14px; border: 1px solid #c9d6f0; border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.role-pick b { display: block; font-size: 14.5px; }
.role-pick small { display: block; margin-top: 2px; font-size: 12px; color: var(--texto-2); }
.role-pick input:checked + span { border-color: var(--azul); background: var(--azul-claro); box-shadow: 0 0 0 1px var(--azul); }
.role-pick input:focus-visible + span { outline: 2px solid var(--oro); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--texto-2); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--azul); flex-shrink: 0; }

/* Mis búsquedas: panel lateral */
.library { position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); height: 100%; max-height: none; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; background: #fff; color: var(--texto); box-shadow: -30px 0 80px rgba(10, 31, 77, 0.3); }
.library:not([open]) { display: none; }
.library::backdrop { background: rgba(10, 31, 77, 0.5); }
.library[open] { animation: lib-in 0.32s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes lib-in { from { transform: translateX(40px); opacity: 0; } }
.library-head { display: flex; align-items: center; gap: 12px; padding: 18px 14px 18px 20px; background: var(--noche); background-image: radial-gradient(#1b3672 1px, transparent 1px); background-size: 16px 16px; color: #fff; }
.library-head-t { flex: 1; min-width: 0; }
.library-head-t b { display: block; font-size: 17px; font-weight: 800; }
.library-head-t small { display: block; font-size: 12.5px; color: #c9d6f0; }
.library-filter { padding: 14px 16px 0; }
.library-filter input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #c9d6f0; border-radius: 10px; font: 500 14.5px var(--f-ui); }
.library-body { flex: 1; overflow-y: auto; padding: 10px 10px 24px; }
.lib-list { margin: 0; padding: 0; list-style: none; }
.lib-item { display: flex; align-items: stretch; gap: 2px; border-radius: 12px; }
.lib-item:hover, .lib-item.on { background: var(--azul-claro); }
.lib-open { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px 12px 10px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.lib-ico { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px var(--linea); color: var(--azul); }
.lib-t { min-width: 0; }
.lib-q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.lib-meta { display: block; margin-top: 4px; font-size: 11.5px; color: var(--texto-2); }
.lib-del { flex-shrink: 0; width: 40px; border: 0; border-radius: 10px; background: none; color: var(--nd); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.lib-item:hover .lib-del, .lib-del:focus-visible { opacity: 1; }
.lib-del:hover { color: var(--mal); background: var(--mal-bg); }
.lib-empty { margin: 18px 12px; font-size: 14px; line-height: 1.55; color: var(--texto-2); }
.lib-empty p { margin: 0 0 8px; }
.lib-empty.err { color: var(--mal-txt); }
@media (hover: none) { .lib-del { opacity: 1; } }

@media (max-width: 640px) {
  .acct-btn span { display: none; }
  .acct-btn { width: 34px; padding: 0; justify-content: center; }
  .help-link { font-size: 12px; }
  .badge-local { display: none; }
  .auth { padding: 24px 20px 20px; }
  .role-pick { grid-template-columns: 1fr; }
  .saved-refresh { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .auth[open], .library[open] { animation: none; } }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 12.5px; color: var(--texto-2); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--linea); }

/* Acceso: cabecera de marca + una sola acción (Google). */
.auth:has(.auth-login:not([hidden])) { padding: 0; overflow: hidden; }
.auth-login .auth-hero { padding: 30px 30px 26px; background: radial-gradient(120% 140% at 0% 0%, #163a85 0%, var(--noche) 60%); color: #fff; }
.auth-brand { margin: 0 0 18px; font: 800 20px var(--f-ui); letter-spacing: -0.03em; }
.auth-brand span { color: var(--oro); }
.auth-brand small { margin-left: 4px; font: 500 12px var(--f-ui); letter-spacing: 0; color: rgba(255, 255, 255, 0.6); }
.auth-login .auth-hero h2 { margin: 0 0 16px; font-size: 34px; color: #fff; }
.auth-perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font: 500 14.5px/1.4 var(--f-ui); color: rgba(255, 255, 255, 0.88); }
.auth-perks li { display: flex; gap: 10px; align-items: baseline; }
.auth-perks li::before { content: ""; flex: none; width: 14px; height: 8px; border-left: 2px solid var(--oro); border-bottom: 2px solid var(--oro); transform: rotate(-45deg) translateY(-3px); }
.auth-body { padding: 24px 30px 22px; display: flex; flex-direction: column; gap: 10px; }
.btn-google { width: 100%; min-height: 56px; gap: 12px; font-size: 16px; background: #fff; color: var(--texto); border: 1px solid #c9d6f0; border-radius: 14px; box-shadow: 0 1px 0 #c9d6f0, 0 10px 24px -14px rgba(10, 31, 77, 0.55); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.btn-google:hover { border-color: var(--azul); transform: translateY(-1px); box-shadow: 0 2px 0 var(--azul), 0 14px 28px -14px rgba(0, 74, 173, 0.6); }
.btn-google:active { transform: translateY(1px); box-shadow: 0 0 0 var(--azul); }
.btn-google:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.auth-hint { margin: 0; text-align: center; font-size: 13px; color: var(--texto-2); }
.auth-login .auth-small { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--linea-2); text-align: center; font-size: 11.5px; color: var(--nd); text-wrap: balance; }
.auth:has(.auth-login:not([hidden])) .auth-x { color: rgba(255, 255, 255, 0.8); }
.auth:has(.auth-login:not([hidden])) .auth-x:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 480px) {
  .auth-login .auth-hero { padding: 26px 22px 22px; }
  .auth-login .auth-hero h2 { font-size: 29px; }
  .auth-body { padding: 20px 22px 18px; }
}
.foot-links { margin-top: 6px; font-size: 12.5px; }
.foot-links a, .auth-login .auth-small a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Qué es EvidenceHub: visible en la portada, se oculta mientras hay una búsqueda en pantalla. */
.about { padding: 56px 0 40px; background: var(--papel); color: var(--texto); }
#lab:not([hidden]) ~ .about, #results:not([hidden]) ~ .about { display: none; }
.about .kicker { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.12em; color: var(--oro-oscuro); }
.about h2 { max-width: 760px; margin: 0 0 14px; font: 400 36px/1.1 'Instrument Serif', 'Source Serif 4', Georgia, serif; }
.about-lead { max-width: 720px; margin: 0 0 26px; font: 400 17px/1.6 var(--f-voz); color: #1c2740; }
.about-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: paso; }
.about-steps li { counter-increment: paso; padding: 18px 18px 16px; border: 1px solid var(--linea); border-radius: 14px; background: #fff; display: grid; gap: 6px; }
.about-steps li::before { content: counter(paso); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--noche); color: var(--oro); font: 700 13px var(--f-ui); }
.about-steps b { font: 700 15.5px var(--f-ui); }
.about-steps span { font-size: 14px; line-height: 1.5; color: var(--texto-2); }
.about-small { margin: 0; font-size: 13.5px; color: var(--texto-2); }
@media (max-width: 560px) { .about h2 { font-size: 29px; } }
/* Nota PEDro en rango («6–7/10»): más pequeña y sin partirse en dos líneas */
.kpi .k-q { white-space: nowrap; }
.kpi .k-q.k-range { font-size: 46px; letter-spacing: -0.04em; }
@media (max-width: 1100px) { .kpi .k-q.k-range { font-size: 38px; } }
@media (max-width: 640px) { .kpi .k-q.k-range { font-size: 30px; } }

/* Calidad AMSTAR-2 en palabra («Baja», «Críticamente baja») */
.kpi .k-q.k-word { font-size: 40px; line-height: 1.05; white-space: normal; letter-spacing: -0.02em; }
@media (max-width: 1100px) { .kpi .k-q.k-word { font-size: 32px; } }
@media (max-width: 640px) { .kpi .k-q.k-word { font-size: 26px; } }

/* Estudios analizados: la pirámide se ajusta al ancho y la matriz se desplaza dentro de su caja (antes se cortaba en móvil) */
.appraise > * { min-width: 0; }
@media (max-width: 900px) { .appraise { grid-template-columns: minmax(0, 1fr); } }

/* Planes */
.plans { position: relative; width: min(880px, calc(100vw - 32px)); padding: 30px 30px 22px; border: 0; border-radius: 22px; background: var(--papel); color: var(--texto); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.plans::backdrop { background: rgba(10, 31, 77, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.plans[open] { animation: tour-in 0.28s ease-out; }
.plans h2 { margin: 0 0 8px; font: 400 34px/1.1 'Instrument Serif', 'Source Serif 4', Georgia, serif; }
.plans-msg { margin: 0 0 6px; padding: 10px 14px; border-radius: 12px; background: var(--oro-suave); color: var(--aviso-txt); font-size: 14px; line-height: 1.5; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 14px; padding-top: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 20px; border: 1px solid var(--linea); border-radius: 18px; background: #fff; }
.plan-card.plan-top { border: 2px solid var(--azul); box-shadow: 0 18px 40px -22px rgba(0, 74, 173, 0.6); }
.plan-card.plan-is-current { background: var(--azul-claro); }
.plan-badge { position: absolute; top: -12px; left: 20px; padding: 3px 10px; border-radius: 999px; background: var(--oro); color: var(--noche); font: 800 11px var(--f-ui); letter-spacing: 0.04em; text-transform: uppercase; }
.plan-card h3 { margin: 0; font: 800 18px var(--f-ui); }
.plan-price { margin: 0; font: 800 34px var(--f-ui); letter-spacing: -0.02em; color: var(--noche); }
.plan-price small { margin-left: 6px; font: 500 13px var(--f-ui); color: var(--texto-2); letter-spacing: 0; }
.plan-card ul { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; align-content: start; }
.plan-card li { display: flex; gap: 9px; font-size: 14px; line-height: 1.45; color: var(--texto-2); }
.plan-card li::before { content: ""; flex: none; width: 12px; height: 7px; margin-top: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plan-card .btn { width: 100%; }
.btn-plan { background: #fff; color: var(--azul); border-color: var(--azul); }
.btn-plan:hover { background: var(--azul-claro); }
.plan-card .btn:disabled { opacity: 0.6; cursor: default; }
.plan-current { display: block; padding: 12px; border-radius: 12px; text-align: center; font: 700 14px var(--f-ui); color: var(--azul); background: #fff; }
.plans-error { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--mal-bg); color: var(--mal-txt); font-size: 13.5px; }
.plans-small { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--texto-2); text-align: center; }
@media (max-width: 560px) { .plans { padding: 24px 18px 18px; } .plans h2 { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { .plans[open] { animation: none; } }
