/* ═══════════════════════════════════════════════════════════════════════════
   SOYLA MONEDA v2.1 — ESCÁNER DE PRECIOS (Calco 1:1 de design/2026-12-01/04-camara.svg)
   Base 360×720 (--u) · Inter Regular 400 + Oswald Light 300 en cifra editada.
   ═══════════════════════════════════════════════════════════════════════════ */

.escaner {
  position: fixed; inset: 0; z-index: 50;
  max-width: var(--ancho-app, 450px); margin: 0 auto;
  background: #002020;
  color: #ffffff; overflow: hidden;
  display: flex; flex-direction: column;
  font-size: calc(14 * var(--u, 1px)); font-weight: 400;
}
.escaner[hidden] { display: none; }
.esc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }

/* [FIJO] TopBar h=56px, padding L/R=16px */
.esc-top {
  position: relative; z-index: 6; flex: none;
  height: calc(56 * var(--u, 1px));
  padding: env(safe-area-inset-top, 0px) calc(16 * var(--u, 1px)) 0;
  display: grid; grid-template-columns: calc(32 * var(--u, 1px)) 1fr calc(32 * var(--u, 1px));
  align-items: center;
}
.esc-top button { width: calc(28 * var(--u, 1px)); height: calc(28 * var(--u, 1px)); display: grid; place-items: center; color: #ffffff; }
.esc-top .svg-ico.chev { width: calc(14 * var(--u, 1px)); height: calc(14 * var(--u, 1px)); fill: #ffffff; }
#esc-fecha { text-align: center; font-size: calc(18 * var(--u, 1px)); font-weight: 400; color: #ffffff; }

/* [TOP FIJO] Zona superior dinámica (y=56..240 -> h=184px; tarjeta 4×40=160px) */
.esc-top-zona {
  position: relative; z-index: 6; flex: none;
  height: calc(184 * var(--u, 1px));
  padding: calc(4 * var(--u, 1px)) calc(16 * var(--u, 1px)) 0;
  display: flex; flex-direction: column; justify-content: center;
}
.escaner.leido:not(.modo-suma) .esc-top-zona,
.escaner.suma-activa .esc-top-zona { justify-content: flex-start; }
.esc-titulo {
  text-align: center; font-size: calc(16 * var(--u, 1px)); line-height: 1.35; font-weight: 400;
  color: #ffffff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  transition: opacity .16s cubic-bezier(.2, .8, .2, 1), transform .16s cubic-bezier(.2, .8, .2, 1);
}
.escaner.leido .esc-titulo,
.escaner.suma-activa .esc-titulo { display: none; }

/* Tarjeta 4×40px = 160px (Pantalla 03 Número y Pantalla 05 Suma) */
@keyframes esc-card-in {
  from { opacity: 0; transform: translateY(calc(-6 * var(--u, 1px))) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.esc-franja {
  display: none; border-radius: calc(16 * var(--u, 1px)); overflow: hidden;
  background: rgba(0, 64, 64, .92);
}
.escaner.leido:not(.modo-suma) .esc-franja {
  display: block;
  animation: esc-card-in .18s cubic-bezier(.2, .8, .2, 1) both;
}
#esc-filas .fila {
  height: calc(40 * var(--u, 1px)); padding: 0 calc(16 * var(--u, 1px));
  display: flex; align-items: center; justify-content: space-between; gap: calc(8 * var(--u, 1px));
  border-bottom: 1px solid rgba(184, 212, 210, .14);
}
#esc-filas .fila:last-child { border-bottom: 0; }
#esc-filas .fila.activa { background: rgba(0, 32, 32, .85); }
#esc-filas .fila .f-izq { display: flex; align-items: center; gap: calc(10 * var(--u, 1px)); font-size: calc(16 * var(--u, 1px)); color: #ffffff; }
#esc-filas .fila.activa .f-izq { color: #c0e020; }
#esc-filas .fila .f-arr {
  width: calc(22 * var(--u, 1px)); height: calc(22 * var(--u, 1px)); border-radius: 50%;
  background: #c0e020; color: #002020; display: grid; place-items: center;
}
#esc-filas .fila .f-arr .svg-ico { width: calc(14 * var(--u, 1px)); height: calc(14 * var(--u, 1px)); fill: #002020; }
#esc-filas .fila .f-val { font-size: calc(18 * var(--u, 1px)); color: #ffffff; font-variant-numeric: tabular-nums; }
#esc-filas .fila.activa .f-val { color: #c0e020; }

.esc-suma-card {
  border-radius: calc(16 * var(--u, 1px)); overflow: hidden;
  background: rgba(0, 64, 64, .92);
  animation: esc-card-in .18s cubic-bezier(.2, .8, .2, 1) both;
}
.esc-suma-card[hidden] { display: none; }
.esc-card-row {
  width: 100%; height: calc(40 * var(--u, 1px)); padding: 0 calc(14 * var(--u, 1px));
  display: flex; align-items: center; justify-content: space-between; gap: calc(8 * var(--u, 1px));
  border-bottom: 1px solid rgba(184, 212, 210, .14);
  font-size: calc(15 * var(--u, 1px)); color: #ffffff;
}
.esc-card-row:last-child { border-bottom: 0; }
.esc-card-row.head {
  background: rgba(0, 32, 32, .85); text-align: left; cursor: pointer;
  transition: background .16s cubic-bezier(.2, .8, .2, 1);
}
.esc-card-row.head:active { background: #003838; }
.esc-card-row em { font-style: normal; }
.esc-card-row b { font-size: calc(17 * var(--u, 1px)); font-weight: 400; font-variant-numeric: tabular-nums; }
.esc-card-row .lime { color: #c0e020; }
.esc-card-nom { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tipo-ico { width: calc(24 * var(--u, 1px)); height: calc(24 * var(--u, 1px)); flex: none; color: #c0e020; }
.esc-ir-btn {
  width: calc(24 * var(--u, 1px)); height: calc(24 * var(--u, 1px)); border-radius: 50%;
  background: #c0e020; color: #002020; display: grid; place-items: center; flex: none;
}
.esc-ir-btn .svg-ico { width: calc(15 * var(--u, 1px)); height: calc(15 * var(--u, 1px)); fill: #002020; }

/* [CENTRO · FIJO] Banda central y=240px, h=240px con visor circular 240×240px */
.esc-centro-banda {
  position: relative; z-index: 4; flex: none; height: calc(240 * var(--u, 1px));
  display: flex; align-items: flex-start; justify-content: center;
}
.esc-visor {
  position: relative; overflow: visible;
  width: calc(240 * var(--u, 1px)); height: calc(240 * var(--u, 1px));
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14) 0%, rgba(184, 212, 210, .18) 100%);
  box-shadow: 0 0 0 100vmax rgba(0, 32, 32, .64);
  display: flex; align-items: center; justify-content: center;
}
/* Semicírculo superior degradado (y=240, h=120, vector 04_01-camara-bg-cifra.svg) */
.esc-semicirculo {
  position: absolute; top: 0; left: 0; width: calc(240 * var(--u, 1px)); height: calc(120 * var(--u, 1px));
  transition: opacity .18s cubic-bezier(.2, .8, .2, 1), transform .18s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.esc-semicirculo-svg { width: 100%; height: 100%; display: block; }
.escaner:not(.leido) .esc-semicirculo,
.escaner.cargando-wasm .esc-semicirculo { opacity: 0; transform: translateY(calc(6 * var(--u, 1px))); }
.esc-linea {
  position: relative; z-index: 2; width: 64%; height: 2px;
  background: #c0e020; box-shadow: 0 0 8px #c0e020;
  animation: esc-pulso 1.8s ease-in-out infinite;
}
@keyframes esc-pulso { 0%, 100% { opacity: .5 } 50% { opacity: 1 } }

/* Cargador 192×192px dentro del visor de 240px */
.esc-cargando { display: none; }
.escaner.cargando-wasm .esc-linea { display: none; }
.escaner.cargando-wasm .esc-cargando {
  position: absolute; width: calc(192 * var(--u, 1px)); height: calc(192 * var(--u, 1px));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 0 calc(26 * var(--u, 1px));
  color: #c0e020; font-size: calc(18 * var(--u, 1px)); font-weight: 400; line-height: 1.25;
}
.esc-dots { position: absolute; inset: 0; width: 100%; height: 100%; fill: #c0e020; }
.esc-dots circle { opacity: .2; animation: esc-dot 1.2s linear infinite; }
.esc-dots circle:nth-child(1) { animation-delay: -1.1s; }
.esc-dots circle:nth-child(2) { animation-delay: -1.0s; }
.esc-dots circle:nth-child(3) { animation-delay: -0.9s; }
.esc-dots circle:nth-child(4) { animation-delay: -0.8s; }
.esc-dots circle:nth-child(5) { animation-delay: -0.7s; }
.esc-dots circle:nth-child(6) { animation-delay: -0.6s; }
.esc-dots circle:nth-child(7) { animation-delay: -0.5s; }
.esc-dots circle:nth-child(8) { animation-delay: -0.4s; }
.esc-dots circle:nth-child(9) { animation-delay: -0.3s; }
.esc-dots circle:nth-child(10) { animation-delay: -0.2s; }
.esc-dots circle:nth-child(11) { animation-delay: -0.1s; }
.esc-dots circle:nth-child(12) { animation-delay: 0s; }
@keyframes esc-dot { 0%, 100% { opacity: .18 } 30% { opacity: 1 } }

/* Controles superpuestos del centro: Fila 1 y=240 (h=32px), Fila 2 y=272 (h=56px) */
.esc-centro-grid {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  padding: 0 calc(16 * var(--u, 1px));
  display: flex; align-items: flex-start; justify-content: center; gap: calc(8 * var(--u, 1px));
  pointer-events: none;
}
.escaner.cargando-wasm .esc-centro-grid { display: none; }
.esc-col-lado {
  width: calc(56 * var(--u, 1px)); flex: none;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto;
}
.esc-col-lado[hidden] { display: none; }
.esc-col-cifra {
  width: calc(200 * var(--u, 1px)); flex: none;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto;
}
.escaner:not(.leido):not(.modo-suma) .esc-col-cifra { display: none; }
.esc-col-lbl {
  height: calc(32 * var(--u, 1px)); display: flex; align-items: center; justify-content: center;
  font-size: calc(12 * var(--u, 1px)); font-weight: 400; color: #e4eceb;
}
.esc-monto-inp {
  width: calc(200 * var(--u, 1px)); height: calc(56 * var(--u, 1px));
  text-align: center; background: transparent; border: 0; outline: none;
  font-family: Oswald, 'Arial Narrow', sans-serif; font-weight: 300;
  font-size: calc(32 * var(--u, 1px)); color: #ffffff; font-variant-numeric: tabular-nums;
}
.esc-mon { display: none; }
.esc-circ-btn, .esc-cant-circ {
  width: calc(56 * var(--u, 1px)); height: calc(56 * var(--u, 1px));
  border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: rgba(0, 64, 64, .85); color: #ffffff; font-size: calc(22 * var(--u, 1px)); font-weight: 400;
  transition: background .16s cubic-bezier(.2, .8, .2, 1), color .16s cubic-bezier(.2, .8, .2, 1), transform .14s cubic-bezier(.2, .8, .2, 1);
}
.esc-circ-btn:active, .esc-redondo:active, .esc-disparo:active { transform: scale(.93); }
.esc-circ-btn .svg-ico { width: calc(32 * var(--u, 1px)); height: calc(32 * var(--u, 1px)); fill: currentColor; }
.esc-circ-btn.on, .esc-cant-circ.on { background: #c0e020; color: #002020; }
.esc-cant-circ { border: 0; outline: none; font-family: Oswald, 'Arial Narrow', sans-serif; font-size: calc(24 * var(--u, 1px)); }

/* [ABAJO · FIJO] Controles inferiores (box h=240px) */
.esc-abajo {
  margin-top: auto; position: relative; z-index: 6; flex: none;
  padding: 0 calc(16 * var(--u, 1px)) calc(14 * var(--u, 1px) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: calc(10 * var(--u, 1px));
}
.esc-elige { display: flex; justify-content: space-between; gap: calc(2 * var(--u, 1px)); width: 100%; height: calc(36 * var(--u, 1px)); align-items: center; }
.esc-elige .pastilla {
  width: calc(64 * var(--u, 1px)); height: calc(32 * var(--u, 1px)); border-radius: calc(16 * var(--u, 1px));
  background: #002020; color: #b8d4d2; font-size: calc(13 * var(--u, 1px)); font-weight: 400;
  transition: background .18s cubic-bezier(.2, .8, .2, 1), color .18s cubic-bezier(.2, .8, .2, 1), transform .14s cubic-bezier(.2, .8, .2, 1);
}
.esc-elige .pastilla:active, .esc-modos button:active { transform: scale(.95); }
.esc-elige .pastilla[aria-pressed="true"] { background: #f0502a; color: #ffffff; }
.esc-elige .pastilla.mas { letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 calc(6 * var(--u, 1px)); }

.esc-controles {
  height: calc(80 * var(--u, 1px)); width: 100%;
  display: flex; align-items: center; justify-content: center; gap: calc(28 * var(--u, 1px));
}
.esc-redondo {
  width: calc(56 * var(--u, 1px)); height: calc(56 * var(--u, 1px)); border-radius: 50%;
  background: #002020; border: 1.5px solid #006060; color: #b8d4d2; display: grid; place-items: center;
  transition: background .16s cubic-bezier(.2, .8, .2, 1), border-color .16s cubic-bezier(.2, .8, .2, 1), color .16s cubic-bezier(.2, .8, .2, 1), transform .14s cubic-bezier(.2, .8, .2, 1), opacity .16s;
}
.esc-redondo[aria-pressed="true"] { background: #c0e020; border-color: #c0e020; color: #002020; }
.esc-redondo:disabled { opacity: .45; }
.esc-redondo .svg-ico { width: calc(32 * var(--u, 1px)); height: calc(32 * var(--u, 1px)); fill: currentColor; }

.esc-disparo {
  width: calc(80 * var(--u, 1px)); height: calc(80 * var(--u, 1px)); border-radius: 50%;
  background: #002020; border: 2.5px solid #ffffff; color: #ffffff; display: grid; place-items: center;
  transition: transform .14s cubic-bezier(.2, .8, .2, 1);
}
.esc-disparo-in {
  width: calc(56 * var(--u, 1px)); height: calc(56 * var(--u, 1px)); border-radius: 50%;
  display: grid; place-items: center; background: transparent;
  transition: background .18s cubic-bezier(.2, .8, .2, 1), transform .18s cubic-bezier(.2, .8, .2, 1), opacity .16s cubic-bezier(.2, .8, .2, 1);
}
.escaner:not(.leido):not(.modo-suma) .esc-disparo-in { opacity: 0; transform: scale(.75); pointer-events: none; }
.escaner.leido .esc-disparo-in { background: #006060; opacity: 1; transform: scale(1); }
.escaner.modo-suma:not(.leido) .esc-disparo-in { background: transparent; opacity: 1; transform: scale(1); }
.esc-disparo .svg-ico { width: calc(32 * var(--u, 1px)); height: calc(32 * var(--u, 1px)); fill: #ffffff; }

.esc-rotulos { font-size: calc(12 * var(--u, 1px)); font-weight: 400; color: #e4eceb; text-align: center; transition: opacity .15s; }

.esc-modos { display: flex; gap: calc(2 * var(--u, 1px)); width: 100%; height: calc(44 * var(--u, 1px)); align-items: center; }
.esc-modos button {
  flex: 1; height: calc(36 * var(--u, 1px)); border-radius: calc(18 * var(--u, 1px));
  background: #002020; color: #b8d4d2; font-size: calc(13 * var(--u, 1px)); font-weight: 400;
  transition: background .18s cubic-bezier(.2, .8, .2, 1), color .18s cubic-bezier(.2, .8, .2, 1), transform .14s cubic-bezier(.2, .8, .2, 1);
}
.esc-modos button.on { background: #006060; color: #ffffff; }

/* 06 · Overlay Listas y Divisas */
#velo-cam-listas .hojita,
#velo-cam-divisas .hojita { padding: calc(12 * var(--u, 1px)) calc(16 * var(--u, 1px)) calc(20 * var(--u, 1px)); }
#velo-cam-listas .cabh,
#velo-cam-divisas .cabh { height: calc(48 * var(--u, 1px)); margin-bottom: calc(6 * var(--u, 1px)); }
#velo-cam-listas .cabh .tit,
#velo-cam-divisas .cabh .tit { font-size: calc(18 * var(--u, 1px)); font-weight: 400; }
.cam-lst-filas { display: flex; flex-direction: column; margin-bottom: calc(16 * var(--u, 1px)); max-height: 36dvh; overflow-y: auto; }
.cam-lst-fila {
  width: 100%; height: calc(56 * var(--u, 1px));
  display: flex; align-items: center; gap: calc(12 * var(--u, 1px));
  border-bottom: 1px solid #e4eceb; color: #002020; text-align: left;
  transition: background .15s cubic-bezier(.2, .8, .2, 1);
}
.cam-lst-fila:active { background: #f2f7f6; }
.cam-lst-fila.on .cam-lst-txt b { color: #006060; font-weight: 500; }
.cam-lst-fila:last-child { border-bottom: 0; }
.cam-lst-fila .svg-ico:first-child { width: calc(24 * var(--u, 1px)); height: calc(24 * var(--u, 1px)); color: #006060; flex: none; }
.cam-lst-fila .svg-ico.rig { width: calc(16 * var(--u, 1px)); height: calc(16 * var(--u, 1px)); color: #006060; flex: none; }
.cam-lst-sigla {
  min-width: calc(56 * var(--u, 1px)); height: calc(28 * var(--u, 1px)); padding: 0 calc(8 * var(--u, 1px)); border-radius: calc(14 * var(--u, 1px));
  background: #e4eceb; color: #002020; display: grid; place-items: center; flex: none;
  font-size: calc(12 * var(--u, 1px)); font-weight: 400; white-space: nowrap;
}
.cam-lst-fila.on .cam-lst-sigla { background: #f0502a; color: #ffffff; }
.cam-lst-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cam-lst-txt b { font-size: calc(16 * var(--u, 1px)); font-weight: 400; color: #002020; }
.cam-lst-txt small { font-size: calc(14 * var(--u, 1px)); font-weight: 400; color: #566a6a; }
.cam-div-vacio { padding: calc(16 * var(--u, 1px)) 0; text-align: center; color: #566a6a; font-size: calc(14 * var(--u, 1px)); }
.cam-lst-new {
  display: flex; align-items: center; gap: calc(8 * var(--u, 1px));
  height: calc(48 * var(--u, 1px)); border: 1px solid #b8d4d2; border-radius: calc(24 * var(--u, 1px));
  padding: 0 calc(8 * var(--u, 1px)) 0 calc(16 * var(--u, 1px)); margin-bottom: calc(12 * var(--u, 1px));
}
.cam-lst-new input { flex: 1; min-width: 0; color: #002020; font-size: calc(16 * var(--u, 1px)); outline: none; }
.cam-lst-new button { padding: calc(6 * var(--u, 1px)) calc(12 * var(--u, 1px)); color: #1565c0; font-size: calc(16 * var(--u, 1px)); font-weight: 400; }
#cam-lst-todas { height: calc(46 * var(--u, 1px)); font-size: calc(16 * var(--u, 1px)); font-weight: 400; }

.esc-aviso {
  position: fixed; z-index: 60; left: 50%; bottom: calc(18 * var(--u, 1px)); transform: translateX(-50%);
  width: calc(328 * var(--u, 1px)); padding: calc(12 * var(--u, 1px)) calc(14 * var(--u, 1px));
  border-radius: calc(16 * var(--u, 1px)); background: #c0e020; color: #002020; font-size: calc(13 * var(--u, 1px)); font-weight: 400;
  animation: esc-card-in .18s cubic-bezier(.2, .8, .2, 1) both;
}
.esc-aviso[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .esc-franja, .esc-suma-card, .esc-aviso, .esc-linea, .esc-dots circle { animation: none !important; }
  .esc-semicirculo, .esc-disparo-in, .esc-elige .pastilla, .esc-modos button, .esc-circ-btn, .esc-redondo, .esc-disparo { transition: none !important; }
}
