:root {
  /* Tema OSCURO: negro elegante; el dorado solo en acentos */
  --fondo: #050505;
  --fondo-2: #0e0e0e;
  --tarjeta: #151515;
  --borde: #262626;
  --oro: #c8a45d;
  --oro-claro: #d8c69c;
  --oro-osc: #9a7b3f;
  --texto: #f2f2f0;
  --texto-fuerte: #ffffff;
  --suave: #9b9b98;
  --verde: #4ade80;
  --verde-osc: #16a34a;
  --rojo: #f87171;
  --ambar: #fbbf24;
  --azul: #d8c69c;
  --sobre-oro: #1c1917;
  --plata: #dfe4ea;
  --t: 255, 255, 255;          /* tinta de los velos/bordes finos */
  --sup: 24, 24, 24;           /* superficie de tarjetas */
  --sup2: 12, 12, 12;          /* superficie más profunda */
  --sup-solido: #1a1a1a;
  --sombra-rgb: 0, 0, 0;
  --sk: 1;                     /* intensidad de sombras */
  --pozo: rgba(var(--pozo-rgb), calc(.22 * var(--pk)));  /* fondos hundidos dentro de tarjetas */
  --pozo-rgb: 0, 0, 0;
  --pk: 1;
  --brillo: 170, 160, 140;     /* resplandor: casi neutro en oscuro */
  --amb-1: #141414;
  --amb-3: #101010;
  --barra-tabs: rgba(14, 14, 14, .9);
  --radio: 16px;
  --sombra: 0 8px 30px rgba(var(--sombra-rgb), calc(.25 * var(--sk)));
  color-scheme: dark;
}
/* Tema CLARO: marfil + blanco + dorado champán, texto grafito */
:root[data-tema="claro"] {
  --fondo: #faf7f0;
  --fondo-2: #ffffff;
  --tarjeta: #ffffff;
  --borde: #e7dfce;
  --oro: #c8a45d;
  --oro-claro: #8a6a2f;
  --oro-osc: #a8843f;
  --texto: #1c1917;
  --texto-fuerte: #1c1917;
  --suave: #6b6560;
  --verde: #15803d;
  --verde-osc: #166534;
  --rojo: #b91c1c;
  --ambar: #b45309;
  --azul: #8a6a2f;
  --sobre-oro: #1c1917;
  --plata: #5b6370;
  --t: 41, 37, 32;
  --sup: 255, 255, 255;
  --sup2: 251, 248, 242;
  --sup-solido: #ffffff;
  --sombra-rgb: 120, 96, 52;
  --sk: .32;
  --pozo: rgba(120, 96, 52, .06);
  --pozo-rgb: 120, 96, 52;
  --pk: .28;
  --brillo: 214, 178, 106;
  --amb-1: #f3e6c8;
  --amb-3: #efe2c4;
  --barra-tabs: rgba(255, 255, 255, .88);
  --sombra: 0 8px 30px rgba(120, 96, 52, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--azul); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; color: var(--suave); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.suave { color: var(--suave); }
.peq { font-size: .82rem; }
.verde { color: var(--verde); }
.rojo { color: var(--rojo); }
.ambar { color: var(--ambar); }
.cargando { padding: 3rem; text-align: center; color: var(--suave); }
.oculto { display: none !important; }

/* ── Estructura ── */
.marco { min-height: 100vh; display: flex; flex-direction: column; }
.barra-demo { background: rgba(var(--brillo), .18); color: var(--ambar); font-size: .8rem; text-align: center; padding: .35rem; }
.cabecera { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .5rem; }
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 600; letter-spacing: .14em; font-size: .92rem; }
.marca b { color: var(--oro-claro); font-weight: 800; }
.marca img { width: 30px; height: auto; }
.contenido { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: .5rem 1rem 6.5rem; }
.rejilla { display: grid; gap: 1rem; }
@media (min-width: 760px) {
  .rejilla.dos { grid-template-columns: 1fr 1fr; }
  .rejilla.tres { grid-template-columns: repeat(3, 1fr); }
  .rejilla.cuatro { grid-template-columns: repeat(4, 1fr); }
}

/* Navegación inferior (cliente, móvil) */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around;
  background: rgba(4, 10, 23, .9); backdrop-filter: blur(10px); border-top: 1px solid var(--borde);
  padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom)); z-index: 5; }
.tabs a { flex: 1; text-align: center; color: var(--suave); font-size: .72rem; padding: .3rem 0; border-radius: 10px; }
.tabs a .ico { display: block; font-size: 1.25rem; line-height: 1.3; }
.tabs a.activo { color: var(--oro-claro); }

/* Navegación lateral (admin / tesorería) */
.lateral { display: flex; gap: .4rem; overflow-x: auto; padding: 0 1rem .6rem; }
.lateral a { white-space: nowrap; padding: .45rem .8rem; border-radius: 999px; color: var(--suave); border: 1px solid var(--borde); font-size: .85rem; }
.lateral a.activo { background: linear-gradient(135deg, var(--oro-claro), var(--oro)); border-color: var(--oro); color: var(--sobre-oro); font-weight: 600; }

/* ── Tarjetas ── */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem; }
.tarjeta + .tarjeta { margin-top: 1rem; }
.rejilla .tarjeta + .tarjeta { margin-top: 0; }
.cifra { font-size: 1.6rem; font-weight: 700; }
.etiqueta { font-size: .8rem; color: var(--suave); text-transform: uppercase; letter-spacing: .6px; }

.heroe { background: radial-gradient(120% 140% at 100% 0%, rgba(201, 165, 92, .22) 0%, transparent 55%), linear-gradient(150deg, rgba(var(--sup), .95), rgba(var(--sup2), .95));
  border: 1px solid rgba(232, 207, 148, .28); border-radius: 22px; padding: 1.4rem 1.3rem; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.heroe .etiqueta { color: var(--oro-claro); }
.heroe .grande { font-size: 2.6rem; font-weight: 800; letter-spacing: -.5px; margin: .2rem 0 .1rem; }
.heroe .grande small { font-size: 1rem; font-weight: 600; color: var(--suave); margin-left: .3rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: rgba(var(--brillo), .14); color: var(--verde); }
.chip.gris { background: rgba(147, 161, 189, .14); color: var(--suave); }
.chip.ambar { background: rgba(255, 193, 94, .14); color: var(--ambar); }
.chip.rojo { background: rgba(255, 107, 122, .14); color: var(--rojo); }
.pulso { animation: pulso 1.6s ease-out 2; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(var(--brillo), .5); } 100% { box-shadow: 0 0 0 14px rgba(var(--brillo), 0); } }
.fila { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.fila + .fila { margin-top: .55rem; }
.separador { height: 1px; background: var(--borde); margin: .9rem 0; border: 0; }

progress { width: 100%; height: 8px; border-radius: 99px; overflow: hidden; appearance: none; background: var(--fondo-2); border: 0; }
progress::-webkit-progress-bar { background: var(--fondo-2); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--verde-osc), var(--verde)); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--verde-osc), var(--verde)); border-radius: 99px; }
meter { width: 100%; height: 10px; }

/* ── Formularios ── */
label { display: block; font-size: .85rem; color: var(--suave); margin: .8rem 0 .35rem; }
input, select, textarea { width: 100%; padding: .75rem .85rem; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--fondo-2); color: var(--texto); font: inherit; }
input:focus, select:focus { outline: 2px solid rgba(201, 165, 92, .6); border-color: transparent; }
input.monto { font-size: 1.5rem; font-weight: 700; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.1rem; border-radius: 12px;
  border: 0; background: linear-gradient(135deg, var(--oro-claro), var(--oro) 55%, var(--oro-osc)); color: var(--sobre-oro); font: inherit; font-weight: 700; cursor: pointer; }
.boton:disabled { opacity: .45; cursor: not-allowed; }
.boton.ancho { width: 100%; margin-top: 1rem; }
.boton.sec { background: transparent; border: 1px solid var(--borde); color: var(--texto); }
.boton.peligro { background: transparent; border: 1px solid var(--rojo); color: var(--rojo); }
.boton.chico { padding: .4rem .7rem; font-size: .82rem; border-radius: 9px; }
.botones { display: flex; gap: .6rem; flex-wrap: wrap; }
.botones .boton { flex: 1; }
.error { color: var(--rojo); font-size: .88rem; margin-top: .6rem; min-height: 1.2em; }

/* ── Tablas ── */
.tabla-env { overflow-x: auto; margin: 0 -1.1rem; padding: 0 1.1rem; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--suave); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; padding: .5rem .4rem; border-bottom: 1px solid var(--borde); }
td { padding: .6rem .4rem; border-bottom: 1px solid rgba(var(--sup), .6); vertical-align: top; }
td.der, th.der { text-align: right; }
tr:last-child td { border-bottom: 0; }

/* ── Acceso ── */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.acceso .caja { width: 100%; max-width: 400px; }
.acceso .marca { justify-content: center; font-size: 1.3rem; margin-bottom: 1.5rem; }
.acceso .marca img { width: 44px; height: auto; }

.qr { background: #fff; border-radius: 12px; padding: .5rem; width: 220px; height: 220px; display: block; margin: .8rem auto; }
.codigo { font-family: ui-monospace, Menlo, monospace; background: var(--fondo-2); border: 1px dashed var(--borde); padding: .6rem .8rem; border-radius: 10px; word-break: break-all; font-size: .85rem; }

.aviso { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); background: #0f2a20; color: var(--verde); border: 1px solid #1d5a43;
  padding: .7rem 1rem; border-radius: 12px; box-shadow: var(--sombra); z-index: 20; max-width: 90vw; font-size: .9rem; }
.aviso.mal { background: #2e1218; color: var(--rojo); border-color: #6b2531; }

.vacio { text-align: center; color: var(--suave); padding: 1.5rem .5rem; }
.contrato { display: block; }
.contrato .arriba { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
details summary { cursor: pointer; color: var(--azul); margin-top: .6rem; font-size: .88rem; }
.espacio { margin-top: 1rem; }
h2.espacio { margin-top: 1.4rem; }
input.check { width: auto; margin-right: .4rem; vertical-align: middle; }
form.botones label { margin: 0; align-self: center; }
.codigo-linea { word-break: break-all; font-family: ui-monospace, Menlo, monospace; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; color: var(--azul); }
.centro { text-align: center; }
.segmentos { display: flex; gap: .4rem; background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 12px; padding: .25rem; margin-bottom: .6rem; }
.seg { flex: 1; border: 0; background: transparent; color: var(--suave); font: inherit; font-weight: 600; padding: .55rem; border-radius: 9px; cursor: pointer; }
.seg.activo { background: var(--tarjeta); color: var(--texto); box-shadow: 0 0 0 1px var(--borde); }
.velo { position: fixed; inset: 0; background: rgba(var(--pozo-rgb), calc(.6 * var(--pk))); display: flex; align-items: flex-end; justify-content: center; z-index: 30; }
.hoja { width: 100%; max-width: 440px; background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 22px 22px 0 0; padding: 1.2rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom)); box-shadow: var(--sombra); }
@media (min-width: 760px) { .velo { align-items: center; } .hoja { border-radius: 22px; } }

