/* Colores opacos compartidos con el sistema visual de la app (claro y oscuro casi negro + acento vino). */
.gv, #clinical-guard-review {
  --gv-paper:#fff3e5; --gv-white:#fff9ef; --gv-raised:#fffcf6;
  --gv-cream:#f4e2cc; --gv-hover:#ebd4ba;
  --gv-ink:#4a281c; --gv-muted:#79563e;
  --gv-accent:#a81938; --gv-accent-deep:#7b1128;
  --gv-accent-hover:#91152f; --gv-on-accent:#ffffff;
  --gv-wine:#9e1b34; --gv-deep:#7b1128; --gv-tint:#ffebe9;
  --gv-line:#8c6c5c; --gv-control-line:#947362; --gv-focus:#28668c;
  --gv-ok:#435c2d; --gv-mint:#e9efd6;
  --gv-ochre:#7e531c; --gv-gold:#fff0d3;
  --gv-disabled:#5c4d49; --gv-ash:#eae3dc;
  color-scheme:light; color:var(--gv-ink); background:var(--gv-paper);
  font:400 16px/1.45 Nunito, NunitoBeta, "Segoe UI", system-ui, sans-serif; text-align:start;
}
html.dark .gv, html.dark #clinical-guard-review {
  --gv-paper:#131011; --gv-white:#1c1718; --gv-raised:#241e1f;
  --gv-cream:#2c2426; --gv-hover:#352b2e;
  --gv-ink:#f5ede8; --gv-muted:#bfb0aa;
  --gv-accent:#a81938; --gv-accent-deep:#7b1128;
  --gv-accent-hover:#bd1d40; --gv-on-accent:#ffffff;
  --gv-wine:#ff8da3; --gv-deep:#ffd6de; --gv-tint:#38171d;
  --gv-line:#8a7378; --gv-control-line:#7a666d; --gv-focus:#82c8f5;
  --gv-ok:#c5e8a6; --gv-mint:#1b2c1a;
  --gv-ochre:#f7cf86; --gv-gold:#312312;
  --gv-disabled:#b7a9a4; --gv-ash:#241e1f;
  color-scheme:dark;
}
#clinical-guard-v2, .gv.gv-confirm { box-sizing:border-box; border:0; box-shadow:none; }
#clinical-guard-v2 { position:fixed; inset:0; width:100%; max-width:none; height:100%; height:100dvh; max-height:none;
  margin:0; padding:0; border-radius:0; overflow:hidden; overscroll-behavior:contain; }
#clinical-guard-v2[open] { display:flex; flex-direction:column; }
#clinical-guard-v2::backdrop { background:var(--gv-paper,#fff3e5); }
.gv.gv-confirm { width:min(calc(100% - 32px),420px); border-radius:20px; padding:24px; margin:auto; border:1px solid var(--gv-line); background:var(--gv-white); color:var(--gv-ink); }
.gv.gv-confirm::backdrop { background:rgb(43 27 25 / 65%); }
html.dark .gv.gv-confirm::backdrop, html.dark #clinical-guard-review::backdrop { background:rgb(7 5 6 / 78%); }
.gv *, .gv *::before, .gv *::after { box-sizing:border-box; }
#clinical-guard-v2 [hidden],.gv-confirm [hidden] { display:none !important; }
.gv h1,.gv h2,.gv h3,.gv p,.gv dl,.gv dd,.gv figure,.gv ol,.gv ul { margin:0; }
.gv h1,.gv h2,.gv h3,.gv strong,.gv b { color:inherit; }
.gv h1 { font-size:clamp(1.6rem,3.4vw,2.5rem); line-height:1.1; font-weight:900; letter-spacing:-.035em; text-wrap:balance; }
.gv h2 { font-size:clamp(1.08rem,2.1vw,1.35rem); line-height:1.22; font-weight:800; letter-spacing:-.018em; }
.gv p,.gv span,.gv strong,.gv dt,.gv dd,.gv button,.gv td,.gv th { overflow-wrap:anywhere; }
.gv h1:focus { outline:none; }
.gv .gv-sr { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.gv .gv-top { flex:none; min-height:60px; padding:calc(6px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));
  display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--gv-line); background:var(--gv-paper); z-index:5; }
