/* Escenas «mira al agente trabajando». Todo cuelga de .esc para no pisar la página.
   Copia de prototipos/escenas.css (rama tarea/escenas, 47b7f9d) para la página.
   Las variables de color son las de estilos.css. */

.esc { container-type: inline-size; color: var(--grafito); }
.esc *, .esc *::before, .esc *::after { box-sizing: border-box; }
:where(.esc) :where(h3, p, dl, dd, dt) { margin: 0; padding: 0; }
:where(.esc) :where(button) { font: inherit; color: inherit; }
.esc :focus-visible { outline: 2.5px solid var(--grafito); outline-offset: 2px; border-radius: 4px; }

/* Fuera de la pantalla no se mueve nada. */
.esc-pausa, .esc-pausa *, .esc-pausa *::before, .esc-pausa *::after { animation-play-state: paused !important; }

.esc-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin-bottom: 10px; }
.esc-titulo { font-size: 1.16rem; font-weight: 800; font-stretch: 112%; letter-spacing: -.012em; line-height: 1.12; }
.esc-demo { color: var(--gris); font-size: .84rem; }

.esc-boton {
  min-height: 48px;
  padding: .7em 1.2em;
  border: 0;
  border-radius: 6px;
  background: var(--firma);
  color: var(--grafito);
  font-weight: 700;
  font-stretch: 105%;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s;
}
.esc-boton:hover { background: var(--firma-clara); }