/* Plan Aurum */
.chip.oro { background: linear-gradient(135deg, var(--oro-claro), var(--oro)); color: var(--sobre-oro); font-weight: 700; }
.plan.aurum { border-color: rgba(232, 207, 148, .45); background: linear-gradient(160deg, rgba(232, 207, 148, .12), var(--tarjeta)); }
.chip.plata { background: linear-gradient(135deg, #e6e9ee, #aeb6c2); color: var(--sobre-oro); font-weight: 700; }

/* ══════════════ Inicio del socio: billetera y cristal (estilo iOS) ══════════════ */
/* Luces de fondo: el cristal necesita color detrás para que se note el desenfoque. Dorado muy contenido. */
.ambiente { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--fondo); }
.ambiente i { position: absolute; border-radius: 50%; }
.ambiente i:nth-child(1) { width: 560px; height: 560px; left: -200px; top: -160px; opacity: .6; background: radial-gradient(circle, var(--amb-1), transparent 68%); animation: amb-1 26s ease-in-out 2 alternate; }
.ambiente i:nth-child(2) { width: 420px; height: 420px; right: -170px; top: 140px; opacity: .22; background: radial-gradient(circle, rgba(200, 164, 93, .7), transparent 68%); animation: amb-2 30s ease-in-out 2 alternate; }
.ambiente i:nth-child(3) { width: 640px; height: 640px; left: 5%; bottom: -360px; opacity: .55; background: radial-gradient(circle, var(--amb-3), transparent 68%); animation: amb-3 34s ease-in-out 2 alternate; }
@keyframes amb-1 { to { transform: translate(90px, 70px); } }
@keyframes amb-2 { to { transform: translate(-80px, 90px); } }
@keyframes amb-3 { to { transform: translate(-90px, -60px); } }
html, body { background: transparent; }
html { background: var(--fondo); }

/* Cabecera alineada con el contenido + avatar */
.cabecera { max-width: 1080px; width: 100%; margin: 0 auto; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  color: var(--oro-claro); background: rgba(var(--t), .06); box-shadow: inset 0 0 0 1px rgba(236, 213, 159, .55); text-decoration: none; }

/* Foco visible para teclado */
:is(button, a, .accion, .icono-vidrio, .segmento button, .tabs a):focus-visible { outline: 2px solid var(--oro-claro); outline-offset: 2px; }

/* Paneles: cristal liviano (sin desenfoque, para que sea fluido en teléfonos sencillos) */
.inicio { display: grid; gap: .9rem; max-width: 560px; margin: 0 auto; }
.col-billetera, .col-detalle { display: grid; gap: .9rem; align-content: start; }
.panel, .inicio .tarjeta { position: relative; border-radius: 22px; padding: 1.1rem 1.15rem;
  background: linear-gradient(155deg, rgba(var(--sup), .78), rgba(var(--sup2), .82));
  border: 1px solid rgba(var(--t), .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 36px -24px rgba(var(--sombra-rgb), calc(.8 * var(--sk))); }
.rotulo { font-size: .84rem; color: rgba(var(--t), .72); font-weight: 600; }

/* ── Tarjeta billetera (proporción de tarjeta real) ── */
.billetera { position: relative; overflow: hidden; isolation: isolate; color: var(--texto-fuerte); border-radius: 26px;
  gap: 1rem; padding: 1.15rem 1.25rem 1.05rem; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 60% at 100% 0%, rgba(236, 213, 159, .34), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, rgba(var(--brillo), .38), transparent 62%),
    linear-gradient(150deg, rgba(var(--sup), .55), rgba(var(--sup2), .5) 55%, rgba(var(--sup2), .62));
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 0 0 .5px rgba(var(--t), .12), inset 0 -1px 0 rgba(var(--sombra-rgb), calc(.3 * var(--sk))), 0 28px 56px -26px rgba(var(--sombra-rgb), calc(.9 * var(--sk))), 0 0 40px -10px rgba(200, 164, 93, .18); }
/* Canto de luz del cristal */
.billetera::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(var(--t), .75), rgba(var(--t), .06) 35%, rgba(236, 213, 159, .45) 72%, rgba(var(--t), .12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* Brillo especular arriba */
.billetera::after { content: ""; position: absolute; inset: 0 0 58% 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--t), .13), transparent); }
.bill-luz { position: absolute; inset: -40% -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(var(--t), .08) 50%, transparent 58%); animation: bill-reflejo 9s ease-in-out 2; }
@keyframes bill-reflejo { 0% { transform: translateX(-40%); } 100% { transform: translateX(40%); } }
.bill-arriba { display: flex; align-items: center; justify-content: space-between; }
.red-insignia { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; padding: .3rem .75rem;
  border-radius: 999px; background: rgba(var(--pozo-rgb), calc(.28 * var(--pk))); }
.bill-chip { width: 30px; opacity: .92; filter: drop-shadow(0 2px 8px rgba(200, 164, 93, .45)); }
.bill-etiqueta { font-size: .8rem; color: rgba(var(--t), .72); }
.bill-saldo { display: flex; align-items: baseline; font-size: clamp(2.6rem, 12vw, 3.3rem); font-weight: 760; letter-spacing: -.035em; line-height: 1.04; font-variant-numeric: tabular-nums; }
.bill-moneda { font-size: .52em; font-weight: 600; margin-right: .06em; color: rgba(var(--t), .78); align-self: flex-start; margin-top: .22em; }
.bill-dec { font-size: .52em; color: rgba(var(--t), .66); }
.bill-partes { display: flex; flex-wrap: wrap; gap: .4rem; }
.parte { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .26rem .55rem; border-radius: 999px; font-size: .72rem; white-space: nowrap;
  color: rgba(var(--t), .78); background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); }
.parte b { color: var(--texto-fuerte); font-weight: 700; font-variant-numeric: tabular-nums; }
.parte i, .punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.p-dep { background: #8fb2ff; } .p-gan { background: var(--verde); } .p-com { background: var(--oro-claro); } .p-inv { background: #c3cad4; }
.p-tron { background: #ff3b47; box-shadow: 0 0 8px rgba(255, 59, 71, .6); } .p-bnb { background: #f3ba2f; box-shadow: 0 0 8px rgba(243, 186, 47, .6); }

/* ── Franja de depósito (red + dirección) ── */
.deposito { border-radius: 22px; padding: .55rem; display: grid; gap: .5rem;
  background: linear-gradient(155deg, rgba(var(--t), .07), rgba(var(--t), .025));
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(var(--t), .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); }
.segmento button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: rgba(var(--t), .62); font: inherit; font-size: .84rem; font-weight: 650; transition: background .2s, color .2s; }
.segmento button.activo { background: rgba(var(--t), .14); color: var(--texto-fuerte); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 10px rgba(var(--sombra-rgb), calc(.25 * var(--sk))); }
.dep-fila { display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .25rem .7rem; }
.dep-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.dep-texto span { font-size: .74rem; color: rgba(var(--t), .72); }
.dep-texto code { color: var(--texto-fuerte); font-size: .95rem; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono-vidrio { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; cursor: pointer; color: var(--texto-fuerte);
  background: rgba(var(--t), .09); border: 0; transition: background .2s, transform .15s; }
.icono-vidrio:hover { background: rgba(var(--t), .16); }
.icono-vidrio:active { transform: scale(.94); }
.icono-vidrio svg, .accion-ico svg, .tabs .ico svg, .boton svg, .cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Enlace de referido ── */
.referido { display: flex; align-items: center; gap: .5rem; padding: .7rem .7rem .7rem 1.05rem; }
.ref-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ref-texto code { color: var(--texto-fuerte); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono-vidrio.oro { color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); }

/* ── Acciones ── */
.acciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.accion { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .7rem .3rem .6rem; border-radius: 20px; cursor: pointer;
  color: var(--texto-fuerte); font: inherit; font-size: .8rem; font-weight: 600; text-decoration: none;
  background: linear-gradient(155deg, rgba(var(--t), .07), rgba(var(--t), .02)); border: 1px solid rgba(var(--t), .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: transform .15s, background .2s; }
.accion:hover { background: linear-gradient(155deg, rgba(var(--t), .11), rgba(var(--t), .04)); }
.accion:active { transform: scale(.96); }
.accion-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--texto-fuerte); background: rgba(var(--t), .12); }
.accion.principal .accion-ico { color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); box-shadow: 0 6px 16px -6px rgba(200, 164, 93, .75), inset 0 1px 0 rgba(255, 255, 255, .5); }

