/* ============================================================
   chk! Token — mini app (estilo Lemon) en un iPhone 14 Pro.
   Paleta: beige + bordó. Minimalista, con aire entre widgets.
   ============================================================ */
:root {
  --bordo: #6d1a2d;
  --bordo-oscuro: #571122;
  --bordo-noche: #470d1c; /* barra inferior */
  --bordo-suave: rgba(109, 26, 45, 0.08);
  --tan: #b8975a;
  --tan-texto: #8a6c33;
  --tan-suave: rgba(184, 151, 90, 0.16);
  --beige-bg: #f7f2e8;   /* beige tirando a blanco */
  --beige-card: #fffdf8;
  --beige-input: #f1ead9;
  --border: #e5dcc6;
  --text: #2b231b;
  --muted: #756a58; /* más oscuro para mejor contraste */
  --amarillo: #b07d00;
  --amarillo-suave: rgba(212, 160, 23, 0.16);
  --ok: #4d6b4f;
  --ok-suave: rgba(77, 107, 79, 0.1);
  --radius: 18px;
  font-size: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============ Escenario: noche tecnológica ============ */
body {
  background:
    /* grilla técnica sutil */
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 48px),
    /* glow bordó arriba a la derecha */
    radial-gradient(1000px 600px at 78% -5%, rgba(109, 26, 45, 0.38), transparent 62%),
    /* glow frío abajo a la izquierda */
    radial-gradient(800px 600px at 5% 105%, rgba(40, 60, 90, 0.25), transparent 60%),
    /* base casi negra */
    #050304;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
/* viñeta nocturna */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.escenario { display: grid; place-items: center; }

/* ============ Presentación del proyecto (derecha, solo desktop) ============ */
.pitch {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  /* Arranca pasando el borde derecho del teléfono (centro 25% + ~208px de
     semiancho + margen), así nunca se tapan. */
  left: calc(25% + 250px);
  right: 4%;
  max-width: 560px;
  flex-direction: column;
  gap: 14px;
  color: #f1ead9;
  z-index: 5;
  animation: pitchIn 0.8s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes pitchIn { from { opacity: 0; transform: translateY(calc(-50% + 24px)); } to { transform: translateY(-50%); } }
.pitch-logo {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  font-size: 1rem; font-weight: 900; letter-spacing: -0.05em;
  border-radius: 16px;
  background: #6d1a2d;
  color: #f7f2e8;
  box-shadow: 0 8px 24px rgba(109, 26, 45, 0.5);
}
.pitch-titulo { font-size: 3rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.pitch-bajada { font-size: 1.15rem; font-weight: 700; color: #e0bcc6; }
.pitch-texto { font-size: 0.95rem; line-height: 1.7; opacity: 0.85; max-width: 470px; }
.pitch-texto strong { color: #f5c542; font-weight: 700; }
.pitch-puntos { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.pitch-puntos li {
  font-size: 0.88rem;
  opacity: 0.85;
  padding-left: 24px;
  position: relative;
}
.pitch-puntos li::before {
  content: "✓";
  position: absolute; left: 0;
  color: #f5c542;
  font-weight: 900;
}
.pitch-lemon {
  margin-top: 8px;
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1ead9;
  background: rgba(247, 242, 232, 0.08);
  border: 1px solid rgba(247, 242, 232, 0.2);
  border-radius: 99px;
  padding: 7px 16px;
}

/* En pantallas anchas aparece el pitch (el corrimiento del teléfono al 26%
   lo hace el JS de escala, con estilo inline). */
@media (min-width: 1020px) {
  #iphone { z-index: 10; }
  .pitch { display: flex; }
}

/* ============ iPhone 14 Pro (393 × 852) ============ */
.iphone {
  position: fixed;
  top: 50%; /* la subida de hasta 3cm la ajusta el JS sin cortar el teléfono */
  left: 50%;
  width: 393px;
  height: 852px;
  background-color: var(--beige-bg);
  /* Patrón minimalista de puntos para que el fondo no se vea vacío */
  background-image: radial-gradient(rgba(109, 26, 45, 0.06) 1px, transparent 1.4px);
  background-size: 22px 22px;
  border-radius: 55px;
  border: 11px solid #0d0b0a;
  box-shadow:
    0 0 0 2px #3a3431,
    0 40px 90px rgba(0, 0, 0, 0.75),
    0 0 80px rgba(109, 26, 45, 0.28); /* halo bordó nocturno */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: center;
}

/* Status bar + dynamic island */
.statusbar {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 30px 0;
  position: relative;
  color: var(--text);
}
.statusbar .hora { font-weight: 700; font-size: 0.95rem; }
.dynamic-island {
  position: absolute;
  top: 13px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 34px;
  background: #0d0b0a;
  border-radius: 20px;
}
.status-icons { display: flex; align-items: center; gap: 6px; }
.senal { display: flex; align-items: flex-end; gap: 1.5px; }
.senal i { display: block; width: 3px; background: var(--text); border-radius: 1px; }
.senal i:nth-child(1) { height: 4px; } .senal i:nth-child(2) { height: 6px; }
.senal i:nth-child(3) { height: 8px; } .senal i:nth-child(4) { height: 10px; }
.red { font-size: 0.72rem; font-weight: 700; }
.bateria {
  width: 23px; height: 11px;
  border: 1.5px solid var(--text);
  border-radius: 3.5px;
  padding: 1.5px;
  position: relative;
}
.bateria::after {
  content: ""; position: absolute; right: -4px; top: 3px;
  width: 2px; height: 4px; background: var(--text); border-radius: 0 2px 2px 0;
}
.bateria b { display: block; height: 100%; width: 78%; background: var(--text); border-radius: 1.5px; }

.home-indicator {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 134px; height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55); /* sobre la barra bordó */
  z-index: 60;
}

/* ============ App ============ */
.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  color: var(--text);
}

code { font-family: "SF Mono", Consolas, monospace; color: var(--bordo); font-size: 0.88em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1 { font-size: 1.3rem; letter-spacing: -0.02em; font-weight: 800; }
h3 { font-size: 0.95rem; margin-bottom: 12px; font-weight: 700; }

/* ============ Header ============ */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 14px;
}
.appbar-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  border-radius: 12px;
  background: var(--bordo);
  color: #f5efe1;
  flex-shrink: 0;
  cursor: pointer; /* tocar = modo oscuro */
  transition: transform 0.15s;
  user-select: none;
}
.brand-logo:active { transform: scale(0.92); }
.brand-name { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; }
.brand-sub {
  font-size: 0.64rem; color: var(--muted);
  display: inline-flex; align-items: center;
  background: var(--tan-suave);
  border-radius: 99px;
  padding: 1px 8px;
  margin-top: 2px;
}

/* Chip del usuario activo (tocar para cambiar de perfil) */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--beige-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 11px 6px 7px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
  min-width: 0;
}
.user-chip:active { transform: scale(0.97); }
.u-avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--bordo);
  background: var(--bordo-suave);
  border-radius: 10px;
  flex-shrink: 0;
}
.u-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.u-info b { font-size: 0.82rem; white-space: nowrap; }
.u-info small { font-size: 0.62rem; color: var(--muted); }
.chev { color: var(--muted); font-size: 0.85rem; margin-top: -4px; }