@container (min-width: 720px) {
  .esc-titulo { font-size: 1.5rem; }
  .esc-demo { font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  .esc *, .esc *::before, .esc *::after { transition: none !important; animation: none !important; }
}

/* ========== bases de datos: dos torres de aluminio y un cable que se jala ========== */

.bd-escenario {
  position: relative;
  height: 400px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(120% 70% at 50% 8%, #FBFBFC 0, rgba(251, 251, 252, 0) 70%),
    linear-gradient(180deg, #E9EAEC 0, #E4E5E7 74%, #D3D4D8 100%);
  box-shadow: inset 0 0 0 1px rgba(29, 30, 33, .07);
  user-select: none;
  -webkit-user-select: none;
}

.bd-torres {
  position: absolute;
  inset: 12px 12px auto;
  height: 312px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.bd-torre {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 8px 0;
  border-radius: 11px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, rgba(0, 0, 0, .012) 1px 3px),
    linear-gradient(180deg, #F3F3F5 0, #E2E3E6 34%, #D2D3D7 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 #A7AAB0,
    inset 1px 0 0 rgba(255, 255, 255, .55),
    inset -1px 0 0 rgba(0, 0, 0, .06),
    0 2px 3px rgba(29, 30, 33, .22),
    0 22px 26px -18px rgba(29, 30, 33, .55);
}

.bd-placa { padding: 0 2px 7px 6px; color: var(--grafito-3); }
.bd-nombre { display: block; font-size: .78rem; font-weight: 600; line-height: 1.15; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.bd-cifra {
  display: block;
  margin-top: 1px;
  color: var(--grafito);
  font-size: 1.42rem;
  font-weight: 800;
  font-stretch: 96%;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1.05;
  contain: layout style;
}

.bd-ventana {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #0A0B0D;
  box-shadow: inset 0 0 0 1px #000, inset 0 3px 8px #000, 0 1px 0 rgba(255, 255, 255, .8);
}
.bd-ventana canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bd-ventana::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .07) 0, rgba(255, 255, 255, 0) 38%);
}

.bd-barrido {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 12px 3px rgba(84, 240, 166, .75);
  opacity: 0;
  will-change: transform;
}

.bd-nota {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  padding: 5px 9px 6px;
  border-radius: 4px;
  background: var(--papel);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55);
  color: var(--grafito);
  font-size: 1rem;
  font-weight: 700;
  font-stretch: 94%;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .16s, transform .22s var(--lento);
  pointer-events: none;
}
.bd-nota.visible { opacity: 1; transform: translate(-50%, 0); }
.bd-nota.mala { color: #D42A1E; }
.bd-nota.buena { color: #0B7A48; }

.bd-pie { position: relative; display: flex; align-items: center; justify-content: center; height: 44px; }
.bd-rejilla {
  position: absolute;
  left: 2px;
  width: 28%;
  height: 14px;
  background: repeating-linear-gradient(90deg, #8B8E94 0 2px, transparent 2px 5px);
  opacity: .55;
}
.bd-foco {
  position: absolute;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #70747B;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5);
}
.bd-foco.vivo { background: var(--enlace); box-shadow: 0 0 8px var(--enlace); }
.bd-puerto {
  position: relative;
  width: 30px;
  height: 24px;
  background: #060607;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 76% 74%, 76% 100%, 24% 100%, 24% 74%, 0 74%);
}
.bd-puerto::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 2px;
  height: 5px;
  background: repeating-linear-gradient(90deg, #B99A52 0 1.5px, transparent 1.5px 3.5px);
}

.bd-signo {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: var(--grafito);
  color: var(--firma);
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #E6E7E9, 0 4px 8px rgba(29, 30, 33, .3);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .18s, transform .3s var(--lento), background .2s;
}
.bd-signo.visible { opacity: 1; transform: none; }
.bd-signo.igual { background: var(--enlace); color: var(--grafito); }

.bd-cable { position: absolute; left: 0; top: 0; z-index: 4; width: 100%; pointer-events: none; }

.bd-clavija {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}
.bd-clavija:active { cursor: grabbing; }
.bd-clavija::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid var(--firma);
  opacity: 0;
}
.bd-clavija.llama::before { animation: bd-llama 1.1s var(--lento) 2; }
@keyframes bd-llama { 0% { opacity: .95; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.7); } }

/* La mano que invita a jalar. La yema queda sobre la clavija y la palma cae en el hueco de abajo. */
.bd-mano {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(29, 30, 33, .42));
  transition: opacity .16s;
  will-change: transform, opacity;
}
.bd-mano.visible { opacity: 1; }
.bd-mano svg { display: block; width: 100%; height: 100%; }

/* El ticket sale de una ranura en el borde de abajo, a saltitos, como una impresora. */
.bd-ranura {
  position: absolute;
  z-index: 7;
  inset: auto 0 0;
  height: 10px;
  background: linear-gradient(180deg, #B9BBC0 0, #D9DADD 30%, #C6C8CC 100%);
  box-shadow: inset 0 1px 0 #6E7177;
}
.bd-ticket {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 8px;
  width: min(290px, 84%);
  padding: 14px 16px 12px;
  background: var(--papel);
  box-shadow: 0 -2px 18px rgba(29, 30, 33, .3);
  transform: translate(-50%, 104%);
  font-size: .92rem;
  font-stretch: 92%;
  font-variant-numeric: tabular-nums;
  line-height: 1.32;
  /* borde de arriba cortado en dientes */
  clip-path: polygon(0 6px, 3% 0, 6% 6px, 9% 0, 12% 6px, 15% 0, 18% 6px, 21% 0, 24% 6px, 27% 0, 30% 6px, 33% 0, 36% 6px, 39% 0, 42% 6px, 45% 0, 48% 6px, 51% 0, 54% 6px, 57% 0, 60% 6px, 63% 0, 66% 6px, 69% 0, 72% 6px, 75% 0, 78% 6px, 81% 0, 84% 6px, 87% 0, 90% 6px, 93% 0, 96% 6px, 100% 0, 100% 100%, 0 100%);
}
.bd-ticket.saliendo { transform: translate(-50%, 0); transition: transform 1.15s steps(13); }
.bd-ticket.retirar { transform: translate(-50%, 104%); transition: transform .28s ease-in; }
.bd-ticket b { display: block; margin-bottom: 4px; font-size: 1.04rem; font-weight: 800; font-stretch: 106%; }
.bd-ticket dl > div { display: flex; justify-content: space-between; gap: 12px; }
.bd-ticket dt { color: var(--grafito-2); }
.bd-ticket dd { font-weight: 700; }
.bd-ticket .marcado dt, .bd-ticket .marcado dd { color: #C25F00; font-weight: 800; }
.bd-ticket .total { margin-top: 3px; padding-top: 4px; border-top: 1.5px dashed var(--grafito-3); font-weight: 800; }
.bd-ticket .total dt { color: var(--grafito); }
.bd-firma { display: block; width: 62px; height: 45px; margin: 2px 0 -2px auto; color: var(--firma); }
.bd-firma { opacity: 0; }
.bd-ticket.firmar .bd-firma { opacity: 1; }
.bd-firma path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bd-ticket.firmar .bd-firma path { stroke-dashoffset: 0; transition: stroke-dashoffset var(--d, .5s) ease-in-out var(--e, 0s); }

.bd-mando { display: grid; gap: 8px; margin-top: 10px; }
.bd-estado { min-height: 2.5em; font-size: 1rem; font-weight: 600; line-height: 1.25; }
.bd-boton { width: 100%; }
.bd-boton.pide { animation: bd-pide 1.4s ease-in-out infinite; }
@keyframes bd-pide { 50% { background: #FFB469; } }

@container (min-width: 720px) {
  .bd-escenario { height: 500px; }
  .bd-torres { inset: 22px 34px auto; height: 372px; gap: 70px; }
  .bd-torre { padding: 12px 12px 0; }
  .bd-placa { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 10px; }
  .bd-nombre { font-size: .98rem; }
  .bd-cifra { font-size: 1.9rem; }
  .bd-signo { top: 26px; width: 46px; height: 46px; margin-left: -23px; font-size: 1.9rem; box-shadow: 0 6px 12px rgba(29, 30, 33, .3); }
  .bd-pie { height: 52px; }
  .bd-puerto { transform: scale(1.2); }
  .bd-nota { font-size: 1.3rem; padding: 7px 12px 8px; }
  .bd-mando { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; }
  .bd-estado { min-height: 0; font-size: 1.22rem; }
  .bd-boton { width: auto; padding-inline: 2em; font-size: 1.1rem; }
  .bd-ticket { width: 340px; font-size: 1.02rem; padding: 16px 20px 14px; }
  .bd-mano { width: 58px; height: 58px; }
}

/* ========== seguridad: el velador hace su ronda por la oficina a oscuras ========== */

.sg-marco {
  overflow: hidden;
  border-radius: 14px;
  background: #131417;
  color: #fff;
}
.esc-seguridad :focus-visible { outline-color: var(--firma); }

.sg-plano {
  position: relative;
  aspect-ratio: 480 / 400;
  overflow: hidden;
  background: #1C1D20;
  user-select: none;
  -webkit-user-select: none;
}
.sg-dibujo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* La noche: un círculo de luz pequeño rodeado de cuatro piezas de color liso.
   Se mueve la pieza entera con transform: no se repinta nada y casi no ocupa memoria. */
.sg-noche {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.sg-noche-mueve { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.sg-noche-mueve i { position: absolute; background: rgb(7 8 10 / .955); }
.sg-noche-mueve .sg-hueco {
  left: calc(var(--r2, 90px) * -1);
  top: calc(var(--r2, 90px) * -1);
  width: calc(var(--r2, 90px) * 2);
  height: calc(var(--r2, 90px) * 2);
  background: radial-gradient(circle closest-side, rgb(245 130 13 / .1) 0, rgb(7 8 10 / 0) 52%, rgb(7 8 10 / .955) 100%);
}
/* La luz nunca sale del plano, así que basta con cubrir un plano entero hacia cada lado. */
.sg-noche-mueve .sg-arriba { left: calc(var(--w) * -1); width: calc(var(--w) * 2); top: calc(var(--h) * -1); height: calc(var(--h) - var(--r2, 90px)); }
.sg-noche-mueve .sg-abajo { left: calc(var(--w) * -1); width: calc(var(--w) * 2); top: var(--r2, 90px); height: calc(var(--h) - var(--r2, 90px)); }
.sg-noche-mueve .sg-izq { left: calc(var(--w) * -1); width: calc(var(--w) - var(--r2, 90px)); top: calc(var(--r2, 90px) * -1); height: calc(var(--r2, 90px) * 2); }
.sg-noche-mueve .sg-der { left: var(--r2, 90px); width: calc(var(--w) - var(--r2, 90px)); top: calc(var(--r2, 90px) * -1); height: calc(var(--r2, 90px) * 2); }
.sg-noche.sg-apagada { opacity: 0; transition: opacity .35s; }
.sg-noche.sg-fluor { animation: sg-fluor .8s steps(1) forwards; }
@keyframes sg-fluor {
  0% { opacity: 1; } 12% { opacity: .35; } 20% { opacity: .95; } 34% { opacity: .2; }
  42% { opacity: .82; } 58% { opacity: .12; } 70% { opacity: .5; } 82%, 100% { opacity: 0; }
}

.sg-velador {
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--firma);
  box-shadow: 0 0 0 3px rgba(245, 130, 13, .35), 0 0 14px 4px rgba(245, 130, 13, .55);
  pointer-events: none;
  will-change: transform;
  transition: opacity .25s;
}
.sg-velador.escondido { opacity: 0; }

.sg-intruso {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #FF4B3E;
  box-shadow: 0 0 0 3px rgba(255, 75, 62, .35), 0 0 16px 5px rgba(255, 75, 62, .6);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.sg-intruso.visible { opacity: 1; }
.sg-intruso.rebota { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); opacity: .85; transition: opacity .3s; }

/* La caja de donde sale el agente: se ve aunque la oficina esté a oscuras. */
.sg-caja {
  position: absolute;
  z-index: 1;
  width: 62px;
  margin: -17px 0 0 -31px;
  color: var(--firma-clara);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}
.sg-caja svg { display: block; width: 28px; height: 28px; margin: 0 auto -3px; }

.sg-grave { --g: #FF5A4D; }
.sg-media { --g: var(--firma); }
.sg-baja { --g: #C9CBD0; }

.sg-pin {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: #17181B;
  color: #fff;
  box-shadow: 0 0 0 2.5px var(--g), 0 0 10px 1px var(--g);
  cursor: pointer;
  opacity: 0;
  transform: scale(.3);
  pointer-events: none;
  transition: opacity .15s, transform .34s cubic-bezier(.3, 1.7, .5, 1), box-shadow .2s;
}
.sg-pin svg { width: 100%; height: 100%; display: block; }
.sg-pin::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.sg-pin.visible { opacity: 1; transform: none; pointer-events: auto; }
.sg-pin.arreglado { --g: var(--enlace); color: var(--enlace); }
/* Atenuado sin transparencia: si no, se ve doble el equipo dibujado en el plano. */
.sg-plano.enfoca .sg-pin.visible:not(.elegido) { color: #6F7279; box-shadow: 0 0 0 2px #3A3C41; }
.sg-pin.elegido { z-index: 3; transform: scale(1.14); }
.sg-pin.adentro { animation: sg-adentro .7s ease-out; }
.sg-pin.golpe { animation: sg-golpe .32s ease-out; }
@keyframes sg-adentro {
  0%, 40%, 80% { background: #FF4B3E; box-shadow: 0 0 0 2.5px #FF4B3E, 0 0 26px 10px rgba(255, 75, 62, .7); }
  20%, 60%, 100% { background: #17181B; }
}
@keyframes sg-golpe { 0%, 100% { translate: 0 0; } 30% { translate: 3px 0; } 60% { translate: -2px 0; } }

.sg-sano {
  position: absolute;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  padding: 3px;
  border-radius: 50%;
  background: var(--enlace);
  color: #0E2B1D;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .15s, transform .3s var(--lento);
}
.sg-sano svg { display: block; width: 100%; height: 100%; stroke-width: 3; }
.sg-sano.visible { opacity: .9; transform: none; }

.sg-panel { position: relative; padding: 8px 10px 10px; overflow: hidden; }
.sg-estado { min-height: 1.4em; margin-bottom: 4px; color: #D9DADD; font-size: .95rem; font-weight: 600; }
.sg-lista { position: relative; height: 200px; }
/* Los huecos de lo que todavía no aparece: se entiende que la lista se está llenando. */
.sg-lista::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .032) 0 38px, transparent 38px 40px);
}

.sg-fila {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 8px;
  border: 0;
  border-radius: 6px;
  background: #1F2024;
  color: #fff;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(var(--pos, 0) * 40px));
  transition: transform .34s var(--lento), opacity .18s, background .15s;
}
.sg-fila.visible { opacity: 1; pointer-events: auto; }
.sg-fila:hover { background: #2A2C31; }
.sg-luz { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); }
.sg-fila-titulo { flex: 1; min-width: 0; font-size: .92rem; font-stretch: 94%; font-weight: 500; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-fila-g { flex: none; color: var(--g); font-size: .8rem; font-weight: 700; }
.sg-flecha { flex: none; width: 16px; height: 16px; color: #8B8E94; }
.sg-flecha svg { display: block; width: 100%; height: 100%; }
.sg-fila.arreglada { --g: var(--enlace); }
.sg-fila.arreglada .sg-fila-titulo { color: #9EA1A7; }

.sg-detalle {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px 10px;
  background: #1F2024;
  transform: translateY(100%);
  transition: transform .26s var(--lento);
}
.sg-detalle.abierto { transform: none; }
.sg-detalle[data-g="grave"] { --g: #FF5A4D; }
.sg-detalle[data-g="media"] { --g: var(--firma); }
.sg-detalle[data-g="baja"] { --g: #C9CBD0; }
.sg-detalle.arreglado { --g: var(--enlace); }
.sg-detalle-cabeza { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.sg-etiqueta { color: var(--g); font-size: .84rem; font-weight: 800; }
.sg-cerrar {
  width: 38px;
  height: 38px;
  margin: -9px -8px -9px 0;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}
.sg-cerrar svg { display: block; width: 100%; height: 100%; }
.sg-detalle-titulo { margin: 0; font-size: 1.04rem; font-weight: 800; font-stretch: 104%; line-height: 1.14; }
.sg-detalle-texto { color: #D9DADD; font-size: .9rem; line-height: 1.26; }
.sg-detalle-texto b { color: #fff; }
.sg-autorizar { margin-top: auto; min-height: 42px; padding-block: .5em; }
.sg-autorizar.hecho { background: var(--enlace); cursor: default; }

@container (min-width: 720px) {
  .sg-marco { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
  .sg-panel { padding: 22px 20px; }
  .sg-estado { margin-bottom: 14px; font-size: 1.2rem; }
  .sg-lista { height: 260px; }
  .sg-lista::before { background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .032) 0 46px, transparent 46px 52px); }
  .sg-fila { height: 46px; padding-left: 12px; transform: translateY(calc(var(--pos, 0) * 52px)); }
  .sg-fila-titulo { font-size: 1rem; white-space: normal; }
  .sg-caja { width: 92px; margin: -24px 0 0 -46px; font-size: .9rem; }
  .sg-caja svg { width: 40px; height: 40px; margin-bottom: -4px; }
  .sg-pin { width: 46px; height: 46px; margin: -23px 0 0 -23px; padding: 10px; }
  .sg-sano { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
  .sg-velador { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
  .sg-intruso { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .sg-detalle { inset: 0; padding: 22px 20px; gap: 12px; }
  .sg-detalle-titulo { font-size: 1.5rem; }
  .sg-detalle-texto { font-size: 1.04rem; line-height: 1.36; }
  .sg-autorizar { margin-top: 10px; min-height: 50px; }
}

/* ========== ventas: las 2:47 de la mañana, con la tinta de la firma ========== */

.vt-marco { display: grid; gap: 8px; }

.vt-trastienda {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: var(--papel);
  box-shadow: inset 0 0 0 1px rgba(29, 30, 33, .1);
}
.vt-noche {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--grafito);
  color: #fff;
}
.vt-luna { flex: none; width: 17px; height: 17px; color: #F4E8C8; }
.vt-noche b { font-size: 1.28rem; font-weight: 800; font-stretch: 118%; letter-spacing: -.012em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vt-noche span { margin-left: auto; color: var(--gris-rack); font-size: .86rem; }

.vt-mesa { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 10px 2px; }
.vt-anaquel-caja { min-width: 0; }
.vt-anaquel { display: block; width: 100%; height: auto; overflow: visible; }

.vt-mueble path { fill: none; stroke: var(--grafito); stroke-width: 3; stroke-linecap: square; }
.vt-caja rect:first-child { fill: var(--aluminio); stroke: var(--grafito); stroke-width: 1.4; }
.vt-caja path { fill: none; stroke: var(--gris); stroke-width: 1; }
.vt-cinta { fill: var(--firma); opacity: 0; transform: scaleY(0); transform-origin: 50% 0; transform-box: fill-box; transition: opacity .1s, transform .16s var(--lento); }
.vt-caja.apartada .vt-cinta { opacity: 1; transform: none; }
.vt-otra { fill: var(--aluminio-claro); stroke: var(--linea); stroke-width: 1.2; }

.vt-marca { fill: none; stroke: var(--firma); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.vt-marca { opacity: 0; }
.vt-marca.on { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .5s ease-in-out; }
.vt-cuenta { fill: #C25F00; font-size: 19px; font-weight: 800; opacity: 0; transition: opacity .2s; }
.vt-cuenta.on { opacity: 1; }
.vt-etiqueta { opacity: 0; transform-box: fill-box; transition: opacity .2s; }
.vt-etiqueta.on { opacity: 1; }
.vt-etiqueta rect { fill: var(--firma); }
.vt-etiqueta text { fill: var(--grafito); font-size: 17px; font-weight: 800; }
.vt-hilo { fill: none; stroke: var(--grafito); stroke-width: 1.4; }

.vt-hoja {
  position: relative;
  min-width: 0;
  min-height: 132px;
  padding: 8px 10px 6px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(29, 30, 33, .22), 0 10px 18px -10px rgba(29, 30, 33, .45);
  font-size: .86rem;
  font-stretch: 92%;
  line-height: 1.26;
  transform: rotate(.8deg);
  opacity: .4;
  transition: opacity .2s;
}
.vt-hoja.on { opacity: 1; }
.vt-hoja-titulo { display: block; margin-bottom: 2px; font-size: .92rem; font-weight: 800; font-stretch: 104%; }
.vt-renglon { display: none; color: var(--grafito-2); }
.vt-renglon.visible { display: block; animation: vt-entra .2s var(--lento); }
@keyframes vt-entra { from { opacity: 0; transform: translateX(-5px); } }
.vt-total { position: relative; width: max-content; font-size: 1.12rem; font-weight: 800; color: var(--grafito); line-height: 1.2; }
.vt-tacha { position: absolute; left: -3px; right: -3px; top: 52%; height: 2.6px; border-radius: 2px; background: var(--firma); transform: rotate(-3deg) scaleX(0); transform-origin: 0 50%; }
.vt-tacha.on { transform: rotate(-3deg) scaleX(1); transition: transform .3s ease-in-out; }
.vt-nuevo { color: #C25F00; font-size: 1.12rem; font-weight: 800; line-height: 1.15; }
.vt-nuevo small { display: block; color: var(--gris); font-size: .72rem; font-weight: 500; line-height: 1.15; }
/* El sello cae sobre la entrega, no sobre el precio: el precio se tiene que seguir leyendo. */
.vt-sello {
  position: absolute;
  left: 8px;
  bottom: 7px;
  padding: 2px 7px 3px;
  border: 2.5px solid #D96E05;
  border-radius: 4px;
  color: #D96E05;
  font-size: .98rem;
  font-weight: 900;
  font-stretch: 108%;
  line-height: 1.1;
  opacity: 0;
  transform: rotate(-7deg) scale(1.7);
  pointer-events: none;
  background: rgba(255, 255, 255, .9);
}
/* Al sellar, la letra pequeña le deja el sitio: la entrega ya se dijo en el chat. */
.vt-hoja.sellada [data-l="5"], .vt-hoja.sellada .vt-nuevo small { visibility: hidden; }
.vt-sello.on { opacity: 1; transform: rotate(-7deg); transition: opacity .08s, transform .16s cubic-bezier(.3, 1.4, .6, 1); }
.vt-recado {
  position: absolute;
  inset: auto -4px -3px;
  padding: 6px 8px 7px;
  border-radius: 2px;
  background: #FFE6C7;
  box-shadow: 0 2px 7px rgba(29, 30, 33, .3);
  color: var(--grafito);
  font-size: .82rem;
  line-height: 1.18;
  opacity: 0;
  transform: translateY(10px) rotate(-1.4deg);
  pointer-events: none;
}
.vt-recado.on { opacity: 1; transform: rotate(-1.4deg); transition: opacity .14s, transform .24s var(--lento); }
.vt-recado b { display: block; font-weight: 800; }
.vt-recado span { display: block; }

.vt-accion { display: flex; align-items: flex-start; gap: 7px; min-height: 2.5em; padding: 2px 12px 6px; color: var(--grafito); font-size: .94rem; font-weight: 700; line-height: 1.22; }
.vt-foco { flex: none; width: 8px; height: 8px; margin-top: .36em; border-radius: 50%; background: var(--linea); }
.vt-foco.vivo { background: var(--firma); box-shadow: 0 0 8px var(--firma); animation: vt-late .7s ease-in-out infinite alternate; }
@keyframes vt-late { to { opacity: .35; } }

.vt-fono { display: flex; flex-direction: column; overflow: hidden; height: 290px; border-radius: 14px; background: #EFE7DD; box-shadow: inset 0 0 0 1px rgba(29, 30, 33, .1); }
.vt-fono-cabeza { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: #008069; color: #fff; }
/* Es el negocio del cliente: un icono genérico de tienda, sin la firma de Nqual5. */
.vt-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: #DFE5E7; color: #54656F; }
.vt-avatar svg { display: block; width: 100%; height: 100%; }
.vt-fono-nombre { display: flex; flex-direction: column; line-height: 1.12; }
.vt-fono-nombre b { font-size: .94rem; font-weight: 700; }
.vt-fono-nombre small { font-size: .74rem; opacity: .9; }

.vt-charla { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 0 8px 4px; }
.vt-rollo { display: flex; flex-direction: column; gap: 5px; will-change: transform; }

.vt-msg {
  align-self: flex-start;
  max-width: 86%;
  padding: 5px 8px 4px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(11, 20, 26, .14);
  font-size: .92rem;
  line-height: 1.24;
  animation: vt-burbuja .2s var(--lento);
}
.vt-msg.yo { align-self: flex-end; background: #D9FDD3; }
.vt-msg small { display: block; margin-top: 1px; color: #667781; font-size: .66rem; text-align: right; line-height: 1.1; white-space: nowrap; }
.vt-msg small svg { display: inline-block; width: 13px; height: 8px; margin-left: 3px; }
@keyframes vt-burbuja { from { opacity: 0; transform: translateY(5px) scale(.97); } }
.vt-tecleo { display: flex; gap: 4px; padding: 9px 11px; }
.vt-tecleo i { width: 6px; height: 6px; border-radius: 50%; background: #8696A0; animation: vt-punto 1s ease-in-out infinite; }
.vt-tecleo i:nth-child(2) { animation-delay: .15s; }
.vt-tecleo i:nth-child(3) { animation-delay: .3s; }
@keyframes vt-punto { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }

.vt-opciones { flex: none; padding: 5px 8px 8px; background: var(--grafito); color: #fff; }
.vt-opciones p { margin-bottom: 5px; font-size: .84rem; font-weight: 600; }
.vt-botones { display: flex; flex-wrap: wrap; gap: 5px; }
.vt-opcion {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: var(--firma);
  color: var(--grafito);
  font-size: .9rem;
  font-weight: 700;
  font-stretch: 94%;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.vt-opcion:hover { background: var(--firma-clara); }
.vt-opcion.vt-cuenta-atras::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--grafito);
  transform-origin: 0 50%;
  animation: vt-cuenta var(--espera, 3.6s) linear forwards;
}
@keyframes vt-cuenta { from { transform: scaleX(0); } to { transform: none; } }
.esc-ventas :focus-visible { outline-offset: 1px; }
.vt-opciones :focus-visible { outline-color: #fff; }

.vt-barra { flex: none; padding: 4px 8px 6px; }
.vt-barra span { display: block; padding: 5px 12px; border-radius: 16px; background: #fff; color: #8696A0; font-size: .86rem; }

@container (min-width: 720px) {
  .vt-marco { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: stretch; }
  .vt-noche { padding: 12px 20px; gap: 12px; }
  .vt-luna { width: 24px; height: 24px; }
  .vt-noche b { font-size: 2.1rem; }
  .vt-noche span { font-size: 1.04rem; }
  .vt-mesa { flex: 1; gap: 24px; padding: 18px 26px 8px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .vt-marca { stroke-width: 1.9; }
  .vt-hoja { min-height: 196px; padding: 16px 18px; font-size: 1.1rem; }
  .vt-hoja-titulo { margin-bottom: 6px; font-size: 1.2rem; }
  .vt-total, .vt-nuevo { font-size: 1.5rem; }
  .vt-nuevo small { font-size: .84rem; }
  .vt-sello { font-size: 1.5rem; padding: 3px 12px 4px; }
  .vt-recado { font-size: 1rem; padding: 9px 12px 10px; }
  .vt-accion { min-height: 0; padding: 8px 26px 18px; font-size: 1.2rem; }
  .vt-fono { height: 540px; border: 9px solid var(--grafito); border-radius: 30px; box-shadow: 0 2px 4px rgba(29, 30, 33, .3), 0 24px 34px -20px rgba(29, 30, 33, .6); }
  .vt-fono-cabeza { padding: 9px 12px; }
  .vt-msg { font-size: 1rem; }
  .vt-opcion { font-size: .96rem; min-height: 44px; }
  .vt-opciones { padding: 8px 10px 10px; }
  .vt-opciones p { font-size: .92rem; }
}