/* ── Ganancias de la semana ── */
.semana-cero .fila { align-items: baseline; }
.semana-cero .semana-monto { font-size: 1.15rem; margin: 0; }
.plan-tasa small { font-size: .72rem; font-weight: 600; color: rgba(236, 213, 159, .75); }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.semana-monto { font-size: 1.9rem; font-weight: 760; letter-spacing: -.02em; margin: .25rem 0 .2rem; font-variant-numeric: tabular-nums; }
.dias { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; align-items: end; height: 84px; margin-top: .4rem; padding-bottom: 0; }
.dia { display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; }
.dia .barra { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; border-bottom: 1px solid rgba(var(--t), .12); }
.dia .barra i { display: block; width: 100%; min-height: 3px; border-radius: 8px 8px 2px 2px; background: rgba(var(--t), .16); }
.dia.con .barra i { background: linear-gradient(180deg, rgba(236, 213, 159, .9), rgba(154, 119, 51, .75)); }
.dia.hoy.con .barra i { background: linear-gradient(180deg, #f6e6bc, var(--oro)); box-shadow: 0 0 14px rgba(236, 213, 159, .35); }
.dia span { font-size: .72rem; color: rgba(var(--t), .7); font-weight: 600; }
.dia.hoy span { color: var(--oro-claro); }

/* ── Plan: franja de nivel ── */
.plan-franja { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding-left: 1.15rem; }
.plan-franja::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; }
.plan-franja.aurum { flex-wrap: nowrap; }
.plan-tasa { white-space: nowrap; }
.plan-franja.aurum::before { background: linear-gradient(180deg, #f3e2b4, var(--oro)); }
.plan-franja.argentum::before { background: linear-gradient(180deg, #e6e9ee, #8e99a8); }
.plan-franja > div:first-child { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.plan-franja strong { font-size: 1.05rem; letter-spacing: .02em; }
.plan-franja.aurum strong { color: var(--oro-claro); }
.plan-franja.argentum strong { color: var(--plata); }
.plan-tasa { font-weight: 760; color: var(--oro-claro); font-variant-numeric: tabular-nums; }
.plan-franja .error { flex-basis: 100%; margin: 0; min-height: 0; }

/* ── Contratos: una lista ── */
.contratos > .fila { margin-bottom: .2rem; }
.contrato-fila { padding: .85rem 0 .8rem; border-top: 1px solid rgba(var(--t), .07); }
.contrato-fila:first-of-type { border-top: 0; }
.contrato-arriba, .contrato-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.contrato-arriba strong { font-size: .95rem; }
.contrato-arriba .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.contrato-meta { font-size: .78rem; color: rgba(var(--t), .66); margin: .25rem 0 .5rem; font-variant-numeric: tabular-nums; }
.cero { color: rgba(var(--t), .5); }
.avance { height: 5px; border-radius: 3px; background: rgba(var(--t), .1); overflow: hidden; }
.avance i { display: block; height: 100%; min-width: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--oro-osc), var(--oro-claro)); }
.cerrados { margin-top: .3rem; border-top: 1px solid rgba(var(--t), .07); padding-top: .6rem; }
.cerrados summary { color: rgba(var(--t), .7); font-size: .82rem; margin: 0; }
.cerrados .contrato-fila { opacity: .65; }
.inicio .vacio { text-align: center; }
.inicio .vacio p { margin: .2rem 0 0; color: rgba(var(--t), .72); }

/* Alturas y anchos por clase (la política de seguridad no permite estilos en línea) */
.h0 { height: 0; } .h10 { height: 10%; } .h15 { height: 15%; } .h20 { height: 20%; } .h25 { height: 25%; } .h30 { height: 30%; } .h35 { height: 35%; }
.h40 { height: 40%; } .h45 { height: 45%; } .h50 { height: 50%; } .h55 { height: 55%; } .h60 { height: 60%; } .h65 { height: 65%; } .h70 { height: 70%; }
.h75 { height: 75%; } .h80 { height: 80%; } .h85 { height: 85%; } .h90 { height: 90%; } .h95 { height: 95%; } .h100 { height: 100%; }
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; } .w20 { width: 20%; } .w25 { width: 25%; } .w30 { width: 30%; } .w35 { width: 35%; }
.w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; }
.w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; } .w100 { width: 100%; }

/* ── Barra de navegación flotante de cristal ── */
.contenido { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
.tabs { left: 50%; right: auto; bottom: calc(.7rem + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(94vw, 460px);
  padding: .35rem; border-radius: 26px; border: 1px solid rgba(var(--t), .12);
  background: linear-gradient(150deg, rgba(var(--sup), .58), rgba(var(--sup2), .7));
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 14px 34px -12px rgba(var(--sombra-rgb), calc(.75 * var(--sk))); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: .15rem; border-radius: 20px; padding: .45rem 0 .4rem; color: rgba(var(--t), .62); transition: color .2s; }
.tabs a .ico { display: grid; place-items: center; line-height: 0; }
.tabs a .ico svg { width: 22px; height: 22px; }
.tabs a.activo { color: var(--oro-claro); background: transparent; }

/* ── Hoja del QR ── */
.velo { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(var(--pozo-rgb), calc(.5 * var(--pk))); }
.hoja.vidrio-hoja { position: relative; text-align: center; background: linear-gradient(160deg, rgba(var(--sup), .86), rgba(var(--sup2), .93));
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid rgba(var(--t), .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 -20px 60px -20px rgba(var(--sombra-rgb), calc(.8 * var(--sk))); }
.hoja h2 { margin: .2rem 0 .9rem; }
.hoja .segmento { margin-bottom: .7rem; }
.cerrar { position: absolute; top: .6rem; right: .6rem; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  color: var(--texto-fuerte); background: rgba(var(--t), .09); }
.aviso-red { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .8rem; padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 650;
  color: var(--ambar); background: rgba(255, 193, 94, .12); box-shadow: inset 0 0 0 1px rgba(255, 193, 94, .3); }
.qr-marco { position: relative; width: 224px; margin: 0 auto .9rem; }
.hoja .qr { display: block; width: 224px; height: 224px; margin: 0; padding: 12px; border-radius: 22px; background: #f6f1e6; box-shadow: 0 12px 30px -12px rgba(var(--sombra-rgb), calc(.7 * var(--sk))); }
.qr-logo { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 12px; box-shadow: 0 0 0 4px #f6f1e6; }
.direccion-grande { font-family: ui-monospace, Menlo, monospace; font-size: .95rem; line-height: 1.6; letter-spacing: .02em; color: var(--texto-fuerte); word-break: break-word;
  padding: .7rem .9rem; border-radius: 14px; background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); user-select: all; }
.boton.copiado { background: linear-gradient(135deg, #7df0c1, var(--verde) 60%, var(--verde-osc)); }

/* ── Escritorio: dos columnas, navegación arriba ── */
@media (min-width: 960px) {
  .inicio { max-width: 1000px; grid-template-columns: 400px minmax(0, 560px); justify-content: center; align-items: start; gap: 1.2rem; padding-bottom: 2rem; }
  .col-billetera { position: sticky; top: 1rem; }
  .marco { position: relative; }
  .cabecera { order: 0; }
  .tabs { position: absolute; top: .7rem; left: 50%; bottom: auto; transform: translateX(-50%); margin: 0; width: auto; display: inline-flex; gap: .2rem; }
  .tabs a { flex-direction: row; gap: .45rem; padding: .5rem 1rem; font-size: .85rem; }
  .tabs a.activo { background: rgba(var(--t), .1); }
  .contenido { padding-top: .8rem; padding-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) { .ambiente i, .bill-luz { animation: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .billetera { background: linear-gradient(150deg, var(--tarjeta), var(--fondo-2)); }
  .deposito, .tabs { background: var(--tarjeta); }
}

/* ── Animación de la hoja del QR (entrada y salida) ── */
.velo-animado { opacity: 0; transition: opacity .3s ease, backdrop-filter .3s ease; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
.velo-animado .hoja { transform: translateY(105%); transition: transform .32s cubic-bezier(.3, .7, .4, 1); will-change: transform; }
.velo-animado .qr-marco { transform: scale(.9); opacity: 0; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1) .12s, opacity .3s ease .12s; }
.velo-animado.abierto { opacity: 1; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.velo-animado.abierto .hoja { transform: none; transition: transform .5s cubic-bezier(.32, 1.25, .5, 1); }
.velo-animado.abierto .qr-marco { transform: none; opacity: 1; }
@media (min-width: 760px) {
  .velo-animado .hoja { transform: translateY(24px) scale(.94); opacity: 0; transition: transform .28s ease, opacity .22s ease; }
  .velo-animado.abierto .hoja { transform: none; opacity: 1; transition: transform .45s cubic-bezier(.32, 1.25, .5, 1), opacity .25s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .velo-animado, .velo-animado .hoja, .velo-animado .qr-marco { transition: none !important; }
}

/* ══════════════ Animaciones al presionar (todo lo que se toca) ══════════════ */
/* Se hunde rápido al presionar y rebota al soltar (resorte), como en iOS. */
:is(button, .boton, .accion, .icono-vidrio, .tabs a, .segmento button, .seg, .lateral a, .avatar, summary, a.tarjeta, .cerrar) {
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), background .25s ease, background-color .25s ease, color .25s ease, box-shadow .25s ease, opacity .25s ease, border-color .25s ease;
}
:is(button, .boton, .accion, .icono-vidrio, .segmento button, .seg, .lateral a, .avatar, summary, a.tarjeta, .cerrar):active:not(:disabled) {
  transform: scale(.94); transition-duration: .09s;
}
.boton.ancho:active:not(:disabled) { transform: scale(.97); }
a.tarjeta:active { transform: scale(.98); }
/* Pestañas: la pestaña se hunde y el ícono da un saltito */
.tabs a:active { transform: scale(.9); transition-duration: .09s; }
.tabs a .ico { transition: transform .55s cubic-bezier(.34, 1.8, .64, 1); }
.tabs a:active .ico { transform: translateY(-3px) scale(1.15); transition-duration: .1s; }
.tabs a.activo .ico { animation: salto-ico .6s cubic-bezier(.34, 1.8, .64, 1); }
@keyframes salto-ico { 0% { transform: scale(.8); } 60% { transform: scale(1.12) translateY(-2px); } 100% { transform: none; } }
/* Botones deshabilitados no reaccionan */
button:disabled, .boton:disabled { transform: none !important; }

/* ── Pantallas: el contenido entra deslizando, en cascada ── */
@keyframes vista-entra { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.vista-entra > *, .vista-entra .inicio > .col-billetera > *, .vista-entra .inicio > .col-detalle > * {
  animation: vista-entra .55s cubic-bezier(.2, .8, .2, 1) both;
}
.vista-entra > :nth-child(2), .vista-entra .col-billetera > :nth-child(2), .vista-entra .col-detalle > :nth-child(1) { animation-delay: .05s; }
.vista-entra > :nth-child(3), .vista-entra .col-billetera > :nth-child(3), .vista-entra .col-detalle > :nth-child(2) { animation-delay: .1s; }
.vista-entra > :nth-child(4), .vista-entra .col-billetera > :nth-child(4), .vista-entra .col-detalle > :nth-child(3) { animation-delay: .15s; }
.vista-entra > :nth-child(n+5), .vista-entra .col-detalle > :nth-child(n+4) { animation-delay: .2s; }
.vista-entra .inicio { animation: none; }

/* ── Avisos: suben y se desvanecen ── */
.aviso { opacity: 0; transform: translate(-50%, 18px) scale(.96); transition: opacity .25s ease, transform .45s cubic-bezier(.34, 1.4, .64, 1); }
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Detalles que se abren (Completados, preguntas) ── */
details[open] > :not(summary) { animation: vista-entra .35s cubic-bezier(.2, .8, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  :is(button, .boton, .accion, .icono-vidrio, .tabs a, .segmento button, .seg, .lateral a, .avatar, summary, a.tarjeta, .cerrar),
  .tabs a .ico, .aviso { transition: none !important; }
  .vista-entra > *, .tabs a.activo .ico, details[open] > :not(summary) { animation: none !important; }
}

/* Ícono de cuenta arriba (reemplaza la pestaña Cuenta) */
.avatar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar.activo { color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); box-shadow: none; }

/* Tarjeta: saldo disponible e invertido lado a lado, sin espacio vacío */
.bill-cifras { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.bill-cifras > div { min-width: 0; }
.bill-cifras .bill-saldo { font-size: clamp(1.45rem, 6.9vw, 2.2rem); }
.bill-inv { padding-left: .8rem; border-left: 1px solid rgba(var(--t), .14); }
.bill-partes:empty { display: none; }

/* Ganancias en la tarjeta; saldo de la billetera en una franja */
.bill-cifras { align-items: end; }
.bill-gan { color: var(--verde); }
.billetera .dias { height: 64px; margin-top: 0; }
.saldo-fila { padding: .85rem 1.15rem; display: grid; gap: .6rem; }
.saldo-fila .fila { align-items: baseline; }
.saldo-fila .semana-monto { font-size: 1.2rem; margin: 0; }

/* ── Rentabilidad del trading ── */
.fila-trading { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .7rem 1rem; }
.fila-trading .relleno { flex: 1; }
.pila { display: grid; gap: .7rem; }
.barras-dias { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; align-items: end; height: 84px; margin-top: .6rem;
  border-bottom: 1px solid rgba(var(--t), .12); }
.barras-dias i { display: block; min-height: 2px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--verde), var(--verde-osc)); }
.barras-dias i.neg { background: linear-gradient(180deg, #ff8b97, var(--rojo)); }
.barras-dias i.h0 { background: rgba(var(--t), .16); }
.rejilla-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rejilla-mini > div { display: flex; flex-direction: column; gap: .15rem; padding: .5rem .55rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.2 * var(--pk))); }
.rejilla-mini b { font-size: 1rem; }
.mes-fila { display: grid; grid-template-columns: 1fr auto auto auto; gap: .7rem; align-items: center; padding: .45rem 0; border-top: 1px solid rgba(var(--t), .06); }
.cuenta-mx { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; align-items: center; padding: .55rem 0; border-top: 1px solid rgba(var(--t), .06); }
@media (max-width: 480px) { .rejilla-mini { grid-template-columns: repeat(2, 1fr); } .mes-fila { grid-template-columns: 1fr auto auto; } .mes-fila .chip { display: none; } }

.par-trading { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.par-trading .cifra { font-size: 1.6rem; }
.fila-trading { flex-wrap: nowrap; }
.barras-dias { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* Inicio: billetera y ganancias lado a lado */
.saldos-dos { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.saldos-dos a { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1.15rem; color: inherit; text-decoration: none; }
.saldos-dos a + a { border-left: 1px solid rgba(var(--t), .08); }
.saldos-dos .semana-monto { font-size: 1.25rem; margin: 0; }

/* Inicio: franja de la billetera de la plataforma */
.franja-billetera { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.15rem; color: inherit; text-decoration: none; }
.franja-billetera .rotulo { flex: 1; font-size: .95rem; color: var(--texto-fuerte); }
.franja-billetera .semana-monto { font-size: 1.25rem; margin: 0; }
.ico-billetera { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--sobre-oro);
  background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px -6px rgba(200, 164, 93, .55); }
.ico-billetera svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Configurar 2FA ── */
.config2fa { display: grid; gap: .9rem; margin-top: .4rem; }
.config2fa .qr-caja { justify-self: center; padding: 10px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px -14px rgba(var(--sombra-rgb), calc(.8 * var(--sk))); }
.config2fa .qr-caja .qr { display: block; width: 168px; height: 168px; margin: 0; padding: 0; border-radius: 6px; background: none; }
.clave2fa { display: flex; align-items: center; gap: .6rem; padding: .65rem .6rem .65rem .95rem; border-radius: 14px;
  background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); border: 1px solid rgba(var(--t), .08); }
.clave2fa > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.clave2fa code { color: var(--texto-fuerte); font-size: .95rem; letter-spacing: .05em; line-height: 1.55; word-spacing: .15em; user-select: all; -webkit-user-select: all; }
.config2fa form { display: grid; gap: .5rem; }
input.codigo-2fa { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: .45em; padding-left: 1.3rem; }
.config2fa a.boton { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; white-space: nowrap; }
.fuera-pantalla { position: fixed; top: 0; left: -9999px; opacity: 0; }

input.codigo-socio { text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Cuenta: código de cuenta copiable junto al título */
.cabeza-cuenta { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.cabeza-cuenta h1 { margin-bottom: 0; }
.codigo-cuenta { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .7rem .4rem .85rem; border-radius: 999px; cursor: pointer;
  color: var(--oro-claro); background: rgba(200, 164, 93, .1); border: 1px solid rgba(200, 164, 93, .35);
  font: 700 .95rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.codigo-cuenta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cabeza-cuenta { margin: .9rem 0; } .cabeza-cuenta h1 { margin: 0; }

/* ══════════════ Barra de abajo más estrecha ══════════════ */
.contenido { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
.tabs { width: min(84vw, 330px); padding: .22rem; border-radius: 22px; bottom: calc(.55rem + env(safe-area-inset-bottom)); }
.tabs a { padding: .32rem 0 .26rem; gap: .08rem; font-size: .66rem; letter-spacing: .01em; border-radius: 18px; }
.tabs a .ico svg { width: 20px; height: 20px; }

/* ══════════════ iPhone: pantalla de inicio (app a pantalla completa) ══════════════ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
/* iOS agranda la página al tocar un campo con letra menor de 16 px: así no salta. */
input, select, textarea { font-size: max(16px, 1em); }
/* Botones y barras no se seleccionan ni abren el menú al mantener presionado. */
:is(button, .boton, .tabs, .accion, .avatar, .icono-vidrio, .cabecera) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.marco, .acceso { min-height: 100vh; min-height: 100dvh; }
/* Bordes seguros: muesca, isla dinámica y esquinas redondeadas. */
.cabecera { padding-top: max(1rem, calc(env(safe-area-inset-top) + .4rem)); padding-left: max(1.1rem, env(safe-area-inset-left)); padding-right: max(1.1rem, env(safe-area-inset-right)); }
.acceso { padding-top: max(1.5rem, env(safe-area-inset-top)); padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
.aviso { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
@media (display-mode: standalone) {
  /* Como app instalada la barra del navegador no existe: el fondo llena hasta arriba, detrás de la hora y la batería. */
  html, body { background: var(--fondo); }
}

/* Barra de abajo: mismo tamaño que la de la app de Claude (≈76% del ancho, ~60 px de alto). */
.contenido { padding-bottom: calc(6.2rem + env(safe-area-inset-bottom)); }
.tabs { width: min(76vw, 400px); padding: .3rem; border-radius: 30px; bottom: calc(.6rem + env(safe-area-inset-bottom)); }
.tabs a { padding: .48rem 0 .42rem; gap: .16rem; font-size: .8rem; font-weight: 600; letter-spacing: 0; border-radius: 24px; }
.tabs a .ico svg { width: 24px; height: 24px; }
.aviso { bottom: calc(6.3rem + env(safe-area-inset-bottom)); }
.tabs { padding: .2rem; border-radius: 28px; }
.tabs a { padding: .32rem 0 .26rem; gap: .1rem; font-size: .76rem; line-height: 1.25; border-radius: 22px; }
.tabs a .ico svg { width: 22px; height: 22px; }

/* ══════════════ Hoja de la Billetera ══════════════ */
button.franja-billetera { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.hoja.hb { text-align: left; max-height: min(90vh, 90dvh); overflow-y: auto; overscroll-behavior: contain; padding-top: 1.1rem; }
.hb .rotulo { font-size: .8rem; color: rgba(var(--t), .68); font-weight: 600; }
.hb-cabeza { display: flex; align-items: center; gap: .9rem; margin: .1rem 3rem 1rem 0; }
.hb-cabeza .ico-billetera { width: 54px; height: 54px; border-radius: 17px; }
.hb-cabeza .ico-billetera svg { width: 27px; height: 27px; }
.hb-saldo { font-size: 2.15rem; font-weight: 760; letter-spacing: -.025em; line-height: 1.1; }
.hb-cuenta { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; margin-bottom: .7rem; border-radius: 14px; cursor: pointer;
  color: inherit; font: inherit; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); border: 1px solid rgba(var(--t), .08); }
.hb-cuenta .rotulo { flex: 1; text-align: left; }
.hb-cuenta .num { color: var(--oro-claro); font: 700 .98rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.hb-cuenta svg, .hb-atras svg, .hb-ico svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hb-cuenta svg { width: 17px; height: 17px; color: var(--oro-claro); }
.hb-ganancias { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .8rem .75rem .95rem; border-radius: 14px;
  background: rgba(var(--brillo), .07); border: 1px solid rgba(var(--brillo), .2); }
.hb-ganancias > div { display: flex; flex-direction: column; gap: .15rem; }
.hb-ganancias b { font-size: 1.2rem; }
.hb-nota { margin: .45rem .2rem 0; }
.hb-acciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0 1.1rem; }
.hb-acciones button { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .75rem .2rem .7rem; border-radius: 18px; cursor: pointer;
  color: var(--texto-fuerte); font: 600 .76rem/1.2 inherit; font-family: inherit; background: rgba(var(--t), .045); border: 1px solid rgba(var(--t), .08); }
.hb-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(var(--t), .09); }
.hb-ico svg { width: 21px; height: 21px; }
.hb-acciones .principal .hb-ico { color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); box-shadow: 0 6px 16px -6px rgba(200, 164, 93, .6); }
.hb-movs { display: grid; }
.hb-movs > .rotulo { margin-bottom: .3rem; }
.hb-mov { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-top: 1px solid rgba(var(--t), .06); font-size: .9rem; }
.hb-barra { display: flex; align-items: center; gap: .6rem; margin: 0 3rem .9rem 0; }
.hb-barra h2 { margin: 0; }
.hb-atras { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; color: var(--texto-fuerte); background: rgba(var(--t), .09); }
.hb-atras svg { width: 20px; height: 20px; }
.hb-disp { display: flex; align-items: baseline; justify-content: space-between; padding: .7rem .9rem; margin-bottom: .6rem; border-radius: 14px; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); }
.hb-disp b { font-size: 1.15rem; }
.hb form { display: grid; gap: .45rem; margin-top: .3rem; }
.hb form .boton.ancho { margin-top: .5rem; }
.hb-monto { display: flex; gap: .5rem; align-items: stretch; }
.hb-monto input { flex: 1; min-width: 0; }
@keyframes hb-entra { from { opacity: 0; transform: translateX(14px); } }
.hb-entra { animation: hb-entra .3s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .hb-entra { animation: none; } }

/* ══════════════ Ventana de confirmación propia ══════════════ */
.dlg-velo { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1.2rem;
  background: rgba(2, 6, 18, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s ease; }
.dlg { width: min(100%, 360px); padding: 1.4rem 1.3rem 1.15rem; border-radius: 24px; text-align: center; color: var(--texto-fuerte);
  background: linear-gradient(160deg, rgba(var(--sup), .96), rgba(var(--sup2), .98)); border: 1px solid rgba(var(--t), .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 30px 70px -20px rgba(var(--sombra-rgb), calc(.9 * var(--sk))), 0 0 50px -18px rgba(200, 164, 93, .3);
  transform: scale(.92) translateY(8px); opacity: 0; transition: transform .32s cubic-bezier(.32, 1.3, .5, 1), opacity .2s ease; }
.dlg-velo.abierto { opacity: 1; }
.dlg-velo.abierto .dlg { transform: none; opacity: 1; }
.dlg h2 { margin: 0 0 .55rem; font-size: 1.12rem; }
.dlg-texto { margin: 0 0 .9rem; color: rgba(var(--t), .78); line-height: 1.45; }
.dlg-monto { font-size: 2.2rem; font-weight: 760; letter-spacing: -.025em; margin: .2rem 0 .3rem; color: var(--oro-claro); }
.dlg .codigo { margin: 0 0 .9rem; text-align: left; word-break: break-all; }
.dlg-campo { margin-bottom: .9rem; text-align: left; }
textarea.dlg-campo { resize: none; }
.dlg-botones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .3rem; }
.dlg-botones .boton { width: 100%; justify-content: center; }
.dlg-botones .boton.peligro { color: #fff; background: linear-gradient(145deg, #ff8b97, #d9485a); border-color: transparent; }
@media (prefers-reduced-motion: reduce) { .dlg-velo, .dlg { transition: none; } }

/* ══════════════ Rentabilidad (tesorería) ══════════════ */
.rt { display: grid; gap: .85rem; max-width: 720px; }
.rt h1 { margin: 0; }
.rt-rotulo { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(var(--t), .6); }
.rt-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.rt-estado { display: flex; align-items: center; gap: .5rem; }
.rt-vivo { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 4px rgba(var(--brillo), .15); }
.rt-actualizar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; color: var(--texto-fuerte);
  background: rgba(var(--t), .07); border: 1px solid rgba(var(--t), .1); }
.rt-actualizar svg, .rt-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rt-actualizar:disabled svg { animation: girar .9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.rt-error { padding: .7rem 1rem; }

/* Capital: tarjeta de cristal como la del inicio */
.rt-capital { position: relative; overflow: hidden; display: grid; gap: .35rem; padding: 1.15rem 1.25rem 1.05rem; border-radius: 24px; color: var(--texto-fuerte);
  background:
    radial-gradient(70% 70% at 100% 0%, rgba(236, 213, 159, .28), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, rgba(var(--brillo), .32), transparent 62%),
    linear-gradient(150deg, rgba(var(--sup), .55), rgba(var(--sup2), .55) 55%, rgba(var(--sup2), .65));
  border: 1px solid rgba(var(--t), .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 24px 50px -26px rgba(var(--sombra-rgb), calc(.9 * var(--sk))); }
.rt-cifra { font-size: clamp(2.1rem, 10vw, 2.7rem); font-weight: 760; letter-spacing: -.03em; line-height: 1.05; }
.rt-partes { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.rt-partes span { display: inline-flex; gap: .4rem; align-items: baseline; padding: .3rem .65rem; border-radius: 999px; font-size: .78rem;
  color: rgba(var(--t), .72); background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); }
.rt-partes b { color: var(--texto-fuerte); font-weight: 700; }
.rt-partes b.verde { color: var(--verde); } .rt-partes b.rojo { color: var(--rojo); }

/* Día / Semana / Mes: tres cuadros iguales */
.rt-cuadros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.rt-cuadro { display: flex; flex-direction: column; gap: .25rem; min-width: 0; padding: .85rem .8rem; border-radius: 18px;
  background: linear-gradient(155deg, rgba(var(--sup), .78), rgba(var(--sup2), .82)); border: 1px solid rgba(var(--t), .08); }
.rt-cuadro b { font-size: clamp(1.05rem, 5vw, 1.4rem); font-weight: 760; letter-spacing: -.02em; white-space: nowrap; }
.rt-nota { margin-top: auto; padding-top: .15rem; font-size: .7rem; }

/* Mes contra punto de empate y meta */
.rt-mes { display: grid; gap: .75rem; }
.rt-mes-pct { font-size: 1.5rem; letter-spacing: -.02em; }
.barra-mes { position: relative; height: 12px; }
.bm-pista { height: 8px; margin-top: 2px; border-radius: 999px; background: rgba(var(--t), .08); overflow: hidden; }
.bm-pista i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff8b97, var(--rojo)); }
.barra-mes.empate .bm-pista i { background: linear-gradient(90deg, #ffd88a, var(--ambar)); }
.barra-mes.meta .bm-pista i { background: linear-gradient(90deg, var(--verde-osc), var(--verde)); }
.bm-marca { position: absolute; top: -3px; width: 2px; height: 18px; margin-left: -1px; border-radius: 2px; background: var(--ambar); }
.bm-marca.meta { background: var(--verde); }
.bm-marca.m0 { left: 0%; } .bm-marca.m5 { left: 5%; } .bm-marca.m10 { left: 10%; } .bm-marca.m15 { left: 15%; } .bm-marca.m20 { left: 20%; } .bm-marca.m25 { left: 25%; } .bm-marca.m30 { left: 30%; } .bm-marca.m35 { left: 35%; } .bm-marca.m40 { left: 40%; } .bm-marca.m45 { left: 45%; } .bm-marca.m50 { left: 50%; } .bm-marca.m55 { left: 55%; } .bm-marca.m60 { left: 60%; } .bm-marca.m65 { left: 65%; } .bm-marca.m70 { left: 70%; } .bm-marca.m75 { left: 75%; } .bm-marca.m80 { left: 80%; } .bm-marca.m85 { left: 85%; } .bm-marca.m90 { left: 90%; } .bm-marca.m95 { left: 95%; } .bm-marca.m100 { left: 100%; }
.bm-leyenda { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem .9rem; color: rgba(var(--t), .7); }
.bm-leyenda b { color: var(--texto-fuerte); }
.bm-leyenda i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .4rem; vertical-align: 1px; }
.pt-empate { background: var(--ambar); } .pt-meta { background: var(--verde); }

/* Gráfica de los días: ganancias hacia arriba, pérdidas hacia abajo */
.rt-grafica { display: grid; gap: .7rem; }
.grafica-dias { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 140px; }
.gd-col { display: grid; grid-template-rows: 1fr 1fr; }
.gd-arriba { display: flex; align-items: flex-end; border-bottom: 1px solid rgba(var(--t), .18); }
.gd-abajo { display: flex; align-items: flex-start; }
.gd-col i { display: block; width: 100%; min-height: 3px; }
.gd-arriba i { border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--verde), var(--verde-osc)); }
.gd-abajo i { border-radius: 1px 1px 4px 4px; background: linear-gradient(180deg, var(--rojo), #b8364a); }
.gd-fechas { display: flex; justify-content: space-between; margin-top: -.2rem; }

/* Cuentas */
.rt-titulo { margin: .6rem 0 0; font-size: 1rem; color: rgba(var(--t), .85); }
.rt-cuenta { display: grid; gap: .8rem; }
.rt-cuenta-cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.rt-cuenta-equity { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.rt-cuenta-equity b { font-size: 1.15rem; }
.rt-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.rt-mini > div { display: flex; flex-direction: column; gap: .2rem; padding: .55rem .6rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); min-width: 0; }
.rt-mini span { font-size: .68rem; font-weight: 600; color: rgba(var(--t), .6); text-transform: uppercase; letter-spacing: .06em; }
.rt-mini b { font-size: .95rem; white-space: nowrap; }
.rt-filas { display: grid; }
.rt-filas > div { display: flex; justify-content: space-between; padding: .45rem 0; border-top: 1px solid rgba(var(--t), .06); font-size: .9rem; }
.rt-dejar { justify-self: start; padding: .3rem 0; border: 0; background: none; cursor: pointer; color: rgba(var(--t), .5); text-decoration: underline; text-underline-offset: 3px; }
.rt-pie { display: flex; justify-content: center; padding: .4rem 0 1rem; }

/* Meses y cuentas por agregar */
.rt-meses { display: grid; padding-top: .4rem; padding-bottom: .4rem; }
.rt-mes-fila { display: grid; grid-template-columns: 1fr auto auto auto; gap: .8rem; align-items: center; padding: .65rem 0; }
.rt-mes-fila + .rt-mes-fila, .rt-libre + .rt-libre { border-top: 1px solid rgba(var(--t), .06); }
.rt-mes-nombre { font-weight: 600; }
.rt-libre { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; align-items: center; padding: .65rem 0; }
.rt-conectar { display: grid; gap: .6rem; justify-items: start; }
.rt-conectar .pila { width: 100%; }
.rt-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--sobre-oro);
  background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); }
.rt-ico svg { width: 22px; height: 22px; }
@media (max-width: 420px) {
  .rt-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-mes-fila { grid-template-columns: 1fr auto auto; }
  .rt-mes-fila .chip { display: none; }
  .rt-cuadro { padding: .75rem .65rem; }
}

.grafica-dias.solo-arriba .gd-col { grid-template-rows: 1fr 0; }
.grafica-dias.solo-abajo .gd-col { grid-template-rows: 0 1fr; }
.grafica-dias.solo-abajo .gd-arriba { border-bottom: 0; } .grafica-dias.solo-abajo .gd-abajo { border-top: 1px solid rgba(var(--t), .18); }

/* Cobertura de los socios */
.rt-cob { display: grid; gap: .8rem; }
.rt-cob-base { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.rt-cob-base > div { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); }
.rt-cob-base b { font-size: 1.05rem; }
.rt-cob-nota { margin: -.3rem 0 0; }
.rt-cob-tabla { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); align-items: center; row-gap: .15rem; column-gap: .4rem; }
.rt-cob-col { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(var(--t), .55); text-align: right; padding-bottom: .2rem; }
.rt-cob-nombre { font-size: .82rem; font-weight: 600; color: rgba(var(--t), .82); padding: .55rem 0; border-top: 1px solid rgba(var(--t), .06); }
.rt-cob-celda { display: flex; flex-direction: column; align-items: flex-end; gap: .05rem; padding: .55rem 0; border-top: 1px solid rgba(var(--t), .06); }
.rt-cob-celda b { font-size: .95rem; white-space: nowrap; }
.rt-cob-celda small { font-size: .68rem; color: rgba(var(--t), .5); }
.rt-cob-nombre.c-real { color: var(--texto-fuerte); }
.rt-cob-nombre.c-int::before, .rt-cob-nombre.c-int2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .45rem; vertical-align: 1px; }
.rt-cob-nombre.c-int::before { background: var(--ambar); }
.rt-cob-nombre.c-int2::before { background: var(--verde); }

.rt-ok { display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem !important; }
.rt-ok svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rt-cob-tabla { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); }
.rt-cob-semana { display: grid; gap: .45rem; }
.rt-cob-semana b { color: var(--texto-fuerte); }
.rt-cob-avance { height: 6px; border-radius: 999px; background: rgba(var(--t), .08); overflow: hidden; }
.rt-cob-avance i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--oro-osc), var(--oro-claro)); }

.rt-cob-tabla { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 1fr)); column-gap: .5rem; }
.rt-cob-celda b { font-size: .88rem; }
.rt-cob-nombre { font-size: .8rem; }
.rt-cob-sub { grid-column: 1 / -1; padding: .7rem 0 .1rem; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: rgba(var(--t), .55); border-top: 1px solid rgba(var(--t), .06); }
.rt-cob-nombre.c-int { white-space: nowrap; }

/* Día de trading en curso (cierra a las 6 pm) */
.gd-col.en-curso i { opacity: .5; outline: 1px dashed rgba(var(--t), .35); outline-offset: -1px; }
.rt-vivo.chico { display: inline-block; width: 6px; height: 6px; margin-right: .35rem; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(var(--brillo), .15); }
.rt-nota { line-height: 1.3; }

/* Inicio: cuenta regresiva al viernes (en lugar de las barras por día) */
.bill-viernes { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 16px;
  background: rgba(var(--pozo-rgb), calc(.24 * var(--pk))); border: 1px solid rgba(var(--t), .08); }
.bill-viernes > div { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.bill-viernes b { font-size: 1rem; color: var(--texto-fuerte); }
.bill-viernes span:not(.bv-ico) { font-size: .8rem; color: rgba(var(--t), .7); }
.bill-viernes strong { color: var(--verde); }
.bv-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--oro-claro);
  background: rgba(200, 164, 93, .14); border: 1px solid rgba(200, 164, 93, .3); }
.bv-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bill-viernes.abierta { background: rgba(var(--brillo), .08); border-color: rgba(var(--brillo), .3); }
.bill-viernes.abierta .bv-ico { color: var(--verde); background: rgba(var(--brillo), .12); border-color: rgba(var(--brillo), .3); }

/* Socios vs trading */
.rt-socios { display: grid; gap: .7rem; }
.rt-socios-pct { font-size: 1.35rem; letter-spacing: -.02em; }
.rt-socios-filas { display: grid; }
.rt-socios-filas > div { display: flex; justify-content: space-between; align-items: baseline; padding: .5rem 0; border-top: 1px solid rgba(var(--t), .06); }
.rt-socios-filas b { font-size: 1rem; }
.rt-socios-barra { height: 8px; border-radius: 999px; background: rgba(var(--t), .08); overflow: hidden; }
.rt-socios-barra i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff8b97, var(--rojo)); }
.rt-socios-barra.ambar i { background: linear-gradient(90deg, #ffd88a, var(--ambar)); }
.rt-socios-barra.verde i { background: linear-gradient(90deg, var(--verde-osc), var(--verde)); }
.rt-socios-nota { margin: 0; }

/* Los tres capitales */
.rt-tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.rt-tres > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; padding: .7rem .7rem; border-radius: 14px;
  background: rgba(var(--pozo-rgb), calc(.24 * var(--pk))); border: 1px solid rgba(var(--t), .07); }
.rt-tres span { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(var(--t), .58); }
.rt-tres b { font-size: clamp(1rem, 4.6vw, 1.25rem); letter-spacing: -.02em; white-space: nowrap; }
.rt-tres .t-trading { border-color: rgba(var(--brillo), .28); background: rgba(var(--brillo), .06); }
.rt-tres .t-trading b { color: var(--verde); }
.rt-tres .t-quieto { border-color: rgba(255, 193, 94, .28); background: rgba(255, 193, 94, .06); }
.rt-tres .t-quieto b { color: var(--ambar); }
.rt-socios-filas small { font-weight: 600; }
.rt-tres span { white-space: nowrap; letter-spacing: .03em; font-size: .64rem; }

/* Iniciar sesión: botón pequeño para bajar la app de Android */
.descarga-app { display: inline-flex; align-self: center; justify-self: center; align-items: center; gap: .5rem; margin: 1rem auto 0;
  padding: .55rem 1rem .55rem .8rem; border-radius: 999px; font-size: .84rem; font-weight: 600; text-decoration: none; color: var(--oro-claro);
  background: rgba(200, 164, 93, .1); border: 1px solid rgba(200, 164, 93, .35); }
.descarga-app svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.caja:has(.descarga-app) { display: flex; flex-direction: column; }

/* ══════════════ Tesorería: billeteras claras ══════════════ */
.billeteras-tes { display: grid; gap: .9rem; }
.billeteras-tes h2 { margin: 0; }
.bt-red { display: grid; gap: .6rem; }
.bt-red + .bt-red { padding-top: .9rem; border-top: 1px solid rgba(var(--t), .08); }
.bt-red-cabeza { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.bt-caja { display: grid; gap: .5rem; padding: .85rem .9rem; border-radius: 16px; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); border: 1px solid rgba(var(--t), .08); }
.bt-caja p { margin: 0; line-height: 1.4; }
.bt-tuya { border-color: rgba(200, 164, 93, .35); background: rgba(200, 164, 93, .06); }
.bt-plataforma { border-color: rgba(var(--brillo), .3); background: rgba(var(--brillo), .07); }
.bt-plataforma.con-aviso { border-color: rgba(255, 107, 122, .55); }
.bt-titulo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.bt-titulo b { font-size: 1.15rem; }
.bt-etiqueta { display: inline-flex; padding: .25rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; }
.bt-etiqueta.tuya { color: var(--sobre-oro); background: linear-gradient(135deg, var(--oro-claro), var(--oro)); }
.bt-etiqueta.plataforma { color: var(--texto); background: rgba(var(--brillo), .22); }
.bt-saldos { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.bt-saldos > div { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .65rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); }
.bt-saldos span { font-size: .7rem; color: rgba(var(--t), .6); font-weight: 600; }
.bt-saldos b { font-size: 1.05rem; }
.bt-saldos .falta { outline: 1px solid rgba(255, 107, 122, .6); }
.bt-saldos .falta b { color: var(--rojo); }
.bt-mandar { color: rgba(var(--t), .78); }
.bt-mandar b { color: var(--texto-fuerte); }
.bt-dir { display: flex; align-items: center; gap: .5rem; padding: .45rem .45rem .45rem .7rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.3 * var(--pk))); }
.bt-dir code { flex: 1; min-width: 0; font-size: .78rem; word-break: break-all; color: var(--texto-fuerte); }
.bt-dir .icono-vidrio { flex: none; width: 36px; height: 36px; }
.bt-aviso { padding: .55rem .7rem; border-radius: 10px; color: var(--rojo); background: rgba(255, 107, 122, .12); border: 1px solid rgba(255, 107, 122, .35); }
.bt-aviso b { color: var(--texto-fuerte); }

/* Confirmación de transferencia: comisión y total */
.dlg-detalle { display: grid; gap: .1rem; margin: -.2rem 0 .9rem; padding: .55rem .8rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); text-align: left; }
.dlg-detalle > div { display: flex; justify-content: space-between; font-size: .86rem; color: rgba(var(--t), .72); padding: .2rem 0; }
.dlg-detalle b { color: var(--texto-fuerte); }

