:root {
  --fondo: #f3f3f4;
  --tinta: #0b0b0c;
  --gris: #6e6e73;
  --gris-claro: #a1a1a6;
  --linea: #e3e3e6;
  --rojo: #ff3b30;
  --rojo-vivo: #ff2d2d;
  --verde: #34d058;
  --verde-texto: #1f9d45;
  --tarjeta: #0a0a0b;
  --tarjeta-texto: #f5f5f7;
  --tarjeta-gris: #9a9aa0;
  --radio: 32px;
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --muelle: cubic-bezier(.32, 1.25, .5, 1);
  --suave: cubic-bezier(.22, 1, .36, 1);
  --abajo: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--fuente); color: var(--tinta); font-size: 16px; line-height: 1.45;
  background: radial-gradient(120% 70% at 50% 35%, #ffffff 0%, var(--fondo) 70%) fixed, var(--fondo);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }

/* ---------- cabecera: menú a la izquierda, Alpha en medio, lista a la derecha */
.cabecera {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; justify-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px;
  pointer-events: none;
}
.cabecera > * { pointer-events: auto; }
body.viendo .cabecera { background: linear-gradient(var(--fondo) 72%, rgba(243,243,244,0)); }
.marca {
  font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: #fff; padding: 9px 18px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a3a3c 0%, #0b0b0c 45%, #000 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), inset 0 -2px 4px rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.28), 0 2px 3px rgba(0,0,0,.3);
  transition: transform .2s var(--suave);
}
.marca:active { transform: scale(.95); }
.marca span { color: #a5a5aa; font-weight: 400; }
.lado {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #1c1c1e;
  background: rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform .2s var(--suave);
}
.lado:active { transform: scale(.9); }
.lado.activo { background: #0b0b0c; color: #fff; }

/* ---------- esfera */
.escena {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 5;
  transition: opacity .45s var(--suave), transform .6s var(--suave);
}
.flotador { width: min(38vw, 175px); aspect-ratio: 1; animation: flotar 6s ease-in-out infinite; will-change: transform; }
#esfera { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: none; outline: none; }
#esfera.sin-webgl { border-radius: 50%; transform: scale(.6);
  background: radial-gradient(circle at 35% 30%, #6a6a6a 0, #111 18%, #000 55%), #000;
  box-shadow: inset -8px -10px 30px rgba(120,140,200,.12); }
.sombra {
  position: absolute; left: 50%; top: calc(50% + min(12vw, 56px)); width: min(15vw, 70px); height: 16px;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.22), transparent); filter: blur(3px);
  animation: sombra 6s ease-in-out infinite;
}
.pista {
  position: absolute; left: 0; right: 0; top: calc(50% + min(12vw, 56px) + 28px); text-align: center; margin: 0;
  color: var(--gris-claro); font-size: 14px; letter-spacing: .02em; transition: opacity .4s;
  animation: aparecer 1.2s 1.2s both;
}
@keyframes flotar { 0%, 100% { transform: translateY(-9px); } 50% { transform: translateY(9px); } }
@keyframes sombra { 0%, 100% { transform: translateX(-50%) scale(.82); opacity: .7; } 50% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes aparecer { from { opacity: 0; } }
body.buscando .pista { opacity: 0; }
body.buscando .escena { transform: translateY(-6vh); }
body.viendo .escena { opacity: 0; transform: scale(.5) translateY(-30vh); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .flotador, .sombra { animation: none; } }

/* ---------- barra de búsqueda */
.barra {
  position: fixed; left: 50%; bottom: calc(var(--abajo) + 22px); z-index: 40;
  width: min(calc(100% - 36px), 680px); height: 66px;
  display: flex; align-items: center; gap: 4px; padding: 0 10px 0 16px;
  background: rgba(250,250,251,.92); border-radius: 999px;
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.12), inset 0 1px 0 #fff;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform .55s var(--muelle), opacity .3s;
}
/* la barra solo existe en la pantalla de la esfera */
body.buscando .barra { transform: translate(-50%, 0); opacity: 1; }
body.viendo .barra { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.mic, .enviar { width: 46px; height: 46px; display: grid; place-items: center; color: #3a3a3c; border-radius: 50%; flex-shrink: 0; }
.mic:active, .enviar:active { background: rgba(0,0,0,.06); }
.mic.escuchando { color: var(--rojo); animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(1.12); } }
.separador { width: 1px; height: 30px; background: #d1d1d6; margin: 0 8px 0 4px; }
#consulta {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; color: var(--tinta);
  -webkit-appearance: none; appearance: none;
}
#consulta::placeholder { color: #8e8e93; }
#consulta::-webkit-search-cancel-button { display: none; }

.sugerencias {
  position: fixed; left: 0; right: 0; bottom: calc(var(--abajo) + 104px); z-index: 35;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 18px;
  transition: opacity .3s, transform .45s var(--suave);
}
/* las sugerencias viven en la portada; al tocar la esfera solo queda la barra */
body.buscando .sugerencias, body.viendo .sugerencias { opacity: 0; transform: translateY(12px); pointer-events: none; }
.chip {
  padding: 9px 15px; border-radius: 999px; font-size: 14.5px; background: #fff; color: #1c1c1e;
  box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 3px 10px rgba(0,0,0,.05); white-space: nowrap;
}
.chip:active { transform: scale(.96); }

/* ---------- resultados */
.resultados {
  position: relative; z-index: 10; max-width: 720px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 96px) 18px calc(var(--abajo) + 40px);
  display: none;
}
body.viendo .resultados { display: block; }
.vista { animation: entrar .55s var(--suave) both; }
@keyframes entrar { from { opacity: 0; transform: translateY(18px); } }
.vista > * { animation: entrar .6s var(--suave) both; }
.vista > *:nth-child(2) { animation-delay: .05s; } .vista > *:nth-child(3) { animation-delay: .1s; }
.vista > *:nth-child(4) { animation-delay: .15s; } .vista > *:nth-child(5) { animation-delay: .2s; }
.vista > *:nth-child(n+6) { animation-delay: .25s; }

.titulo { display: flex; align-items: center; gap: 16px; margin: 8px 2px 22px; }
.icono-negro {
  width: 62px; height: 62px; border-radius: 18px; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #3a3a3c 0%, #0b0b0c 50%, #000 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 10px 20px rgba(0,0,0,.25);
}
.titulo h1 { font-size: clamp(23px, 6vw, 30px); line-height: 1.12; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.titulo p { margin: 3px 0 0; color: var(--gris); font-size: clamp(14.5px, 3.8vw, 17px); }
.titulo .texto { flex: 1; min-width: 0; }
.selector {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.75);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08); font-size: 15px; white-space: nowrap; position: relative;
}
.selector select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* tarjeta negra brillante */
.tarjeta {
  position: relative; color: var(--tarjeta-texto); border-radius: var(--radio); margin: 0 0 20px; padding: 26px 26px 22px;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(180deg, #19191b 0%, #070708 40%, #000 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.28), inset 0 0 0 1px rgba(255,255,255,.07),
    inset 0 -3px 10px rgba(255,255,255,.07),
    0 22px 44px -12px rgba(0,0,0,.45), 0 4px 10px rgba(0,0,0,.18);
  overflow: hidden; isolation: isolate;
}
.tarjeta::before { /* reflejo líquido en el borde superior */
  content: ""; position: absolute; left: 6%; right: 6%; top: -40px; height: 80px; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 40% at 60% 100%, rgba(255,255,255,.22), transparent 70%);
  filter: blur(2px);
}
.tarjeta::after { /* brillo en la esquina inferior */
  content: ""; position: absolute; inset: auto -10% -60px 30%; height: 90px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 80% 0%, rgba(255,255,255,.10), transparent 70%);
}
.tarjeta.pulsable { cursor: pointer; transition: transform .25s var(--suave); }
.tarjeta.pulsable:active { transform: scale(.985); }
.etiqueta-gris { color: var(--tarjeta-gris); font-size: 17px; margin: 0; }
.cifra { font-size: clamp(38px, 11vw, 54px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.cambio { font-size: 19px; font-weight: 600; display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
.cambio .neto { color: var(--tarjeta-gris); font-weight: 400; }
.sube { color: var(--verde); } .baja { color: var(--rojo-vivo); }
.grafico { position: relative; margin: 14px -6px 0; touch-action: pan-y; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .lectura { position: absolute; top: -4px; right: 6px; font-size: 13px; color: var(--tarjeta-gris); text-align: right; pointer-events: none; font-variant-numeric: tabular-nums; }
.grafico .ampliar { position: absolute; right: 4px; bottom: 28px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #d0d0d5; }
.cifras {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12);
}
.cifras > div { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 0 6px; }
.cifras > div + div { border-left: 1px solid rgba(255,255,255,.14); }
.cifras svg { flex-shrink: 0; color: #fff; }
.cifras small { display: block; color: #d1d1d6; font-size: 14.5px; line-height: 1.2; }
.cifras b { font-size: 19px; font-variant-numeric: tabular-nums; }
.cabeza-tarjeta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cabeza-tarjeta h2 { font-size: 23px; margin: 0; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.pastilla {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 14.5px; white-space: nowrap;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); color: #ececf0;
}
.pastilla.verde { background: rgba(52,208,88,.16); box-shadow: inset 0 0 0 1px rgba(52,208,88,.35); }
.pastilla.roja { background: rgba(255,45,45,.18); box-shadow: inset 0 0 0 1px rgba(255,45,45,.4); }
.pastilla.verde::before, .pastilla.roja::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pastilla.verde::before { background: var(--verde); } .pastilla.roja::before { background: var(--rojo-vivo); }
.pastilla .r { color: var(--rojo-vivo); }
.tarjeta p { margin: 0 0 10px; color: #e6e6ea; font-size: 16.5px; }
.tarjeta p:last-child { margin-bottom: 0; }
.tarjeta ul { margin: 6px 0 4px; padding: 0; list-style: none; }
.tarjeta li { position: relative; padding-left: 22px; margin: 6px 0; color: #ececf0; font-size: 16.5px; }
.tarjeta li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.tarjeta ul.rojos li::before { background: var(--rojo-vivo); box-shadow: 0 0 8px rgba(255,45,45,.7); }
.tarjeta h3 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--tarjeta-gris); margin: 18px 0 4px; font-weight: 600; }
.tarjeta strong { color: #fff; }
.meta { color: var(--tarjeta-gris); font-size: 14px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fichas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ficha { padding: 6px 12px; border-radius: 999px; font-size: 14px; background: rgba(255,255,255,.1); color: #fff; }
.fuentes { margin-top: 12px; font-size: 13.5px; color: var(--tarjeta-gris); }
.fuentes a { color: #c9c9ce; margin-right: 12px; }
.nota { font-size: 13px; color: var(--gris); text-align: center; margin: 4px 12px 22px; }
.seccion { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--gris); margin: 30px 4px 12px; font-weight: 600; }

/* filas tipo lista de mercado */
.fila { display: grid; grid-template-columns: 1fr 86px auto; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; }
.fila + .fila { border-top: 1px solid rgba(255,255,255,.08); }
.fila .nom b { display: block; font-size: 16.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .nom small { color: var(--tarjeta-gris); font-size: 13px; }
.fila .val { text-align: right; font-variant-numeric: tabular-nums; }
.fila .val b { display: block; font-size: 16.5px; color: #fff; }
.fila .val span { font-size: 14px; font-weight: 600; padding: 2px 8px; border-radius: 7px; display: inline-block; margin-top: 2px; }
.fila .val span.sube { background: rgba(52,208,88,.15); } .fila .val span.baja { background: rgba(255,45,45,.15); }
.pestanas { display: flex; gap: 6px; margin: -4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.pestanas button { padding: 7px 14px; border-radius: 999px; font-size: 14.5px; color: #d1d1d6; background: rgba(255,255,255,.07); white-space: nowrap; }
.pestanas button.activa { background: #fff; color: #000; font-weight: 600; }

/* curso */
.leccion-fila { display: flex; gap: 14px; align-items: center; padding: 13px 0; cursor: pointer; }
.leccion-fila + .leccion-fila { border-top: 1px solid rgba(255,255,255,.08); }
.num { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); color: #d1d1d6; }
.num.hecha { background: #fff; color: #000; box-shadow: none; }
.leccion-fila b { display: block; font-weight: 600; color: #fff; }
.leccion-fila small { color: var(--tarjeta-gris); font-size: 13.5px; }
.barra-progreso { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin: 12px 0 4px; }
.barra-progreso i { display: block; height: 100%; background: linear-gradient(90deg, #ff453a, #ff2d2d); box-shadow: 0 0 10px rgba(255,45,45,.6); border-radius: 3px; }
.opciones { display: grid; gap: 10px; margin-top: 14px; }
.opcion { text-align: left; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); color: #fff; font-size: 16px; transition: background .2s; }
.opcion.bien { background: rgba(52,208,88,.2); box-shadow: inset 0 0 0 1.5px var(--verde); }
.opcion.mal { background: rgba(255,45,45,.18); box-shadow: inset 0 0 0 1.5px var(--rojo-vivo); }
.explicacion { margin-top: 14px; }
.navegacion { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.boton-claro { padding: 12px 18px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06); font-size: 15px; font-weight: 500; }

/* ---------- menú */
.menu { position: fixed; inset: 0; z-index: 60; }
.menu-fondo { position: absolute; inset: 0; background: rgba(0,0,0,.18); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: aparecer .3s; }
.menu-hoja {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 68px); left: 16px; width: min(300px, calc(100% - 32px));
  padding: 10px; border-radius: 26px; color: #fff;
  background: linear-gradient(180deg, #1c1c1e, #050505);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 24px 50px rgba(0,0,0,.35);
  transform-origin: top left; animation: abrir .4s var(--muelle);
}
@keyframes abrir { from { opacity: 0; transform: scale(.85); } }
.menu-hoja button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 14px; border-radius: 16px; font-size: 17px; text-align: left; }
.menu-hoja button:active, .menu-hoja button:hover { background: rgba(255,255,255,.08); }
.menu-hoja small { display: block; color: var(--tarjeta-gris); font-size: 12.5px; padding: 10px 14px 6px; }

/* ---------- gráfico a pantalla completa */
.completa {
  position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right)) calc(var(--abajo) + 16px) max(16px, env(safe-area-inset-left));
  animation: aparecer .25s;
}
.completa .arriba { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.completa .arriba h2 { margin: 0; font-size: 18px; font-weight: 600; color: #d1d1d6; }
.completa .cifra { font-size: clamp(30px, 8vw, 44px); }
.completa .cerrar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; flex-shrink: 0; }
.completa .grafico { flex: 1; margin: 12px 0 0; display: flex; }
.completa .grafico svg { height: 100%; }
.completa .lectura { font-size: 15px; color: #fff; }
.rangos { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.rangos button { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: #c7c7cc; }
.rangos button.activa { background: #fff; color: #000; font-weight: 600; }

@media (min-width: 900px) {
  .resultados { padding-top: 110px; }
  .cabecera { padding: 20px 28px; }
}

/* ---------- ticker flotante */
.ticker {
  position: fixed; left: 50%; bottom: calc(var(--abajo) + 24px); z-index: 38; transform: translateX(-50%);
  width: min(calc(100% - 36px), 420px); height: 62px; padding: 0 14px 0 9px; display: flex; align-items: center; gap: 11px;
  border-radius: 999px; color: #fff; text-align: left;
  background: linear-gradient(180deg, #2a2a2c 0%, #0b0b0c 50%, #000 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), 0 14px 30px rgba(0,0,0,.25);
  transition: opacity .3s, transform .5s var(--muelle);
  animation: aparecer .8s .6s both;
}
.ticker[hidden] { display: none; }
/* fuera de Explorar, Mi lista, Noticias e Ideas no se ve (tampoco en la esfera) */
body:not(.con-ticker) .ticker { opacity: 0; transform: translate(-50%, 140%); pointer-events: none; }
body.con-ticker .resultados { padding-bottom: calc(var(--abajo) + 110px); }
.ticker .datos { flex: 0 0 auto; line-height: 1.2; transition: opacity .3s; }
.ticker .datos b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ticker .datos small { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.ticker svg.spark { flex: 1; min-width: 0; height: 34px; }
.ticker .flechita { color: #8e8e93; flex-shrink: 0; }
.ticker.cambiando .datos, .ticker.cambiando svg, .ticker.cambiando .logo { opacity: 0; }
.ticker svg, .ticker .logo { transition: opacity .3s; }

/* logos redondos */
.logo {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -.02em;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), inset 0 -2px 4px rgba(0,0,0,.25);
}
.logo.peq { width: 26px; height: 26px; font-size: 9.5px; }
.logo.gran { width: 50px; height: 50px; font-size: 16px; }

/* ---------- lista de seguimiento */
.cabeza-lista { display: flex; align-items: flex-end; justify-content: space-between; margin: 6px 4px 14px; }
.cabeza-lista h1 { margin: 0; font-size: clamp(26px, 7vw, 32px); letter-spacing: -.02em; }
.cabeza-lista p { margin: 2px 0 0; color: var(--gris); font-size: 14px; }
.boton-texto { font-size: 15px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.07); }
.grupo { padding: 6px 18px; }
.grupo-titulo { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--gris); margin: 22px 6px 8px; }
.linea { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; position: relative; }
.linea + .linea { border-top: 1px solid rgba(255,255,255,.08); }
.linea .sim { font-size: 16.5px; font-weight: 600; color: #fff; display: flex; gap: 6px; align-items: center; min-width: 0; }
.linea .sim i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--tarjeta-gris); background: rgba(255,255,255,.09); padding: 1px 5px; border-radius: 5px; }
.linea .nombre { font-size: 13.5px; color: var(--tarjeta-gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.linea .der { text-align: right; font-variant-numeric: tabular-nums; }
.linea .der b { display: block; font-size: 16.5px; font-weight: 600; color: #fff; }
.linea .der small { font-size: 13.5px; font-weight: 500; }
.linea:active { opacity: .7; }
.linea .quitar { display: none; }
.editando .linea { grid-template-columns: 40px 1fr auto 34px; }
.editando .linea .quitar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rojo-vivo); color: #fff; font-size: 20px; line-height: 1; }

/* ---------- explorar */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 16px; }
.tile {
  display: grid; justify-items: center; gap: 6px; padding: 14px 4px 12px; border-radius: 22px; font-size: 13.5px; color: #fff;
  background: linear-gradient(180deg, #26262a 0%, #0b0b0c 55%, #000 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 10px 22px -8px rgba(0,0,0,.4);
}
.tile svg { width: 24px; height: 24px; }
.tile:active { transform: scale(.96); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 14px; padding: 2px 18px; }
.chips::-webkit-scrollbar, .carrusel::-webkit-scrollbar { display: none; }
.chips button { padding: 8px 15px; border-radius: 999px; font-size: 14.5px; background: #fff; color: #1c1c1e; white-space: nowrap; box-shadow: 0 0 0 1px rgba(0,0,0,.07); }
.chips button.activa { background: #0b0b0c; color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.3); }
.carrusel {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 46%; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -18px 8px; padding: 2px 18px 14px; scroll-padding: 18px;
}
.carrusel.una { grid-template-rows: auto; grid-auto-columns: 78%; }
@media (min-width: 640px) { .carrusel { grid-auto-columns: 30%; } .carrusel.una { grid-auto-columns: 46%; } }
.mini-tarjeta {
  scroll-snap-align: start; padding: 13px 13px 10px; border-radius: 22px; color: #fff; cursor: pointer; text-align: left; min-width: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.09), transparent 55%), linear-gradient(180deg, #19191b 0%, #070708 45%, #000 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.06), 0 12px 24px -10px rgba(0,0,0,.45);
}
.mini-tarjeta:active { transform: scale(.97); }
.mini-tarjeta .arriba { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.mini-tarjeta .arriba span { overflow: hidden; text-overflow: ellipsis; }
.mini-tarjeta .px { font-size: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mini-tarjeta .px small { color: var(--tarjeta-gris); font-size: 11px; margin-left: 3px; }
.mini-tarjeta .var { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-tarjeta .var small { color: var(--tarjeta-gris); font-weight: 400; }
.mini-tarjeta svg.spark { width: 100%; height: 38px; display: block; margin-top: 6px; }
.mini-tarjeta p { font-size: 14.5px; margin: 8px 0 0; color: #e6e6ea; line-height: 1.35; }
.titulo-seccion { display: flex; align-items: center; gap: 4px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 24px 2px 12px; }
.titulo-seccion svg { color: var(--gris); }
.flujo { padding: 6px 20px; }
.flujo .item { display: block; width: 100%; text-align: left; padding: 13px 0; }
.flujo .item + .item { border-top: 1px solid rgba(255,255,255,.08); }
.flujo small { color: var(--tarjeta-gris); font-size: 12.5px; display: block; margin-bottom: 3px; }
.flujo b { font-size: 16px; font-weight: 600; line-height: 1.3; color: #fff; }

/* ---------- ficha de un activo (estilo hoja negra) */
.hoja { padding: 20px 20px 18px; }
.hoja-cabeza { display: flex; align-items: center; gap: 12px; }
.hoja-cabeza h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.hoja-cabeza small { color: var(--tarjeta-gris); font-size: 13.5px; }
.hoja-cabeza .texto { flex: 1; min-width: 0; }
.estrella { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); }
.estrella.puesta { color: #ffcc00; }
.precio-grande { font-size: clamp(36px, 10vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 16px 0 4px; font-variant-numeric: tabular-nums; }
.precio-grande small { font-size: 14px; font-weight: 500; color: var(--tarjeta-gris); letter-spacing: 0; margin-left: 4px; }
.cambio-hoy { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cambio-hoy span { color: var(--tarjeta-gris); font-weight: 400; }
.cambio-periodo { font-size: 13.5px; color: var(--tarjeta-gris); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rangos-ficha { display: flex; align-items: center; gap: 2px; margin: 10px -6px 4px; }
.rangos-ficha button { flex: 1; padding: 7px 0; border-radius: 10px; font-size: 13.5px; color: #c7c7cc; font-weight: 500; }
.rangos-ficha button.activa { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.rangos-ficha .ampliar2 { flex: 0 0 36px; display: grid; place-items: center; color: #fff; }
.boton-blanco { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 14px; border-radius: 999px; background: #fff; color: #000; font-size: 16px; font-weight: 600; }
.boton-blanco:active { transform: scale(.98); }
.pestanas-claras { display: flex; gap: 4px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.pestanas-claras button { padding: 9px 16px; border-radius: 999px; font-size: 15px; color: var(--gris); font-weight: 500; white-space: nowrap; }
.pestanas-claras button.activa { background: #0b0b0c; color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 6px 14px rgba(0,0,0,.18); }

/* globo de lectura al recorrer un gráfico */
.globo {
  position: absolute; top: -10px; left: 0; z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 5px 9px; border-radius: 9px; font-size: 12px; line-height: 1.3; color: #fff; text-align: left;
  background: rgba(30,30,32,.94); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 6px 16px rgba(0,0,0,.4);
  font-variant-numeric: tabular-nums; display: none;
}
.globo b { font-size: 13px; }
.globo small { color: var(--tarjeta-gris); font-size: 11px; }

/* ---------- gráfico de velas a pantalla completa */
.velas { padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 calc(var(--abajo) + 10px); gap: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.v-arriba { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 4px 14px 8px; }
.v-titulo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; min-width: 0; }
.v-titulo small { color: var(--tarjeta-gris); font-weight: 400; font-size: 13px; }
.v-ohlc { grid-column: 1; font-size: 12px; color: #c7c7cc; font-variant-numeric: tabular-nums; line-height: 1.45; min-height: 34px; }
.v-ohlc em { font-style: normal; color: var(--tarjeta-gris); margin-right: 2px; }
.v-ohlc span { margin-right: 8px; }
.v-arriba .cerrar { grid-row: 1 / span 2; grid-column: 2; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.v-lienzo { position: relative; flex: 1; min-height: 0; }
.v-lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.v-reset { position: absolute; left: 12px; bottom: 34px; width: 38px; height: 38px; border-radius: 50%; background: rgba(40,40,42,.9); display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); opacity: 0; pointer-events: none; transition: opacity .2s; }
.v-reset.ver { opacity: 1; pointer-events: auto; }
.v-pista { position: absolute; left: 0; right: 66px; top: 8px; text-align: center; font-size: 12px; color: #8e8e93; pointer-events: none; transition: opacity .6s; }
.v-rangos { display: flex; justify-content: center; gap: 4px; padding: 8px 12px 6px; }
.v-rangos button { padding: 7px 13px; border-radius: 10px; font-size: 13.5px; color: #c7c7cc; font-weight: 500; }
.v-rangos button.activa { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.v-barra {
  display: flex; align-items: center; gap: 6px; margin: 4px 12px 0; padding: 6px 8px; border-radius: 999px;
  background: linear-gradient(180deg, #232325, #111113); box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.v-barra .v-sim { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-right: 10px; flex: 1; min-width: 0; }
.v-barra .v-int { font-size: 14px; color: #c7c7cc; padding: 0 8px; }
.v-barra button { height: 36px; min-width: 40px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; color: #c7c7cc; font-size: 13.5px; font-weight: 600; }
.v-barra button.activa { background: rgba(255,255,255,.14); color: #fff; }

.aviso { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 74px); z-index: 90; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: #0b0b0c; color: #fff; font-size: 14.5px; box-shadow: 0 10px 24px rgba(0,0,0,.25); animation: entrar .35s var(--suave); transition: opacity .4s; }
.aviso.fuera { opacity: 0; }
.hoja::before { opacity: .45; }
@media (max-width: 440px) {
  .cifras svg { display: none; }
  .cifras > div { padding: 0 4px; }
  .cifras small { font-size: 13px; }
  .cifras b { font-size: 17px; }
}
.titulo-seccion, .tarjeta[id^="n-"] { scroll-margin-top: 84px; }

/* ---------- cuenta */
.avatar-boton { padding: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #3a3a3c 0%, #0b0b0c 55%, #000 100%); box-shadow: inset 0 1px 1px rgba(255,255,255,.4); }
.lado.activo .avatar { background: #fff; color: #000; }
.perfil { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 16px; padding: 22px; }
.avatar-grande { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #000;
  background: linear-gradient(180deg, #fff, #d8d8dc); box-shadow: inset 0 -2px 4px rgba(0,0,0,.15), 0 6px 16px rgba(0,0,0,.4); }
.perfil-texto { min-width: 0; }
.perfil-texto h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perfil-texto p { margin: 2px 0 0 !important; font-size: 13.5px !important; color: var(--tarjeta-gris) !important; }
.boton-blanco.peq { width: auto; margin: 0; padding: 9px 16px; font-size: 14.5px; }
.editar-nombre { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 14px; }
.editar-nombre input { flex: 1; min-width: 0; padding: 11px 16px; border-radius: 999px; border: 0; outline: 0; font: inherit; font-size: 16px; color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.editar-nombre input:focus { box-shadow: inset 0 0 0 1.5px #fff; }
.filas-cuenta { padding: 4px 18px; }
.fila-cuenta { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 12px 0; text-align: left; color: #fff; font-size: 16px; }
.fila-cuenta + .fila-cuenta { border-top: 1px solid rgba(255,255,255,.08); }
.fila-cuenta > span:first-child:not(.ico), .fila-cuenta > .ico + span { flex: 1; min-width: 0; }
.fila-cuenta b { display: block; font-weight: 500; }
.fila-cuenta small { display: block; color: var(--tarjeta-gris); font-size: 13px; margin-top: 1px; }
.fila-cuenta > svg { color: #6e6e73; flex-shrink: 0; }
.fila-cuenta .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); flex-shrink: 0; }
.fila-cuenta.peligro b { color: var(--rojo-vivo); }
.fila-cuenta.confirmar small { color: var(--rojo-vivo); font-weight: 600; }
.interruptor { width: 50px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.16); position: relative; flex-shrink: 0; transition: background .25s; }
.interruptor i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35); transition: transform .3s var(--muelle); }
.interruptor.on { background: var(--verde); }
.interruptor.on i { transform: translateX(20px); }
.segmentos { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.1); flex-shrink: 0; }
.segmentos button { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; color: #c7c7cc; white-space: nowrap; }
.segmentos button.activa { background: #fff; color: #000; font-weight: 600; }
.volver { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 500; color: var(--gris); margin: 0 0 6px; }
.volver svg { transform: rotate(180deg); }
.texto-legal h3 { margin-top: 20px; }
.texto-legal h3:first-child { margin-top: 0; }
@media (max-width: 400px) { .fila-cuenta:has(.segmentos) { flex-wrap: wrap; } }
[hidden] { display: none !important; }
.texto-legal h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: #fff; }

/* ---------- bienvenida: instalar, perfil e intereses */
body.con-bienvenida .cabecera, body.con-bienvenida .barra, body.con-bienvenida .ticker { visibility: hidden; }
.bienvenida {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 70% at 50% 0%, #fff 0%, var(--fondo) 60%);
  padding: calc(env(safe-area-inset-top, 0px) + 40px) 22px calc(env(safe-area-inset-bottom, 0px) + 32px);
  animation: entrar .5s var(--suave) both;
}
.bienvenida.saliendo { opacity: 0; transform: scale(1.03); transition: opacity .4s, transform .45s var(--suave); }
.bv-hoja { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-height: 100%; }
.bv-hoja.ancha { max-width: 620px; }
.bv-hoja > * { animation: entrar .55s var(--suave) both; }
.bv-hoja > *:nth-child(2) { animation-delay: .05s; } .bv-hoja > *:nth-child(3) { animation-delay: .1s; } .bv-hoja > *:nth-child(n+4) { animation-delay: .15s; }
.bv-marca { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 6px; }
.bv-marca img { border-radius: 16px; box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.bv-marca b { font-size: 15px; letter-spacing: .02em; color: var(--gris); font-weight: 600; }
.bienvenida h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.02em; text-align: center; margin: 0; text-wrap: balance; }
.bv-sub { color: var(--gris); text-align: center; font-size: 16px; line-height: 1.45; margin: 0 0 6px; text-wrap: pretty; }
.bv-lista { list-style: none; padding: 6px; margin: 4px 0; background: #fff; border-radius: 24px; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.06); }
.bv-lista li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 12px; font-size: 16px; line-height: 1.45; }
.bv-lista li + li { border-top: 1px solid var(--linea); }
.bv-lista svg { vertical-align: -5px; margin-left: 2px; }
.bv-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--tinta); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.bv-url { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--fondo); font-size: 14px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.bv-boton {
  height: 58px; border-radius: 999px; font-size: 17px; font-weight: 600; color: #fff; margin-top: 6px;
  background: linear-gradient(180deg, #2a2a2c 0%, #0b0b0c 50%, #000 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), 0 12px 26px rgba(0,0,0,.22);
  transition: transform .15s, opacity .2s;
}
.bv-boton:active { transform: scale(.97); }
.bv-boton:disabled { opacity: .3; box-shadow: none; }
.bv-enlace { align-self: center; padding: 12px 16px; color: var(--gris); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.bv-pasos { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.bv-pasos i { width: 26px; height: 5px; border-radius: 3px; background: #d8d8dc; }
.bv-pasos i.activo { background: var(--tinta); } .bv-pasos i.hecho { background: #8e8e93; }
.bv-avatar { align-self: center; margin: 6px 0 4px; }
.bv-campo {
  height: 60px; border-radius: 18px; border: 0; padding: 0 20px; font: inherit; font-size: 19px; color: var(--tinta); text-align: center;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.05); outline: none; -webkit-appearance: none; appearance: none;
}
.bv-campo:focus { box-shadow: 0 0 0 2px var(--tinta), 0 6px 18px rgba(0,0,0,.06); }
.bv-legal { font-size: 13px; color: var(--gris-claro); text-align: center; line-height: 1.5; margin: 4px 0 0; }
.bv-legal a { color: var(--gris); }
.bv-grupo { margin-top: 6px; }
.bv-grupo-cabeza { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bv-grupo h2 { font-size: 17px; margin: 0; }
.bv-todos { font-size: 14px; color: var(--gris); padding: 6px 10px; border-radius: 999px; }
.bv-todos:active { background: rgba(0,0,0,.06); }
.bv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bv-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px; font-size: 15px;
  background: #fff; color: var(--tinta); box-shadow: 0 0 0 1px rgba(0,0,0,.08); transition: background .2s, color .2s, transform .15s;
}
.bv-chip:active { transform: scale(.96); }
.bv-chip.on { background: var(--tinta); color: #fff; box-shadow: inset 0 1px 1px rgba(255,255,255,.3); }
.bv-chip .logo { width: 28px; height: 28px; font-size: 10px; }
.bv-pie { position: sticky; bottom: 0; margin-top: auto; padding: 18px 0 4px; background: linear-gradient(180deg, transparent, var(--fondo) 35%); }
.bv-pie .bv-boton { width: 100%; }
.bv-chip span { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
