:root {
  --bg: #0b0b0d;
  --surface: #151518;
  --surface-2: #1d1d22;
  --line: #2a2a31;
  --text: #f1ede4;
  --muted: #9b968a;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, .14);
  --ok: #7fbf8e;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: rgba(11,11,13,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; color: var(--gold); }
.back { background: none; border: 0; color: var(--text); font-size: 22px; padding: 4px 8px; cursor: pointer; }
.spacer { flex: 1; }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 22px; line-height: 1.3; margin: 32px 0 12px; }
h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 32px 0 10px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }

.card {
  display: block; width: 100%; text-align: left; background: var(--surface); color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  text-decoration: none; cursor: pointer; font: inherit;
}
.card:hover, .card:focus-visible { border-color: var(--gold); outline: none; }
.card.locked { opacity: .55; cursor: default; }
.card.locked:hover { border-color: var(--line); }
.card .t { font-weight: 600; font-size: 18px; margin-bottom: 4px; }
.row { display: flex; align-items: center; gap: 14px; }
.badge {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 15px;
}
.badge.done { background: var(--ok); color: #0b0b0d; }
.grow { flex: 1; min-width: 0; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 14px 0 4px; }
.progress > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .3s; }

.btn {
  display: block; width: 100%; text-align: center; border: 0; border-radius: 14px; padding: 15px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; margin-top: 12px;
  background: var(--gold); color: #0b0b0d;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:active { transform: scale(.99); }

.lead { color: var(--muted); font-size: 18px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.box b { color: var(--gold); }
ul.bul { padding-left: 20px; margin: 0 0 14px; }
ul.bul li { margin-bottom: 6px; }

.chat { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 16px; line-height: 1.5; }
.msg small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-bottom: 2px; }
.msg.l { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.r { align-self: flex-end; background: #2a2a31; color: var(--muted); border-bottom-right-radius: 4px; }
.msg.best { align-self: flex-end; background: var(--gold-soft); border: 1px solid var(--gold); color: var(--text); border-bottom-right-radius: 4px; }
.msg.best small { color: var(--gold); opacity: 1; }

ol.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 12px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); margin-top: 2px; flex: none; }
.check:last-child { border-bottom: 0; }

.quote {
  border-left: 3px solid var(--gold); padding: 6px 0 6px 16px; margin: 28px 0 8px;
  font-size: 20px; line-height: 1.45; font-style: italic;
}
.today { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius); padding: 16px 18px; margin: 24px 0; }
.today .eyebrow { margin-bottom: 4px; }