/* Campo del código 2FA con botón para abrir la app autenticadora (app de Android) */
.campo-2fa { display: flex; gap: .5rem; align-items: stretch; }
.campo-2fa input { flex: 1; min-width: 0; }
.abrir-auth { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .9rem; border-radius: 12px; text-decoration: none;
  font-size: .85rem; font-weight: 700; color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); }
.abrir-auth svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Botón "Pegar" junto a los campos donde se pega algo */
.campo-pegar { display: flex; gap: .5rem; align-items: stretch; }
.campo-pegar input { flex: 1; min-width: 0; }
.boton-pegar { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .85rem; border-radius: 12px; cursor: pointer;
  font: 600 .84rem/1 inherit; font-family: inherit; color: var(--texto-fuerte); background: rgba(var(--t), .08); border: 1px solid rgba(var(--t), .14); }
.boton-pegar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.campo-2fa .boton-pegar span, .campo-2fa .abrir-auth span { display: inline; }
@media (max-width: 380px) { .campo-2fa .boton-pegar span { display: none; } .campo-2fa .boton-pegar { padding: 0 .7rem; } }

/* Aviso de versión nueva de la app de Android */
.aviso-app { position: fixed; z-index: 45; left: 50%; top: calc(.6rem + env(safe-area-inset-top)); transform: translateX(-50%); width: min(94vw, 440px);
  display: flex; align-items: center; gap: .6rem; padding: .55rem .55rem .55rem .95rem; border-radius: 16px; font-size: .86rem;
  background: linear-gradient(150deg, rgba(var(--sup), .97), rgba(var(--sup2), .98)); border: 1px solid rgba(200, 164, 93, .45);
  box-shadow: 0 16px 40px -14px rgba(var(--sombra-rgb), calc(.9 * var(--sk))); }
