:root {
  --tinta: #1F1D1B; --texto: #46433D; --suave: #6E6A60; --papel: #FBF8F0; --papel-2: #F4EFE2; --linea: #CFC7B4;
  --cuadricula: rgba(54,104,138,.16); --manila: #E2CF9E; --manila-osc: #D3BC83; --manila-borde: #B99C5F;
  --carbon: #28337A; --grafito: #4F5259; --escritorio: #283029; --crespon: #141414;
  --f-maquina: 'Special Elite', 'Courier Prime', 'Courier New', monospace; --f-texto: 'Courier Prime', 'Courier New', monospace; --f-form: 'IBM Plex Sans Condensed', 'Arial Narrow', Arial, sans-serif;
  --f-logo: 'Big Shoulders Display', 'Arial Narrow', sans-serif; --f-lapiz: 'Caveat', 'Comic Sans MS', cursive; --f-cartel: 'Bungee', 'Big Shoulders Display', sans-serif;
}
/* ENIGMARIO · juego en línea · «Expediente confidencial»: una carpeta abierta sobre la mesa */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body.juego { margin: 0; min-height: 100vh; color: var(--tinta); font-family: var(--f-form); font-size: 15px; line-height: 1.35;
  background-color: var(--escritorio);
  background-image: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.06), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