.gv .gv-top-right { display:flex; align-items:center; gap:10px; min-width:0; }
.gv .gv-study-label { font-size:.9rem; font-weight:800; color:var(--gv-ink); }
.gv .gv-steps { display:grid; gap:5px; min-width:0; text-align:right; font-weight:800; font-size:.82rem; color:var(--gv-wine); }
.gv .gv-steps div { display:flex; gap:4px; justify-content:flex-end; }
.gv .gv-steps i { width:18px; height:4px; border-radius:4px; background:var(--gv-line); }
.gv .gv-steps i.gv-done { background:var(--gv-wine); }
.gv .gv-music {
  display:inline-grid; place-items:center; flex:none; width:44px; height:44px; min-width:44px; min-height:44px;
  padding:0; border-radius:12px; border:1px solid var(--gv-control-line); background:var(--gv-white);
  color:var(--gv-muted); cursor:pointer; box-shadow:none;
}
.gv .gv-music[aria-pressed="true"] { color:var(--gv-wine); border-color:var(--gv-accent); background:var(--gv-tint); }
.gv .gv-music[aria-pressed="true"] .gv-music-slash { display:none; }
.gv .gv-music[aria-pressed="false"] .gv-music-slash { display:block; }
.gv .gv-main { flex:1; min-height:0; min-width:0; overflow:hidden; position:relative; display:grid; }
.gv .gv-visual,.gv .gv-sheet { min-width:0; min-height:0; }
.gv .gv-sheet { overflow:auto; overscroll-behavior:contain; padding:20px max(14px,env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); background:var(--gv-paper); scrollbar-gutter:stable; }
.gv .gv-paper { display:grid; gap:16px; max-width:760px; margin-inline:auto; align-content:start; }
.gv .gv-paper section { display:grid; gap:10px; }
.gv .gv-scenic:not(.gv-split) .gv-visual { position:absolute; inset:0; }
.gv .gv-scenic:not(.gv-split) .gv-sheet { align-self:end; justify-self:center; width:min(100%,680px); z-index:1; max-height:65%; border:1px solid var(--gv-line); border-radius:24px 24px 0 0; }

/* Transición tipo MedSteps + viñeta persistente en todos los pasos (arriba compacta en móvil, izquierda en escritorio). */
.gv .gv-split {
  --gv-vig-h:clamp(104px,21%,148px);
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:var(--gv-vig-h) minmax(0,1fr);
}
.gv:not([data-phase="scene"]) .gv-split:has(.gv-speech:not([hidden])) {
  --gv-vig-h:clamp(118px,26%,190px);
}
.gv .gv-split .gv-visual {
  position:absolute; top:0; left:0; width:100%; height:var(--gv-vig-h); z-index:2; overflow:hidden;
  border-bottom:1px solid var(--gv-line);
  transition:height 380ms cubic-bezier(.22,1,.36,1), width 380ms cubic-bezier(.22,1,.36,1);
}
.gv .gv-split .gv-sheet {
  grid-row:2; grid-column:1; z-index:1; border:0;
  opacity:1; transform:translate3d(0,0,0);
  transition:opacity 360ms cubic-bezier(.22,1,.36,1) 45ms, transform 380ms cubic-bezier(.22,1,.36,1) 45ms;
}
.gv[data-phase="scene"] .gv-split .gv-visual {
  width:100%; height:100%; z-index:4; border-bottom-color:transparent;
}
.gv[data-phase="scene"] .gv-split .gv-sheet {
  opacity:0; transform:translate3d(0,28px,0); pointer-events:none; visibility:hidden;
}

.gv .gv-scene { position:relative; width:100%; height:100%; isolation:isolate; overflow:hidden; background:var(--gv-cream); }
.gv .gv-room { position:absolute; inset:0; width:100%; height:100%; max-width:none; display:block; object-fit:cover; object-position:center 48%; }
.gv .gv-cast { position:absolute; inset:0; max-width:1140px; margin:auto; transition:bottom 380ms cubic-bezier(.22,1,.36,1); }
.gv .gv-cast img { position:absolute; bottom:0; height:85%; width:45%; max-width:none; display:block; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 5px 6px rgb(55 31 20 / 20%)); }
.gv .gv-doctor { left:2%; }
.gv .gv-patient { right:3%; }
.gv .gv-cast .gv-bed { width:56%; right:0; }
.gv .gv-with-companion .gv-doctor { width:32%; left:0; }
.gv .gv-with-companion .gv-patient { width:38%; right:1%; z-index:1; }
.gv .gv-with-companion .gv-companion { width:35%; right:26%; height:74%; }
.gv[data-stage="dialogo"] .gv-cast { bottom:clamp(120px,25%,195px); }
.gv[data-stage="entrada"] .gv-cast { bottom:clamp(64px,12%,100px); }
.gv[data-phase="scene"] .gv-split .gv-cast { bottom:clamp(112px,22%,176px); }
.gv[data-stage="entrada"][data-entrance="loading"] :is(.gv-patient,.gv-companion) { opacity:0; }
.gv[data-stage="entrada"][data-entrance="ready"] :is(.gv-patient,.gv-companion) { animation:gv-enter 1.15s cubic-bezier(.21,.65,.32,1) both; }
.gv[data-stage="entrada"][data-entrance="ready"] .gv-companion { animation-delay:160ms; }
@keyframes gv-enter { from { opacity:0; translate:70vw 0; } 22% { opacity:1; } to { opacity:1; translate:0 0; } }

