/* ORDENEX v3 · app.css — el armazón (dueño: integrador): transición entre pantallas,
   selector de temas, pantallas de aviso. Solo variables de tokens.css. */

#lienzo { min-height: calc(100dvh - var(--alto-barra)); outline: none; }
/* backwards y no both: una animación de transform que se queda «puesta» convierte la pantalla en el marco de los
   elementos fijos (la barra Comprar/Vender del teléfono se iba al fondo de la página). */
#lienzo .app-pantalla { animation: onx-entra var(--t-media) var(--curva) backwards; }
#lienzo.app-saliendo .app-pantalla { opacity: .4; transition: opacity var(--t-rapida) var(--curva); }

/* Mientras corre la intro no se ve la casa detrás. */
html:not(.app-lista) #barra, html:not(.app-lista) #barra-inf { visibility: hidden; }

.app-vacio { padding-block: 18vh; }
.app-vacio .vacio { display: grid; gap: 12px; justify-items: center; text-align: center; }
.app-vacio h2 { font-size: 22px; }

/* Selector de temas: cada opción enseña su propia paleta. */
.app-temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.app-tema {
  display: grid; gap: 8px; justify-items: start; padding: 10px; text-align: left;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie-2); color: var(--texto);
  cursor: pointer; transition: border-color var(--t-rapida) var(--curva), transform var(--t-rapida) var(--curva);
}
.app-tema:hover { border-color: var(--acento); transform: translateY(-1px); }
.app-tema.activo { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento) inset; }
.app-tema-muestra { width: 100%; height: 44px; border-radius: var(--radio-s); border: 1px solid var(--borde); }
.app-tema-muestra[data-tema-muestra="oscuro"] { background: linear-gradient(135deg, #07090D 0 60%, #C9A961 60% 70%, #1FC27E 70% 85%, #F0465A 85%); }
.app-tema-muestra[data-tema-muestra="claro"] { background: linear-gradient(135deg, #F7F7F5 0 60%, #9C7A22 60% 70%, #0E9F62 70% 85%, #D33449 85%); }
.app-tema-muestra[data-tema-muestra="boveda"] { background: linear-gradient(135deg, #070D1C 0 60%, #D4B36A 60% 70%, #34CF96 70% 85%, #FF6B7C 85%); }
.app-tema-muestra[data-tema-muestra="contraste"] { background: linear-gradient(135deg, #000 0 60%, #FFD84D 60% 70%, #4DFFA6 70% 85%, #FF6B7A 85%); }

@media (prefers-reduced-motion: reduce) {
  #lienzo .app-pantalla { animation: none; }
}

/* Barra superior en el teléfono: textos cortos para que «Conectar» nunca se salga del borde. */
.app-corto { display: none; }
@media (max-width: 599px) {
  .barra-sup .app-largo { display: none; }
  .barra-sup .app-corto { display: inline; }
  .barra-sup-dentro { gap: 10px; padding-inline: 12px; }
  .barra-acciones { gap: 4px; }
  .barra-marca .marca { font-size: 14px; letter-spacing: .14em; }
  .barra-marca img { height: 22px; }
  .barra-sup .chapa-demo { padding-inline: 8px; }
  .barra-sup .btn-s { padding-inline: 10px; }
}
@media (max-width: 359px) { .barra-marca .marca { display: none; } }

/* ══ v3 · objetivos táctiles (2026-11): con dedo o en pantalla angosta, todo botón, pestaña, enlace de acción y
   campo mide 44 px de alto o más. La barra inferior conserva sus cinco destinos con el margen del área segura. ══ */
@media (pointer: coarse), (max-width: 860px) {
  .btn, .btn-s, .btn-icono, .pestana, [role="tab"], .segmentado > button, .selector, select, .entrada,
  .menu-item, .chapa-filtro, .filtro, summary { min-height: 44px; }
  .btn-icono { min-width: 44px; }
  .btn-s { padding-block: 0; }
  .entrada-grupo { min-height: 44px; }
  .entrada-grupo > .entrada { min-height: 0; align-self: stretch; }
  .barra-sup .btn, .barra-sup .btn-icono { min-height: 44px; }
  /* enlaces de acción sueltos (no texto corrido) */
  a.enlace, .enlace.pequeno, .mk-ficha, .p2p-volver, .p2p-enlace, .vn-enlace { display: inline-flex; align-items: center; min-height: 44px; }
}
.app-vacio-acciones { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* sin conexión: banda discreta */
.app-sinred {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--alto-barra) + 8px); z-index: 85;
  padding: 8px 14px; border-radius: var(--radio-pildora); font-size: 12.5px; color: var(--texto);
  background: var(--superficie-2); border: 1px solid color-mix(in srgb, var(--aviso) 45%, transparent); box-shadow: var(--sombra-s);
  max-width: calc(100vw - 32px); text-align: center;
}
@media (pointer: coarse), (max-width: 860px) {
  .px-pie-nav a { display: flex; align-items: center; min-height: 44px; padding: 0; }
  .cu-nav a { height: auto; min-height: 44px; }
  .sl-intervalos button, .sl-vistas button { min-height: 44px !important; height: 44px !important; min-width: 44px; }
  .cpr-rap { min-height: 44px; }
  .mk-buscar input { align-self: stretch; }
}
/* Vista previa del equipo (ensayo): la chapa no empuja la barra fuera de la pantalla en el teléfono. */
@media (max-width: 420px) { [data-hueco-ensayo] { display: none; } } /* la pantalla ya lleva su propia banda de ensayo */

/* ── El telón de la entrada «El Anillo» (js/tema-temprano.js pone html.onx-entrada antes del primer pintado) ──
   Negro verdoso y un punto verde que respira, sin texto ni imágenes (no compite por el LCP). El 3D lo toma sin salto
   (html.onx-entrada-viva) y la capa de js/escena/entrada.js pone su velo. Si el 3D no llega a tiempo, app.js lo quita. */
html.onx-entrada #intro-raiz { position: fixed; inset: 0; z-index: 1000; background: #020705; }
html.onx-entrada:not(.onx-entrada-viva) #intro-raiz::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #2BFFA3; box-shadow: 0 0 16px 5px rgba(43, 255, 163, .55), 0 0 60px 22px rgba(43, 255, 163, .16);
  animation: onx-respira 1.6s ease-in-out infinite;
}
html.onx-entrada-viva #intro-raiz { background: transparent; }
html.ex-activa, html.ex-activa body { overflow: hidden; }
@keyframes onx-respira { 0%, 100% { transform: scale(.72); opacity: .7; } 50% { transform: scale(1.12); opacity: 1; } }
/* el panel recibe el anillo: el filo verde queda como contorno y se desvanece en 600 ms (en reposo el panel no tiene
   borde); el contenido entra en tres grupos (interruptor, cifras, botón; 60 ms de escalón, 12 px de subida). */
[data-panel-origen] { outline: none; }
[data-panel-origen].po-resuelve > .po::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1.5px #2BFFA3; animation: po-contorno 600ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes po-contorno { from { opacity: 1; } to { opacity: 0; } }
[data-panel-origen].po-entra > .po > .po-g { animation: po-grupo 420ms cubic-bezier(.2, .8, .2, 1) both; }
[data-panel-origen].po-entra > .po > .po-gm, [data-panel-origen].po-entra > .po > .po-gr { animation-delay: 60ms; }
[data-panel-origen].po-entra > .po > .po-ga, [data-panel-origen].po-entra > .po > .po-gd { animation-delay: 120ms; }
@keyframes po-grupo { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { [data-panel-origen].po-resuelve > .po::after, [data-panel-origen].po-entra > .po > .po-g { animation: none; } }

/* ── Barra superior y navegación inferior (cambio mínimo, 2026-11-13): «Entrar» neutro y la pestaña activa en blanco ── */
#barra .nav-entrar.btn-primario {
  background: var(--superficie-2); color: var(--texto); clip-path: none; border-radius: 10px; filter: none;
  box-shadow: inset 0 0 0 1px var(--borde-2);
}
#barra .nav-entrar.btn-primario::before { display: none; }
#barra .nav-entrar.btn-primario:hover:not(:disabled) { filter: none; box-shadow: inset 0 0 0 1px var(--texto-3); }
#barra .nav-entrar.btn-primario:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--borde-2); }
:root:not([data-tema="claro"]) #barra-inf a[aria-current="page"] { color: var(--texto); }
:root:not([data-tema="claro"]) #barra-inf a[aria-current="page"]::before { background: var(--texto) !important; box-shadow: none !important; }
:root:not([data-tema="claro"]) #barra-inf a[aria-current="page"] .icono { filter: none; }
:root:not([data-tema="claro"]) #barra .barra-nav > a[aria-current="page"]::after, :root:not([data-tema="claro"]) #barra .nav-boton[aria-current="page"]::after { background: var(--texto) !important; box-shadow: none !important; }

/* ── «Entrar con Veta», variante compacta (solo desde el panel de la portada: ui.js · conectarCompacto) ── */
.gidc-modal { max-width: 420px; border-radius: 24px; background: #0D1210; border: 0; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); font-family: var(--fuente); }
.gidc-modal .modal-cab { border-bottom: 0; padding: 24px 24px 0; }
.gidc-modal .modal-cab h3 { font-family: var(--fuente-editorial); font-weight: 500; font-size: 30px; line-height: 1.15; color: #F2F5F3; }
.gidc-modal .modal-cab [data-cerrar] { min-width: 44px; min-height: 44px; color: #9AA6A0; }
.gidc-modal .modal-cuerpo { padding: 16px 24px 24px; }
.gid-compacto { display: grid; gap: 16px; }
.gid-compacto .gid-motivo { margin: 0; font-size: 15px; line-height: 1.5; color: #9AA6A0; }
.gidc-ir { height: 56px; width: 100%; border: 0; border-radius: 14px; background: #2BFFA3; color: #04120B; font: 600 17px var(--fuente); cursor: pointer; transition: transform 220ms cubic-bezier(.3, 1.35, .5, 1); }
.gidc-ir:active { transform: scale(.97); transition-duration: 90ms; }
.gidc-ir:focus-visible, .gidc-ver:focus-visible, .gidc-como:focus-visible { outline: 2px solid #F2F5F3; outline-offset: 3px; }
.gidc-ver { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; color: #F2F5F3; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(242, 245, 243, .35); }
.gidc-como { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; font: 500 15px var(--fuente); color: #9AA6A0; cursor: pointer; }
.gidc-como svg { transition: transform 260ms cubic-bezier(.2, .8, .2, 1); }
.gidc-como[aria-expanded="true"] svg { transform: rotate(180deg); }
.gidc-como-c { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms cubic-bezier(.2, .8, .2, 1); }
.gidc-como-c[data-abierto="true"] { grid-template-rows: 1fr; }
.gidc-como-c > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear 260ms; }
.gidc-como-c[data-abierto="true"] > div { visibility: visible; transition-delay: 0s; }
.gidc-pasos { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; color: #9AA6A0; }
.gidc-pasos b { color: #F2F5F3; font-weight: 600; }
.gidc-nota { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #9AA6A0; }
@media (prefers-reduced-motion: reduce) { .gidc-ir, .gidc-como svg, .gidc-como-c, .gidc-como-c > div { transition: none; } .gidc-ir:active { transform: none; } }

/* ── Acentos (2026-11-13, 3.ª ronda): VERDE para la marca y la acción, ORO solo para ORIGEN y los activos de oro, PLATA
   para AGKA; lo demás, neutro. El lingote verde es el mismo material del botón del panel. ── */
:root {
  --lingote-verde: linear-gradient(180deg, #8AFFD0 0%, #2BFFA3 48%, #15C47C 100%);
  --bisel-verde: inset 0 1px 0 rgba(255, 255, 255, .72), inset 0 -1px 0 rgba(0, 48, 26, .6);
}
/* el disco «Trading» de la barra inferior: lingote verde (antes oro) */
#barra-inf .inf-trading-disco { background: #2BFFA3 var(--lingote-verde) !important; color: #04120B !important; clip-path: none; border-radius: 12px !important; box-shadow: var(--bisel-verde), 0 8px 18px -10px rgba(43, 255, 163, .6) !important; }
:root[data-tema="claro"] #barra-inf .inf-trading-disco { background: #2BFFA3 var(--lingote-verde) !important; color: #04120B !important; }
/* la barra superior tampoco pide Michroma ni Geist Mono (chapas como «Próximamente» en Instrument Sans) */
#barra, #barra-inf { --fuente-num: var(--fuente); --fuente-sello: var(--fuente); }
/* «Entrar con Veta» del pie de la portada y del diálogo: lingote verde */
#lienzo .px-cta .btn-primario, .gidc-ir { background: #2BFFA3 var(--lingote-verde) !important; color: #04120B !important; clip-path: none; border-radius: 14px; box-shadow: var(--bisel-verde); filter: none; }
#lienzo .px-cta .btn-primario::before, .px-cta-caja::before { display: none; }
#lienzo .px-cta .btn-primario:active, .gidc-ir:active { transform: translateY(2px); box-shadow: inset 0 2px 6px rgba(0, 48, 26, .55); }
.px-cta-caja { border-color: var(--borde) !important; background: var(--superficie) !important; }
/* el aviso SFSP en tono neutro (sin naranja ni oro) y sin fuentes de marca: Instrument Sans con cifras tabulares */
#onx-sfsp { --fuente-num: var(--fuente); --fuente-sello: var(--fuente); }
#onx-sfsp .num { font-variant-numeric: tabular-nums; }
#onx-sfsp .onx-banda-ver { color: var(--texto); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--texto) 35%, transparent); }
#onx-sfsp .chapa { color: var(--texto-2); background: transparent; border: 1px solid var(--borde-2); box-shadow: none; letter-spacing: .04em; }

/* «← Volver a Veta»: quien llegó desde la ficha de una moneda en Veta tiene la vuelta a mano (js/nucleo/veta.js).
   Una línea discreta entre la barra y la pantalla; no compite con la acción principal. */
.veta-vuelta { border-bottom: 1px solid var(--borde); background: var(--fondo); }
.veta-vuelta[hidden] { display: none; }
.veta-vuelta-in { max-width: 1440px; margin: 0 auto; padding: 0 16px; min-height: 44px; display: flex; align-items: center; }
.veta-vuelta-a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; margin-left: -4px;
  font-size: 13.5px; font-weight: 500; color: var(--texto-2); text-decoration: none; border-radius: 8px;
  transition: color var(--t-rapida, .15s) ease;
}
.veta-vuelta-a:hover { color: var(--texto); }
.veta-vuelta-a:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
@media (min-width: 861px) { .veta-vuelta-in { padding: 0 24px; } }
/* La fila que pidió Veta (#/mercados?moneda=SIM) se marca un momento con un borde de oro que se desvanece. */
.mk-fila.mk-resalta { animation: mk-resalta 1.6s ease-out both; }
@keyframes mk-resalta { 0%, 55% { box-shadow: inset 0 0 0 1.5px var(--oro-hilo, #D9B15A); } 100% { box-shadow: inset 0 0 0 1.5px transparent; } }
@media (prefers-reduced-motion: reduce) { .mk-fila.mk-resalta { animation: none; box-shadow: inset 0 0 0 1.5px var(--oro-hilo, #D9B15A); } }