.center { text-align: center; padding-top: 40px; }
.big { font-size: 56px; margin-bottom: 8px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 9;
  max-width: 608px; margin: 0 auto; background: var(--gold); color: #0b0b0d; font-weight: 600;
  padding: 14px 18px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Barra inferior */
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around; align-items: flex-end;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(11,11,13,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; min-width: 0; }
.tab .tl { white-space: nowrap; }
.tab.on { color: var(--gold); }
.tab.center .ti {
  width: 52px; height: 52px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #0b0b0d; box-shadow: 0 6px 18px rgba(212,175,55,.35); border: 4px solid var(--bg);
}
.tab.center.on { color: var(--gold); }

/* Tarjetas, etiquetas y venta */
.card.soon { opacity: .6; cursor: default; }
.card.soon:hover { border-color: var(--line); }
.card.locked-offer { border-style: dashed; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.tag.gold { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.vsl {
  aspect-ratio: 16 / 9; border-radius: var(--radius); margin-bottom: 20px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px;
  background: linear-gradient(135deg, #1d1d22, #0f0f12); border: 1px solid var(--line);
}
.vsl .play { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #0b0b0d; font-size: 22px; padding-left: 4px; }

/* Login */
.field { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; font: inherit; margin-top: 12px; }
.field:focus { outline: none; border-color: var(--gold); }
.field.code { text-align: center; letter-spacing: .3em; font-size: 22px; }
.err { color: #e5867c; margin-top: 14px; }
.tabbar[hidden] { display: none; }
.logo { display: block; margin: 0 auto 16px; width: 220px; max-width: 70%; height: auto; border-radius: 50%; }

/* Guía de instalación */
ol.guide { list-style: none; padding: 0; margin: 20px 0 0; }
.gstep { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.gn { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #0b0b0d; font-weight: 700; }
.pointer { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 8; text-align: center; color: var(--gold); font-weight: 700; pointer-events: none; animation: bob 1.2s ease-in-out infinite; }
.pointer.top { bottom: auto; top: 10px; }
.pointer span { display: block; font-size: 15px; background: rgba(11,11,13,.9); border: 1px solid var(--gold); border-radius: 99px; padding: 4px 14px; margin-bottom: 2px; }
.pointer i { display: block; font-style: normal; font-size: 40px; line-height: 1; text-shadow: 0 0 14px rgba(212,175,55,.7); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }
.pointer.top { animation-name: bobtop; }
@keyframes bobtop { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -10px); } }
@media (prefers-reduced-motion: reduce) { .pointer, .pointer.top { animation: none; } }

/* Texto enriquecido: numeradas y tablas */
ol.nums { padding-left: 22px; margin: 0 0 14px; }
ol.nums li { margin-bottom: 6px; padding-left: 4px; }
.tablewrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.tbl th { text-align: left; color: var(--gold); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface); }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
i { color: var(--text); }

/* Tablas: tarjetas en el celular, selector de ruta */
.segs { display: flex; gap: 8px; margin: 4px 0 12px; }
.seg { flex: 1; min-width: 0; background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; font: inherit; cursor: pointer; text-align: center; line-height: 1.25; }
.seg b { display: block; font-size: 15px; }
.seg small { display: block; font-size: 11px; margin-top: 2px; }
.seg.on { border-color: var(--gold); color: var(--text); background: var(--gold-soft); }
.seg.on b { color: var(--gold); }
.tbl.routes [data-r] { display: none; }
.tbl.routes[data-sel="0"] [data-r="0"], .tbl.routes[data-sel="1"] [data-r="1"], .tbl.routes[data-sel="2"] [data-r="2"] { display: table-cell; }
@media (max-width: 640px) {
  .tablewrap { border: 0; border-radius: 0; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
  .tbl td { display: block; border: 0; padding: 4px 0; }
  .tbl td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 1px; }
  .tbl td:first-child { font-weight: 700; color: var(--gold); font-size: 17px; }
  .tbl td:first-child::before { display: none; }
  .tbl.routes [data-r] { display: none; }
  .tbl.routes[data-sel="0"] td[data-r="0"], .tbl.routes[data-sel="1"] td[data-r="1"], .tbl.routes[data-sel="2"] td[data-r="2"] { display: block; }
  .tbl.routes td[data-r]::before { display: none; }
}
.dl { flex: none; color: var(--gold); font-size: 22px; }

/* Planes de Mi Asesor */
.plans { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 560px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.plan.featured { border-color: var(--gold); background: var(--gold-soft); }
.plan .pn { font-weight: 700; font-size: 18px; }
.plan .pu { color: var(--gold); font-weight: 600; margin: 2px 0 8px; }
.plan ul.bul { margin: 0; }

/* Perfil en el encabezado y material plegable de la Biblioteca */
.profile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); border: 1px solid var(--line); text-decoration: none; }
.profile.on, .profile:hover { color: var(--gold); border-color: var(--gold); }
.profile[hidden] { display: none; }
details.mat { margin: 0 0 12px; }
details.mat > summary { cursor: pointer; list-style: none; padding: 12px 4px; color: var(--gold); font-weight: 600; }
details.mat > summary::-webkit-details-marker { display: none; }
details.mat > summary::after { content: ' ▾'; }
details.mat[open] > summary::after { content: ' ▴'; }

/* Mi Asesor: formulario, opciones de respuesta y botones pequeños */
.lbl { display: block; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
textarea.field.area { resize: vertical; min-height: 110px; line-height: 1.5; }
.opts { display: grid; gap: 10px; margin: 12px 0; }
.opt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.opt.sel { border-color: var(--gold); background: var(--gold-soft); }
.opt .otext { font-size: 17px; line-height: 1.5; margin-bottom: 10px; }
.obtns { display: flex; gap: 8px; flex-wrap: wrap; }
.mini { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.mini.on { border-color: var(--gold); color: var(--gold); }
.turn { margin-bottom: 14px; }
details.turn.old { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
details.turn.old > summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-size: 15px; }

/* Radar de señales */
.radar { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-size: 15px; line-height: 1.5; }
.radar p { margin: 6px 0 0; }
.radar ul.bul { margin: 8px 0 0; }
.radar .rtop { display: flex; align-items: center; gap: 8px; }
.radar .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); flex: none; }
.radar.g { border-left-color: #7fbf8e; } .radar.g .dot { background: #7fbf8e; }
.radar.y { border-left-color: var(--gold); } .radar.y .dot { background: var(--gold); }
.radar.r { border-left-color: #e5867c; } .radar.r .dot { background: #e5867c; }