/* Narración / diálogo a pantalla completa antes de encoger la escena a viñeta. */
.gv .gv-narration {
  position:absolute; left:max(14px,env(safe-area-inset-left)); right:max(14px,env(safe-area-inset-right));
  bottom:max(14px,env(safe-area-inset-bottom)); max-width:680px; margin-inline:auto; z-index:3;
  display:flex; flex-wrap:wrap; align-items:center; gap:12px 16px; padding:14px 16px;
  border:1px solid var(--gv-line); border-radius:18px; background:var(--gv-paper); color:var(--gv-ink);
  box-shadow:0 12px 32px rgb(10 6 7 / 28%); cursor:pointer;
  animation:gv-narration-in 260ms cubic-bezier(.22,1,.36,1) both;
}
@keyframes gv-narration-in { from { opacity:0; transform:translate3d(0,14px,0); } to { opacity:1; transform:translate3d(0,0,0); } }
.gv .gv-narration-body { flex:1 1 210px; min-width:0; display:grid; gap:4px; }
.gv .gv-narration-body>strong { display:block; color:var(--gv-wine); font-size:.84rem; font-weight:800; }
.gv .gv-narration-body>p { font-size:1rem; line-height:1.45; font-weight:700; min-height:1.45em; }
.gv .gv-narration-next { flex:none; margin-left:auto; }

.gv .gv-meta,.gv .gv-provenance,.gv .gv-lead,.gv .gv-mark { color:var(--gv-muted); }
.gv .gv-meta { font-weight:800; font-size:.82rem; }
.gv .gv-lead { font-size:1.02rem; line-height:1.5; }
.gv .gv-provenance,.gv .gv-mark { font-size:.78rem; line-height:1.4; }
.gv .gv-mark { display:block; font-weight:700; }
.gv .gv-tags,.gv .gv-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.gv .gv-tag,.gv .gv-priority,.gv .gv-status,.gv .gv-score,.gv .gv-complete { display:inline-block; width:fit-content; font-size:.79rem; line-height:1.35; font-weight:800; padding:5px 9px; border-radius:8px; color:var(--gv-muted); background:var(--gv-cream); }
.gv .gv-priority,.gv .gv-negative { color:var(--gv-wine); background:var(--gv-tint); }
.gv .gv-complete,.gv .gv-positive,.gv .gv-status-normal { color:var(--gv-ok); background:var(--gv-mint); }
.gv .gv-status-altered { color:var(--gv-ochre); background:var(--gv-gold); }
.gv .gv-vitals { display:grid; grid-template-columns:repeat(auto-fit,minmax(91px,1fr)); gap:7px; }
.gv .gv-vitals>div { min-width:0; padding:10px; background:var(--gv-white); border:1px solid var(--gv-line); border-radius:12px; }
.gv .gv-vitals dt { color:var(--gv-muted); font-size:.79rem; font-weight:800; }
.gv .gv-vitals dd { font-size:1.04rem; font-weight:900; font-variant-numeric:tabular-nums; }
.gv .gv-triage-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 12px; }
.gv .gv-triage-meta .gv-priority { display:inline-flex; align-items:baseline; border-radius:20px; padding:5px 10px; }
.gv .gv-priority::before { content:""; align-self:center; width:7px; height:7px; flex:none; border-radius:50%; margin-right:6px; background:currentColor; }
.gv .gv-priority.gv-routine { background:var(--gv-mint); color:var(--gv-ok); }
.gv .gv-star { color:inherit; font-size:.77em; line-height:0; margin-left:1px; }
.gv .gv-identity { display:grid; gap:2px; }
.gv .gv-identity p { color:var(--gv-muted); font-size:.91rem; }
.gv .gv-triage-note { color:var(--gv-muted); font-size:.78rem; line-height:1.45; }
.gv[data-stage="triaje"] .gv-paper { gap:12px; }
.gv .gv-button,.gv .gv-exit,.gv .gv-skip,.gv .gv-link { display:inline-flex; align-items:center; justify-content:center; gap:5px; width:fit-content; min-width:44px; min-height:44px; border-radius:12px;
  padding:10px 16px; border:1px solid var(--gv-control-line); color:var(--gv-ink); background:var(--gv-white); font:800 1rem/1.35 Nunito,NunitoBeta,"Segoe UI",sans-serif; text-align:center; cursor:pointer; box-shadow:none; }