/* Botón "Movimientos" arriba a la derecha (abre actividad y números) */
.mov-btn {
  background: var(--bordo-suave);
  border: 1.5px solid var(--bordo);
  color: var(--bordo);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
  user-select: none;
}
.mov-btn:active { transform: scale(0.95); }
.mov-btn:hover { background: var(--bordo); color: #f7f2e8; }
.iphone.dark .mov-btn:hover { color: #5a1424; background: #f7f2e8; }

/* ============ Botones ============ */
.btn {
  font-family: inherit;
  border: none;
  border-radius: 13px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary, .btn-accent { background: var(--bordo); color: #f5efe1; }
.btn-primary:hover:not(:disabled), .btn-accent:hover:not(:disabled) { background: var(--bordo-oscuro); }
.btn-warn { background: var(--bordo); color: #ffffff; }
.btn-warn:hover:not(:disabled) { background: var(--bordo-oscuro); }
.btn-ghost { background: var(--bordo); color: #ffffff; }
.btn-ghost:hover:not(:disabled) { background: var(--bordo-oscuro); }
.btn-full { width: 100%; }
.btn-wallet { background: var(--bordo); color: #f5efe1; font-size: 0.8rem; padding: 9px 16px; }

/* ============ Main ============ */
main {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 26px;
  scrollbar-width: none;
}
main::-webkit-scrollbar { display: none; }

/* Entrada animada al cambiar de sección */
.vista { animation: vistaIn 0.32s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes vistaIn {
  from { opacity: 0; transform: translateY(14px); }
}

/* Las tarjetas entran en cascada */
.grid > .card, .lista > .item-row { animation: vistaIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.grid > .card:nth-child(2), .lista > .item-row:nth-child(2) { animation-delay: 0.06s; }
.grid > .card:nth-child(3), .lista > .item-row:nth-child(3) { animation-delay: 0.12s; }
.grid > .card:nth-child(4), .lista > .item-row:nth-child(4) { animation-delay: 0.18s; }
.grid > .card:nth-child(5), .lista > .item-row:nth-child(5) { animation-delay: 0.24s; }

.vista-header { margin-bottom: 16px; }
.vista-header p { margin-top: 5px; line-height: 1.5; font-size: 0.8rem; }

/* Widgets de stats: 3 columnas parejas, con aire */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.stat-box {
  background: var(--beige-card);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  min-width: 0;
}
.stat-box .valor { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.stat-box .label { font-size: 0.62rem; color: var(--muted); margin-top: 3px; }
.stat-box.acc .valor, .stat-box.pri .valor, .stat-box.warn .valor { color: var(--bordo); }

/* Variante 2 columnas (panel de actividad): montos largos entran cómodos */
.stats-row.dos { grid-template-columns: 1fr 1fr; margin-bottom: 6px; }
.stats-row.dos .stat-box { background: var(--beige-input); }
.stats-row.dos .valor { font-size: 0.92rem; }

/* Conversión a pesos dentro de los widgets de stats y perfiles */
.ars-mini {
  font-size: 0.58rem;
  color: var(--muted);
  font-family: "SF Mono", Consolas, monospace;
  margin-top: 1px;
}
.p-ars { font-size: 0.6rem; color: var(--muted); font-weight: 600; }

/* ============ Inicio (home minimalista) ============ */
.home-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  gap: 22px;
}
.home-card {
  width: 100%;
  background: var(--bordo);
  /* Patrón minimalista: anillos concéntricos sutiles en la esquina */
  background-image:
    repeating-radial-gradient(circle at 112% -28%, transparent 0 22px, rgba(247, 242, 232, 0.06) 22px 23.5px),
    repeating-radial-gradient(circle at -14% 118%, transparent 0 26px, rgba(247, 242, 232, 0.045) 26px 27.5px);
  border-radius: 26px;
  padding: 30px 22px 24px;
  text-align: center;
  color: #f7f2e8;
  box-shadow: 0 18px 40px rgba(109, 26, 45, 0.35);
  animation: vistaIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.home-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}
.home-monto {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
  font-family: "SF Mono", Consolas, monospace;
}
.home-monto span { font-size: 1rem; opacity: 0.65; font-weight: 700; }
.home-ars { font-size: 0.82rem; font-weight: 700; opacity: 0.75; margin-top: 2px; font-family: "SF Mono", Consolas, monospace; }
.home-sub { font-size: 0.72rem; opacity: 0.65; margin-top: 5px; }

.home-acciones {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 26px;
}
.home-accion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #f7f2e8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s;
  max-width: 96px;
}

/* Flechas SVG gruesas con animación en loop, sutil y moderna */
.flecha {
  font-style: normal;
  line-height: 0;
  display: block;
}
.flecha svg { display: block; }
/* La animación en bucle se ejecuta SOLO con el mouse encima */
.home-accion:hover .f-abajo { animation: flechaBaja 0.9s ease-in-out infinite; }
.home-accion:hover .f-arriba { animation: flechaSube 0.9s ease-in-out infinite; }
@keyframes flechaBaja {
  0%, 50%, 100% { transform: translateY(0); opacity: 1; }
  25% { transform: translateY(5px); opacity: 0.7; }
}
@keyframes flechaSube {
  0%, 50%, 100% { transform: translateY(0); opacity: 1; }
  25% { transform: translateY(-5px); opacity: 0.7; }
}
.home-accion:active { transform: scale(0.93); }
.home-circulo {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(247, 242, 232, 0.14);
  border: 1.5px solid rgba(247, 242, 232, 0.35);
  font-size: 1.35rem;
  transition: background 0.2s, transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.25s;
}
/* Hover: el botón se levanta con sombra */
.home-accion:hover .home-circulo {
  background: rgba(247, 242, 232, 0.26);
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}
.home-accion.principal:hover .home-circulo {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}
.home-accion.principal .home-circulo {
  width: 64px; height: 64px;
  background: #f7f2e8;
  color: #6d1a2d;
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
/* El círculo principal lleva el logo "chk!" */
.home-circulo.chk {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  font-family: inherit;
}
.home-nota { font-size: 0.66rem; text-align: center; line-height: 1.6; max-width: 280px; }

/* ---- Estado desconectado: botón Conectar en el medio ---- */
#homeOff { padding: 14px 0 10px; }
.home-off-logo {
  width: 62px; height: 62px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 1.15rem; font-weight: 900; letter-spacing: -0.05em;
  border-radius: 19px;
  background: rgba(247, 242, 232, 0.16);
  border: 1.5px solid rgba(247, 242, 232, 0.35);
}
.home-off-texto { font-size: 0.82rem; opacity: 0.75; margin-bottom: 20px; }
.btn-conectar-home {
  background: #f7f2e8;
  color: #5a1424;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px 52px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.2s;
}
.btn-conectar-home:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38); }
.btn-conectar-home:active { transform: scale(0.96); }
.btn-conectar-home:disabled { opacity: 0.6; cursor: wait; }
.iphone.dark .home-off-logo { background: rgba(109, 26, 45, 0.1); border-color: rgba(109, 26, 45, 0.35); }
.iphone.dark .btn-conectar-home { background: #6d1a2d; color: #f7f2e8; }

/* ---- Animación de entrada al conectar ---- */
.home-acciones.entrada .home-accion { animation: popIn 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.home-acciones.entrada .home-accion:nth-child(1) { animation-delay: 0.55s; }
.home-acciones.entrada .home-accion:nth-child(2) { animation-delay: 0.7s; }
.home-acciones.entrada .home-accion:nth-child(3) { animation-delay: 0.85s; }
@keyframes popIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.7); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.home-ars.aparece { animation: vistaIn 0.45s both; }

/* Inicio en modo oscuro: tarjeta crema con texto bordó (mismo patrón, invertido) */
.iphone.dark .home-card {
  background: #f7f2e8;
  background-image:
    repeating-radial-gradient(circle at 112% -28%, transparent 0 22px, rgba(109, 26, 45, 0.05) 22px 23.5px),
    repeating-radial-gradient(circle at -14% 118%, transparent 0 26px, rgba(109, 26, 45, 0.04) 26px 27.5px);
  color: #5a1424;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.iphone.dark .home-accion { color: #5a1424; }
.iphone.dark .home-circulo { background: rgba(109, 26, 45, 0.1); border-color: rgba(109, 26, 45, 0.35); }
.iphone.dark .home-accion:hover .home-circulo { background: rgba(109, 26, 45, 0.18); }
.iphone.dark .home-accion.principal .home-circulo { background: var(--bordo, #6d1a2d); background: #6d1a2d; color: #f7f2e8; }

/* ============ Cards / ofertas ============ */
.grid { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--beige-card);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-form, .panel-stats { margin-bottom: 16px; }

/* ---- Tarjetas de oferta compactas y expandibles (acordeón) ---- */
.oferta-card.compacta { padding: 12px 14px; cursor: default; }
.oferta-head {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}
.oferta-tit { flex: 1; min-width: 0; }
.oferta-precio-mini {
  text-align: right;
  flex-shrink: 0;
  color: var(--bordo);
  font-family: "SF Mono", Consolas, monospace;
  line-height: 1.1;
}
.oferta-precio-mini b { font-size: 0.95rem; font-weight: 800; display: block; }
.oferta-precio-mini small { font-size: 0.58rem; font-weight: 700; opacity: 0.7; }
.precio-ars { display: block; font-size: 0.56rem; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.chev-oferta {
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.25s;
  flex-shrink: 0;
  margin-top: -3px;
}
.oferta-card.abierta .chev-oferta { transform: rotate(180deg); }
.oferta-card.compacta .oferta-emoji { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 11px; }
.oferta-card.compacta .oferta-producto { font-size: 0.8rem; line-height: 1.25; }
.oferta-card.compacta .oferta-comercio { font-size: 0.68rem; margin-top: 2px; }
.oferta-detalle { display: none; padding-top: 12px; }
.oferta-card.abierta .oferta-detalle { display: block; animation: vistaIn 0.28s cubic-bezier(0.2, 0.8, 0.3, 1); }
.oferta-desc { font-size: 0.74rem; line-height: 1.5; margin-bottom: 10px; }

.oferta-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.oferta-emoji {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 1.45rem;
  background: var(--beige-input);
  border-radius: 14px;
  flex-shrink: 0;
}
.oferta-producto { font-weight: 700; font-size: 0.9rem; line-height: 1.3; }
.oferta-comercio { font-size: 0.74rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}
.badge-ok { background: var(--ok-suave); color: var(--ok); }
/* Vencimiento cercano: en amarillo */
.badge-warn { background: var(--amarillo-suave); color: var(--amarillo); }
.badge-danger { background: var(--bordo-suave); color: var(--bordo); }
.badge-token { background: var(--bordo-suave); color: var(--bordo); font-family: "SF Mono", Consolas, monospace; }
.badge-bordo { background: var(--bordo); color: #f5efe1; font-size: 0.5em; vertical-align: middle; padding: 3px 9px; }

/* Meta de la oferta: 3 datos en línea */
.oferta-meta {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  gap: 10px;
  margin: 12px 0;
}
.oferta-meta .k { color: var(--muted); font-size: 0.62rem; }
.oferta-meta .v { font-weight: 700; margin-top: 2px; font-size: 0.78rem; }
.oferta-meta .v.precio { color: var(--bordo); font-size: 0.92rem; }

.progress { height: 6px; background: var(--beige-input); border-radius: 99px; overflow: hidden; margin: 4px 0; }
.progress > div { height: 100%; background: var(--bordo); border-radius: 99px; transition: width 0.5s; }
.progress-label { font-size: 0.66rem; color: var(--muted); display: flex; justify-content: space-between; }

.split-bar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.split-bar .adelanto { background: var(--tan); }
.split-bar .retenido { background: var(--bordo); }
.split-leyenda { display: flex; justify-content: space-between; font-size: 0.64rem; color: var(--muted); }
.split-leyenda b.a { color: var(--tan-texto); } .split-leyenda b.r { color: var(--bordo); }

.oferta-acciones { margin-top: 14px; display: flex; gap: 8px; }
.oferta-acciones .btn { flex: 1; }

/* ============ Listas ============ */
.lista { display: flex; flex-direction: column; gap: 14px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--beige-card);
  border-radius: var(--radius);
  padding: 15px 16px;
  flex-wrap: wrap;
}
.item-row .oferta-emoji { width: 42px; height: 42px; font-size: 1.25rem; }
.item-info { flex: 1; min-width: 150px; }
.item-titulo { font-weight: 700; font-size: 0.86rem; }
.item-sub { font-size: 0.7rem; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.item-datos { display: flex; gap: 16px; flex-wrap: wrap; }
.item-datos .dato { text-align: right; font-size: 0.76rem; }
.item-datos .k { color: var(--muted); font-size: 0.62rem; }
.item-datos .v { font-weight: 700; margin-top: 1px; }
.item-acciones { display: flex; gap: 8px; width: 100%; }
.item-acciones .btn { flex: 1; }

/* Fecha de vencimiento en la esquina de la carta del token,
   con una leve iluminación en bucle */
.item-row.con-vence { position: relative; padding-top: 30px; }
.vence-tag {
  position: absolute;
  top: 9px; right: 12px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--beige-input);
  color: var(--muted);
  animation: glowSuave 2.6s ease-in-out infinite;
}
.vence-tag.amarillo {
  background: var(--amarillo-suave);
  color: var(--amarillo);
  animation: glowAmarillo 1.8s ease-in-out infinite;
}
.vence-tag.rojo {
  background: var(--bordo-suave);
  color: var(--bordo);
  animation: glowRojo 1.8s ease-in-out infinite;
}
@keyframes glowSuave {
  0%, 100% { box-shadow: 0 0 0 rgba(140, 129, 112, 0); }
  50% { box-shadow: 0 0 10px rgba(140, 129, 112, 0.35); }
}
@keyframes glowAmarillo {
  0%, 100% { box-shadow: 0 0 2px rgba(245, 197, 66, 0.1); }
  50% { box-shadow: 0 0 14px rgba(245, 197, 66, 0.55); }
}
@keyframes glowRojo {
  0%, 100% { box-shadow: 0 0 2px rgba(180, 50, 70, 0.1); }
  50% { box-shadow: 0 0 14px rgba(220, 70, 95, 0.5); }
}

.balance-chip {
  font-size: 1rem; font-weight: 800;
  color: var(--bordo);
  background: var(--bordo-suave);
  border-radius: 12px;
  padding: 7px 13px;
  font-family: "SF Mono", Consolas, monospace;
}

.vacio {
  text-align: center;
  color: var(--muted);
  padding: 50px 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* ============ Panel stats ============ */
.panel-stats .fila-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--beige-input);
  font-size: 0.8rem;
  gap: 10px;
}
.panel-stats .fila-stat:last-child { border-bottom: none; }
.panel-stats .fila-stat .v { font-weight: 700; font-family: "SF Mono", Consolas, monospace; font-size: 0.76rem; text-align: right; }
.panel-stats .fila-stat .v.acc { color: var(--ok); }
.panel-stats .fila-stat .v.warn { color: var(--tan-texto); }

.seccion-sub { margin: 20px 0 12px; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

/* ============ Formularios ============ */
form label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
form input[type="text"], form input[type="number"] {
  width: 100%;
  margin-top: 5px;
  background: var(--beige-input);
  border: none;
  border-radius: 12px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.88rem;
  font-family: inherit;
}
form input:focus { outline: 1.5px solid var(--bordo); }
form input[type="range"] { width: 100%; margin-top: 14px; accent-color: var(--bordo); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-preview { margin: 2px 0 16px; }

/* ============ Modales (bottom sheet) ============ */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 30, 22, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  z-index: 100;
  animation: fadeIn 0.18s;
}
/* Orden de capas: la confirmación de compra y el ingreso/retiro
   van SIEMPRE por encima del mercado y los demás sheets. */
#modalMercado { z-index: 110; }
#modalActividad, #modalPerfil { z-index: 115; }
#modalDinero { z-index: 130; }
#modalCompra { z-index: 140; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--beige-card);
  border-radius: 28px 28px 0 0;
  padding: 14px 22px 36px;
  width: 100%;
  position: relative;
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 86%;
  overflow-y: auto;
  scrollbar-width: none;
}
.modal::-webkit-scrollbar { display: none; }
@keyframes sheetUp { from { transform: translateY(60%); opacity: 0.4; } }

/* Cierre animado de los bottom sheets */
.modal-backdrop.cerrando { animation: fadeOut 0.23s forwards; }
.modal-backdrop.cerrando .modal { animation: sheetDown 0.23s cubic-bezier(0.5, 0, 0.8, 0.4) forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetDown { to { transform: translateY(100%); opacity: 0.3; } }
.modal-grip {
  width: 40px; height: 4.5px;
  border-radius: 99px;
  background: var(--border);
  margin: 0 auto 16px;
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  background: var(--bordo); border: none;
  color: #ffffff; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; font-size: 0.8rem;
}
.modal-close:hover { background: var(--bordo-oscuro); }
.modal h2 { font-size: 1.1rem; margin-bottom: 3px; font-weight: 800; }
.modal .sub { color: var(--muted); font-size: 0.78rem; margin-bottom: 16px; }

/* Lista de perfiles */
.perfil-lista { display: flex; flex-direction: column; gap: 10px; }
.perfil-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--beige-input);
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 13px 15px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
.perfil-item:active { transform: scale(0.98); }
.perfil-item.active { border-color: var(--bordo); background: var(--bordo-suave); }
.perfil-item .u-avatar { width: 38px; height: 38px; font-size: 1.2rem; border-radius: 12px; background: var(--beige-card); }
.perfil-item .p-info { flex: 1; min-width: 0; }
.perfil-item .p-nombre { font-weight: 700; font-size: 0.86rem; }
.perfil-item .p-detalle { font-size: 0.68rem; color: var(--muted); margin-top: 2px; font-family: "SF Mono", Consolas, monospace; }
.perfil-item .p-saldo { font-size: 0.74rem; font-weight: 800; color: var(--bordo); font-family: "SF Mono", Consolas, monospace; white-space: nowrap; }
.perfil-item .p-check { color: var(--bordo); font-weight: 800; }

/* Stepper / resumen */
.cantidad-stepper { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.cantidad-stepper button {
  width: 40px; height: 40px;
  font-size: 1.2rem;
  background: var(--bordo); color: #ffffff;
  border: none; border-radius: 13px; cursor: pointer;
  font-weight: 700;
}
.cantidad-stepper button:hover { background: var(--bordo-oscuro); }
.cantidad-stepper .num { font-size: 1.5rem; font-weight: 800; min-width: 56px; text-align: center; font-family: "SF Mono", Consolas, monospace; }

.resumen-compra {
  background: var(--beige-input);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 0.78rem;
}
.resumen-compra .linea { display: flex; justify-content: space-between; padding: 4px 0; gap: 10px; }
.resumen-compra .linea.total { border-top: 1px solid var(--border); margin-top: 7px; padding-top: 9px; font-weight: 800; font-size: 0.86rem; }
.resumen-compra .v { font-family: "SF Mono", Consolas, monospace; font-weight: 700; text-align: right; }
.resumen-compra .v.acc { color: var(--ok); } .resumen-compra .v.warn { color: var(--tan-texto); }

.nota-legal {
  font-size: 0.64rem; color: var(--muted);
  background: var(--beige-input);
  border-left: 3px solid var(--bordo);
  padding: 8px 12px;
  border-radius: 0 10px 10px 0;
  margin-top: 12px;
  line-height: 1.5;
}

/* ============ Pasos de tx ============ */
.tx-pasos { margin: 16px 0; display: flex; flex-direction: column; gap: 11px; }
.tx-paso { display: flex; align-items: center; gap: 11px; font-size: 0.78rem; color: var(--muted); }
.tx-paso .icono {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--beige-input);
  font-size: 0.76rem;
  flex-shrink: 0;
}
.tx-paso.activo { color: var(--text); }
.tx-paso.activo .icono::after {
  content: ""; width: 12px; height: 12px;
  border: 2px solid var(--bordo); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.tx-paso.ok { color: var(--text); }
.tx-paso.ok .icono { background: var(--bordo-suave); color: var(--bordo); }
@keyframes spin { to { transform: rotate(360deg); } }
.tx-hash { font-family: "SF Mono", Consolas, monospace; font-size: 0.62rem; color: var(--muted); }

.exito-check {
  width: 66px; height: 66px;
  margin: 8px auto 14px;
  display: grid; place-items: center;
  font-size: 1.9rem;
  border-radius: 50%;
  background: var(--bordo-suave);
  border: 2px solid var(--bordo);
  color: var(--bordo);
  animation: pop 0.35s;
}
@keyframes pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.12); } }

/* ============ Toasts ============ */
.toasts {
  position: absolute;
  top: 58px; left: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: rgba(50, 42, 34, 0.95);
  color: #f1ead9;
  border-radius: 15px;
  padding: 12px 16px;
  font-size: 0.76rem;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.28s;
}
.toast.ok { border-left: 4px solid #9fc09b; }
.toast.warn { border-left: 4px solid var(--tan); }
.toast.saliendo { animation: toastOut 0.3s forwards; }
.toast .t-hash { font-family: "SF Mono", Consolas, monospace; font-size: 0.6rem; opacity: 0.65; display: block; margin-top: 2px; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-16px); opacity: 0; } }

/* ============ Feed actividad ============ */
.feed { display: flex; flex-direction: column; }
.evento {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 0 12px 18px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
  position: relative;
  font-size: 0.78rem;
}
.evento::before {
  content: "";
  position: absolute; left: -5.5px; top: 16px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--tan);
  border: 2px solid var(--beige-bg);
}
.evento.ev-ok::before { background: var(--ok); }
.evento.ev-warn::before { background: var(--bordo); }
.evento .ev-nombre {
  font-family: "SF Mono", Consolas, monospace;
  font-weight: 700;
  color: var(--bordo);
  font-size: 0.74rem;
}
.evento .ev-detalle { color: var(--text); line-height: 1.45; font-size: 0.74rem; }
.evento .ev-meta { font-family: "SF Mono", Consolas, monospace; font-size: 0.6rem; color: var(--muted); }

/* ============ Tab bar (bordó, opciones blancas) ============ */
.tabbar {
  flex-shrink: 0;
  display: flex;
  background: var(--bordo-noche);
  padding: 8px 8px 22px;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 20px rgba(50, 42, 34, 0.22);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  cursor: pointer;
  border-radius: 13px;
  transition: color 0.25s, background 0.25s, transform 0.25s;
}
.tab:active { transform: scale(0.94); }
.tab .t-ico {
  font-size: 1.2rem;
  /* Emojis en blanco para que combinen con la barra bordó */
  filter: grayscale(1) brightness(6) opacity(0.6);
  transition: filter 0.25s, transform 0.25s;
}
/* Hover sobre cada logo de la barra: pop con rebote propio */
.tab:hover { color: rgba(255, 255, 255, 0.9); }
.tab:hover .t-ico {
  filter: grayscale(1) brightness(9);
  animation: tabPop 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.iphone.dark .tab:hover { color: rgba(90, 20, 36, 0.85); }
.iphone.dark .tab:hover .t-ico {
  filter: grayscale(1) sepia(1) saturate(9) hue-rotate(-32deg) brightness(0.5);
  animation: tabPop 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.tab.active { color: #ffffff; background: rgba(255, 255, 255, 0.13); }
.tab.active .t-ico { filter: grayscale(1) brightness(10); animation: tabPop 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes tabPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28) translateY(-2px); }
  100% { transform: scale(1); }
}

/* ============ Chat del Asesor ============ */
.chat-modos { display: flex; gap: 8px; margin-bottom: 12px; }
.chat-modo {
  flex: 1;
  background: var(--beige-card);
  border: 1.5px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-modo.active { border-color: var(--bordo); color: var(--bordo); background: var(--bordo-suave); }

.chat-mensajes {
  background: var(--beige-card);
  border-radius: var(--radius);
  padding: 14px;
  height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.chat-mensajes::-webkit-scrollbar { display: none; }

.burbuja {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  animation: vistaIn 0.25s;
}
.burbuja.usuario {
  align-self: flex-end;
  background: var(--bordo);
  color: #f7f2e8;
  border-bottom-right-radius: 5px;
}
.burbuja.bot {
  align-self: flex-start;
  background: var(--beige-input);
  color: var(--text);
  border-bottom-left-radius: 5px;
}
.burbuja.error { border-left: 3px solid var(--bordo); font-size: 0.74rem; color: var(--muted); }

/* Indicador "escribiendo…" */
.escribiendo { display: flex; gap: 4px; align-self: flex-start; padding: 12px 14px; }
.escribiendo i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: tecleo 1.2s infinite;
}
.escribiendo i:nth-child(2) { animation-delay: 0.18s; }
.escribiendo i:nth-child(3) { animation-delay: 0.36s; }
@keyframes tecleo { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input {
  flex: 1;
  background: var(--beige-card);
  border: 1.5px solid transparent;
  border-radius: 14px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.84rem;
  font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: var(--bordo); }
.chat-enviar { border-radius: 14px; padding: 0 18px; font-size: 1rem; }

/* En modo oscuro la burbuja del usuario se invierte (crema con texto bordó) */
.iphone.dark .burbuja.usuario { background: #f7f2e8; color: #5a1424; }

/* ============ Lock overlay ============ */
.lock-overlay {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 0.82rem;
}
.lock-overlay .candado { font-size: 2.3rem; margin-bottom: 12px; }

/* ============================================================
   MODO OSCURO (se activa tocando el logo chk!)
   Colores invertidos: lo bordó pasa a blanco/crema y
   lo blanco/beige pasa a bordó.
   ============================================================ */
.iphone.dark {
  /* Puntitos crema sobre el fondo bordó profundo */
  background-image: radial-gradient(rgba(247, 242, 232, 0.05) 1px, transparent 1.4px);
  background-size: 22px 22px;
  --bordo: #f7f2e8;            /* acentos ahora en crema */
  --bordo-oscuro: #e6dcc8;
  --bordo-suave: rgba(247, 242, 232, 0.12);
  --tan-texto: #dcbd80;
  --beige-bg: #330814;         /* fondo bordó profundo */
  --beige-card: #4a1322;       /* tarjetas bordó (más contraste vs fondo) */
  --beige-input: #5e1829;
  --border: #7c2339;
  --text: #faf6ee;
  --muted: #e0bcc6;            /* más claro para mejor contraste */
  --amarillo: #f5c542;
  --amarillo-suave: rgba(245, 197, 66, 0.16);
  --ok: #a9c9a4;
  --ok-suave: rgba(169, 201, 164, 0.15);
}

/* Botones: crema con texto bordó */
.iphone.dark .btn-primary,
.iphone.dark .btn-accent,
.iphone.dark .btn-warn,
.iphone.dark .btn-ghost,
.iphone.dark .btn-wallet,
.iphone.dark .modal-close,
.iphone.dark .cantidad-stepper button {
  background: #f7f2e8;
  color: #5a1424;
}
.iphone.dark .btn-primary:hover:not(:disabled),
.iphone.dark .btn-accent:hover:not(:disabled),
.iphone.dark .btn-warn:hover:not(:disabled),
.iphone.dark .btn-ghost:hover:not(:disabled) { background: #e6dcc8; }

/* Logo invertido */
.iphone.dark .brand-logo { background: #f7f2e8; color: #5a1424; }

/* Barra inferior: blanca con opciones bordó (alto contraste) */
.iphone.dark .tabbar { background: #ffffff; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4); }
.iphone.dark .tab { color: rgba(109, 26, 45, 0.55); }
.iphone.dark .tab .t-ico {
  /* Emojis teñidos a bordó sobre la barra blanca */
  filter: grayscale(1) sepia(1) saturate(7) hue-rotate(-32deg) brightness(0.62) opacity(0.65);
}
.iphone.dark .tab.active { color: #6d1a2d; background: rgba(109, 26, 45, 0.12); }
.iphone.dark .tab.active .t-ico {
  filter: grayscale(1) sepia(1) saturate(9) hue-rotate(-32deg) brightness(0.5);
  animation: tabPop 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.iphone.dark .home-indicator { background: rgba(109, 26, 45, 0.5); }

/* Detalles que llevaban texto claro hardcodeado */
.iphone.dark .badge-bordo { color: #5a1424; }
.iphone.dark .toast { background: rgba(247, 242, 232, 0.97); color: #44101f; }
.iphone.dark .toast .t-hash { opacity: 0.55; }
.iphone.dark .saldo-box b { color: #f7f2e8; }
.iphone.dark code { color: #ecd9b0; }