.aviso-app span { flex: 1; color: rgba(var(--t), .85); }
.aviso-app b { color: var(--oro-claro); }
.aviso-app .boton { text-decoration: none; }
.aviso-app-cerrar { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer; color: var(--texto-fuerte); background: rgba(var(--t), .08); }
.aviso-app-cerrar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ══════════════ Teclado abierto: nada queda tapado ══════════════ */
:root { --teclado: 0px; --alto-visible: 100dvh; }
/* Hojas (Billetera, QR): se apoyan encima del teclado y caben en lo que se ve. */
.velo { padding-bottom: var(--teclado); transition: padding-bottom .2s ease; }
.hoja { max-height: calc(var(--alto-visible) - .6rem); overflow-y: auto; overscroll-behavior: contain; }
.hoja.hb { max-height: calc(var(--alto-visible) - .6rem); }
/* El campo que se está escribiendo no se esconde detrás del borde de la hoja. */
.hoja input, .hoja select, .hoja textarea, .contenido input, .contenido select, .contenido textarea { scroll-margin: 6rem 0 7rem; }
/* Ventanas de confirmación: centradas en la parte visible. */
.dlg-velo { padding-bottom: calc(1.2rem + var(--teclado)); }
/* Con el teclado abierto, la barra de abajo y los avisos flotantes se esconden para no tapar los campos. */
body.teclado-abierto .tabs, body.teclado-abierto .aviso-app { opacity: 0; pointer-events: none; transform: translate(-50%, 120%); }
body.teclado-abierto .contenido { padding-bottom: 2rem; }
.tabs { transition: opacity .18s ease, transform .25s ease; }

