/* NEXBIT — sistema visual estilo neobanco: claro, tarjetas muy redondeadas, botones píldora,
   acento azul y tipografía grotesca apretada. Tema oscuro opcional ([data-theme="dark"]). */
:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F1F2F4;
  --surface-3: #E6E7EB;
  --line: #ECEDF0;
  --text: #191C1F;
  --muted: #6F737A;
  --muted2: #A4A8AE;
  --accent: #0666EB;
  --accent-h: #0055CC;
  --accent-soft: rgba(6, 102, 235, .09);
  --on-accent: #FFFFFF;
  --ink: #191C1F;
  --on-ink: #FFFFFF;
  --green: #00A57A;
  --red: #E23B4E;
  --warn: #D97706;
  --green-bg: rgba(0, 165, 122, .1);
  --red-bg: rgba(226, 59, 78, .1);
  --warn-bg: rgba(217, 119, 6, .12);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, .16);
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  /* alias de la versión anterior (algunas vistas los usan en estilos en línea) */
  --bg2: var(--surface); --bg3: var(--surface-2); --bg4: var(--surface-3); --yellow: var(--accent);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #151517;
  --surface-2: #222226;
  --surface-3: #2E2E33;
  --line: #26262A;
  --text: #F5F5F7;
  --muted: #8E8E95;
  --muted2: #5C5C63;
  --accent: #4D8DFF;
  --accent-h: #6FA2FF;
  --accent-soft: rgba(77, 141, 255, .14);
  --ink: #FFFFFF;
  --on-ink: #000000;
  --green: #2FD193;
  --red: #FF5A65;
  --warn: #FBBF24;
  --green-bg: rgba(47, 209, 147, .12);
  --red-bg: rgba(255, 90, 101, .12);
  --warn-bg: rgba(251, 191, 36, .12);
  --shadow: none;
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; padding-bottom: 30px; overflow-x: hidden; transition: background .2s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 32px; line-height: 1.1; }
h2 { font-size: 24px; }
h3 { font-size: 17px; letter-spacing: -.01em; }
p { margin: 0; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.yellow, .accent { color: var(--accent); }
a.yellow:hover, a.accent:hover { color: var(--accent-h); }
.up { color: var(--green); }
.down { color: var(--red); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.r { text-align: right; }
.push { margin-left: auto; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 20px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .tbl td, .ob-row, .tr-row, .mk-row, .stat b, .big-bal, .t-last, .t-stat, .hl-row, .of-av, .info-list b, .hero-badges b { font-variant-numeric: tabular-nums; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; border: 0; font-weight: 600; font-size: 15px; white-space: nowrap; transition: background .15s, transform .12s, opacity .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-h); color: var(--on-accent); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { opacity: .88; color: var(--on-ink); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost.danger { color: var(--red); }
.btn-buy { background: var(--green); color: #fff; }
.btn-buy:hover { filter: brightness(1.06); color: #fff; }
.btn-sell { background: var(--red); color: #fff; }
.btn-sell:hover { filter: brightness(1.06); color: #fff; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; color: var(--text); font-size: 18px; border-radius: 50%; }
.icon-btn:hover { background: var(--surface-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; margin-left: 14px; }
.link-btn:first-child { margin-left: 0; }
.link-btn:hover { color: var(--accent-h); }
.chip { background: var(--surface-2); border: 0; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text); }
.chip:hover { background: var(--surface-3); }

/* ---------- cabecera ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; height: 68px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.035em; color: var(--text); }
.logo:hover { color: var(--text); }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--text); transition: background .15s; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .nav a.on { background: var(--surface-2); }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-link { font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.top-link:hover { background: var(--surface-2); }
.burger { display: none; }
.user-menu { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #5B8CFF, #8E5BFF); font-weight: 700; color: #fff; }
.dropdown { display: none; position: absolute; right: 0; top: 50px; width: 290px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; }
.dropdown.open { display: block; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dropdown a, .dropdown button { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; background: none; border: 0; font-weight: 500; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dd-head { padding: 12px 14px 14px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; word-break: break-all; border-bottom: 1px solid var(--line); }
.dd-bal { margin-top: 10px; display: flex; flex-direction: column; }
.dd-bal b { font-family: var(--display); font-size: 20px; }
.dropdown .pill { margin-left: 6px; font-size: 11px; padding: 2px 8px; }
.theme-btn svg { width: 20px; height: 20px; }

/* ---------- barra de estado ---------- */
.statusbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; height: 30px; display: flex; gap: 20px; align-items: center; padding: 0 20px; background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.statusbar a:hover { color: var(--accent); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--red); }

/* ---------- arranque ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 440px; padding: 24px; }
.boot-card h2 { font-size: 24px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tarjetas, páginas y tablas ---------- */
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 24px 28px; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.p-head h3 { font-size: 17px; }
.page { max-width: 1240px; margin: 0 auto; padding: 32px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
.page.narrow { max-width: 520px; }
.page.narrow-md { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 4px; }
.page-head h1 { font-size: 40px; letter-spacing: -.035em; }
.page-head p { margin-top: 6px; }
.back { color: var(--muted); font-size: 14px; font-weight: 500; }
.back:hover { color: var(--text); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col > * { min-width: 0; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px 12px; white-space: nowrap; }
.tbl td { padding: 13px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.tbl tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }
.tbl-lg td { padding: 16px 12px; font-size: 15px; }
.tbl .empty { text-align: center; color: var(--muted); padding: 40px 12px; white-space: normal; border-top: 0; }
.empty-ic { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; color: var(--muted2); }
.sortable { cursor: pointer; }
.sortable:hover { color: var(--text); }
.tbl th.sorted { color: var(--text); }
.tbl th.sorted::after { content: ' ↓'; color: var(--accent); }
.tbl th.sorted.asc::after { content: ' ↑'; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.asset-cell { display: inline-flex; align-items: center; gap: 12px; }
.asset-cell > span { display: flex; flex-direction: column; line-height: 1.3; }
.asset-cell > span > small { display: block; }
.tbl-markets td:first-child .asset-cell > span > span { display: block; }
.coin { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); font-weight: 700; font-size: calc(var(--s) * .5); line-height: 1; overflow: hidden; }
.coin img { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--surface); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-family: var(--font); font-weight: 500; }
.tag-me { color: var(--accent); background: var(--accent-soft); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill-ok { color: var(--green); background: var(--green-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-bad { color: var(--red); background: var(--red-bg); }
.pill-why { display: block; max-width: 240px; white-space: normal; margin-top: 2px; }
.st-filled { color: var(--green); }
.st-canceled, .st-expired { color: var(--muted); }
.st-partially_filled { color: var(--warn); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat small { color: var(--muted); font-weight: 500; }
.stat b { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.kv li:first-child { border-top: 0; }
.kv li > span { color: var(--muted); }
.kv b { font-weight: 500; min-width: 0; }
.info-list { list-style: none; margin: 18px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.info-list li { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.info-list li span { color: var(--muted); }
.info-list li b { font-weight: 600; text-align: right; }
.info-list li.hl { padding-top: 10px; border-top: 1px solid var(--line); }
.info-list li.hl b { font-family: var(--display); font-size: 18px; }
.note { font-size: 13.5px; color: var(--muted); background: var(--accent-soft); padding: 12px 16px; border-radius: 14px; margin-top: 14px; }
.note.warn { background: var(--red-bg); color: var(--text); }
.keybox { background: var(--surface-2); border-radius: 12px; padding: 12px; margin: 4px 0 12px; user-select: all; }

/* ---------- pestañas (control segmentado) ---------- */
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.tabs button { background: none; border: 0; padding: 7px 16px; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 999px; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
:root[data-theme="dark"] .tabs button.on { background: var(--surface-3); }
.tabs-text { background: none; padding: 0; }
.tabs-text button { padding: 0; margin-right: 16px; background: none !important; box-shadow: none !important; font-family: var(--display); font-size: 17px; }
.chk { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- formularios ---------- */
.field { position: relative; display: flex; align-items: center; background: var(--surface-2); border-radius: 14px; height: 50px; padding: 0 16px; margin: 8px 0; transition: box-shadow .15s, background .15s; }
.field:focus-within { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.field label { color: var(--muted); font-size: 14px; margin-right: 10px; white-space: nowrap; }
.field input, .field select { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; text-align: right; font-size: 15px; font-weight: 600; }
.field input::placeholder { color: var(--muted2); font-weight: 500; }
.field .unit { color: var(--muted); margin-left: 10px; font-size: 14px; font-weight: 500; }
.field .unit.link-btn { color: var(--accent); font-weight: 700; }
.field.disabled input { color: var(--muted); font-weight: 500; }
.field.col { flex-direction: column; align-items: stretch; height: auto; padding: 0; background: none; box-shadow: none; }
.field.col label { margin: 0 0 8px; font-weight: 500; color: var(--text); }
.field.col input { flex: none; height: 52px; text-align: left; background: var(--surface-2); border: 0; border-radius: 14px; padding: 0 16px; font-weight: 500; outline: 0; transition: box-shadow .15s; }
.field.col input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.select { width: 100%; height: 52px; background: var(--surface-2); border: 0; border-radius: 14px; padding: 0 14px; font-weight: 600; outline: 0; }
.select:focus { box-shadow: 0 0 0 2px var(--accent); }
.select.bare { width: auto; height: 100%; background: transparent; text-align: right; box-shadow: none; }
.select option { background: var(--surface); }
.form-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px; row-gap: 8px; margin-bottom: 22px; }
.form-step .n, .mfa-step .n { width: 28px; height: 28px; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); border-radius: 50%; font-size: 13px; font-weight: 700; }
.form-step .n { grid-row: span 2; }
.form-step > :not(.n) { grid-column: 2; }
.form-step > label { font-weight: 600; }
.form-step .field { margin: 0; }
.net-box { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.code-input { height: 52px; width: 170px; background: var(--surface-2); border: 0; border-radius: 14px; padding: 0 12px; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: .25em; text-align: center; outline: 0; }
.code-input.wide { width: 100%; margin: 8px 0 12px; }
.code-input:focus { box-shadow: 0 0 0 2px var(--accent); background: var(--surface); }
.search input { width: 100%; height: 40px; background: var(--surface-2); border: 0; border-radius: 999px; padding: 0 16px 0 38px; outline: 0; font-size: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238E9196' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
.search input:focus { box-shadow: 0 0 0 2px var(--accent); background-color: var(--surface); }
.page-head .search { width: 300px; max-width: 100%; }
.search-lg input { height: 46px; }

/* ---------- avisos y diálogos ---------- */
/* Widget flotante de soporte (chatbot) */
#sup-btn { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; border: 0; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 180; display: grid; place-items: center; font-size: 22px; transition: transform .18s, background .18s; }
#sup-btn:hover { background: var(--accent-h); transform: translateY(-2px); }
#sup-btn[aria-expanded="true"] { background: var(--ink); }
#sup-panel { position: fixed; right: 20px; bottom: 86px; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 180; display: flex; flex-direction: column; overflow: hidden; animation: rise .22s cubic-bezier(.2,.8,.2,1); }
#sup-panel[hidden] { display: none; }
.sup-head { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--surface-3); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sup-head h3 { margin: 0; font-size: 15px; }
.sup-head small { color: var(--muted); font-size: 12px; }
.sup-close { background: transparent; border: 0; cursor: pointer; font-size: 20px; color: var(--muted); line-height: 1; padding: 4px 8px; }
.sup-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.sup-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.sup-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.sup-msg.bot { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.sup-msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 12px; font-style: italic; max-width: 100%; text-align: center; padding: 4px 0; }
.sup-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 10px 14px; background: var(--surface-2); border-radius: 14px; border-bottom-left-radius: 4px; }
.sup-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: supbounce 1.2s infinite; }
.sup-typing span:nth-child(2) { animation-delay: .15s; }
.sup-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes supbounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.sup-form { border-top: 1px solid var(--surface-3); padding: 10px; background: var(--surface); display: flex; gap: 8px; }
.sup-form textarea { flex: 1; resize: none; border: 1px solid var(--surface-3); background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 14px; font-family: inherit; min-height: 36px; max-height: 90px; line-height: 1.3; }
.sup-form textarea:focus { outline: none; border-color: var(--accent); }
.sup-form button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 600; }
.sup-form button:disabled { opacity: .5; cursor: default; }
@media (max-width: 520px) {
  #sup-panel { right: 8px; bottom: 76px; width: calc(100vw - 16px); height: calc(100vh - 100px); }
  #sup-btn { right: 12px; bottom: 12px; }
}

#toasts { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { position: relative; width: 100%; background: var(--ink); color: var(--on-ink); border-radius: 18px; padding: 13px 18px 13px 50px; font-size: 14px; box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.toast.show { transform: none; opacity: 1; }
.toast::before { content: "i"; position: absolute; left: 16px; top: 13px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--accent); }
.toast-ok::before { content: "✓"; background: var(--green); }
.toast-error::before { content: "!"; background: var(--red); }
.modal-back { position: fixed; inset: 0; z-index: 150; background: rgba(10, 12, 16, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: rise .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(18px) scale(.98); opacity: 0; } }
.modal-wide { width: min(640px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 24px 4px; }
.modal-head h3 { font-size: 22px; letter-spacing: -.02em; }
.modal-body { padding: 10px 24px 4px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px 24px; }
.modal-foot .btn { flex: 1; }

/* ---------- inicio ---------- */
.home { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.hero { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; padding: 56px 0 72px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.hero h1 .yellow { color: inherit; background: linear-gradient(92deg, #0666EB, #7C5CFF 60%, #C04BFF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 19px; line-height: 1.5; margin: 26px 0 32px; max-width: 520px; }
.hero-form { display: flex; gap: 10px; max-width: 480px; background: var(--surface); padding: 6px; border-radius: 999px; box-shadow: var(--shadow); }
.hero-form input { flex: 1; min-width: 0; height: 52px; background: none; border: 0; padding: 0 18px; outline: 0; font-size: 16px; }
.hero-badges { display: flex; gap: 44px; margin-top: 44px; flex-wrap: wrap; }
.hero-badges div { display: flex; flex-direction: column; gap: 2px; }
.hero-badges b { font-family: var(--display); font-size: 28px; letter-spacing: -.03em; }
.eyebrow { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--surface); border-radius: 999px; padding: 7px 14px; margin-bottom: 26px; box-shadow: var(--shadow); }

/* móvil con el mercado en vivo: la pieza de la portada */
.hero-r { position: relative; display: grid; place-items: center; min-height: 600px; }
.hero-r::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #5B8CFF 0%, #7C5CFF 38%, #C04BFF 62%, transparent 72%); filter: blur(10px); opacity: .9; }
.phone { position: relative; width: 310px; height: 620px; border-radius: 52px; background: #0A0A0B; padding: 11px; box-shadow: 0 40px 90px rgba(30, 20, 80, .35), inset 0 0 0 2px #2A2A2E; transform: rotate(-4deg); }
.phone-screen { position: relative; height: 100%; border-radius: 42px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 28px; border-radius: 999px; background: #0A0A0B; z-index: 2; }
.phone-top { padding: 56px 20px 18px; background: linear-gradient(160deg, #0666EB, #5B3CF0); color: #fff; }
.phone-top small { opacity: .8; }
.phone-top b { display: block; font-family: var(--display); font-size: 30px; letter-spacing: -.03em; margin: 2px 0 10px; }
.phone-top .spark { color: #fff; opacity: .9; }
.phone-acts { display: flex; justify-content: space-around; padding: 14px 10px 6px; }
.phone-acts span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.phone-acts i { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-style: normal; font-size: 16px; }
.phone-list { flex: 1; margin: 8px 10px 12px; background: var(--surface); border-radius: 22px; padding: 6px; overflow: hidden; }
.phone-list .hl-row { grid-template-columns: 1fr auto; padding: 9px 10px; gap: 6px; border-radius: 14px; }
.phone-list .hl-row b { font-size: 13.5px; }
.phone-list .hl-row small { font-size: 11px; }
.phone-list .hl-row .chg { font-size: 11.5px; font-weight: 600; display: block; text-align: right; }

.hl-cols, .hl-row { display: grid; grid-template-columns: 1.5fr 1.1fr 84px 76px; align-items: center; gap: 8px; }
.hl-cols { padding: 0 14px 6px; }
.hl-row { padding: 11px 14px; border-radius: 14px; }
.hl-row:hover { background: var(--surface-2); color: var(--text); }
.hl-cols > :not(:first-child), .hl-row > :not(:first-child) { text-align: right; justify-self: end; }

.markets-strip { padding: 22px 24px; margin-bottom: 20px; }
.ms-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ms-head h2 { font-size: 26px; letter-spacing: -.03em; }

/* tarjetas grandes con degradado */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0 0 64px; }
.feature { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; min-height: 300px; padding: 26px; border-radius: var(--r-lg); color: #fff; box-shadow: none; transition: transform .2s; }
.feature:hover { transform: translateY(-3px); color: #fff; }
.feature:nth-child(1) { background: linear-gradient(160deg, #0666EB 0%, #0A3FB0 100%); }
.feature:nth-child(2) { background: linear-gradient(160deg, #6A4BFF 0%, #3B1FB8 100%); }
.feature:nth-child(3) { background: linear-gradient(160deg, #1D1D22 0%, #000 100%); }
.feature:nth-child(4) { background: linear-gradient(160deg, #00A57A 0%, #006B54 100%); }
.feature h3 { font-size: 26px; letter-spacing: -.03em; line-height: 1.05; }
.feature p { flex: 1; font-size: 14.5px; color: rgba(255, 255, 255, .78); }
.f-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; margin-bottom: 18px; }
.f-link { font-size: 14px; font-weight: 700; }

/* ---------- trading ---------- */
#view.view-trade { background: var(--bg); }
.trade { display: grid; gap: 8px; padding: 8px; grid-template-columns: minmax(280px, 310px) minmax(0, 1fr) minmax(280px, 320px);
  grid-template-areas: "head head head" "book chart mkts" "book form trades" "orders orders orders"; grid-template-rows: auto 480px auto auto; }
.trade .panel { padding: 14px 16px; min-width: 0; border-radius: 18px; }
.t-head { grid-area: head; display: flex; align-items: center; gap: 30px; overflow-x: auto; }
.t-book { grid-area: book; display: flex; flex-direction: column; }
.t-chart { grid-area: chart; display: flex; flex-direction: column; padding: 10px 10px 6px !important; }
.t-form { grid-area: form; }
.t-mkts { grid-area: mkts; display: flex; flex-direction: column; }
.t-trades { grid-area: trades; display: flex; flex-direction: column; }
.t-orders { grid-area: orders; min-height: 280px; }
.pair { display: flex; align-items: center; gap: 12px; flex: none; }
.pair h1 { font-size: 22px; letter-spacing: -.02em; }
.t-last { display: flex; flex-direction: column; flex: none; }
.t-last b { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.t-stat { display: flex; flex-direction: column; flex: none; font-size: 13.5px; font-weight: 600; }
.t-stat small { color: var(--muted); font-weight: 500; }
.ob-tools { display: flex; align-items: center; gap: 8px; }
.ob-group { height: 30px; background: var(--surface-2); border: 0; border-radius: 999px; color: var(--text); font-size: 12.5px; font-weight: 600; padding: 0 8px; }
.ob-modes { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.ob-modes button { background: none; border: 0; border-radius: 999px; padding: 5px 7px; opacity: .55; }
.ob-modes button.on { opacity: 1; background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.ob-i { display: block; width: 13px; height: 13px; border-radius: 3px; }
.ob-i.both { background: linear-gradient(var(--red) 0 45%, transparent 45% 55%, var(--green) 55%); }
.ob-i.bids { background: var(--green); }
.ob-i.asks { background: var(--red); }
.ob-cols, .ob-row, .tr-cols, .tr-row, .mk-cols, .mk-row { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 12.5px; gap: 4px; }
.ob-cols, .tr-cols, .mk-cols { color: var(--muted); padding: 2px 4px 8px; font-weight: 500; }
.ob-cols span:not(:first-child), .ob-row span:not(:first-child), .tr-cols span:not(:first-child), .tr-row span:not(:first-child), .mk-cols span:not(:first-child), .mk-row > :not(:first-child) { text-align: right; }
.ob-side { display: flex; flex-direction: column; }
.ob-asks { justify-content: flex-end; min-height: 352px; }
.t-book .ob-side:not(.ob-asks) { min-height: 352px; }
.ob-row { position: relative; height: 22px; line-height: 22px; padding: 0 4px; cursor: pointer; font-family: var(--mono); font-size: 12px; border-radius: 6px; }
.ob-row:hover { background: var(--surface-2); }
.ob-row .bar { position: absolute; right: 0; top: 1px; bottom: 1px; z-index: 0; border-radius: 4px; transition: width .2s; }
.ob-row span { position: relative; z-index: 1; }
.ob-row.ask .p { color: var(--red); font-weight: 600; }
.ob-row.bid .p { color: var(--green); font-weight: 600; }
.ob-row.ask .bar { background: var(--red-bg); }
.ob-row.bid .bar { background: var(--green-bg); }
.ob-row.mine .p::before { content: '●'; font-size: 7px; color: var(--accent); margin-right: 4px; vertical-align: 2px; }
.ob-mid { display: flex; align-items: baseline; gap: 10px; padding: 10px 6px; margin: 6px 0; background: var(--surface-2); border-radius: 12px; }
.ob-mid b { font-size: 19px; font-family: var(--display); letter-spacing: -.02em; }
.ob-ratio { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin-top: auto; padding-top: 10px; }
.ratio-bar { flex: 1; height: 6px; background: var(--red); border-radius: 999px; overflow: hidden; }
.ratio-bar i { display: block; height: 100%; background: var(--green); transition: width .3s; }
.chart-tools { margin-bottom: 6px !important; padding: 0 6px; }
.intervals { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.intervals button { background: none; border: 0; padding: 4px 11px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 999px; }
.intervals button:hover { color: var(--text); }
.intervals button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
:root[data-theme="dark"] .intervals button.on, :root[data-theme="dark"] .ob-modes button.on { background: var(--surface-3); }
.ch-legend { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 500; }
.ch-legend #ch-ma { display: flex; gap: 10px; }
.chart-box { flex: 1; min-height: 0; position: relative; }
.chart-box .chart-loader { display: none; }
.chart-box.loading .chart-loader { display: grid; place-items: center; position: absolute; inset: 0; z-index: 3; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.otypes { display: inline-flex; gap: 2px; margin-bottom: 8px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.otypes button { background: none; border: 0; padding: 6px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-radius: 999px; }
.otypes button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
:root[data-theme="dark"] .otypes button.on { background: var(--surface-3); }
.of-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.of-av { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.of-av b { font-weight: 600; }
.of-plus { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; line-height: 1; margin-left: 4px; }
.of-plus:hover { color: #fff; background: var(--accent-h); }
.of-side .field { height: 46px; margin: 8px 0; }
.of-est { min-height: 18px; margin: 2px 0 10px; }
.of-auth { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.of-auth .link-btn { margin: 0; }
.slider { margin: 10px 0 4px; }
.slider input[type=range] { width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--v), var(--surface-3) var(--v)); outline: 0; margin: 8px 0; }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 0; box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0, 0, 0, .15); cursor: pointer; }
.slider input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); cursor: pointer; }
.marks { display: flex; justify-content: space-between; }
.marks button { background: none; border: 0; padding: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.marks button:hover { color: var(--accent); }
.t-mkts .search { margin-bottom: 10px; }
.mk-list { overflow-y: auto; max-height: 420px; }
.mk-row { grid-template-columns: 1.2fr 1fr .8fr; padding: 7px 6px; border-radius: 10px; font-weight: 500; }
.mk-row:hover, .mk-row.on { background: var(--surface-2); color: var(--text); }
.tr-list { overflow-y: auto; max-height: 330px; font-family: var(--mono); }
.tr-row { height: 22px; line-height: 22px; padding: 0 4px; }
.tr-list, .mk-list { scrollbar-gutter: stable; }
.tr-cols, .mk-cols { padding-right: 12px; }
.ord-head { margin-bottom: 4px; }
.ord-head .tabs { margin-bottom: 0; }
.empty-auth { text-align: center; color: var(--muted); padding: 50px 0; }

/* ---------- wallet ---------- */
.wallet { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 98px); }
.w-side { padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; }
.w-side a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; color: var(--muted); font-weight: 600; }
.w-side a:hover { color: var(--text); background: var(--surface-2); }
.w-side a.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .w-side a.on { background: var(--surface-2); }
.w-side a.on svg { color: var(--accent); }
.w-main { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 1200px; }
.w-title { font-size: 34px; letter-spacing: -.035em; margin-bottom: 4px; }
.w-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 36px 24px 28px; }
.big-bal { margin: 6px 0 2px; }
.big-bal b { font-family: var(--display); font-size: 52px; font-weight: 700; letter-spacing: -.045em; }
.big-bal span { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--muted); }
.quick-acts { display: flex; gap: 28px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.qa i { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); transition: background .15s, transform .15s; font-style: normal; }
.qa.primary i { background: var(--accent); color: #fff; }
.qa:hover { color: var(--text); }
.qa:hover i { transform: translateY(-2px); background: var(--surface-3); }
.qa.primary:hover i { background: var(--accent-h); }
.qa svg { width: 22px; height: 22px; }
.onboard h3 { font-size: 22px; margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); border-radius: var(--r); padding: 20px; }
.step > span { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-weight: 700; }
.step p { font-size: 13.5px; margin: 4px 0 12px; }
.alloc { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 24px; }
.alloc-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; }
.alloc-bar i { display: block; min-width: 4px; border-radius: 999px; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.alloc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.alloc-legend i { width: 9px; height: 9px; border-radius: 50%; }
.alloc-legend b { color: var(--text); font-weight: 600; }
.dep-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.dep-grid > * { min-width: 0; }
.dep-grid h3 { margin-bottom: 8px; }
.addr-box { display: flex; flex-wrap: wrap; gap: 18px; background: var(--surface-2); border-radius: var(--r); padding: 16px; align-items: center; }
.addr-txt { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 200px; }
.qr { background: #fff; padding: 8px; border-radius: 16px; flex: none; width: 164px; height: 164px; display: grid; place-items: center; }
.qr img, .qr canvas { display: block; }
.howto { margin: 8px 0 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

/* pills de red */
.net-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.net-pill { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: 12px 16px; background: var(--surface-2); border: 2px solid transparent; border-radius: 14px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; position: relative; }
.net-pill:hover { background: var(--surface-3, var(--surface-2)); }
.net-pill.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.net-pill b { font-size: 14px; font-weight: 600; }
.net-pill small { font-size: 12px; color: var(--muted); }
.tag-rec { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 6px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); margin-left: 4px; vertical-align: 1px; }
.memo-box { border: 2px solid var(--warn); }
.pending-config { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 16px; text-align: center; color: var(--muted); }
.pending-config p { max-width: 340px; font-size: 14px; line-height: 1.5; }
.credit-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.credit-form .row-gap { display: flex; gap: 12px; }
.credit-form .row-gap .field { flex: 1; }

/* ---------- convertir ---------- */
.conv { display: flex; flex-direction: column; gap: 6px; padding: 20px; }
.conv-box { background: var(--surface-2); border-radius: var(--r); padding: 16px 20px; }
.conv-top { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.conv-row { display: flex; align-items: center; gap: 10px; height: 56px; }
.conv-row input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.conv-row .select.bare { font-weight: 700; max-width: 200px; background: var(--surface); border-radius: 999px; height: 40px; padding: 0 12px; }
.swap { align-self: center; width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--surface); background: var(--ink); color: var(--on-ink); margin: -16px 0; z-index: 1; font-size: 16px; }
.swap:hover { opacity: .85; }
.conv-rate { padding: 12px 4px 16px; }
.conv-sum { display: flex; align-items: center; justify-content: space-around; gap: 10px; padding: 12px 0; text-align: center; }
.conv-sum > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- acceso ---------- */
.auth { display: grid; place-items: center; padding: 48px 16px; min-height: calc(100vh - 98px); }
.auth-card { width: min(440px, 100%); padding: 36px; display: flex; flex-direction: column; gap: 14px; border-radius: var(--r-lg); }
.auth-card h1 { font-size: 34px; letter-spacing: -.035em; margin-bottom: 4px; }
.auth-logo { display: flex; align-items: center; gap: 9px; color: var(--text); font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -.035em; margin-bottom: 8px; }
.pw-rules { list-style: none; margin: -6px 0 0; padding: 0; color: var(--muted); }
.pw-rules li::before { content: '○ '; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: '✓ '; }

/* ---------- mercados ---------- */
.star { background: none; border: 0; color: var(--muted2); font-size: 16px; padding: 0 2px; }
.star.on { color: #F5B800; }
.spark { display: block; }
.spark.up { color: var(--green); }
.spark.down { color: var(--red); }
.flash-up { animation: flashUp .7s ease-out; }
.flash-down { animation: flashDown .7s ease-out; }
@keyframes flashUp { from { color: var(--green); } }
@keyframes flashDown { from { color: var(--red); } }

/* ---------- Earn ---------- */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product { padding: 22px; display: flex; flex-direction: column; gap: 14px; border-radius: var(--r-lg); }
.product p { flex: 1; }
.pr-top { display: flex; align-items: center; gap: 10px; }
.pr-top > div { display: flex; flex-direction: column; flex: 1; }
.pr-apr { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.04em; text-align: right; line-height: 1; }
.pr-apr small { display: block; font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; letter-spacing: 0; }

/* ---------- seguridad ---------- */
.sec-card h3 { margin-bottom: 4px; }
.sec-row { display: flex; align-items: center; gap: 16px; }
.sec-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--warn-bg); color: var(--warn); }
.sec-ic.on { background: var(--green-bg); color: var(--green); }
.mfa-setup { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.mfa-step { display: flex; gap: 14px; }
.mfa-step .n { flex: none; }
.mfa-step > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mfa-qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.rec-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.rec-codes span { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; font-weight: 600; user-select: all; }
.pw-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 12px; }

/* ---------- pie ---------- */
.site-foot { background: var(--surface); padding: 48px 28px 24px; margin-top: 8px; }
.foot-in { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-brand p { margin-top: 14px; max-width: 380px; line-height: 1.6; }
.site-foot h4 { margin: 0 0 14px; font-size: 15px; }
.site-foot .foot-in > div > a:not(.logo) { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; }
.site-foot .foot-in > div > a:not(.logo):hover { color: var(--text); }
.foot-base { max-width: 1240px; margin: 32px auto 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- barras de desplazamiento ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .trade { grid-template-columns: minmax(260px, 290px) minmax(0, 1fr); grid-template-areas: "head head" "book chart" "book form" "trades mkts" "orders orders"; grid-template-rows: auto 440px auto auto auto; }
  .features, .products { grid-template-columns: repeat(2, 1fr); }
  .foot-in { grid-template-columns: 1fr 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .burger { display: inline-grid; order: 3; }
  .nav { display: none; position: fixed; top: 68px; left: 12px; right: 12px; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 10px; }
  body.nav-open .nav { display: flex; }
  .nav a { padding: 12px 16px; }
  .top-right { order: 2; }
  .hero { grid-template-columns: 1fr; padding: 32px 0 40px; gap: 24px; }
  .hero-r { min-height: 560px; }
  .two-col, .dep-grid, .steps, .pw-form { grid-template-columns: 1fr; }
  .wallet { grid-template-columns: 1fr; }
  .w-side { flex-direction: row; overflow-x: auto; padding: 8px 12px; }
  .w-side a { flex: none; padding: 9px 14px; }
  .w-main { padding: 16px 16px 32px; }
  .page { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 32px; }
  .kv li { grid-template-columns: 1fr; gap: 2px; }
  .trade { grid-template-columns: 1fr; grid-template-areas: "head" "chart" "form" "book" "trades" "orders" "mkts"; grid-template-rows: auto 380px auto auto auto auto auto; }
  .ob-asks, .t-book .ob-side:not(.ob-asks) { min-height: 0; }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .home { padding: 0 16px; }
  .features, .products { grid-template-columns: 1fr; }
  .feature { min-height: 240px; }
  .of-grid { grid-template-columns: 1fr; gap: 28px; }
  /* cabecera: logo, tema, dos botones y menú caben en 375 px con o sin sesión */
  .topbar { gap: 6px; padding: 0 12px; }
  .top-right { gap: 6px; }
  .top-right .btn-sm { padding: 0 12px; font-size: 13.5px; }
  .top-right .icon-btn { width: 36px; height: 36px; }
  .logo span { display: none; }
  .hero h1 { font-size: 46px; }
  .hero-form { flex-direction: column; border-radius: 24px; }
  .hero-form .btn { width: 100%; }
  .phone { transform: scale(.86) rotate(-3deg); }
  .hero-r::before { width: 360px; height: 360px; }
  .addr-box { flex-direction: column; align-items: flex-start; }
  .pad { padding: 18px; }
  .big-bal b { font-size: 40px; }
  .quick-acts { gap: 6px; flex-wrap: nowrap; }
  .qa { width: 62px; font-size: 12px; }
  .qa i { width: 48px; height: 48px; }
  .ms-head h2 { font-size: 22px; }
  .hero-badges { gap: 24px; }
  .statusbar { gap: 12px; }
  .hide-xs { display: none !important; }
  .hl-cols, .hl-row { grid-template-columns: 1.4fr 1fr 72px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 17px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 28px 28px 0 0; max-height: 88vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- importes grandes y confirmación ---------- */
.amount-box { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 18px 0 10px; }
.amount-box input { width: 100%; max-width: 340px; background: none; border: 0; outline: 0; text-align: right; font-family: var(--display); font-size: 64px; font-weight: 800; letter-spacing: -.045em; }
.amount-box input::placeholder { color: var(--muted2); }
.amount-box .select.bare { flex: none; height: 48px; font-family: var(--display); font-size: 26px; font-weight: 800; background: var(--surface-2); border-radius: 999px; padding: 0 14px; }
.center-row { justify-content: center; margin-bottom: 18px; }
.success { text-align: center; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.success-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff; background: var(--green); animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes popIn { from { transform: scale(.3); opacity: 0; } }
.success h2 { font-size: 30px; letter-spacing: -.035em; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; display: inline-block; vertical-align: -3px; margin-right: 6px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* ---------- compra / venta ---------- */
a.asset-cell:hover { color: var(--text); }
.side-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 8px; }
.side-switch button { border: 0; background: none; border-radius: 999px; padding: 10px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.side-switch button.buy.on { background: var(--green); color: #fff; }
.side-switch button.sell.on { background: var(--red); color: #fff; }
.row-gap.between { justify-content: space-between; }
@media (max-width: 560px) {
  .amount-box input { font-size: 46px; }
}
.page > .tabs { align-self: flex-start; }

/* ---------- cartera ---------- */
.pf-hero { padding: 28px 28px 18px; }
.pf-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.pf-val { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 6px; }
.pf-val b { font-family: var(--display); font-size: 56px; font-weight: 800; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.pf-val span { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--muted); }
.pf-sub { display: flex; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; }
.pf-chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.pf-chart-head .tabs { margin-bottom: 0; }
.pf-chart { height: 280px; margin-top: 10px; }
.stat small.muted { font-weight: 500; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.act:first-child { border-top: 0; }
.act > i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; background: var(--surface-2); }
.act-in > i { background: var(--green-bg); color: var(--green); }
.act-out > i { background: var(--red-bg); color: var(--red); }
.act-buy > i { background: var(--accent-soft); color: var(--accent); }
.act-sell > i { background: rgba(124, 92, 255, .12); color: #7C5CFF; }
.act-earn > i { background: var(--warn-bg); color: var(--warn); }
.act span { display: flex; flex-direction: column; min-width: 0; }
.act .r { align-items: flex-end; font-variant-numeric: tabular-nums; }

/* hoja de compra / venta */
.ts-list { display: flex; flex-direction: column; gap: 2px; max-height: 56vh; overflow-y: auto; margin-top: 12px; }
.ts-list h4 { font-size: 13px; color: var(--muted); font-family: var(--font); font-weight: 600; letter-spacing: 0; margin: 12px 4px 6px; }
.ts-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-radius: 14px; padding: 10px 8px; text-align: left; }
.ts-row:hover { background: var(--surface-2); }
.ts-row > span { display: flex; flex-direction: column; }
.ts-row > span.r { margin-left: auto; align-items: flex-end; }
.ts-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ts-head > div { display: flex; flex-direction: column; }
.ts-head > .r { margin-left: auto; align-items: flex-end; }
.ts-head b { font-family: var(--display); font-size: 20px; }
.amount-box.sm input { font-size: 54px; max-width: 300px; }
.amount-unit { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--muted); }
@media (max-width: 560px) {
  .pf-val b { font-size: 40px; }
  .pf-hero { padding: 20px 16px 12px; }
  .pf-chart { height: 220px; }
  .amount-box.sm input { font-size: 42px; }
}
.pf .stat-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 560px) { .pf .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Administración: base de datos ---------- */
.db-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 12px 0 16px; }
.db-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-sm); padding: 10px 12px; color: var(--text); }
.db-t:hover { background: var(--surface-3); }
.db-t.on { border-color: var(--accent); background: var(--accent-soft); }
.db-t b { font-size: 13px; }
.db-t span { font-size: 13px; font-weight: 600; }
.db-t small { font-size: 12px; line-height: 1.3; }
.db-sample td, .db-sample th { white-space: nowrap; }

/* Entrada de cada pantalla: los bloques suben y aparecen escalonados (solo al cambiar de página) */
@keyframes enterUp { from { opacity: 0; transform: translateY(14px); } }
#view.enter :is(.page, .home, .w-main, .trade) > *, #view.enter :is(.stat-grid, .products, .features, .steps, .quick-acts) > * {
  animation: enterUp .55s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--n, 0) * 45ms);
}
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(2) { --n: 1; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(3) { --n: 2; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(4) { --n: 3; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(5) { --n: 4; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(6) { --n: 5; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(7) { --n: 6; }
#view.enter :is(.page, .home, .w-main, .trade, .stat-grid, .products, .features, .steps, .quick-acts) > :nth-child(n+8) { --n: 7; }

/* Tarjetas que se levantan al pasar el ratón */
.stat, .product { transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s; }
.product:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 34px rgba(16, 24, 40, .1); }
.btn { transition: transform .12s, background .15s, color .15s, box-shadow .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }

/* Esqueleto de carga */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }

/* Fondo de puntos del hero */
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 32% 45%, #000 25%, transparent 78%); mask-image: radial-gradient(ellipse 75% 85% at 32% 45%, #000 25%, transparent 78%); }
.hero > :not(.hero-fx) { position: relative; z-index: 1; }

/* Cinta de cotizaciones (inspirada en LogoLoop de React Bits): dos copias que se desplazan sin costura */
@keyframes marquee { to { transform: translateX(-50%); } }
.tape { overflow: hidden; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding: 10px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.tape-track { display: flex; width: max-content; animation: marquee var(--dur, 60s) linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; color: var(--text); font-size: 14px; white-space: nowrap; border-right: 1px solid var(--line); }
.tape-item:hover { color: var(--accent); }
.tape-item .t-chg { font-weight: 600; font-size: 13px; }
.home .tape { margin: -40px 0 28px; }

@media (max-width: 560px) {
  .tape-item { padding: 0 14px; }
  .home .tape { margin: -24px 0 20px; }
}

/* ---------- compra directa ---------- */
.pay-with { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
.pay-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--on-ink); }
.amount-unit .select.bare { font-size: 20px; height: 40px; }

.icon-btn.sm { width: 32px; height: 32px; color: var(--muted); }
.icon-btn.sm:hover { color: var(--accent); }
.tag-req { font-style: normal; font-size: 10.5px; padding: 2px 7px; margin-left: 4px; color: var(--warn); background: var(--warn-bg); vertical-align: 1px; }

/* ===== Ajustes de móvil =====
   Van al final para ganar en la cascada a las reglas de cada sección. */
@media (max-width: 900px) {
  /* iOS amplía la página al enfocar un campo con letra < 16px y ya no la devuelve a su tamaño */
  .field input, .field select, .field.col input, .search input, .select, .hero-form input, .credit-form input { font-size: 16px; }
  .wallet, .auth { min-height: calc(100dvh - 98px); }
  .t-head { gap: 20px; scrollbar-width: none; }
  .t-head::-webkit-scrollbar { display: none; }
}
@media (max-width: 560px) {
  h1 { font-size: 28px; }
  .page-head h1, .w-title { font-size: 30px; }
  .page { gap: 16px; }

  /* pestañas: una sola fila que se desliza en lugar de partirse en un bloque gris */
  .tabs { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; padding: 7px 14px; }
  .tabs-text { overflow: visible; }
  .pf-chart-head { gap: 8px; }

  /* tablas: más compactas y sin las columnas secundarias en las que más se usan */
  .tbl th { padding: 8px 6px; }
  .tbl td { padding: 11px 6px; }
  .tbl-lg td { padding: 13px 6px; font-size: 14px; }
  .tbl .asset-cell { gap: 8px; }
  .tbl-markets :is(th, td):nth-child(n+5), .tbl-assets :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(7)), .tbl-holdings :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(7), :nth-child(8)) { display: none; }
  .tbl-markets :is(th, td):nth-child(n+2), .tbl-assets :is(th, td):nth-child(n+2), .tbl-holdings :is(th, td):nth-child(n+2) { text-align: right; }
  .tbl :is(th, td):first-child { padding-left: 4px; }
  .tbl :is(th, td):last-child { padding-right: 4px; }

  /* trading */
  .trade { gap: 6px; padding: 6px; }
  .trade .panel { padding: 12px; }
  .of-grid { grid-template-columns: minmax(0, 1fr); }
  .pair h1 { font-size: 20px; }
  .t-last b { font-size: 21px; }
  .ord-head { gap: 8px; }

  /* wallet: los cinco accesos rápidos caben en una fila */
  .w-top { padding: 28px 16px 22px; }
  .quick-acts { gap: 4px; justify-content: space-between; width: 100%; }
  .qa { flex: 1 1 0; width: auto; min-width: 0; font-size: 11.5px; }
  .qa i { width: 46px; height: 46px; }
  .w-side { gap: 4px; scrollbar-width: none; }
  .w-side::-webkit-scrollbar { display: none; }

  /* cartera */
  .pf-top .row-gap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .pf-top .row-gap .btn { padding: 0 10px; }

  /* convertir: el importe no se queda en una franja de 20 px junto al selector */
  .conv { padding: 14px; }
  .conv-box { padding: 14px 16px; }
  .conv-row input { font-size: 26px; }
  .conv-row .select.bare { max-width: 140px; font-size: 14px; }

  /* seguridad: el texto no queda encajonado entre el icono y el botón */
  .sec-row { flex-wrap: wrap; align-items: flex-start; }
  .sec-row > .grow { flex: 1 1 calc(100% - 62px); }
  .sec-row > .btn { width: 100%; }
  .mfa-step { gap: 10px; }
  .code-input { width: 100%; max-width: 220px; }

  /* earn */
  .pr-apr { font-size: 26px; }

  /* pie y diálogos */
  .site-foot { padding: 32px 16px 20px; }
  .modal-head { padding: 20px 18px 4px; }
  .modal-body { padding: 10px 18px 4px; }
  .modal-foot { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 24px 20px; }
  .auth-card h1 { font-size: 28px; }
}

/* ---------- bono de bienvenida (opt-in) ---------- */
.bonus-card { display: flex; flex-direction: column; gap: 10px; border: 2px dashed var(--line); }
.bonus-card.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.bonus-card.claimed { border-style: solid; border-color: var(--warn); background: var(--warn-bg); }
.bonus-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bonus-head h3 { margin: 0; }
.bonus-chip { display: flex; align-items: center; gap: 10px 20px; justify-content: space-between; flex-wrap: wrap; }
.bonus-chip.opted-in { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.bonus-chip.locked { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.bonus-chip b { font-size: 14.5px; }
.lock-banner { border: 2px solid var(--warn); background: var(--warn-bg); display: flex; flex-direction: column; gap: 6px; }
.lock-banner h3 { margin: 0; color: var(--warn); }

/* Password con botón de mostrar/ocultar */
.pw-field { position: relative; }
.pw-field > input { width: 100%; padding-right: 44px; }
.pw-field > .pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; padding: 0; }
.pw-field > .pw-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.pw-field > .pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-field > .pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-field > .pw-toggle .pw-eye-off { display: none; }
.pw-field.show > .pw-toggle .pw-eye { display: none; }
.pw-field.show > .pw-toggle .pw-eye-off { display: block; }