/* Sellos de goma */
.sello { display: inline-block; font-family: var(--f-logo); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; line-height: 1;
  color: var(--sello, var(--acento)); border: 2.5px solid currentColor; border-radius: 4px; padding: 4px 8px 3px; outline: 1px solid currentColor;
  outline-offset: 2px; filter: url(#tinta-sello); mix-blend-mode: multiply; white-space: nowrap; }

/* Barra de la mesa */
.barra { display: flex; align-items: center; gap: 14px; padding: 8px 20px 0; min-height: 50px; color: #F2EDE0; }
.barra :focus-visible { outline-color: #F2EDE0; }
.volver { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #F2EDE0;
  border: 1.5px solid rgba(242,237,224,.45); flex-shrink: 0; }
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.marca .linea { font-family: var(--f-maquina); font-size: 13px; letter-spacing: .14em; color: var(--tinta); background: var(--papel);
  padding: 4px 8px 3px; transform: rotate(-1.5deg); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.titulo-movil { display: none; }
.barra .der { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-barra { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1.5px solid rgba(242,237,224,.38); color: #F2EDE0;
  border-radius: 4px; padding: 6px 12px 6px 9px; font-weight: 600; font-size: 14px; min-height: 38px; white-space: nowrap; }
.btn-barra:hover { background: rgba(255,255,255,.08); }
.reloj { position: relative; display: flex; align-items: baseline; gap: 8px; background: var(--papel); color: var(--tinta); padding: 6px 12px 5px 26px;
  border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.4); min-height: 38px; }
.reloj::before { content: ""; position: absolute; left: 9px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--escritorio); }
.reloj .et { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.reloj b { font-family: var(--f-maquina); font-weight: 400; font-size: 21px; line-height: 1; min-width: 48px; }
@media (max-width: 1279px) { .btn-barra.borron span { display: none; } .btn-barra.borron { padding: 6px 8px; } }

/* La carpeta abierta */
.carpeta { position: relative; margin: 6px 16px 18px; padding: 14px 14px 16px; border-radius: 3px 10px 10px 10px;
  background-color: var(--manila);
  background-image: repeating-linear-gradient(96deg, rgba(120,90,40,.035) 0 2px, transparent 2px 7px), linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.05));
  box-shadow: 0 14px 34px rgba(0,0,0,.5), inset 0 0 0 1px rgba(110,80,30,.25);
  display: flex; gap: 24px; align-items: flex-start;
  --plano: clamp(400px, min(100vw - 660px, max(100vh - 214px, 560px)), 760px); }   /* 1366×800 → 586 px: cabe la bitácora */
@media (min-width: 1700px) { .carpeta { max-width: 1640px; margin-left: auto; margin-right: auto; } .barra { max-width: 1672px; margin: 0 auto; } }
.pestana-exp { position: absolute; left: 320px; bottom: 100%; height: 34px; max-width: calc(100% - 820px); min-width: 0; padding: 5px 14px 0;
  background: var(--manila); border-radius: 9px 9px 0 0; display: flex; align-items: center; gap: 12px;
  box-shadow: inset 1px 1px 0 rgba(110,80,30,.25), inset -1px 0 0 rgba(110,80,30,.25); }
.pestana-exp .rot { display: flex; align-items: baseline; gap: 7px; min-width: 0; background: var(--papel); padding: 3px 10px 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08); white-space: nowrap; }
.pestana-exp .rot small { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.pestana-exp .num { font-family: var(--f-cartel); font-weight: 400; font-size: 15px; color: var(--acento); letter-spacing: .02em; }
.pestana-exp .tit { font-family: var(--f-maquina); font-size: 15px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pestana-exp .conf { font-size: 14px; padding: 3px 7px 2px; flex-shrink: 0; }
@media (max-width: 1279px) { .pestana-exp .conf { display: none; } .pestana-exp { left: 280px; max-width: calc(100% - 560px); } }
.col-izq { flex: 0 0 auto; width: calc(var(--plano) + 24px); display: flex; flex-direction: column; min-width: 0; }
.col-der { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.col-der::before { content: ""; position: absolute; left: -13px; top: -14px; bottom: -16px; width: 3px;
  background: linear-gradient(90deg, rgba(90,62,20,.25), rgba(255,255,255,.25)); }
.fichero-fijo, .pie-movil { display: none; }

/* Pestañas de archivador: qué hace un toque en el croquis */
.pestanas-fila { display: flex; align-items: flex-end; gap: 8px; height: 42px; padding-left: 6px; position: relative; z-index: 2; }
.pestanas { display: flex; align-items: flex-end; gap: 3px; flex: 1 1 auto; min-width: 0; height: 100%; }
.pestana { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; gap: 7px; height: 37px; padding: 3px 8px 2px 9px; text-align: left;
  background: #E9E2CF; border: 1px solid rgba(80,60,20,.3); border-bottom: 0; border-radius: 7px 7px 0 0; color: var(--texto);
  box-shadow: inset 0 -6px 8px -6px rgba(0,0,0,.18); touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.pestana .tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.08; }
.pestana b { font-weight: 700; font-size: 15px; }
.pestana small { font-size: 11.5px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pestana:hover { background: #F0EADA; }
.pestana[aria-pressed="true"] { height: 42px; background: var(--papel); color: var(--tinta); box-shadow: none; }
.pestana[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 5px; background: var(--papel); }
.pestana[aria-pressed="true"] b, .pestana[aria-pressed="true"] .ico { color: var(--acento); }
.pestana:focus-visible { outline-offset: -3px; }
.corrector { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; background: var(--papel); color: var(--tinta);
  border: 1.5px solid var(--tinta); border-radius: 999px; padding: 4px 12px 4px 8px; font-weight: 600; font-size: 14px; min-height: 36px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.corrector[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
/* Croquis angosto (tableta apaisada, ventana chica: el croquis mide menos de 560 px): el ícono sobre la palabra, sin la ayuda */
@media (min-width: 1000px) and (max-width: 1219px) {
  .pestana { flex-direction: column; justify-content: center; gap: 1px; padding: 3px 2px 2px; text-align: center; }
  .pestana .tx { align-items: center; }
  .pestana small { display: none; }
  .pestana b { font-size: 14px; }
}

/* Hoja de escena: papel cuadriculado con el croquis */
.hoja-escena, .inventario { background-color: var(--papel);
  background-image: linear-gradient(rgba(54,104,138,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(54,104,138,.2) 1px, transparent 1px),
    linear-gradient(rgba(54,104,138,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(54,104,138,.1) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px; background-position: -1px -1px; }
.hoja-escena { position: relative; padding: 4px 12px 6px; box-shadow: 0 2px 6px rgba(0,0,0,.25); border-radius: 2px 2px 0 0; }
.form-cab { display: flex; align-items: baseline; gap: 14px; padding-bottom: 3px; border-bottom: 1.5px solid var(--tinta); margin-bottom: 2px; min-width: 0; }
.form-cab .tit { font-family: var(--f-maquina); font-weight: 400; font-size: 16px; letter-spacing: .04em; line-height: 1; white-space: nowrap; }
.campo { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.campo .et { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.campo .val { font-family: var(--f-maquina); font-size: 14px; border-bottom: 1px solid rgba(31,29,27,.25); padding: 0 2px; }
.form-cab .nota { margin-left: auto; min-width: 0; font-size: 12px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tablero { position: relative; }
.lienzo { position: relative; container-type: inline-size; }
.lienzo > svg { display: block; width: 100%; height: auto; }
.lienzo svg text.coord { font-family: var(--f-maquina); font-size: 14px; fill: var(--tinta); }
.capa, .rotulos { position: absolute; display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); }
/* Los nombres de las habitaciones van por encima de las fichas; los apuntes, debajo del nombre. Son etiquetas de papel
   (la misma pieza que la hoja impresa y la web). La letra sale del lado de la casilla (--k, elegida en Python para que
   el nombre entre en una o dos líneas): nada se recorta, así las tildes y la Ñ siempre se ven */
.rotulos { pointer-events: none; z-index: 4; }
.rotulos span { position: relative; min-width: 0; }
.rotulos b { position: absolute; left: 2px; top: 2px; max-width: calc(100% - 4px); font-family: var(--f-logo); font-weight: 800;
  font-size: min(13px, calc(95cqw / var(--n) * var(--k, .19))); letter-spacing: .02em; line-height: 1.2; text-transform: uppercase;
  color: var(--tinta); background: var(--papel); border: 1px solid rgba(31,29,27,.5); border-radius: 1.5px; padding: 1px 3px; }
.casilla { appearance: none; -webkit-appearance: none; border: 0; padding: 0; margin: 0; background: transparent; position: relative; cursor: pointer;
  touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; min-width: 0; }
@media (hover: hover) { .casilla:hover { background: rgba(31,29,27,.06); } }
.casilla:focus-visible { outline: 3px solid var(--tinta); outline-offset: -3px; z-index: 3; background: rgba(31,29,27,.07); }
.casilla.resalta { box-shadow: inset 0 0 0 4px var(--acento); animation: latido .9s ease-in-out 3; z-index: 2; }
.casilla.sacude { animation: sacude .3s; }
@keyframes latido { 50% { box-shadow: inset 0 0 0 7px var(--acento); } }
@keyframes sacude { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* Tachado automático de fila y columna: un × de lápiz tenue, chico, al centro */
.tache { position: absolute; left: 50%; top: 50%; width: 24%; height: 24%; transform: translate(-50%, -50%); pointer-events: none; }
.tache svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tache path { stroke: var(--grafito); stroke-opacity: .55; stroke-width: 1.3px; stroke-linecap: round; fill: none; vector-effect: non-scaling-stroke; }
/* Descartar: sello ✕ en el color del block */
.descarte { position: absolute; inset: 17%; display: flex; color: var(--acento); filter: url(#tinta-sello); transform: rotate(-7deg); pointer-events: none; }
.descarte svg { width: 100%; height: 100%; }
/* Apuntes: fichas sólidas en el color del block con la inicial en blanco */
.notas { position: absolute; z-index: 3; inset: 3px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; pointer-events: none; }
.notas b { font-family: var(--f-form); font-weight: 700; font-size: clamp(10px, calc(95cqw / var(--n) * .2), 16px); line-height: 1; color: #FFF;
  background: var(--acento); border-radius: 3px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--papel); }
.notas b.hecha { opacity: .45; }
.casilla.con-rotulo .notas { top: 40%; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
.casilla.con-rotulo.dos .notas { top: 60%; }
/* Persona ubicada: foto carné con clip y nombre */
.ficha { position: absolute; left: 50%; top: 53%; z-index: 2; transform: translate(-50%, -50%) rotate(var(--r, -2deg)); display: flex; flex-direction: column;
  align-items: center; background: #FFF; padding: 2px 2px 1px; box-shadow: 0 2px 3px rgba(0,0,0,.35); pointer-events: none;
  min-width: calc(95cqw / var(--n) * .6); }
.ficha .foto { position: relative; display: block; width: calc(95cqw / var(--n) * .56); aspect-ratio: 72 / 84; overflow: hidden; }
.ficha .foto svg.retr { width: 100%; height: 100%; display: block; }
.ficha .crespon { position: absolute; right: 0; top: 0; width: 36%; height: auto; }
/* El nombre entero, sin puntos suspensivos: la letra se achica si el nombre es largo (--a: su ancho en em, de jugar.js) */
.ficha .nom { font-weight: 700; font-size: clamp(5.5px, calc((95cqw / var(--n) - 8px) / var(--a, 5)), max(8px, calc(95cqw / var(--n) * .125)));
  letter-spacing: .05em; text-transform: uppercase; line-height: 1.2; white-space: nowrap; max-width: calc(95cqw / var(--n) - 4px); }
.ficha .clip { position: absolute; top: -9px; right: 3px; width: 8px; height: auto; }
.ficha.sel { outline: 2.5px dashed var(--acento); outline-offset: 2px; transform: translate(-50%, -50%) rotate(0deg) scale(1.05); box-shadow: 0 5px 9px rgba(0,0,0,.35); }
.ficha.choque { outline: 3px solid var(--acento); outline-offset: 1px; animation: sacude .3s; }
.ficha.choque::before { content: "¡OJO!"; position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 3px); background: var(--acento); color: #FFF;
  font-family: var(--f-logo); font-weight: 900; font-size: 10px; letter-spacing: .08em; padding: 1px 4px 0; line-height: 1.2; }
/* Bitácora bajo el croquis */
.bitacora { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; padding: 4px 0 1px;
  border-top: 1px dashed rgba(31,29,27,.3); margin-top: 4px; }
.info { flex: 1 1 260px; margin: 0; font-family: var(--f-texto); font-size: 14px; line-height: 1.3; min-height: 2.6em; min-width: 0; }
.info::before { content: "▸ "; }
.info.error::before { content: "✕ "; color: var(--acento); font-weight: 700; }
.info.bien::before { content: "✓ "; color: var(--acento); font-weight: 700; }
.info:focus { outline: none; }
.info .dicho { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* ya se lee en el acta */
.choque { margin: 5px 0 2px; font-weight: 600; font-size: 14px; color: var(--acento); background: var(--acento-t); border: 2px solid var(--acento); padding: 4px 9px; }
.choque:empty { display: none; }
.inventario { padding: 5px 12px 8px; border-top: 1.5px dashed rgba(31,29,27,.35); box-shadow: 0 4px 6px rgba(0,0,0,.22); border-radius: 0 0 2px 2px; }
.inventario h3 { margin: 0 0 3px; display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--suave); }
.inventario h3 small { font-size: 10px; letter-spacing: .06em; font-weight: 600; text-transform: none; }
.inventario .grupo { display: flex; align-items: flex-start; gap: 4px; }
.inventario .grupo + .grupo { margin-top: 2px; }
.inventario .et { flex: 0 0 76px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 5px; padding-top: 2px; }
.inventario ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.inventario li { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-maquina); font-size: 13px; white-space: nowrap; }
.inventario .ic svg { display: block; height: 18px; width: auto; }
.muestra { width: 13px; height: 13px; border: 1px solid var(--tinta); display: inline-block; background: #FFF; }
.muestra.rayada { background: repeating-linear-gradient(45deg, #FFF 0 2px, rgba(31,29,27,.55) 2px 3.2px); }
/* Escritorio: el inventario en un bloque corrido bajo la bitácora (el título y «bloquea» en la misma línea) */
@media (min-width: 1000px) {
  .inventario { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 18px; padding: 4px 12px 6px; }
  .inventario h3 { margin: 0; }
  .inventario h3 small { display: none; }
  .inventario .grupo { align-items: center; }
  .inventario .grupo + .grupo { margin-top: 0; }
  .inventario .et { flex: 0 0 auto; padding: 0 6px 0 0; }
}

/* Acta de declaraciones: papel bond perforado; cada fila es una ficha que se toma */
.acta { position: relative; background: var(--papel); padding: 10px 14px 8px 44px; box-shadow: 0 3px 8px rgba(0,0,0,.25); border-radius: 2px; }
.acta::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 16px;
  background: radial-gradient(circle, var(--manila-osc) 5px, rgba(60,40,10,.35) 5.6px, transparent 6.6px) 0 64px / 16px 150px repeat-y; }
.acta::after { content: ""; position: absolute; left: 33px; top: 0; bottom: 0; width: 4px; border-left: 1px solid var(--acento); border-right: 1px solid var(--acento); opacity: .35; }
.acta-cab { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1.5px solid var(--tinta); padding-bottom: 6px; }
.acta-cab h2 { margin: 0 auto 0 0; font-family: var(--f-maquina); font-weight: 400; font-size: 21px; line-height: 1; letter-spacing: .03em; }
.acta-cab h2 small { display: block; font-family: var(--f-form); font-size: 12px; color: var(--suave); letter-spacing: 0; margin-top: 4px; }
.nivel { display: flex; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--texto); flex-wrap: wrap; justify-content: flex-end; }
.nivel-c { display: inline-flex; align-items: center; gap: 4px; }
.nivel-c.si { color: var(--tinta); }
.relato { margin: 5px 0 2px; font-family: var(--f-texto); font-size: 13px; line-height: 1.28; }
.relato .et, .tabla-cab span { font-family: var(--f-form); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.relato .et { margin-right: 7px; }
.tabla-cab, .decl { display: grid; grid-template-columns: 22px 34px minmax(92px, 128px) minmax(0, 1fr) 56px; column-gap: 10px; align-items: center; }
.tabla-cab { padding: 4px 6px 2px; border-bottom: 1px solid var(--tinta); }
.tabla-cab span:last-child { text-align: center; }
.declaraciones { list-style: none; margin: 0; padding: 0; }
.declaraciones li { border-bottom: 1px dashed rgba(31,29,27,.22); }
.declaraciones li:last-child { border-bottom: 0; }
.decl { width: 100%; background: none; border: 0; text-align: left; padding: 3px 6px; min-height: 46px; position: relative; color: var(--tinta); }
.decl:hover { background: rgba(31,29,27,.04); }
.decl:focus-visible { outline-offset: -2px; }
.decl .num { font-family: var(--f-maquina); font-size: 14px; color: var(--suave); }
.decl .foto-carne { width: 34px; height: 40px; }
.foto-carne { position: relative; display: block; width: 40px; height: 47px; background: #FFF; padding: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.3); flex-shrink: 0; }
.foto-carne svg.retr { width: 100%; height: 100%; display: block; }
.foto-carne .crespon { position: absolute; right: 2px; top: 2px; width: 40%; height: auto; }
/* Los textos, a 6 px de las rayas (la víctima o un rol largo dan filas altas: el nombre no toca la raya de arriba) */
.decl .quien { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 2px; padding: 3px 0; }
.decl .nom { font-family: var(--f-maquina); font-size: 15.5px; letter-spacing: .05em; line-height: 1.15; overflow-wrap: anywhere; }
.decl .rol { font-size: 12.5px; color: var(--suave); line-height: 1.1; }
/* «En mano»: en la columna Casilla, sobre la raya (o el sello) */
.decl .mano { display: none; font-family: var(--f-logo); font-weight: 900; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #FFF;
  background: var(--acento); padding: 1px 4px 0; line-height: 1.25; white-space: nowrap; }
.decl[aria-pressed="true"] .mano { display: inline-block; }
.decl .dijo { font-family: var(--f-texto); font-size: 13.5px; line-height: 1.24; padding: 3px 0; }
.decl .cas { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 3px 0; }
.decl .cas .vacio { width: 40px; border-bottom: 1px solid var(--suave); height: 18px; }
.decl .sello-cas { font-size: 17px; letter-spacing: .06em; padding: 3px 6px 2px; transform: rotate(-5deg); }
.decl[aria-pressed="true"] { background: var(--acento-t); box-shadow: inset 3px 0 0 var(--acento); }
.decl[aria-pressed="true"] .nom { color: var(--acento); }
.decl .clip { position: absolute; left: 36px; top: 1px; width: 11px; height: auto; transform: rotate(8deg); display: none; z-index: 1; }
.decl[aria-pressed="true"] .clip { display: block; }
.decl.victima .marca-v { font-family: var(--f-logo); font-weight: 900; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #FFF;
  background: var(--crespon); padding: 1px 5px 0; line-height: 1.25; }
.decl.victima .dijo { font-family: var(--f-form); font-size: 13.5px; color: var(--texto); font-style: italic; }
.decl.victima .unico { font-style: normal; font-weight: 600; }
.nota-det { display: block; margin-top: 3px; padding: 2px 7px; font-family: var(--f-texto); font-style: normal; color: var(--tinta);
  background: var(--papel-2); border-left: 3px solid var(--tinta); }

/* Despacho: el memo «¡Psst! El dato» (papel carbón) y el dictamen */
.despacho { display: flex; gap: 14px; align-items: stretch; }
.memo { position: relative; flex: 1 1 0; min-width: 0; background: #F3F1EC; color: var(--carbon); padding: 8px 14px 9px 16px; transform: rotate(-.4deg);
  box-shadow: 0 3px 7px rgba(0,0,0,.28); border-top: 3px solid var(--carbon); }
.memo > .clip { position: absolute; left: 16px; top: -18px; width: 12px; height: auto; }
.memo-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-bottom: 1px solid rgba(40,51,122,.4); padding-bottom: 4px; min-height: 30px; }
.memo-cab .tipo { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin: 0 auto 0 18px; white-space: nowrap; }
.memo-cab .psst { font-family: var(--f-logo); font-weight: 900; font-size: 17px; letter-spacing: .06em; color: var(--acento); margin-right: 2px; }
.memo-cab .nro:not(:empty)::before { content: " n.º "; }
.archivar { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid rgba(40,51,122,.45); color: var(--carbon);
  border-radius: 3px; padding: 3px 8px; font-size: 12.5px; font-weight: 600; min-height: 30px; white-space: nowrap; }
.memo .asunto { margin: 6px 0 3px; font-size: 12px; }
.memo .asunto b { font-family: var(--f-maquina); font-weight: 400; font-size: 16px; }
.memo .asunto b:focus { outline: none; }
.memo p.tx { margin: 0; font-family: var(--f-texto); font-size: 14px; line-height: 1.33; }
.memo p.tx b { font-weight: 700; }
.memo .vacio-tx { display: none; margin-top: 8px !important; }
.memo.vacio .memo-cuerpo, .memo.vacio .archivar, .memo.vacio .nro { display: none; }
.memo.vacio .vacio-tx { display: block; }
.memo .cc { margin: 6px 0 0; text-align: right; font-size: 10.5px; letter-spacing: .06em; opacity: .7; }
.memo .btn-papel { color: var(--carbon); }
.memo .btn-papel.otro { min-height: 30px; padding: 2px 9px 2px 7px; font-size: 13px; white-space: nowrap; }
.btn-papel { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--papel); color: var(--tinta); border: 1.5px solid currentColor;
  border-radius: 3px; padding: 5px 12px 5px 9px; font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 rgba(0,0,0,.15); min-height: 40px; text-decoration: none; }
.btn-papel:active { transform: translateY(1px); box-shadow: none; }
.btn-papel .ico { width: 18px; height: 18px; }
.btn-papel.fuerte { background: var(--acento); color: #FFF; border-color: var(--acento); }
.dictamen { flex: 0 0 244px; min-width: 0; background: var(--papel); padding: 8px 14px 10px; box-shadow: 0 3px 7px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 6px; }
.dictamen h3 { margin: 0; font-family: var(--f-maquina); font-weight: 400; font-size: 21px; line-height: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.dictamen h3 span { color: var(--acento); white-space: nowrap; }
.dictamen h3 small { font-family: var(--f-form); font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--suave); white-space: nowrap; }
.dictamen .preg { margin: 0; font-family: var(--f-texto); font-size: 13.5px; line-height: 1.25; }
.acciones-dict { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-top: auto; }
.avance { width: 100%; margin: 0; display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--texto); }
.avance .et { display: none; }
.avance .cajas { display: flex; gap: 3px; }
.avance i { width: 13px; height: 13px; border: 1.3px solid var(--tinta); background: #FFF; }
.avance i.si { background: var(--tinta); }
.avance .vas { margin-left: auto; font-family: var(--f-maquina); font-weight: 400; font-size: 14.5px; color: var(--tinta); white-space: nowrap; }
.btn-dato { display: none; }
.acusar { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--papel); color: var(--acento);
  border: 3px double currentColor; border-radius: 4px; padding: 4px 8px 3px; min-height: 50px; }
.acusar b { font-family: var(--f-logo); font-weight: 900; font-size: 23px; letter-spacing: .16em; line-height: 1; display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; }
.acusar small { font-size: 12px; font-weight: 600; color: var(--suave); }
.acusar[aria-disabled="true"] { color: #9C9A92; cursor: not-allowed; }
.acusar.listo { background: var(--acento); color: #FFF; border-color: #FFF; box-shadow: 0 0 0 2px var(--acento), 0 3px 8px rgba(0,0,0,.3); animation: aparece .25s ease-out; }
.acusar.listo small { color: #FFF; }
@keyframes aparece { from { transform: translateY(8px); opacity: 0; } }

/* Diálogos: papeles sobre la mesa */
dialog { border: 0; padding: 0; background: transparent; color: var(--tinta); max-width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: rgba(20,24,22,.66); }
.dlg-papel { position: relative; background: var(--papel); padding: 20px 24px 20px 26px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.dlg-papel h2 { margin: 0 0 4px; padding-right: 48px; font-family: var(--f-maquina); font-weight: 400; font-size: 26px; line-height: 1.1; }
.dlg-papel .sub { margin: 0 0 12px; font-size: 14px; color: var(--texto); }
.dlg-papel h3 { font-family: var(--f-maquina); font-weight: 400; font-size: 18px; margin: 16px 0 6px; border-bottom: 1px solid var(--tinta); padding-bottom: 3px; }
.cerrar-x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--tinta); background: var(--papel);
  display: flex; align-items: center; justify-content: center; color: var(--tinta); z-index: 2; }
.articulos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-family: var(--f-texto); font-size: 14.5px; line-height: 1.38; }
.articulos .art { font-family: var(--f-form); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-right: 4px; color: var(--acento); }
.controles { margin: 0; padding: 0 0 0 18px; font-size: 14.5px; line-height: 1.42; }
.controles li + li { margin-top: 3px; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.rueda { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 16px 8px 10px; margin: 6px 0 4px;
  background: repeating-linear-gradient(180deg, transparent 0 21px, rgba(31,29,27,.2) 21px 22px), #E8E6DE; }
.rueda button { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 4px 4px; min-width: 76px; border-radius: 3px; }
.rueda button:hover { background: rgba(255,255,255,.55); }
.rueda .foto-carne { width: 64px; height: 75px; }
.rueda .num { font-family: var(--f-logo); font-weight: 900; font-size: 13px; background: var(--tinta); color: #FFF; padding: 1px 6px; }
.rueda .n { font-family: var(--f-maquina); font-size: 14.5px; background: var(--papel); padding: 1px 6px; }
.fin .dlg-papel { padding: 22px 24px 20px; }
.fin-grid { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: start; }
.fin-foto { margin: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fin-foto > .clip { position: absolute; top: -14px; right: 22px; width: 14px; height: auto; z-index: 1; }
.foto-carne.grande { width: 112px; height: 131px; padding: 4px; transform: rotate(-2deg); box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.fin-foto figcaption { font-family: var(--f-maquina); font-size: 16px; letter-spacing: .04em; }
.fin-foto .cerrado { order: 3; font-size: 22px; line-height: .95; text-align: center; padding: 6px 9px 4px; margin-top: 4px; }
.fin .informe { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--suave); }
.fin h2 { font-size: 30px; color: var(--acento); }
.fin .marcador { margin: 6px 0 8px; font-family: var(--f-maquina); font-size: 16px; }
.fin p.tx { margin: 0; font-family: var(--f-texto); font-size: 15px; line-height: 1.38; }
.fin .informe { padding-right: 44px; }

/* Recorrido guiado: un velo oscuro con un hueco sobre lo que hay que tocar, un marco amarillo que late, una mano que
   señala y una nota que explica. Los velos atajan los toques fuera del hueco; en los pasos que solo explican, «tapa»
   ataja también los del hueco. */
.rec-abrir { flex: none; align-self: center; background: none; border: 0; padding: 2px 0; font-family: var(--f-form); font-weight: 700; font-size: 13.5px;
  color: var(--acento); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.rec-ofrece { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px; background: var(--acento-t);
  border-left: 4px solid var(--acento); font-size: 14px; }
.recorrido { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.recorrido .velo { position: fixed; left: 0; top: 0; width: 0; height: 0; background: rgba(16,20,18,.66); pointer-events: auto; }
.recorrido .velo.tapa { background: transparent; }
.recorrido .foco { position: fixed; border: 3px solid #FFD60A; border-radius: 6px; pointer-events: none; box-shadow: 0 0 0 2px rgba(16,20,18,.5);
  animation: foco-rec 1.4s ease-in-out infinite; }
@keyframes foco-rec { 50% { box-shadow: 0 0 0 6px rgba(255,214,10,.35); } }
.recorrido .foco.llama { animation: llama-rec .5s ease-out 2; }
@keyframes llama-rec { 50% { box-shadow: 0 0 0 12px rgba(255,214,10,.7); } }
.recorrido .mano { position: fixed; width: 46px; height: 46px; margin-left: -23px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #FFD60A; color: var(--tinta); box-shadow: 0 3px 10px rgba(0,0,0,.45); pointer-events: auto; cursor: pointer;
  animation: mano-rec 1s ease-in-out infinite; }
.recorrido .mano .ico { width: 30px; height: 30px; stroke-width: 1.9; }
@keyframes mano-rec { 50% { transform: translateY(7px); } }
.nota-rec { position: fixed; left: 12px; top: 12px; z-index: 2; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  background: var(--papel); color: var(--tinta); padding: 13px 16px 12px; border-top: 5px solid var(--acento); box-shadow: 0 12px 30px rgba(0,0,0,.5);
  pointer-events: auto; }
.nota-rec > .clip { position: absolute; top: -13px; right: 24px; width: 12px; height: auto; }
.rec-cab { margin: 0 0 5px; padding-right: 30px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.nota-rec h2 { margin: 0 0 5px; font-family: var(--f-maquina); font-weight: 400; font-size: 21px; line-height: 1.15; color: var(--acento); }
.nota-rec h2:focus { outline: none; }
.nota-rec .tx { margin: 0; font-family: var(--f-texto); font-size: 15px; line-height: 1.4; }
.nota-rec .tx b { font-weight: 700; }
.rec-botones { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rec-botones #rec-sig { margin-left: auto; }
.rec-leer { background: none; border: 0; padding: 4px 2px; font-size: 13.5px; color: var(--texto); text-decoration: underline; text-underline-offset: 2px; }
body.en-recorrido { overscroll-behavior: none; }
@media (min-width: 600px) and (max-width: 999px), (max-height: 520px) and (min-width: 600px) { .nota-rec { width: min(460px, calc(100vw - 24px)); } }
@media (max-width: 480px), (max-height: 520px) {
  .nota-rec { padding: 10px 13px 10px; }
  .nota-rec h2 { font-size: 18px; margin-bottom: 3px; }
  .nota-rec .tx { font-size: 14px; line-height: 1.33; }
  .rec-botones { margin-top: 9px; }
  .rec-botones .btn-papel { min-height: 36px; padding: 4px 10px; }
}
@media (max-height: 660px) {           /* celulares bajos (360×640, 320×568): la nota, más compacta, para no tapar el croquis */
  .nota-rec { padding: 8px 11px 8px; border-top-width: 4px; }
  .rec-cab { margin-bottom: 2px; font-size: 10px; }
  .nota-rec h2 { font-size: 16.5px; margin-bottom: 2px; }
  .nota-rec .tx { font-size: 13px; line-height: 1.27; }
  .rec-botones { margin-top: 6px; }
  .rec-botones .btn-papel { min-height: 34px; padding: 3px 10px; font-size: 13px; }
}

/* ——— Celular en vertical (o pantalla angosta): fichero fijo arriba, croquis y barra fija abajo ——— */
@media (max-width: 999px) and (orientation: portrait), (max-width: 999px) and (min-height: 561px) {
  html { scroll-padding-top: 160px; scroll-padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  body.juego { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.juego.con-pista { padding-bottom: calc(76px + 42vh + env(safe-area-inset-bottom)); }
  .barra { padding: 6px 10px 2px; gap: 8px; min-height: 52px; }
  .volver { width: 38px; height: 38px; }
  .marca, .btn-barra span, .btn-barra.borron, .pestana-exp { display: none; }
  .titulo-movil { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.08; }
  .titulo-movil b { font-family: var(--f-maquina); font-weight: 400; font-size: 19px; color: #FFF; overflow: hidden;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .titulo-movil span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(242,237,224,.78); white-space: nowrap; margin-top: 2px; }
  .barra .der { gap: 6px; }
  .btn-barra { padding: 0; width: 38px; min-height: 38px; justify-content: center; }
  .reloj { padding: 4px 9px 3px 22px; min-height: 38px; }
  .reloj::before { left: 8px; width: 8px; height: 8px; margin-top: -4px; }
  .reloj .et { display: none; }
  .reloj b { font-size: 19px; min-width: 0; }
  .carpeta { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 4px 6px 8px; padding: 0 6px 10px; border-radius: 8px; }
  .col-izq, .col-der, .despacho { display: contents; }
  .col-der::before { display: none; }
  .fichero-fijo { display: block; order: 1; position: sticky; top: 0; z-index: 15; margin: 0 -6px; padding: 7px 6px 7px; background-color: var(--manila);
    border-radius: 8px 8px 0 0; box-shadow: 0 7px 8px -7px rgba(0,0,0,.45); }
  .pestanas-fila { order: 3; }
  .hoja-escena { order: 4; }
  .acta { order: 6; }
  .inventario { order: 7; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
  .pie-movil { order: 8; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  /* Fichero de fotos: la casilla va escrita en el borde blanco de la foto, sin tapar la cara */
  .fichero { display: grid; grid-template-columns: repeat(var(--np), minmax(0, 1fr)); gap: 3px; }
  .fichero button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px 0 3px; position: relative;
    border-radius: 3px; min-width: 0; }
  .fichero .foto-carne { width: 40px; height: auto; padding: 2px 2px 0; }
  .fichero .foto-carne svg.retr { width: 36px; height: 42px; }
  .fichero .foto-carne .cas { display: block; height: 12px; font-family: var(--f-logo); font-weight: 900; font-size: 11.5px; line-height: 12px;
    letter-spacing: .06em; text-align: center; color: var(--acento); }
  .fichero .n { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
  .fichero button[aria-pressed="true"] { background: var(--papel); box-shadow: 0 2px 4px rgba(0,0,0,.25); }
  .fichero button[aria-pressed="true"] .n { color: var(--acento); }
  .fichero button[aria-pressed="true"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -3px; height: 3px; background: var(--acento); }
  .fichero .victima .n { color: var(--texto); }
  .en-mano { margin-top: 6px; background: var(--papel); padding: 5px 10px 6px; box-shadow: 0 2px 4px rgba(0,0,0,.2); border-left: 3px solid var(--acento); }
  .en-mano .cab { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--suave);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .en-mano .cab .nom { font-family: var(--f-maquina); font-weight: 400; font-size: 16px; letter-spacing: .03em; text-transform: none; color: var(--acento); }
  .en-mano .dijo { margin: 2px 0 0; font-family: var(--f-texto); font-size: 14px; line-height: 1.27; }
  .en-mano.nadie .cab .nom { color: var(--suave); }
  .en-mano.nadie .dijo { font-family: var(--f-form); color: var(--texto); }
  .pestanas-fila { height: 48px; padding-left: 2px; gap: 6px; margin-bottom: -8px; }
  .pestana { height: 42px; padding: 3px 2px 2px; flex-direction: column; justify-content: center; gap: 1px; text-align: center; }
  .pestana[aria-pressed="true"] { height: 48px; }
  .pestana .tx { align-items: center; }
  .pestana small { display: none; }
  .pestana b { font-size: 13.5px; }
  .pestana .ico { width: 20px; height: 20px; }
  .corrector { width: 46px; height: 40px; padding: 0; justify-content: center; }
  .corrector span { display: none; }
  .hoja-escena { padding: 5px 4px 3px; }
  .form-cab { display: none; }
  .tablero { max-width: 640px; margin: 0 auto; }
  .lienzo svg text.coord { font-size: 15px; }
  .ficha .clip { display: none; }
  .bitacora { padding: 4px 2px 1px; margin-top: 3px; }
  .info { font-family: var(--f-form); font-size: 14.5px; min-height: 2.7em; }
  /* El dato: una hoja fija pegada a la barra de abajo (--alto-barra la mide jugar.js: sin rendija), para leerla sin perder
     de vista el croquis. Borde de arriba opaco con sombra; si el texto es largo, se desplaza dentro de la hoja */
  .memo { position: fixed; left: 6px; right: 6px; bottom: var(--alto-barra, calc(67px + env(safe-area-inset-bottom))); z-index: 25; max-height: 42vh;
    display: flex; flex-direction: column; transform: none; padding: 6px 12px 8px; border-top-width: 4px;
    box-shadow: 0 -6px 12px -3px rgba(0,0,0,.4), 0 -1px 0 rgba(0,0,0,.25); }
  .memo-cuerpo { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .memo.vacio { display: none; }
  .memo > .clip { display: none; }
  .memo-cab { gap: 6px; }
  .memo-cab .tipo { margin-left: 0; letter-spacing: .1em; }
  .archivar { width: 36px; justify-content: center; padding: 0; }
  .archivar span { display: none; }
  .memo .asunto { margin: 4px 0 2px; }
  .memo .asunto b { font-size: 15px; }
  .memo p.tx { font-size: 13.5px; line-height: 1.3; }
  .memo .cc { display: none; }
  /* Dictamen: barra fija abajo con el progreso, El dato y Acusar */
  .dictamen { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; align-items: center; gap: 0; padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -3px 12px rgba(0,0,0,.35); border-top: 3px solid var(--acento); }
  .dictamen h3, .dictamen .preg, .avance .et { display: none; }
  .acciones-dict { flex: 1 1 auto; flex-wrap: nowrap; margin: 0; gap: 8px; align-items: center; }
  .avance { width: auto; flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 3px; }
  .avance .cajas { gap: 2px; }
  .avance i { width: 10px; height: 10px; border-width: 1.2px; }
  .avance .vas { margin: 0; font-size: 14px; }
  .btn-dato { display: inline-flex; flex: 0 0 auto; min-height: 50px; padding: 4px 10px 4px 8px; }
  .acusar { min-height: 50px; padding: 2px 4px; min-width: 0; }
  .acusar b { font-size: 20px; letter-spacing: .12em; }
  .acusar small { font-size: 11px; text-align: center; line-height: 1.15; }
  /* Acta: fotos y nombres arriba, la declaración debajo */
  .acta { padding: 8px 8px 6px 28px; }
  .acta::before { left: 4px; width: 14px; }
  .acta::after { left: 21px; }
  .acta-cab h2 { font-size: 19px; }
  .nivel, .tabla-cab { display: none; }
  .decl { grid-template-columns: 42px minmax(0, 1fr) 50px; grid-template-areas: "foto quien cas" "foto dijo dijo"; column-gap: 8px; row-gap: 3px;
    align-items: start; padding: 6px 4px; }
  .decl .num { display: none; }
  .decl .foto-carne { grid-area: foto; }
  .decl .quien { grid-area: quien; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 3px 6px; padding: 0; }
  .decl .dijo { grid-area: dijo; font-size: 14px; padding: 0; }
  .decl .cas { grid-area: cas; }
  .decl .clip { left: 32px; }
  .inventario h3 small { display: none; }
  .inventario .et { flex-basis: 70px; }
  .inventario li { font-size: 12.5px; }
  .foto-carne.grande { width: 92px; height: 108px; }
  .fin-foto .cerrado { font-size: 19px; }
  .fin h2 { font-size: 27px; }
  .dlg-papel { padding: 18px 16px 16px; }
  .rueda { gap: 8px 4px; padding: 14px 4px 8px; }
  .rueda .foto-carne { width: 60px; height: 70px; }
  .rueda button { flex: 0 0 calc((100% - 8px) / 3); min-width: 0; }   /* de a tres: 5 → 3 + 2, 6 → 3 + 3 */
}
@media (min-width: 600px) and (max-width: 999px) {
  .fichero .foto-carne { width: 52px; } .fichero .foto-carne svg.retr { width: 48px; height: 56px; } .fichero .n { font-size: 13px; }
  .pestana small { display: block; }
}
@media (max-width: 370px) {
  .pestana b { font-size: 12px; }
  .fichero .n { font-size: 11px; }
  .titulo-movil b { font-size: 17px; }
}

/* ——— Celular apaisado: dos columnas, el croquis a la altura de la pantalla y las fichas al lado ——— */
@media (max-width: 999px) and (orientation: landscape) and (max-height: 560px) {
  .barra { padding: 4px 12px 0; min-height: 44px; }
  .volver { width: 34px; height: 34px; }
  .marca, .btn-barra span, .pestana-exp { display: none; }
  .titulo-movil { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
  .titulo-movil b { font-family: var(--f-maquina); font-weight: 400; font-size: 18px; color: #FFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .titulo-movil span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(242,237,224,.78); white-space: nowrap; }
  .btn-barra { padding: 0; width: 36px; min-height: 34px; justify-content: center; }
  .reloj { min-height: 34px; padding: 3px 9px 2px 22px; }
  .reloj::before { left: 8px; }
  .reloj .et { display: none; }
  .reloj b { font-size: 18px; }
  .carpeta { margin: 4px 8px 10px; padding: 8px 8px 10px; gap: 16px; --plano: clamp(220px, calc(100dvh - 100px), 52vw); }
  .col-izq { position: sticky; top: 4px; width: calc(var(--plano) + 12px); }
  .col-der { gap: 10px; }
  .col-der::before { left: -9px; }
  .pestanas-fila { height: 40px; gap: 6px; }
  .pestanas { gap: 2px; }
  .pestana { flex: 1 1 auto; height: 34px; padding: 2px 3px; justify-content: center; }      /* cada pestaña, del ancho de su palabra */
  .pestana[aria-pressed="true"] { height: 40px; }
  .pestana small, .pestana .ico { display: none; }
  .pestana b { font-size: 12.5px; }
  .corrector { height: 32px; min-height: 32px; padding: 0 9px; }
  .corrector span { display: none; }
  .hoja-escena { padding: 3px 6px 3px; }
  .form-cab { display: none; }
  .ficha .clip { display: none; }
  .info { font-size: 13px; min-height: 0; }
  .bitacora { margin-top: 2px; padding-top: 2px; }
  .inventario h3 small { display: none; }
  .fichero-fijo { display: block; order: -2; position: sticky; top: 0; z-index: 15; background: var(--manila); padding: 2px 0 6px; }
  .fichero { display: grid; grid-template-columns: repeat(var(--np), minmax(0, 1fr)); gap: 3px; }
  .fichero button { display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 3px 0 2px; min-width: 0; border-radius: 3px; }
  .fichero .foto-carne { width: 34px; height: auto; padding: 2px 2px 0; }
  .fichero .foto-carne svg.retr { width: 30px; height: 35px; }
  .fichero .foto-carne .cas { display: block; height: 11px; font-family: var(--f-logo); font-weight: 900; font-size: 10.5px; line-height: 11px; text-align: center; color: var(--acento); }
  .fichero .n { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fichero button[aria-pressed="true"] { background: var(--papel); box-shadow: 0 2px 4px rgba(0,0,0,.25); }
  .fichero button[aria-pressed="true"] .n { color: var(--acento); }
  .en-mano { margin-top: 4px; background: var(--papel); padding: 4px 8px 5px; border-left: 3px solid var(--acento); font-size: 13px; }
  .en-mano .cab { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .en-mano .cab .nom { font-family: var(--f-maquina); font-weight: 400; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--acento); }
  .en-mano .dijo { margin: 1px 0 0; font-family: var(--f-texto); font-size: 13.5px; line-height: 1.25; }
  .despacho { order: -1; flex-direction: column; gap: 10px; }
  .memo { transform: none; }
  .memo.vacio { display: none; }
  .btn-dato { display: inline-flex; }
  .dictamen { flex: none; flex-direction: row; align-items: center; padding: 6px 8px; }
  .dictamen h3, .dictamen .preg, .avance .et { display: none; }
  .acciones-dict { margin: 0; flex-wrap: nowrap; align-items: center; width: 100%; }
  .avance { width: auto; flex-direction: column; align-items: flex-start; gap: 2px; }
  .avance .vas { margin: 0; }
  .acusar { min-height: 44px; }
  .acusar b { font-size: 19px; }
  .acta { padding: 8px 8px 6px 28px; }
  .acta::before { left: 4px; width: 14px; }
  .acta::after { left: 21px; }
  .nivel, .tabla-cab { display: none; }
  .decl { grid-template-columns: 40px minmax(0, 1fr) 48px; grid-template-areas: "foto quien cas" "foto dijo dijo"; column-gap: 8px; row-gap: 2px; align-items: start; }
  .decl .num { display: none; }
  .decl .foto-carne { grid-area: foto; }
  .decl .quien { grid-area: quien; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 3px 6px; padding: 0; }
  .decl .dijo { grid-area: dijo; font-size: 13.5px; padding: 0; }
  .decl .cas { grid-area: cas; }
  .pie-movil { display: none; }
}
/* Informe final en pantallas angostas: la foto y el sello arriba, uno al lado del otro (el sello no tapa la cara) */
@media (max-width: 520px) {
  .fin-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fin-foto { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "foto nom" "foto sello"; justify-items: start;
    align-items: center; column-gap: 18px; row-gap: 4px; padding-right: 44px; }
  .fin-foto #fin-foto { grid-area: foto; }
  .fin-foto figcaption { grid-area: nom; align-self: end; font-size: 18px; }
  .fin-foto .cerrado { grid-area: sello; align-self: start; }
  .fin-foto > .clip { left: 66px; right: auto; }
  .fin .informe { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