/* ══════════════ Notificaciones: franja para activarlas ══════════════ */
.franja-notif { display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem .8rem; }
.fn-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--oro-claro); background: rgba(200, 164, 93, .14); }
.fn-ico svg, .fn-cerrar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fn-texto { flex: 1; font-size: .86rem; color: rgba(var(--t), .85); }
.fn-cerrar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer; color: rgba(var(--t), .6); background: transparent; }

/* ══════════════ Animación: llegó dinero ══════════════ */
.celebra { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(60% 50% at 50% 45%, rgba(200, 164, 93, .22), rgba(2, 6, 18, .82) 70%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .3s ease; }
.celebra.abierto { opacity: 1; }
.cel-tarjeta { position: relative; overflow: hidden; width: min(100%, 340px); display: grid; justify-items: center; gap: .55rem; padding: 1.6rem 1.3rem 1.2rem;
  border-radius: 28px; text-align: center; color: var(--texto-fuerte);
  background: linear-gradient(160deg, rgba(var(--sup), .97), rgba(var(--sup2), .98)); border: 1px solid rgba(236, 213, 159, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 30px 80px -20px rgba(var(--sombra-rgb), calc(.95 * var(--sk))), 0 0 70px -10px rgba(200, 164, 93, .45);
  transform: scale(.7) translateY(30px); opacity: 0; transition: transform .55s cubic-bezier(.3, 1.45, .5, 1) .05s, opacity .3s ease .05s; }
.celebra.abierto .cel-tarjeta { transform: none; opacity: 1; }
.cel-brillo { position: absolute; inset: -60% -60% auto; height: 120%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(236, 213, 159, .18), transparent 30%); animation: cel-gira 6s linear infinite; }
@keyframes cel-gira { to { transform: rotate(360deg); } }
.cel-emblema { width: 64px; filter: drop-shadow(0 6px 18px rgba(200, 164, 93, .55)); animation: cel-salta .9s cubic-bezier(.3, 1.6, .5, 1) .2s both; }
@keyframes cel-salta { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.cel-titulo { position: relative; font-size: 1.05rem; font-weight: 700; color: rgba(var(--t), .9); }
.cel-monto { position: relative; font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
  background: linear-gradient(180deg, #fff3cf, var(--oro) 70%, var(--oro-osc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cel-texto { position: relative; font-size: .9rem; color: rgba(var(--t), .75); }
.cel-lista { position: relative; list-style: none; margin: .2rem 0 .3rem; padding: 0; width: 100%; display: grid; gap: .3rem; }
.cel-lista li { display: flex; justify-content: space-between; padding: .45rem .7rem; border-radius: 10px; font-size: .86rem; background: rgba(var(--pozo-rgb), calc(.25 * var(--pk))); }
.cel-lista b { color: var(--verde); }
.cel-tarjeta .boton { position: relative; margin-top: .4rem; }
.cel-monedas { position: fixed; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.cel-monedas i { position: absolute; left: 0; top: 0; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, #fff6d8, var(--oro) 45%, var(--oro-osc) 75%); box-shadow: inset 0 -2px 0 rgba(var(--sombra-rgb), calc(.25 * var(--sk))), 0 0 10px rgba(236, 213, 159, .55); }
.celebra.abierto .cel-monedas i { animation: cel-moneda 1.6s cubic-bezier(.15, .7, .3, 1) both; }
@keyframes cel-moneda {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0); }
  15% { opacity: 1; }
  70% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 140px)) scale(.8) rotate(calc(var(--r) * 2)); }
}
.cel-monedas .m1 { --x: 118px; --y: -39px; --r: 0deg; width: 16px; height: 16px; animation-delay: 0.00s; }
.cel-monedas .m2 { --x: 130px; --y: 19px; --r: 67deg; width: 23px; height: 23px; animation-delay: 0.05s; }
.cel-monedas .m3 { --x: 107px; --y: 86px; --r: 134deg; width: 18px; height: 18px; animation-delay: 0.10s; }
.cel-monedas .m4 { --x: 27px; --y: 65px; --r: 201deg; width: 25px; height: 25px; animation-delay: 0.15s; }
.cel-monedas .m5 { --x: -35px; --y: 97px; --r: 268deg; width: 20px; height: 20px; animation-delay: 0.20s; }
.cel-monedas .m6 { --x: -70px; --y: 33px; --r: 335deg; width: 27px; height: 27px; animation-delay: 0.00s; }
.cel-monedas .m7 { --x: -135px; --y: 21px; --r: 42deg; width: 22px; height: 22px; animation-delay: 0.05s; }
.cel-monedas .m8 { --x: -195px; --y: -26px; --r: 109deg; width: 17px; height: 17px; animation-delay: 0.10s; }
.cel-monedas .m9 { --x: -143px; --y: -86px; --r: 176deg; width: 24px; height: 24px; animation-delay: 0.15s; }
.cel-monedas .m10 { --x: -152px; --y: -152px; --r: 243deg; width: 19px; height: 19px; animation-delay: 0.20s; }
.cel-monedas .m11 { --x: -72px; --y: -158px; --r: 310deg; width: 26px; height: 26px; animation-delay: 0.00s; }
.cel-monedas .m12 { --x: -32px; --y: -208px; --r: 17deg; width: 21px; height: 21px; animation-delay: 0.05s; }
.cel-monedas .m13 { --x: 41px; --y: -240px; --r: 84deg; width: 16px; height: 16px; animation-delay: 0.10s; }
.cel-monedas .m14 { --x: 84px; --y: -173px; --r: 151deg; width: 23px; height: 23px; animation-delay: 0.15s; }
.cel-monedas .m15 { --x: 157px; --y: -153px; --r: 218deg; width: 18px; height: 18px; animation-delay: 0.20s; }
.cel-monedas .m16 { --x: 133px; --y: -83px; --r: 285deg; width: 25px; height: 25px; animation-delay: 0.00s; }
@media (prefers-reduced-motion: reduce) { .celebra .cel-tarjeta, .celebra { transition: none; } .cel-monedas, .cel-brillo { display: none; } .cel-emblema { animation: none; } }

/* Idioma: en Cuenta y en la pantalla de entrar */
.idiomas-panel { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.idioma-op { display: block; text-align: center; padding: .65rem .5rem; border-radius: 12px; text-decoration: none; color: var(--texto-fuerte); font-weight: 600;
  background: rgba(var(--t), .05); border: 1px solid rgba(var(--t), .1); }
.idioma-op.activo { color: var(--sobre-oro); background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); border-color: transparent; }
.idiomas-entrar { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .9rem; margin-top: 1rem; }
.idiomas-entrar .idioma-op { padding: .2rem .1rem; background: none; border: 0; color: rgba(var(--t), .55); font-weight: 500; font-size: .85rem; }
.idiomas-entrar .idioma-op.activo { color: var(--oro-claro); background: none; }

/* ══════════ Inicio: Depositar + enlace de referido en la misma fila ══════════ */
.fila-acciones { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .6rem; align-items: stretch; }
.fila-acciones .accion { justify-content: center; }
.fila-acciones .referido { min-width: 0; }

/* ══════════ Tarjeta del plan con detalles ══════════ */
.plan-tarjeta { display: grid; gap: .8rem; padding: 1rem 1.1rem 1.05rem 1.25rem; }
.plan-tarjeta::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; }
.plan-tarjeta.aurum::before { background: linear-gradient(180deg, #f3e2b4, var(--oro)); }
.plan-tarjeta.argentum::before { background: linear-gradient(180deg, #e6e9ee, #8e99a8); }
.plan-tarjeta.aurum { background: radial-gradient(120% 90% at 100% 0%, rgba(200, 164, 93, .14), transparent 60%), linear-gradient(155deg, rgba(var(--sup), .78), rgba(var(--sup2), .82)); }
.pt-cabeza { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.pt-cabeza > div { display: flex; flex-direction: column; gap: .15rem; }
.pt-sello { font-weight: 800; letter-spacing: .14em; font-size: .95rem; }
.aurum .pt-sello { color: var(--oro-claro); }
.argentum .pt-sello { color: var(--plata); }
.pt-tasa { font-size: 1.45rem; letter-spacing: -.02em; }
.aurum .pt-tasa { color: var(--oro-claro); }
.pt-tasa small { font-size: .72rem; font-weight: 600; color: rgba(var(--t), .6); }
.pt-datos { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.pt-datos > div { display: flex; flex-direction: column; gap: .2rem; padding: .55rem .7rem; border-radius: 12px; background: rgba(var(--pozo-rgb), calc(.22 * var(--pk))); min-width: 0; }
.pt-datos span { font-size: .7rem; font-weight: 600; color: rgba(var(--t), .58); }
.pt-datos b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-mejora { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem .75rem; border-radius: 14px;
  background: rgba(200, 164, 93, .08); border: 1px solid rgba(200, 164, 93, .25); }
.pt-mejora > div { display: flex; flex-direction: column; gap: .1rem; }
.pt-mejora b { color: var(--oro-claro); font-size: 1.05rem; }
.pt-mejora small { font-size: .7rem; color: rgba(var(--t), .6); font-weight: 600; }
.plan-tarjeta .error { margin: 0; min-height: 0; }

/* Hojas que crecen desde su botón: sin las transiciones de la hoja que sube (las mueve el script). */
.velo-desde { opacity: 1; }
.velo-desde .hoja { will-change: transform; }
.origen-oculto { visibility: hidden; }

/* ══════════════ Tablet y PC (va al final: manda sobre lo anterior) ══════════════ */
/* Tablet: dos columnas, hojas centradas y más anchas, barra flotante abajo (es táctil). */
@media (min-width: 768px) {
  .contenido { max-width: 1040px; padding-left: 1.5rem; padding-right: 1.5rem; }
  .inicio { max-width: none; grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr); align-items: start; gap: 1.2rem; }
  .col-billetera { position: sticky; top: 1rem; }
  .velo { align-items: center; padding: 1.5rem; }
  .hoja, .hoja.hb { max-width: 480px; border-radius: 26px; }
  .hoja { padding-bottom: 1.3rem; }
  .tabs { position: fixed; top: auto; left: 50%; bottom: calc(.8rem + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(60vw, 440px); display: flex; }
  .tabs a { flex-direction: column; padding: .32rem 0 .26rem; font-size: .78rem; }
  .tabs a.activo { background: transparent; }
  /* Las demás pantallas (invertir, retirar, historial, cuenta) a un ancho cómodo de leer. */
  .contenido > :not(.inicio) { max-width: 720px; margin-left: auto; margin-right: auto; }
  .contenido > h1, .contenido > .fila, .contenido > .cabeza-cuenta { max-width: 720px; }
  .acceso .caja { max-width: 440px; }
}
/* PC: el menú sube a la cabecera, sin barra flotante abajo. */
@media (min-width: 1100px) {
  .contenido { padding-top: .8rem; padding-bottom: 2.5rem; }
  .inicio { grid-template-columns: 420px minmax(0, 1fr); gap: 1.5rem; }
  .marco { position: relative; }
  .tabs { position: absolute; top: max(.75rem, calc(env(safe-area-inset-top) + .25rem)); bottom: auto; left: 50%; transform: translateX(-50%); width: auto;
    display: inline-flex; gap: .25rem; padding: .3rem; border-radius: 999px; }
  .tabs a { flex-direction: row; gap: .5rem; padding: .55rem 1.1rem; font-size: .88rem; border-radius: 999px; }
  .tabs a .ico svg { width: 19px; height: 19px; }
  .tabs a.activo { background: rgba(var(--t), .1); }
  body.teclado-abierto .tabs { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
  .contenido > :not(.inicio) { max-width: 760px; }
  .pt-datos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-tarjeta.argentum .pt-datos { grid-template-columns: 1fr 1fr; }
}
/* Pantallas grandes con el ratón: los botones se iluminan al pasar por encima. */
@media (hover: hover) and (pointer: fine) {
  .accion:hover, .franja-billetera:hover, .icono-vidrio:hover, .boton:hover { filter: brightness(1.08); }
}
.pt-datos b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }

/* ══════════ Términos y condiciones ══════════ */
.acepto-terminos { display: flex; align-items: flex-start; gap: .55rem; margin-top: .9rem; font-weight: 500; cursor: pointer; }
.acepto-terminos input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--oro); }
.leer-terminos { display: inline-block; margin: .35rem 0 .6rem 1.85rem; color: var(--oro-claro); }
.terminos-aceptar p { line-height: 1.55; color: rgba(var(--t), .82); }
.terminos-aceptar .leer-terminos { margin: 0 0 1rem; }

/* Login: volver a la página web */
.acceso { position: relative; }
.ir-web { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 14px; z-index: 2; display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem .5rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: rgba(var(--t), .85); text-decoration: none;
  background: rgba(var(--t), .06); border: 1px solid rgba(var(--t), .12); }
.ir-web svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ir-web:hover { color: var(--texto-fuerte); background: rgba(var(--t), .1); }

/* ══════════ Hojas que crecen desde su botón: mientras se mueven, sin desenfoque (fluidez) ══════════ */
.velo-desde { background: rgba(var(--pozo-rgb), calc(.5 * var(--pk))); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.velo-desde .hoja { transition: -webkit-backdrop-filter .25s ease, backdrop-filter .25s ease; }
/* Mientras se mueve, la hoja (casi opaca) va sin su propio vidrio; el fondo sí se desenfoca poco a poco con la animación. */
.velo-desde.animando .hoja { -webkit-backdrop-filter: none; backdrop-filter: none; transition: none; }
/* La ventana se abre en el centro de la pantalla (también en el teléfono). */
.velo-desde { align-items: center; padding: max(1rem, env(safe-area-inset-top)) 1rem calc(max(1rem, env(safe-area-inset-bottom)) + var(--teclado)); }
.velo-desde .hoja { border-radius: 26px; padding-bottom: 1.3rem; max-height: calc(var(--alto-visible) - 2rem); }

/* ══════════ Widgets del inicio ══════════ */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.widget { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-height: 138px; padding: .95rem 1rem;
  border-radius: 24px; border: 1px solid rgba(var(--t), .1); color: var(--texto-fuerte); font: inherit; text-align: left; cursor: pointer; overflow: hidden;
  background: radial-gradient(130% 100% at 100% 0%, rgba(var(--brillo), .22), transparent 60%), linear-gradient(160deg, rgba(var(--sup), .82), rgba(var(--sup2), .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 30px -18px rgba(var(--sombra-rgb), calc(.9 * var(--sk)));
  transition: transform .18s cubic-bezier(.3, .7, .3, 1); -webkit-tap-highlight-color: transparent; }
.widget:active { transform: scale(.965); }
.w-titulo { font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: rgba(var(--t), .62); }
.w-cifra { font-size: 1.45rem; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; }
.w-cifra.oro { color: var(--oro-claro); }
.w-sub { font-size: .78rem; color: rgba(var(--t), .6); font-weight: 600; }
.w-barras { margin-top: auto; display: flex; align-items: flex-end; gap: 6px; width: 100%; height: 44px; }
.w-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.w-bar i { display: block; width: 100%; max-width: 16px; border-radius: 5px; background: rgba(var(--t), .14); min-height: 4px; }
.w-bar.hoy i { background: linear-gradient(180deg, #7ef0b3, #2fbf7a); }
.w-bar em { font-style: normal; font-size: .6rem; color: rgba(var(--t), .45); font-weight: 700; }
.w-bar i.h0 { height: 4px; }
.w-bar i.h10 { height: 4px; }
.w-bar i.h15 { height: 4px; }
.w-bar i.h20 { height: 6px; }
.w-bar i.h25 { height: 8px; }
.w-bar i.h30 { height: 9px; }
.w-bar i.h35 { height: 10px; }
.w-bar i.h40 { height: 12px; }
.w-bar i.h45 { height: 14px; }
.w-bar i.h50 { height: 15px; }
.w-bar i.h55 { height: 16px; }
.w-bar i.h60 { height: 18px; }
.w-bar i.h65 { height: 20px; }
.w-bar i.h70 { height: 21px; }
.w-bar i.h75 { height: 22px; }
.w-bar i.h80 { height: 24px; }
.w-bar i.h85 { height: 26px; }
.w-bar i.h90 { height: 27px; }
.w-bar i.h95 { height: 28px; }
.w-bar i.h100 { height: 30px; }
.w-anillo { position: absolute; top: .9rem; right: .9rem; width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(var(--oro) calc(var(--p, 0) * 1%), rgba(var(--t), .12) 0); }
.w-anillo.verde { background: conic-gradient(#3fd18c calc(var(--p, 0) * 1%), rgba(var(--t), .12) 0); }
.w-anillo i { position: absolute; inset: 5px; border-radius: 50%; background: var(--sup-solido); }
.w-anillo.p0 { --p: 0; }
.w-anillo.p5 { --p: 5; }
.w-anillo.p10 { --p: 10; }
.w-anillo.p15 { --p: 15; }
.w-anillo.p20 { --p: 20; }
.w-anillo.p25 { --p: 25; }
.w-anillo.p30 { --p: 30; }
.w-anillo.p35 { --p: 35; }
.w-anillo.p40 { --p: 40; }
.w-anillo.p45 { --p: 45; }
.w-anillo.p50 { --p: 50; }
.w-anillo.p55 { --p: 55; }
.w-anillo.p60 { --p: 60; }
.w-anillo.p65 { --p: 65; }
.w-anillo.p70 { --p: 70; }
.w-anillo.p75 { --p: 75; }
.w-anillo.p80 { --p: 80; }
.w-anillo.p85 { --p: 85; }
.w-anillo.p90 { --p: 90; }
.w-anillo.p95 { --p: 95; }
.w-anillo.p100 { --p: 100; }
.w-pago .w-sub, .w-contratos .w-sub { margin-top: auto; }
.w-niveles { margin-top: auto; display: grid; gap: 5px; width: 100%; }
.w-niveles span { display: block; height: 6px; border-radius: 4px; background: rgba(var(--t), .1); overflow: hidden; }
.w-niveles i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--oro), var(--oro-claro)); }
.w-niveles i.w0 { width: 0; }
.w-niveles i.w5, .wd-barra i.w5 { width: 5%; }
.w-niveles i.w10, .wd-barra i.w10 { width: 10%; }
.w-niveles i.w15, .wd-barra i.w15 { width: 15%; }
.w-niveles i.w20, .wd-barra i.w20 { width: 20%; }
.w-niveles i.w25, .wd-barra i.w25 { width: 25%; }
.w-niveles i.w30, .wd-barra i.w30 { width: 30%; }
.w-niveles i.w35, .wd-barra i.w35 { width: 35%; }
.w-niveles i.w40, .wd-barra i.w40 { width: 40%; }
.w-niveles i.w45, .wd-barra i.w45 { width: 45%; }
.w-niveles i.w50, .wd-barra i.w50 { width: 50%; }
.w-niveles i.w55, .wd-barra i.w55 { width: 55%; }
.w-niveles i.w60, .wd-barra i.w60 { width: 60%; }
.w-niveles i.w65, .wd-barra i.w65 { width: 65%; }
.w-niveles i.w70, .wd-barra i.w70 { width: 70%; }
.w-niveles i.w75, .wd-barra i.w75 { width: 75%; }
.w-niveles i.w80, .wd-barra i.w80 { width: 80%; }
.w-niveles i.w85, .wd-barra i.w85 { width: 85%; }
.w-niveles i.w90, .wd-barra i.w90 { width: 90%; }
.w-niveles i.w95, .wd-barra i.w95 { width: 95%; }
.w-niveles i.w100, .wd-barra i.w100 { width: 100%; }

/* Detalle del widget abierto */
.hoja.hw { text-align: left; max-height: min(88vh, 88dvh); overflow-y: auto; overscroll-behavior: contain; padding-top: 1.2rem; }
.hw-cuerpo { display: grid; gap: .8rem; }
.hw .rotulo { font-size: .82rem; color: rgba(var(--t), .65); font-weight: 700; }
.wd-grande { font-size: 2.3rem; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; margin-top: -.3rem; }
.wd-grande.oro { color: var(--oro-claro); }
.wd-lista { display: grid; gap: .5rem; }
.wd-dia { display: grid; grid-template-columns: 6.5rem 1fr auto; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 14px; background: rgba(var(--pozo-rgb), calc(.2 * var(--pk))); }
.wd-dia.hoy { background: rgba(var(--brillo), .1); border: 1px solid rgba(var(--brillo), .25); }
.wd-fecha { font-size: .85rem; color: rgba(var(--t), .75); text-transform: capitalize; }
.wd-barra { height: 6px; border-radius: 4px; background: rgba(var(--t), .08); overflow: hidden; }
.wd-barra i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2fbf7a, #7ef0b3); }
.wd-barra i.w0 { width: 0; }
.wd-tabla { display: grid; border-radius: 16px; overflow: hidden; background: rgba(var(--pozo-rgb), calc(.2 * var(--pk))); }
.wd-tabla > div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; font-size: .92rem; }
.wd-tabla > div + div { border-top: 1px solid rgba(var(--t), .06); }
.wd-tabla > div span { color: rgba(var(--t), .7); }
.wd-tabla > .total { background: rgba(var(--brillo), .08); font-weight: 700; }
.wd-contrato { display: grid; gap: .4rem; padding: .7rem .8rem; border-radius: 14px; background: rgba(var(--pozo-rgb), calc(.2 * var(--pk))); }
.wd-botones { margin-top: .2rem; }
.w-pago .w-titulo, .w-contratos .w-titulo { padding-right: 42px; }
.widget .w-cifra { white-space: nowrap; }
.widget > * { max-width: 100%; }

/* Widgets: anillos con ícono al centro; niveles del equipo numerados */
.w-anillo i { display: grid; place-items: center; color: rgba(var(--t), .7); }
.w-anillo i svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.w-niveles span { position: relative; margin-left: 14px; overflow: visible; }
.w-niveles span::before { content: attr(data-n); position: absolute; left: -14px; top: 50%; transform: translateY(-50%); font-size: .6rem; font-weight: 700; color: rgba(var(--t), .45); }
.w-niveles i { border-radius: 4px; }

/* Apariencia: botones del tema */
.temas { grid-template-columns: repeat(3, 1fr); }
button.idioma-op { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--borde); background: transparent; }
/* Modo claro: el emblema a color (sobre fondo claro el emblema claro no se ve) */
:root[data-tema="claro"] img[src$="emblema-claro.png"] { content: url("/marca/emblema.png"); }

/* ══════════ Widgets: "Hoy" a todo el ancho (el equipo tiene su sección) ══════════ */
/* "Hoy" va junto a Depositar (donde antes estaba el enlace de referido) */
.w-semana { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 52%); grid-template-rows: auto 1fr; column-gap: .8rem; }
.w-semana .w-titulo { grid-column: 1; grid-row: 1; }
.w-semana .w-cifra { grid-column: 1; grid-row: 2; align-self: end; font-size: clamp(1.15rem, 5.2vw, 1.45rem); }
.w-semana .w-barras { grid-column: 2; grid-row: 1 / 3; margin: 0; height: 100%; min-height: 54px; align-self: stretch; gap: 4px; }

/* ══════════ Mi equipo ══════════ */
.equipo { display: grid; gap: .85rem; padding: 1.1rem 1.15rem 1.15rem; border-radius: 24px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(var(--brillo), .16), transparent 60%), linear-gradient(160deg, rgba(var(--sup), .9), rgba(var(--sup2), .95)); }
.eq-cabeza { display: flex; align-items: center; justify-content: space-between; }
.eq-cabeza .rotulo { font-size: .82rem; font-weight: 700; color: var(--suave); letter-spacing: .02em; }
.eq-ver { border: 0; background: transparent; color: var(--oro-claro); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; padding: .3rem 0; }
.eq-ver::after { content: " ›"; }
.eq-hero { display: grid; gap: .1rem; }
.eq-hero b { font-size: 2rem; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; color: var(--oro-claro); }
.eq-hero span { font-size: .8rem; color: var(--suave); font-weight: 600; }
.eq-stats { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: .45rem; }
.eq-stats > div { display: grid; gap: .1rem; padding: .6rem .7rem; border-radius: 14px; background: var(--pozo); min-width: 0; }
.eq-stats b { font-size: 1.05rem; color: var(--texto-fuerte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-stats span { font-size: .7rem; color: var(--suave); font-weight: 600; }
.eq-niveles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.eq-chip { display: grid; gap: .1rem; padding: .6rem .7rem; border-radius: 14px; border: 1px solid rgba(var(--brillo), .35); background: rgba(var(--brillo), .07); min-width: 0; }
.eq-chip-n { font-size: .68rem; font-weight: 700; color: var(--suave); }
.eq-chip b { font-size: 1.15rem; color: var(--oro-claro); }
.eq-chip .peq { color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-recientes { display: grid; gap: .4rem; }
.eq-reciente { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 14px; background: var(--pozo); }
.eq-reciente > div { display: grid; min-width: 0; }
.eq-reciente b { font-size: .9rem; color: var(--texto-fuerte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--sobre-oro);
  background: linear-gradient(145deg, #f3e2b4, var(--oro) 60%, var(--oro-osc)); }
.eq-estado { font-size: .68rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; color: var(--suave); background: rgba(var(--t), .07); }
.eq-estado.activo { color: var(--verde); background: rgba(46, 229, 157, .12); }
.eq-invitar { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.eq-invitar svg { width: 18px; height: 18px; }
.eq-niveles-det { display: grid; gap: .55rem; }
.eq-nivel-det { display: grid; gap: .5rem; padding: .75rem .85rem; border-radius: 16px; background: var(--pozo); }
.eq-pct { font-weight: 800; color: var(--oro-claro); }
.eq-mini { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .8rem; }
@media (min-width: 480px) { .eq-mini { grid-template-columns: repeat(4, auto); justify-content: space-between; } }
.eq-mini span { display: grid; font-size: .68rem; color: var(--suave); font-weight: 600; min-width: 0; }
.eq-mini b { font-size: .92rem; color: var(--texto-fuerte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════ Modo oscuro: negro, sobrio; el dorado queda para la marca y los botones principales ══════════ */
:root:not([data-tema="claro"]) .billetera {
  background: radial-gradient(80% 60% at 100% 0%, rgba(255, 255, 255, .07), transparent 60%), linear-gradient(150deg, #1c1c1c, #0c0c0c 60%, #080808); }
:root:not([data-tema="claro"]) .billetera::before { background: linear-gradient(140deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, .04) 40%, rgba(216, 198, 156, .25) 75%, rgba(255, 255, 255, .06)); }
:root:not([data-tema="claro"]) .plan-tarjeta.aurum { background: linear-gradient(155deg, #191919, #0e0e0e); }
:root:not([data-tema="claro"]) .equipo { background: linear-gradient(160deg, #171717, #0d0d0d); }
:root:not([data-tema="claro"]) .widget { background: linear-gradient(160deg, #171717, #0d0d0d); }
:root:not([data-tema="claro"]) .eq-chip { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); }
:root:not([data-tema="claro"]) .eq-hero b, :root:not([data-tema="claro"]) .eq-chip b, :root:not([data-tema="claro"]) .w-cifra.oro { color: var(--texto); }
:root:not([data-tema="claro"]) .hoja.vidrio-hoja { background: linear-gradient(160deg, rgba(26, 26, 26, .96), rgba(10, 10, 10, .97)); }
:root:not([data-tema="claro"]) .marca b { color: var(--oro); }

/* Soporte (Cuenta) */
.soporte-correo { display: inline-block; font-weight: 700; color: var(--oro-claro); word-break: break-all; }