.gv .gv-exit { background:var(--gv-paper); color:var(--gv-wine); border-color:var(--gv-control-line); padding:8px 12px; }
.gv .gv-exit span { font-size:1.5em; line-height:.75; }
.gv .gv-primary { color:var(--gv-on-accent); background:var(--gv-accent); border-color:var(--gv-accent-deep); }
.gv .gv-paper>.gv-primary { justify-self:stretch; width:100%; }
.gv .gv-options { display:grid; gap:8px; }
.gv .gv-option { margin:0; display:flex; align-items:center; gap:12px; min-height:50px; padding:12px 14px; border-radius:12px; border:1px solid var(--gv-line); color:var(--gv-ink); background:var(--gv-white); cursor:pointer; }
.gv .gv-option-exclusive { margin-top:4px; border-style:dashed; border-color:var(--gv-control-line); }
.gv .gv-option span { color:inherit; font-size:.97rem; line-height:1.45; font-weight:700; }
.gv .gv-option input { display:grid; place-content:center; appearance:none; flex:0 0 20px; width:20px; height:20px; padding:0; margin:0; border:2px solid var(--gv-control-line); border-radius:5px; background:var(--gv-raised); box-shadow:none; opacity:1; }
.gv .gv-option input[type="radio"] { border-radius:50%; }
.gv .gv-option input:checked { border-color:var(--gv-accent); background:var(--gv-accent); }
.gv .gv-option input[type="checkbox"]:checked::after { content:""; width:10px; height:6px; border:solid var(--gv-on-accent); border-width:0 0 2px 2px; transform:translateY(-1px) rotate(-45deg); }
.gv .gv-option input[type="radio"]:checked::after { content:""; width:8px; height:8px; border-radius:50%; background:var(--gv-on-accent); }
.gv .gv-option:has(input:checked) { color:var(--gv-wine); border-color:var(--gv-wine); border-style:solid; background:var(--gv-tint); }
.gv .gv-option:has(input:checked:disabled) { cursor:default; }
.gv .gv-button:disabled,.gv .gv-option:has(input:disabled:not(:checked)) { opacity:1; color:var(--gv-disabled); border-color:var(--gv-line); background:var(--gv-ash); cursor:default; }
@media(hover:hover) {
  .gv :is(.gv-button,.gv-exit,.gv-music,.gv-skip,.gv-link):hover:not(:disabled),.gv .gv-option:hover:not(:has(input:checked)):not(:has(input:disabled)),.gv .gv-detail>summary:hover { color:var(--gv-ink); background:var(--gv-hover); }
  .gv .gv-music[aria-pressed="true"]:hover:not(:disabled) { color:var(--gv-wine); background:var(--gv-tint); }
  .gv .gv-button.gv-primary:hover:not(:disabled) { color:var(--gv-on-accent); background:var(--gv-accent-hover); }
  .gv .gv-option:has(input:checked):hover { color:var(--gv-deep); background:var(--gv-tint); }
}
.gv :is(button,summary):focus-visible,.gv .gv-option:has(input:focus-visible),.gv .gv-node:focus-visible { outline:3px solid var(--gv-focus); outline-offset:2px; }
.gv .gv-option input:focus-visible { outline:none; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) { display:grid; grid-template-columns:minmax(75px,32%) minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.gv .gv-visual .gv-speech { height:100%; max-height:100%; overflow:auto; padding:9px 12px; border-left:1px solid var(--gv-line); }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-doctor { display:none; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient { width:95%; right:0; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-patient { width:60%; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-companion { width:61%; right:37%; }
.gv[data-phase="scene"] .gv-visual .gv-speech { display:none; }
.gv .gv-speech { background:var(--gv-paper); color:var(--gv-ink); }
.gv .gv-speech:has(.gv-skip:not([hidden])) { cursor:pointer; }
.gv[data-stage="dialogo"] .gv-sheet { display:flex; flex-direction:column; }
.gv[data-stage="dialogo"] .gv-paper { width:100%; min-height:0; grid-template-rows:minmax(0,1fr) auto; }
.gv[data-stage="dialogo"] .gv-speech { min-height:0; overflow:auto; }
.gv .gv-speech>strong { display:block; color:var(--gv-wine); font-size:.86rem; text-transform:capitalize; }
.gv .gv-speech p { margin:4px 0; }
.gv .gv-skip,.gv .gv-link { padding:6px 8px; color:var(--gv-wine); border-color:transparent; background:var(--gv-paper); text-decoration:underline; font-size:.88rem; }
.gv .gv-items,.gv .gv-timeline { padding:0; list-style:none; }
.gv .gv-card,.gv .gv-detail,.gv .gv-report-hero { padding:16px; border:1px solid var(--gv-line); border-radius:16px; background:var(--gv-white); color:var(--gv-ink); }
.gv .gv-card { display:grid; gap:14px; }
.gv .gv-card figure { display:grid; gap:8px; }
.gv .gv-card figure img { display:block; width:auto; max-width:100%; max-height:440px; margin:auto; border-radius:10px; }
.gv .gv-card figcaption { font-size:.85rem; color:var(--gv-muted); }

/* Resultados bonitos e interpretables: reloj clínico, tarjetas con arte y llegada escalonada. */
.gv .gv-results-clock {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 14px; border:1px solid var(--gv-line); border-radius:14px;
  background:var(--gv-cream); color:var(--gv-ink);
}
.gv .gv-results-clock-label { font-size:.82rem; font-weight:800; color:var(--gv-muted); }
.gv .gv-results-clock strong { font-size:1.15rem; font-weight:900; font-variant-numeric:tabular-nums; color:var(--gv-wine); }
.gv .gv-results-list { display:grid; gap:14px; }
@keyframes gv-result-in { from { opacity:0; transform:translate3d(0,14px,0); } to { opacity:1; transform:translate3d(0,0,0); } }
.gv[data-phase="panel"] .gv-result-card { animation:gv-result-in 380ms cubic-bezier(.22,1,.36,1) both; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(1) { animation-delay:60ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(2) { animation-delay:260ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(3) { animation-delay:460ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(4) { animation-delay:660ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(5) { animation-delay:860ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(6) { animation-delay:1060ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(7) { animation-delay:1260ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(8) { animation-delay:1460ms; }
.gv[data-phase="panel"] .gv-result-card:nth-of-type(n+9) { animation-delay:1660ms; }
.gv .gv-result-head { display:flex; align-items:center; gap:12px; min-width:0; }
.gv .gv-result-art {
  flex:none; width:64px; height:64px; display:grid; place-items:center;
  border:1px solid var(--gv-line); border-radius:14px; background:var(--gv-cream); overflow:hidden; padding:4px;
}
.gv .gv-result-art img { display:block; width:100%; height:100%; object-fit:contain; }
.gv .gv-result-art img[data-fallback] { padding:6px; }
.gv .gv-result-meta { flex:1; min-width:0; display:grid; gap:4px; }
.gv .gv-result-kicker { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; }
.gv .gv-ecg-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.gv .gv-ecg-metrics>div { min-width:0; padding:9px 10px; border:1px solid var(--gv-line); border-radius:12px; background:var(--gv-cream); }
.gv .gv-ecg-metrics dt { font-size:.75rem; font-weight:800; color:var(--gv-muted); }
.gv .gv-ecg-metrics dd { font-size:.92rem; font-weight:800; margin-top:2px; color:var(--gv-ink); font-variant-numeric:tabular-nums; }
.gv .gv-finding-box {
  display:grid; gap:6px; padding:12px 14px; border-radius:12px;
  border:1px solid var(--gv-line); border-left:4px solid var(--gv-wine);
  background:var(--gv-cream); color:var(--gv-ink);
}
.gv .gv-finding-box h3 { font-size:.8rem; font-weight:800; color:var(--gv-wine); text-transform:uppercase; letter-spacing:.03em; }
.gv .gv-finding-box p { font-size:.94rem; line-height:1.5; color:var(--gv-ink); }
.gv .gv-empty { padding:16px; border:1px dashed var(--gv-line); border-radius:14px; background:var(--gv-white); color:var(--gv-ink); font-size:.98rem; line-height:1.5; }

.gv .gv-table-wrap { overflow-x:auto; border:1px solid var(--gv-line); border-radius:12px; background:var(--gv-raised); }
.gv .gv-table { width:100%; border-collapse:collapse; font-size:.86rem; font-variant-numeric:tabular-nums; }
.gv .gv-table th,.gv .gv-table td { text-align:start; padding:9px 10px; vertical-align:middle; border-bottom:1px solid var(--gv-line); }
.gv .gv-table tbody tr:last-child th,.gv .gv-table tbody tr:last-child td { border-bottom:0; }
.gv .gv-table thead th { font-size:.76rem; font-weight:800; color:var(--gv-muted); background:var(--gv-cream); }
.gv .gv-table tbody th { font-weight:800; color:var(--gv-ink); }
.gv .gv-table tbody tr.gv-row-altered { background:var(--gv-tint); }
.gv .gv-table tbody tr.gv-row-altered th { box-shadow:inset 3px 0 0 var(--gv-accent); }
.gv .gv-status { font-size:.75rem; padding:3px 7px; }
@media(max-width:540px) {
  .gv .gv-ecg-metrics { grid-template-columns:repeat(auto-fit,minmax(108px,1fr)); }
  .gv .gv-table-wrap { border:0; background:transparent; overflow:visible; }
  .gv .gv-table,.gv .gv-table tbody { display:grid; gap:10px; }
  .gv .gv-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .gv .gv-table tbody tr {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px;
    padding:11px 12px; border:1px solid var(--gv-line); border-radius:12px; background:var(--gv-raised);
  }
  .gv .gv-table tbody tr.gv-row-altered { background:var(--gv-tint); border-color:var(--gv-accent); }
  .gv .gv-table tbody tr.gv-row-altered th { box-shadow:none; }
  .gv .gv-table tbody th { grid-column:1 / -1; padding:0 0 6px; border-bottom:1px solid var(--gv-line); font-size:.92rem; }
  .gv .gv-table tbody td { display:grid; gap:2px; padding:0; border:0; font-size:.86rem; }
  .gv .gv-table tbody td::before { content:attr(data-col); font-size:.72rem; font-weight:800; color:var(--gv-muted); }
  .gv .gv-table tbody td[data-col="Estado"] { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:4px; }
}

.gv .gv-report-hero { display:flex; flex-wrap:wrap; align-items:center; gap:12px; background:var(--gv-cream); }
.gv .gv-ring { position:relative; flex:none; width:94px; height:94px; }
.gv .gv-ring svg { width:100%; height:100%; fill:none; stroke-width:7; }
.gv .gv-ring-track { stroke:var(--gv-line); }
.gv .gv-ring-fill { stroke:var(--gv-wine); }
.gv .gv-ring b { position:absolute; inset:0; display:grid; align-content:center; justify-items:center; font-size:1.65rem; line-height:1; color:var(--gv-wine); }
.gv .gv-ring small { font-size:.75rem; margin-top:3px; }
.gv .gv-lumi { width:48px; height:48px; object-fit:contain; margin-left:auto; }
.gv .gv-detail { padding:0; overflow:visible; }
.gv .gv-detail>summary { min-height:46px; padding:12px 14px; font-weight:800; cursor:pointer; border-radius:16px; color:var(--gv-ink); }
.gv .gv-detail>div { padding:2px 14px 14px; }
.gv .gv-items li,.gv .gv-timeline li { padding:10px 0; border-top:1px solid var(--gv-line); }
.gv .gv-items li p,.gv .gv-timeline time { color:var(--gv-muted); }
.gv .gv-list { padding-inline-start:22px; }
.gv .gv-list li+li { margin-top:6px; }
.gv .gv-debrief { gap:22px; }
.gv .gv-debrief .gv-summary { gap:6px; }
.gv .gv-pearls ul { display:grid; gap:12px; list-style:none; padding:0; }
.gv .gv-pearls li { border-left:3px solid var(--gv-wine); padding-left:12px; }
.gv .gv-pearls strong { display:block; margin-bottom:2px; color:var(--gv-wine); font-size:.86rem; }
.gv .gv-timeline li { display:grid; grid-template-columns:minmax(64px,auto) 1fr; gap:12px; }
.gv .gv-timeline time { font-variant-numeric:tabular-nums; font-weight:800; }
.gv .gv-tree { min-width:0; }
.gv .gv-node { display:grid; gap:2px; padding:12px 15px; min-width:0; width:fit-content; border:1px solid var(--gv-line); border-left:4px solid currentColor; border-radius:12px; color:var(--gv-wine); background:var(--gv-tint); }
.gv .gv-node small { font-weight:800; }
.gv .gv-node-accion { color:var(--gv-ink); background:var(--gv-cream); }
.gv .gv-node-resultado { color:var(--gv-ok); background:var(--gv-mint); }
.gv .gv-node-atencion { color:var(--gv-ochre); background:var(--gv-gold); }
.gv .gv-branches { display:grid; list-style:none; min-width:0; margin:0 0 0 6px; padding:0 0 0 10px; border-left:2px solid var(--gv-line); }
.gv .gv-edge { display:block; padding:8px 0; color:var(--gv-muted); font-size:.85rem; font-weight:800; }
.gv .gv-edge b { color:var(--gv-wine); }

@media(min-width:720px) and (min-height:440px) {
  .gv .gv-top { padding-inline:max(28px,calc((100% - 1200px)/2)); }
  .gv .gv-steps { font-size:.85rem; }
  .gv .gv-steps i { width:21px; }
  .gv .gv-split {
    --gv-vig-w:clamp(260px,39%,520px);
    grid-template-columns:var(--gv-vig-w) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr);
  }
  .gv .gv-split .gv-visual {
    width:var(--gv-vig-w); height:100%; border-bottom:0; border-right:1px solid var(--gv-line);
  }
  .gv .gv-split .gv-sheet { grid-column:2; grid-row:1; }
  .gv[data-phase="scene"] .gv-split .gv-visual { width:100%; height:100%; border-right-color:transparent; }
  .gv[data-phase="scene"] .gv-split .gv-sheet { transform:translate3d(32px,0,0); }
  .gv .gv-sheet { padding:clamp(22px,3vw,40px); }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) { display:grid; grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; }
  .gv .gv-visual .gv-speech { max-height:230px; padding:18px clamp(18px,3vw,32px); border-left:0; border-top:1px solid var(--gv-line); }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-doctor { display:block; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient { width:45%; right:0; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-patient { width:38%; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-companion { width:35%; right:26%; }
  .gv .gv-scenic:not(.gv-split) .gv-sheet { margin-bottom:20px; padding:20px 28px; border-radius:22px; }
  .gv .gv-vitals { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .gv .gv-table { font-size:.93rem; }
  .gv .gv-table td,.gv .gv-table th { padding:10px 12px; }
  .gv .gv-card,.gv .gv-report-hero { padding:20px; }
  .gv .gv-branches { margin-left:12px; padding-left:17px; }
  .gv .gv-lumi { width:86px; height:86px; }
}
@media(max-height:450px) and (min-width:520px) {
  .gv .gv-top { min-height:48px; padding-block:2px; }
  .gv .gv-split {
    --gv-vig-w:32%;
    grid-template-columns:var(--gv-vig-w) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr);
  }
  .gv .gv-split .gv-visual { width:var(--gv-vig-w); height:100%; border-bottom:0; border-right:1px solid var(--gv-line); }
  .gv .gv-split .gv-sheet { grid-column:2; grid-row:1; }
  .gv[data-phase="scene"] .gv-split .gv-visual { width:100%; height:100%; border-right-color:transparent; }
  .gv[data-phase="scene"] .gv-split .gv-sheet { transform:translate3d(24px,0,0); }
  .gv:not([data-phase="scene"]) .gv-split .gv-visual:has(.gv-speech:not([hidden])) { display:flex; flex-direction:column; }
  .gv .gv-split .gv-visual .gv-speech { max-height:64%; }
}
@media(prefers-reduced-motion:reduce) {
  .gv *, .gv *::before, .gv *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}

#clinical-guard-review {
  position:fixed; inset:0; width:min(620px,calc(100% - 24px)); max-width:none; max-height:90vh; max-height:90dvh; overflow:auto;
  overscroll-behavior:contain; padding:clamp(16px,3vw,28px); margin:auto; border:1px solid var(--gv-line); border-radius:18px;
  box-shadow:0 12px 40px rgb(10 6 7 / 32%); color:var(--gv-ink); background:var(--gv-paper);
}
#clinical-guard-review::backdrop { background:rgb(43 27 25 / 65%); }
#clinical-guard-review h2 { margin:0 0 14px; color:var(--gv-ink); }
#clinical-guard-review label { display:grid; gap:6px; font-weight:800; color:var(--gv-ink); }
#clinical-guard-review input[type="search"] { min-height:46px; width:100%; border:1px solid var(--gv-control-line); border-radius:10px; background:var(--gv-raised); color:var(--gv-ink); padding:10px 12px; font:inherit; }
#clinical-guard-review [role="status"] { color:var(--gv-muted); margin:10px 0; }
#clinical-guard-review .b-lesson-modes { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin:10px 0 16px; }
#clinical-guard-review button { min-width:44px; min-height:44px; color:var(--gv-ink); background:var(--gv-white); border:1px solid var(--gv-control-line); border-radius:10px; padding:9px 12px; font:inherit; cursor:pointer; }
#clinical-guard-review .b-lesson-mode { width:100%; text-align:start; }
#clinical-guard-review .b-lesson-mode * { color:inherit; }
#clinical-guard-review button:disabled { opacity:1; color:var(--gv-disabled); background:var(--gv-ash); }
#clinical-guard-review :is(button,input):focus-visible { outline:3px solid var(--gv-focus); outline-offset:2px; }
@media(hover:hover) { #clinical-guard-review button:hover:not(:disabled) { color:var(--gv-ink); background:var(--gv-hover); } }
.gv .gv-option .gv-response { display:block; font-size:.9rem; font-weight:400; margin-top:6px; color:var(--gv-muted); }
.gv .gv-option .gv-response .gv-mark { color:var(--gv-wine); }
#clinical-guard-v2 img:is(.gv-patient,.gv-companion)[src$="/paciente-juego.png"],
#clinical-guard-v2 img:is(.gv-patient,.gv-companion)[src$="/paciente-juego.webp"] { scale:-1 1; }
.gv .gv-priority.gv-urgent { color:var(--gv-ochre); background:var(--gv-gold); }
.gv .gv-priority.gv-critical { color:var(--gv-on-accent); background:var(--gv-accent); }
.gv .gv-card figcaption a { display:inline-flex; align-items:center; min-height:44px; color:var(--gv-wine); text-decoration:underline; }
.gv .gv-card figcaption a:focus-visible { outline:3px solid var(--gv-focus); outline-offset:2px; }
.gv .lce-ecg { display:grid; gap:10px; min-width:0; }
.gv .lce-ecg-meta { display:flex; flex-wrap:wrap; gap:8px; color:var(--gv-muted); font-size:.8rem; }
.gv .lce-ecg-paper { overflow:hidden; border:1px solid var(--gv-line); border-radius:10px; background:#fff9f4; color:#362522; }
.gv .lce-ecg-lead { position:relative; }
.gv .lce-ecg-lead>b { position:absolute; z-index:1; left:6px; top:5px; padding:1px 5px; border-radius:4px; color:#362522; background:#fff9f4e6; font-size:.82rem; }
.gv .lce-ecg-svg { display:block; width:100%; height:auto; }

.gv[data-stage="entrada"] .gv-scenic .gv-sheet {
  position:absolute; inset:0; place-self:stretch; margin:0; width:100%; height:100%; max-height:none; border:0; border-radius:0;
  padding:clamp(14px,3vw,32px); overflow:visible; pointer-events:none; background:transparent;
}
.gv[data-stage="entrada"] .gv-paper { height:100%; max-width:1000px; align-content:space-between; justify-items:start; gap:8px; }
.gv[data-stage="entrada"] h1 {
  max-width:min(29ch,100%); padding:9px 14px; border-radius:14px; border:1px solid var(--gv-line);
  color:var(--gv-ink); background:var(--gv-paper); font-size:clamp(1.15rem,2.8vw,1.8rem); text-align:start;
}
.gv[data-stage="entrada"] .gv-paper>.gv-button { justify-self:end; width:auto; pointer-events:auto; }
.gv .gv-wait::before { content:""; position:absolute; z-index:1; inset:0; background:rgb(19 16 17 / 76%); pointer-events:none; }
.gv .gv-scenic.gv-wait .gv-sheet {
  z-index:1; place-self:center; width:min(420px,calc(100% - 28px)); max-height:calc(100% - 24px);
  margin:0; padding:0; border:1px solid var(--gv-line); border-radius:22px; scrollbar-gutter:auto;
  box-shadow:0 12px 45px rgb(10 6 7 / 38%);
}
.gv .gv-study-card,.gv .gv-arrival { display:grid; justify-items:center; gap:8px; padding:clamp(16px,3vw,28px); text-align:center; }
.gv .gv-study-card { animation:gv-card-in .22s ease-out both; }
@keyframes gv-card-in { from { opacity:.35; translate:0 6px; } to { opacity:1; translate:0 0; } }
.gv .gv-study-count { color:var(--gv-muted); font-size:.8rem; font-weight:800; }
.gv .gv-study-art {
  width:min(100%,228px); height:clamp(80px,20dvh,170px); display:grid; place-items:center;
  border:1px solid var(--gv-line); border-radius:16px; background:var(--gv-cream); overflow:hidden;
}
.gv .gv-study-art img { display:block; height:100%; width:100%; object-fit:contain; }
.gv .gv-study-art img[data-fallback] { padding:14px; }
.gv .gv-study-card h1 { margin-top:4px; font-size:clamp(1rem,3.8vw,1.2rem); letter-spacing:-.015em; line-height:1.25; text-wrap:pretty; }
.gv .gv-study-name { color:var(--gv-muted); font-size:.88rem; line-height:1.3; }
.gv .gv-clock {
  justify-self:stretch; display:grid; gap:2px; justify-items:center; align-content:center; margin:5px 0 2px;
  padding:9px 12px; border-radius:12px; color:var(--gv-on-accent); background:var(--gv-accent-deep);
}
.gv .gv-clock small { font-size:.8rem; font-weight:700; }
.gv .gv-clock b { font-size:clamp(1.85rem,6vw,2.45rem); line-height:1.1; font-variant-numeric:tabular-nums; }
.gv .gv-study-card .gv-button,.gv .gv-arrival .gv-button { justify-self:stretch; width:100%; }
.gv .gv-arrival { gap:12px; }
.gv .gv-arrival h1 { font-size:clamp(1.55rem,4.5vw,2rem); }
.gv .gv-arrival-delay { color:var(--gv-wine); font-weight:800; }
.gv .gv-dial {
  width:62px; height:62px; margin:2px 0 3px; position:relative; border:4px solid var(--gv-wine);
  background:var(--gv-tint); border-radius:50%;
}
.gv .gv-dial::before,.gv .gv-dial::after { content:""; position:absolute; left:50%; bottom:50%; width:3px; height:31%; border-radius:3px; transform-origin:50% 100%; background:var(--gv-wine); transform:translateX(-50%) rotate(32deg); }
.gv .gv-dial::after { height:23%; transform:translateX(-50%) rotate(-69deg); }
@media(max-height:460px) {
  .gv .gv-scenic.gv-wait .gv-sheet { max-height:calc(100% - 12px); }
  .gv .gv-study-card,.gv .gv-arrival { padding:12px; gap:4px; }
  .gv .gv-study-art { height:64px; }
  .gv .gv-dial { width:38px; height:38px; }
}

/* 2026-12-04 (Richard): coherencia de escala. Un niño o un lactante nunca se ve más grande que la médica o su madre. */
.gv .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:30%; }
.gv .gv-with-companion .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:27%; right:4%; }
.gv .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:24%; }
.gv .gv-with-companion .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:21%; right:6%; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:70%; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:43%; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:58%; }
.gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:36%; }
@media(min-width:720px) and (min-height:440px) {
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:32%; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-cast>.gv-patient.gv-child:not(.gv-bed) { width:27%; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:26%; }
  .gv:not([data-phase="scene"]) .gv-visual:has(.gv-speech:not([hidden])) .gv-with-companion .gv-cast>.gv-patient.gv-infant:not(.gv-bed) { width:22%; }
}
