/* ============================================================
   NAWI · App web — estilos (calca el prototipo)
   ============================================================ */
:root { --nav-h: 72px; }
html, body { height: 100%; margin: 0; }
body { display: flex; justify-content: center; }
/* APP-SHELL FLEX: el marco ocupa el alto real del viewport y se divide en
   [header] + [.app-scroll (crece y hace scroll)] + [.nav (fijo abajo)].
   Solo el contenido hace scroll; el nav queda anclado sin position:fixed. */
.phone { max-width: 420px; margin-inline: auto; height: 100dvh; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--obsidian); }
.app-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }

.header { padding: 24px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 50%, var(--em-deep)); box-shadow: 0 0 16px var(--gold-glow-strong); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: #1A1000; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: 1px; }
.brand-name b { color: var(--em); font-weight: 500; }
.lang-select { background: var(--panel-3); color: var(--cream); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 12px; font-size: 12px; font-family: var(--font-ui); }

.demo-badge { margin: 0 20px 12px; text-align: center; font-size: 11px; color: var(--warn); border: 1px dashed var(--warn); border-radius: var(--r-pill); padding: 5px 10px; }

.ticker { margin: 0 20px 16px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; }
.ticker .lbl { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.ticker .price { font-family: var(--font-mono); font-size: 15px; color: var(--gold-hi); }
/* Ticker del home con gráfica del día: layout en columna (buy/sell siguen en fila). */
.ticker:has(.sparkline) { flex-direction: column; align-items: stretch; gap: 6px; }
/* Caja de precio con link "Ver precios por volumen": el link baja a su propia
   linea con aire; label + precio quedan solos arriba (no apeñuscado). */
.ticker:has(.vol-link) { flex-wrap: wrap; row-gap: 12px; padding: 14px; }
.ticker .vol-link { flex-basis: 100%; margin: 0; }
.ticker-head { display: flex; align-items: center; justify-content: space-between; }
.price-chg { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.price-chg.up { color: var(--em); }
.price-chg.down { color: var(--danger); }
.sparkline { width: 100%; height: 28px; display: block; }
.sparkline .spark-line { fill: none; stroke-width: 1.5; }
.sparkline .spark-line.up { stroke: var(--em); }
.sparkline .spark-line.down { stroke: var(--danger); }
.spark-axes { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--muted); letter-spacing: .3px; }
.price-src { font-size: 11px; color: var(--muted); text-decoration: underline; align-self: flex-start; }

.vault { margin: 0 20px 16px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px 22px 22px; position: relative; overflow: hidden; }
.vault::before { content: ""; position: absolute; top: -60px; inset-inline-end: -60px; width: 200px; height: 200px; background: radial-gradient(circle, var(--gold-glow-strong), transparent 70%); }
.vault::after { content: ""; position: absolute; bottom: -40px; inset-inline-start: -40px; width: 160px; height: 160px; background: radial-gradient(circle, var(--em-glow), transparent 70%); }
.eyebrow { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--em); box-shadow: 0 0 8px var(--em); }
.balance { font-family: var(--font-display); font-weight: 700; font-size: 60px; line-height: .9; color: var(--gold-hi); letter-spacing: -2px; text-shadow: 0 4px 40px var(--gold-glow-strong); position: relative; z-index: 1; }
.balance .u { font-size: 24px; font-weight: 300; color: var(--gold); margin-inline-start: 4px; }
.fiat { margin-top: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--cream); position: relative; z-index: 1; }
.backing { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); position: relative; z-index: 1; }
.backing-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.backing-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.backing-status { font-family: var(--font-mono); font-size: 11px; color: var(--em); }
.meter { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--em-deep), var(--em)); box-shadow: 0 0 10px var(--em-glow); transition: width .8s ease; }
.backing-note { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.backing-note b { color: var(--cream); font-weight: 500; }

.actions { margin: 0 20px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { border: none; border-radius: var(--r-btn); padding: 15px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn-buy { background: linear-gradient(160deg, var(--gold-hi), var(--gold)); color: #1A1000; }
.btn-sell { background: var(--panel-2); color: var(--cream); border: 1px solid var(--line); }
.btn-em { background: linear-gradient(160deg, #2EBF8F, var(--em)); color: #051A12; }
.btn-outline { background: transparent; color: var(--em); border: 1px solid var(--em); }
.btn-full { grid-column: 1 / -1; }
.signin-cta { margin: 0 20px 16px; }
.signin-link { cursor: pointer; color: var(--gold); text-decoration: underline; }

.section-title { margin: 6px 20px 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* ---- Bolsillos ---- */
.pockets { margin: 0 20px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pocket { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-card-md); padding: 16px; cursor: pointer; }
.pocket.active { background: linear-gradient(145deg, #1A2E24, #0F1C17); border-color: var(--em-deep); }
.pocket-icon { font-size: 20px; margin-bottom: 10px; display: block; }
.pocket-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pocket-value { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--cream); }
.pocket-value .small { font-size: 12px; color: var(--muted); }
.pocket-tag { display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: var(--r-pill); font-size: 10px; font-weight: 600; background: var(--em-deep); color: var(--em); }
.pocket-note { margin: 0 20px 16px; font-size: 11px; color: var(--muted); line-height: 1.5; text-align: center; }
.redeem-opt { padding: 12px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.redeem-opt.sel { border: 2px solid var(--em); }
.redeem-opt.active { border: 2px solid var(--em); }
.redeem-opt .t { font-size: 14px; font-weight: 600; }
.redeem-opt .d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.redeem-opt .go { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--em); text-decoration: none; }
.redeem-opt .go:hover { text-decoration: underline; }
.jp-map { width: 100%; height: 240px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; overflow: hidden; background: var(--panel-2); }
/* Exportar oro (B2B) */
.exp-quote { margin: 0 20px 12px; padding: 12px 16px; background: var(--em-deep); border: 1px solid var(--em); border-radius: 12px; font-size: 13px; }
.exp-ok-card { margin: 12px 20px 0; padding: 14px 16px; background: var(--em-deep); border: 1px solid var(--em); border-radius: 12px; }
.exp-ok-ttl { font-weight: 700; color: var(--em); }
.exp-ok-msg { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.exp-order { margin: 0 20px 12px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.exp-order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.exp-order-ttl { font-size: 15px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.exp-order-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.exp-badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; background: var(--line); color: var(--muted); }
.exp-badge.st-deposit_paid, .exp-badge.st-in_preparation { background: rgba(180,140,20,.18); color: #d9a520; }
.exp-badge.st-docs_ready, .exp-badge.st-dispatched { background: rgba(40,120,200,.18); color: #4e8eff; }
.exp-badge.st-delivered { background: var(--em-deep); color: var(--em); }
.exp-badge.st-cancelled { background: rgba(200,60,60,.15); color: #ff6b6b; }
.exp-timeline { display: flex; gap: 6px; margin-top: 10px; }
.exp-dot { width: 100%; height: 4px; border-radius: 2px; background: var(--line); }
.exp-dot.on { background: var(--em); }
.exp-track { margin-top: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.exp-track-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 2px 0; }
.exp-track-row .k { color: var(--muted); }
.exp-track-row .v { color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.exp-track-row .v.mono { font-family: var(--font-mono); letter-spacing: .5px; }
.exp-doclink { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--gold); text-decoration: none; }
.exp-doclink:hover { text-decoration: underline; }
.ledger { margin: 0 20px; }
.ledger-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ledger-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.ledger-head a { font-size: 12px; color: var(--em); }
.ledger-sub { font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.mov { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.mov:last-child { border-bottom: none; }
.mov-dot { width: 36px; height: 36px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 15px; border: 1px solid var(--line); }
.mov-dot.in { color: var(--em); border-color: var(--em-deep); background: #0F1F19; }
.mov-dot.out { color: var(--gold); border-color: #2A2010; background: #1A1508; }
.mov-info { flex: 1; }
.mov-info .t { font-size: 14px; font-weight: 500; }
.mov-info .d { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.mov-amt { text-align: end; font-family: var(--font-mono); }
.mov-amt .g { font-size: 13px; font-weight: 500; display: block; }
.mov-amt .g.pos { color: var(--em); }
.mov-amt .g.neg { color: var(--danger); }
.mov-amt .u { font-size: 11px; color: var(--muted); }

.page-title { padding: 4px 20px 12px; font-family: var(--font-display); font-size: 26px; font-weight: 500; }
.page-sub { padding: 0 20px 18px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.field { margin: 0 20px 16px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; display: block; }
.field input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-input); padding: 14px 16px; font-family: var(--font-mono); font-size: 20px; color: var(--cream); outline: none; }
.field input:focus { border-color: var(--gold); }
.helper { font-size: 11px; color: var(--muted); margin-top: 6px; }
.preview { margin: 0 20px 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-input); }
.prow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.prow:last-child { margin-bottom: 0; padding-top: 8px; border-top: 1px solid var(--line-2); }
.prow .k { font-size: 12px; color: var(--muted); }
.prow .v { font-family: var(--font-mono); font-size: 13px; color: var(--cream); }
.prow .v.gold { color: var(--gold-hi); }
.prow .v.em { color: var(--em); }

.cert { margin: 0 20px 16px; background: linear-gradient(145deg, #1A1508, #0F0E08); border: 1px solid #2A2010; border-radius: 20px; padding: 22px; }
.cert-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #1A1508; }
.cert-row:last-child { border-bottom: none; }
.cert-k { font-size: 11px; color: var(--muted); }
.cert-v { font-family: var(--font-mono); font-size: 12px; color: var(--cream); text-align: end; max-width: 60%; }
.cert-v.gold { color: var(--gold-hi); font-size: 16px; }
.cert-qr { margin-top: 16px; padding: 14px; background: var(--cream); border-radius: 12px; text-align: center; font-size: 11px; color: var(--panel); line-height: 1.5; }
/* URL de verificación copiable (input read-only + botón Copiar). */
.cert-copy { margin-top: 12px; display: flex; gap: 8px; align-items: stretch; }
.cert-copy-url { flex: 1 1 auto; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-input); padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; color: var(--cream); outline: none; }
.cert-copy-url:focus { border-color: var(--gold); }
.cert-copy-btn { flex: 0 0 auto; padding: 10px 14px; font-size: 12px; }

.foot { margin: 22px 20px 0; padding-top: 16px; border-top: 1px solid var(--line-2); text-align: center; }
.foot-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.foot-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--em); box-shadow: 0 0 6px var(--em); }
.foot-sub { font-size: 11px; color: var(--muted-2); line-height: 1.6; }

/* Barra inferior ANCLADA por flex: es el último hijo de .phone (columna flex),
   así queda siempre abajo sin position:fixed ni sus quirks en iOS. Fondo sólido
   + borde superior + safe-area. En RTL (dir="rtl") los ítems se reflejan solos. */
.nav { position: static; flex: 0 0 auto; left: auto; right: auto; margin-inline: 0; width: 100%; max-width: none; background: var(--obsidian); border-top: 1px solid var(--line); display: flex; padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 150; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; background: none; border: none; }
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; color: var(--muted); }
.nav-item.active .nav-label { color: var(--em); font-weight: 600; }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px var(--em)); }

.screen { display: none; }
.screen.active { display: block; }
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 20px; text-align: center; }

/* Overlay fijo por encima del nav anclado (~72px + safe-area). */
.toast { position: fixed; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--em); color: #051A12; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .3s; z-index: 200; }
.toast.show { opacity: 1; }

/* ---- Botón atrás ---- */
.back-btn { display: flex; align-items: center; gap: 8px; padding: 8px 20px 12px; font-size: 14px; color: var(--em); cursor: pointer; background: none; border: none; }

/* ---- Minas ---- */
.mine-card { margin: 0 20px 12px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-card-md); cursor: pointer; }
.mine-card:hover { border-color: var(--em); }
.mine-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mine-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--panel-3); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mine-name { font-size: 15px; font-weight: 600; }
.mine-region { font-size: 12px; color: var(--muted); margin-top: 1px; }
.mine-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--r-pill); font-size: 10px; font-weight: 600; background: var(--em-deep); color: var(--em); margin-bottom: 10px; }
.mine-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.mine-stat { background: var(--panel-3); border-radius: 10px; padding: 8px; }
.mine-stat .lbl { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.mine-stat .val { font-family: var(--font-mono); font-size: 12px; color: var(--cream); font-weight: 500; }
.info-card { margin: 0 20px 16px; padding: 16px; background: var(--panel); border: 1px solid var(--em-deep); border-radius: var(--r-card-md); }
.upload-step { padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; }
.upload-step .st { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.upload-step .sd { font-size: 12px; color: var(--muted); }
.kyc-state { font-size: 12px; color: var(--muted); margin-top: 8px; font-family: var(--font-mono); }
.kyc-state.ok { color: var(--em); }
.kyc-state.err { color: var(--danger); }

/* ---- Perfil ---- */
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(145deg, var(--em-deep), var(--panel-3)); border: 2px solid var(--em); margin: 12px auto 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 28px; color: var(--cream); overflow: hidden; }
.profile-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-wrap { position: relative; width: 72px; margin: 0 auto; }
.avatar-wrap .profile-avatar { margin: 12px 0; }
.avatar-cam { position: absolute; bottom: 8px; right: -4px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg, #0A0A0F); background: var(--em); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.profile-name { text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.profile-email { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.kyc-bar { margin: 0 20px 20px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--em-deep); border-radius: 14px; }
.kyc-title { font-size: 12px; color: var(--em); font-weight: 600; margin-bottom: 8px; }
.kyc-steps { display: flex; gap: 6px; }
.kyc-step { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--em); }
.kyc-step.inactive { background: var(--line); }
.kyc-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.menu-item { display: flex; align-items: center; gap: 14px; margin: 0 20px; padding: 14px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.menu-icon { font-size: 18px; width: 24px; text-align: center; }
.menu-text { flex: 1; font-size: 14px; font-weight: 500; }
.menu-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.menu-arrow { color: var(--muted-2); font-size: 16px; }
.level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: var(--em-deep); color: var(--em); margin-inline-start: auto; }
.section-title-app { margin: 6px 20px 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* ---- Autenticación del comprador (Perfil) ---- */
.auth-box { margin: 0 20px 20px; padding: 16px; background: var(--panel); border: 1px solid var(--em-deep); border-radius: var(--r-card-md); }
.auth-head { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--cream); margin-bottom: 4px; }
.auth-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.auth-connecting { font-size: 12px; color: var(--em); font-family: var(--font-mono); text-align: center; margin-bottom: 10px; }
.auth-btn { margin-bottom: 10px; }
.auth-email { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-input); padding: 13px 14px; font-family: var(--font-mono); font-size: 14px; color: var(--cream); outline: none; margin-bottom: 10px; }
.auth-email:focus { border-color: var(--gold); }
.pass-wrap { position: relative; display: block; }
.pass-wrap .auth-email { padding-right: 46px; }
.pass-eye { position: absolute; right: 8px; top: 13px; background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
/* Botones de proveedor (Google/Apple/Microsoft/enlace): logo oficial a la
   izquierda, etiqueta centrada ópticamente. Superficie neutra — el color de
   marca lo pone el logo, no el botón (por eso ya no usan btn-sell/btn-em). */
.auth-provider {
  /* Rejilla de 3 columnas: [logo] [etiqueta centrada] [hueco espejo].
     La 3ª columna va vacía y existe solo para compensar el ancho del logo,
     así la etiqueta queda centrada de verdad SIN márgenes negativos
     (un negativo aquí montaba el texto encima del logo). */
  display: grid;
  grid-template-columns: 18px 1fr 18px;
  align-items: center; gap: 12px;
  width: 100%;   /* sin esto, el texto largo estira el botón y quedan desiguales */
  background: var(--panel-2); color: var(--cream);
  border: 1px solid var(--line); border-radius: var(--r-input);
  padding: 13px 16px; font-weight: 500;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.auth-provider:hover:not(:disabled) { border-color: var(--gold); background: #16211C; transform: translateY(-1px); }
.auth-provider:active:not(:disabled) { transform: translateY(0); }
.auth-provider:disabled { opacity: .5; cursor: not-allowed; }
.auth-ico { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; }
.auth-ico svg { width: 100%; height: 100%; display: block; }
/* La etiqueta vive en la columna del medio: centrada y sin invadir el logo. */
/* min-width:0 deja que la columna 1fr se encoja; sin eso el texto no cede
   y todos los botones terminan con anchos distintos. */
.auth-provider > span:last-child { grid-column: 2; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth-status { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 4px; min-height: 14px; }
/* Errores de login: antes se perdían en gris y parecía que "no decía nada". */
.auth-status.is-error { color: #E8A2A2; font-weight: 500; }
.auth-who { font-size: 13px; color: var(--cream); margin-bottom: 12px; }
.auth-who b { color: var(--gold-hi); }

/* Ventana in-app (navegador interno): legal, seguridad. Cubre toda la pantalla. */
.page-overlay { position: fixed; inset: 0; z-index: 300; background: var(--bg, #0A0A0F); display: flex; flex-direction: column; }
.page-overlay.hidden { display: none; }
.po-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.po-title { font-family: var(--font-display); font-size: 16px; color: var(--gold-hi); }
.po-close { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--cream); font-size: 15px; line-height: 1; cursor: pointer; }
.po-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.po-iframe { width: 100%; height: 100%; border: 0; display: block; }
.po-text { padding: 18px 16px; font-size: 14px; line-height: 1.7; color: var(--cream); white-space: pre-line; }

/* Ahorro programado: botón cancelar plan */
.sav-cancel { background: transparent; border: 1px solid var(--danger); color: var(--danger); border-radius: 999px; padding: 5px 12px; font-size: 11px; cursor: pointer; flex: none; white-space: nowrap; }

/* ---- Certificado de custodia (hash clickeable) ---------------------------- */
.hash-link { display: inline-block; margin-top: 4px; padding: 3px 8px; background: rgba(201,164,92,.10);
  border: 1px solid rgba(201,164,92,.35); border-radius: 999px; color: var(--gold);
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; cursor: pointer; }
.hash-link:hover { background: rgba(201,164,92,.20); }
.cert { padding: 20px 16px; }
.cert-badge { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.cert-badge.ok { background: rgba(60,180,120,.15); border: 2px solid var(--ok, #3CB478); color: var(--ok, #3CB478); }
.cert-badge.bad { background: rgba(200,70,70,.15); border: 2px solid var(--danger); color: var(--danger); }
.cert-status { text-align: center; font-size: 15px; font-weight: 600; color: var(--cream); margin-bottom: 16px; }
.cert-status.ok { color: var(--ok, #3CB478); }
.cert-status.bad { color: var(--danger); }
.cert-body { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 16px; }
.cert-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cert-row:last-child { border-bottom: none; }
.cert-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; flex: none; }
.cert-v { font-size: 13px; color: var(--cream); text-align: right; word-break: break-word; }
.cert-hash { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--gold);
  word-break: break-all; background: rgba(201,164,92,.07); border: 1px solid rgba(201,164,92,.25);
  border-radius: 8px; padding: 10px; margin: 6px 0 16px; line-height: 1.6; }
.cert-acts { display: flex; gap: 10px; margin-bottom: 14px; }
.cert-acts .btn { flex: 1; }
.cert-note { font-size: 11px; color: var(--muted); line-height: 1.6; text-align: center; }

/* Al imprimir/guardar PDF: solo el certificado, en claro y sin cromo de la app. */
@media print {
  body { background: #fff !important; }
  .phone > .header, .demo-badge, .app-scroll, .po-head, .cert-acts, .tabbar { display: none !important; }
  #pageOverlay { position: static !important; background: #fff !important; }
  #pageOverlay.hidden { display: none !important; }
  .cert, .cert-body { color: #000 !important; }
  .cert-status, .cert-v { color: #000 !important; }
  .cert-k, .cert-note { color: #444 !important; }
  .cert-hash { color: #000 !important; background: #f4f4f4 !important; border-color: #ccc !important; }
  .cert-badge.ok { color: #1a7f4b !important; border-color: #1a7f4b !important; background: #eaf7f0 !important; }
}

/* ---- Punto de equilibrio de la redención ---- */
.be-box { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px;
  padding: 12px 14px; margin: 14px 0; background: rgba(255,255,255,.02); }
.be-box.bueno { border-left-color: var(--ok, #3CB478); }
.be-box.aceptable { border-left-color: var(--gold); }
.be-box.caro { border-left-color: #E0913F; }
.be-box.mal_negocio { border-left-color: var(--danger); }
.be-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.be-ttl { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.be-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--muted); white-space: nowrap; }
.be-box.bueno .be-badge { background: rgba(60,180,120,.16); color: var(--ok, #3CB478); }
.be-box.aceptable .be-badge { background: rgba(201,164,92,.16); color: var(--gold); }
.be-box.caro .be-badge { background: rgba(224,145,63,.18); color: #E0913F; }
.be-box.mal_negocio .be-badge { background: rgba(200,70,70,.18); color: var(--danger); }
.be-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-bottom: 9px; }
.be-fill { height: 100%; width: 0; border-radius: 999px; transition: width .35s ease; background: var(--muted); }
.be-box.bueno .be-fill { background: var(--ok, #3CB478); }
.be-box.aceptable .be-fill { background: var(--gold); }
.be-box.caro .be-fill { background: #E0913F; }
.be-box.mal_negocio .be-fill { background: var(--danger); }
.be-msg { font-size: 13px; color: var(--cream); line-height: 1.55; }
.be-hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 5px; }

/* ---- Academia ---- */
.acad-min { flex: none; font-size: 10px; color: var(--muted); font-family: 'IBM Plex Mono', monospace;
  background: rgba(255,255,255,.05); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.lesson-body { padding: 4px 20px 40px; }
.lesson-body p { font-size: 14px; line-height: 1.75; color: var(--cream); margin: 0 0 16px; }
.lesson-body p:first-child { font-size: 15px; }
/* Material de la lección: la foto y el video se ven aquí mismo; el PDF se abre
   aparte. max-width:100% para que una foto de 4000px no rompa el móvil. */
.lesson-media { padding: 0 20px 40px; display: flex; flex-direction: column; gap: 12px; }
.lesson-media-img, .lesson-media-video { width: 100%; max-width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  display: block; }
.lesson-media-doc { display: block; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--cream);
  font-size: 13px; text-decoration: none; }
.lesson-media-doc:hover { border-color: var(--gold-hi); }

/* ── Retirar en joyería (canje) ─────────────────────────── */
.jp-code-card { background: var(--panel-3); border: 1px solid var(--gold); border-radius: 16px; padding: 20px; margin: 16px 20px; text-align: center; }
.jp-code-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.jp-code { font-family: var(--font-mono); font-size: 40px; font-weight: 500; color: var(--gold-hi); letter-spacing: 6px; margin: 8px 0; }
.jp-code-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.jv-ok-card { background: rgba(39,160,120,.10); border: 1px solid var(--em-deep); border-radius: 16px; padding: 20px; margin: 16px 20px; text-align: center; }
.jv-ok-ttl { font-size: 20px; color: var(--em); font-weight: 600; }
.jv-ok-msg { font-size: 14px; color: var(--cream); margin-top: 6px; }

/* ── Menú lateral (sugerencia Ron): hamburguesa "Menú" + sidebar izquierdo ───── */
.nav-menu-btn{position:fixed;top:10px;left:10px;z-index:1200;display:flex;align-items:center;gap:6px;
  background:rgba(18,18,18,.92);color:var(--cream,#EDE8DF);border:1px solid var(--line,#243028);
  border-radius:10px;padding:8px 12px;font:600 13px system-ui,sans-serif;cursor:pointer}
.nav-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1150}
.nav-sidebar{position:fixed;top:0;left:0;bottom:0;width:264px;max-width:82vw;z-index:1180;
  background:#0d0d0d;border-right:1px solid var(--line,#243028);overflow-y:auto;padding:14px 8px;
  transform:translateX(-100%);transition:transform .25s ease;-webkit-overflow-scrolling:touch}
.nav-sidebar.open{transform:translateX(0)}
.nav-sidebar-brand{font-weight:800;color:#f4d47a;font-size:18px;padding:6px 12px 12px}
.nav-sidebar .menu-item{margin:2px 0}
/* Desktop ancho: el menú queda FIJO abierto (todo a 1 clic) y se corre el contenido. */
@media (min-width:1200px){
  .nav-sidebar{transform:translateX(0)}
  .nav-menu-btn,.nav-backdrop{display:none!important}
  body{padding-left:264px}
}
