:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #16181d;
  --muted: #5f6673;
  --border: #dde1e7;
  --accent: #2f5fd0;
  --pos: #137a4b;
  --neg: #b42318;
  --warn: #a15c07;
  --chart-line: #2f5fd0;
  --chart-fill: rgba(47, 95, 208, 0.12);
  --c0: #2f5fd0;
  --c1: #137a4b;
  --c2: #b7791f;
  --c3: #8e44ad;
  --c4: #0e8a91;
  --c5: #c2410c;
  --c6: #6b7280;
  --radius: 10px;
  color-scheme: light;
}

/* Oscuro: sigue al sistema salvo que se haya elegido "claro" con el botón,
   o se fuerza con data-theme="dark" (ver theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --text: #e8eaef;
    --muted: #9aa2b1;
    --border: #2a2f3a;
    --accent: #7ea2ff;
    --pos: #4cc38a;
    --neg: #ff7b72;
    --warn: #f0b75a;
    --chart-line: #7ea2ff;
    --chart-fill: rgba(126, 162, 255, 0.15);
    --c0: #7ea2ff;
    --c1: #4cc38a;
    --c2: #f0b75a;
    --c3: #d38cf0;
    --c4: #5fd0d6;
    --c5: #ff9f7a;
    --c6: #a8b0bf;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --text: #e8eaef;
  --muted: #9aa2b1;
  --border: #2a2f3a;
  --accent: #7ea2ff;
  --pos: #4cc38a;
  --neg: #ff7b72;
  --warn: #f0b75a;
  --chart-line: #7ea2ff;
  --chart-fill: rgba(126, 162, 255, 0.15);
  --c0: #7ea2ff;
  --c1: #4cc38a;
  --c2: #f0b75a;
  --c3: #d38cf0;
  --c4: #5fd0d6;
  --c5: #ff9f7a;
  --c6: #a8b0bf;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 0.95rem; margin: 0; font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  max-width: 1800px;
  margin: 0 auto;
}
.topbar p { margin: 4px 0 0; }
/* Logo de KryptOzone en la barra superior: una versión por tema. El fondo
   de cada imagen (blanco / negro) se funde con el de la página. */
.brand { margin: 0; line-height: 0; }
.brand-logo { height: 114px; width: auto; max-width: 100%; }
.brand-light { mix-blend-mode: multiply; }
.brand-dark { display: none; mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-light { display: none; }
  :root:not([data-theme="light"]) .brand-dark { display: inline; }
}
:root[data-theme="dark"] .brand-light { display: none; }
:root[data-theme="dark"] .brand-dark { display: inline; }
@media (max-width: 600px) { .brand-logo { height: 78px; } }

main { max-width: 1800px; margin: 0 auto; padding: 0 16px 32px; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-right: 6px;
}

/* Luz verde de "Modo: firma activa", con un pulso suave. */
.mode-light {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px 1px rgba(34, 197, 94, 0.8);
  vertical-align: 1px;
  animation: mode-light-pulse 2s ease-in-out infinite;
}
@keyframes mode-light-pulse {
  50% { box-shadow: 0 0 2px 0 rgba(34, 197, 94, 0.4); opacity: 0.75; }
}
@media (prefers-reduced-motion: reduce) { .mode-light { animation: none; } }

.banner { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; }
.data-approvals { border: 1px solid var(--neg); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; background: color-mix(in srgb, var(--neg) 6%, transparent); }
.data-approvals h2 { font-size: 1rem; margin: 0 0 6px; color: var(--neg); }
.data-approval { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--neg) 25%, transparent); }
.data-approval .info { flex: 1 1 280px; min-width: 0; }
.data-approval .actions { display: flex; gap: 8px; }
.data-approval .state { font-weight: 600; }
.banner-error { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card h2 { color: var(--muted); font-weight: 500; }
.card .big { font-size: 1.6rem; font-weight: 650; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.card p { margin: 0; }
.card-main .big { font-size: 2rem; }

.panel { margin-bottom: 16px; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.panel-head p { margin: 0; }

.ranking-table { min-width: 1600px; }
.ranking-table-wrap { scrollbar-gutter: stable; }
.ranking-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ranking-scroll-hint, .ranking-cards { display: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; }
td.reason { white-space: normal; min-width: 220px; font-size: 0.82rem; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
.empty td { color: var(--muted); text-align: center; padding: 16px; white-space: normal; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--accent); color: #fff; }

.chart { width: 100%; height: 240px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; }
.chart .area { fill: var(--chart-fill); }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 16px; }

button {
  font: inherit;
  border-radius: 8px;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
}

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.login-card p { margin: 4px 0 16px; }
/* Logo animado de KryptOzone (login): arriba del cuadro de ingreso, más grande. */
.login-body { align-content: center; gap: 20px; }
.login-logo { width: min(640px, 100%); aspect-ratio: 16 / 9; background: #f8f8f8; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.login-logo video, .login-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-logo img { display: none; }
/* El fondo del login es el del video de cada tema (#f8f8f8 en claro, negro en
   oscuro): el logo se funde con la página. */
.login-body { background: #f8f8f8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-body,
  :root:not([data-theme="light"]) .login-logo { background: #000; }
}
:root[data-theme="dark"] .login-body,
:root[data-theme="dark"] .login-logo { background: #000; }
.login-card h1 { margin-bottom: 16px; }
.login-card label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.login-card input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.login-card button[type="submit"] {
  width: 100%;
  padding: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-top: 4px;
}
.login-error { color: var(--neg); }
.login-card button[type="submit"] { display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-card button[type="submit"] .spinner { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.login-card button[type="submit"]:disabled { opacity: 0.8; cursor: progress; }
/* Detección del autocompletado del navegador (login.js escucha el animationstart). */
@keyframes bd-autofill { from { opacity: 1; } to { opacity: 1; } }
.login-card input:-webkit-autofill { animation: bd-autofill 1ms; }

.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
/* Más específica que .theme-switch (position: relative), que va después. */
.theme-switch.theme-corner { position: fixed; top: 16px; right: 16px; z-index: 10; }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  max-width: 180px;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Interruptor sol / luna: la perilla tapa el ícono del modo inactivo. */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 62px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  flex: none;
}
.theme-switch .icon-sun { color: var(--warn); }
.theme-switch .icon-moon { color: var(--accent); }
.theme-switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  transform: translateX(30px);
}
.theme-switch[aria-checked="true"] .knob { transform: translateX(0); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .theme-switch .knob { transition: none; } }

.swatch.pos-swatch { background: var(--pos); }
.swatch.neg-swatch { background: var(--neg); }
.swatch.neutral-swatch { background: var(--c6); }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.stats-chart { height: 200px; }
.bars-v .neutral-fill { fill: var(--c6); }
.bars-v .count-label { fill: var(--text); font-size: 11px; font-weight: 600; }
.subhead { font-size: 0.82rem; font-weight: 500; color: var(--muted); margin: 14px 0 8px; }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 16px;
}
.split > .panel { margin-bottom: 16px; }
.panel .split { margin-bottom: 8px; }

.fill-0 { fill: var(--c0); background: var(--c0); }
.fill-1 { fill: var(--c1); background: var(--c1); }
.fill-2 { fill: var(--c2); background: var(--c2); }
.fill-3 { fill: var(--c3); background: var(--c3); }
.fill-4 { fill: var(--c4); background: var(--c4); }
.fill-5 { fill: var(--c5); background: var(--c5); }
.fill-6 { fill: var(--c6); background: var(--c6); }

.pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pie { width: 170px; height: 170px; flex: none; }
.pie svg { width: 100%; height: 100%; display: block; }
.pie .slice { stroke: var(--surface); stroke-width: 2; }
.pie .center-value { fill: var(--text); font-size: 15px; font-weight: 650; }
.pie .center-label { fill: var(--muted); font-size: 10px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; font-size: 0.85rem; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .label { flex: 1; }
.legend .value { font-variant-numeric: tabular-nums; color: var(--muted); }

.bars-h { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 175px) 1fr 64px; align-items: center; gap: 8px; font-size: 0.82rem; }
.bar-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; }
.bar-track .zero { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.bar-track .bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar.pos-bg { background: var(--pos); }
.bar.neg-bg { background: var(--neg); }
.bar.blocked { opacity: 0.55; }

.bars-v { width: 100%; height: 160px; }
.bars-v svg { width: 100%; height: 100%; display: block; }
.bars-v .axis { fill: var(--muted); font-size: 11px; }
.bars-v .grid { stroke: var(--border); stroke-width: 1; }
.bars-v .pos-fill { fill: var(--pos); }
.bars-v .neg-fill { fill: var(--neg); }
.chart-empty.small-empty { font-size: 0.85rem; }

/* Posiciones activas */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--pos);
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
.live-dot.stale { background: var(--warn); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.dex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dex-chips:empty { display: none; }
.dex-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.dex-uniswap_v3 { background: #7c3aed1f; border-color: #7c3aed66; color: #6d28d9; }
.dex-pancakeswap_v3 { background: #1fc7d41f; border-color: #1fc7d466; color: #0b8f99; }
:root[data-theme="dark"] .dex-uniswap_v3 { color: #c4b5fd; }
:root[data-theme="dark"] .dex-pancakeswap_v3 { color: #5fe0e8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dex-uniswap_v3 { color: #c4b5fd; }
  :root:not([data-theme="light"]) .dex-pancakeswap_v3 { color: #5fe0e8; }
}

/* Red blockchain (arriba de las tarjetas) -- deliberadamente neutro/gris,
   distinto de los colores por DEX (.dex-uniswap_v3, etc.) de cada tarjeta,
   para que no se lea como si repitiera la misma información. */
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.network-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pos);
}

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.chip-pos { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.chip-neg { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.chip-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip-muted { background: var(--surface-2); color: var(--muted); }

.active-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.active-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.active-title h3 { margin: 0 0 6px; font-size: 1.05rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.empty-note { margin: 4px 0; }

.range { margin: 14px 0 10px; }
.range-track { position: relative; height: 10px; border-radius: 5px; background: var(--border); }
.range-band { position: absolute; left: 8%; right: 8%; top: 0; bottom: 0; border-radius: 5px; background: color-mix(in srgb, var(--pos) 45%, transparent); }
.range-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
}
.range-marker.out { background: var(--neg); }
.range-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-labels span:first-child { padding-left: 4%; }
.range-labels span:last-child { padding-right: 4%; }
.range-current { color: var(--text); text-align: center; }
.range-edge-pct { font-size: 0.9em; opacity: 0.75; }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.metric { display: flex; flex-direction: column; min-width: 0; }
.metric-wide { grid-column: 1 / -1; }
#networks-section .dex-chips { margin-bottom: 0; }
.metric-label { font-size: 0.75rem; color: var(--muted); }
.metric-value { font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
.metric-value-hl { font-size: 1.15em; }
.active-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.active-foot a { color: var(--accent); text-decoration: none; }
.active-foot a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .card .big { font-size: 1.35rem; }
  .card-main .big { font-size: 1.6rem; }
  .chart { height: 200px; }
}

@media (max-width: 1650px) {
  .ranking-scroll-hint { display: block; margin: 4px 0 8px; }
}

@media (max-width: 850px) {
  .ranking-table-wrap, .ranking-scroll-hint { display: none; }
  .ranking-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
  .ranking-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); min-width: 0; }
  .ranking-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
  .ranking-card h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
  .ranking-card .badges { margin: 8px 0 12px; }
  .ranking-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .ranking-card-reason { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
  .ranking-cards .small-empty { padding: 20px; }
}

/* Lo oculto se oculta siempre, aunque la clase defina display (p. ej. .wallet-qr). */
[hidden] { display: none !important; }

/* Menús de la barra superior: billetera y autorizaciones (wallet.js) */
.menu { position: relative; }
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}
.menu-button[aria-expanded="true"] { border-color: var(--accent); }
.menu-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.menu-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-button.connected { border-color: color-mix(in srgb, var(--pos) 60%, var(--border)); }
.menu-button .mono { font-size: 0.8rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); }
.count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--neg);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 320px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.menu-panel[hidden] { display: none; }
.menu-panel p { margin: 0; }
.menu-panel-wide { width: 460px; }
@media (max-width: 600px) {
  .menu { position: static; }
  .menu-panel, .menu-panel-wide { position: fixed; left: 16px; right: 16px; top: 72px; width: auto; }
}
.wallet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 6px 14px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.wallet-qr { display: grid; justify-items: center; gap: 6px; }
.wallet-qr img { background: #fff; border-radius: 8px; padding: 8px; width: 260px; max-width: 100%; height: auto; }
.linklike { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
.auth-list { display: grid; gap: 12px; }
.auth-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface-2); display: grid; gap: 6px; }
.auth-card h3 { margin: 0; font-size: 0.98rem; }
.auth-card ol { margin: 0; padding-left: 20px; }
.auth-card li.bad { color: var(--neg); }
.auth-status-pending { color: var(--warn); }
.auth-status-executed { color: var(--pos); }
.auth-status-failed, .auth-status-stale, .auth-status-cancelled { color: var(--neg); }
/* Identificador de la firma: en bloques de 4 para comparar con la billetera. */
.hash-box { border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 10px; background: var(--surface); display: grid; gap: 4px; }
.hash-label { font-size: 0.78rem; color: var(--muted); }
.hash-groups { display: flex; flex-wrap: wrap; gap: 3px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; }
.hash-groups span:nth-child(odd) { color: var(--accent); }
.hash-groups span.edge { font-weight: 700; text-decoration: underline; }
.hash-quick { font-size: 0.8rem; }
.hash-quick b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-card details summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); }
.auth-history > summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); }
/* Espera de la firma: reloj de carga + cuenta regresiva. */
.signing-wait { display: flex; align-items: center; gap: 8px; margin: 0; }
.signing-wait b { font-variant-numeric: tabular-nums; }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Íconos de tokens */
.with-icon { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.token-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; background: var(--surface-2); }
.token-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.token-icon-fallback { font-size: 0.6rem; font-weight: 700; color: var(--muted); }
.pair-icons { display: inline-flex; align-items: center; flex: none; }
.pair-icons .token-icon + .token-icon { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
h3.with-icon .token-icon { width: 26px; height: 26px; }

/* Login con billetera */
.wallet-login { display: grid; gap: 10px; margin-top: 4px; }
.wallet-login > button { width: 100%; }
/* Botón de WalletConnect (logo oficial, como el de la marca) */
.wc-button { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 1rem; cursor: pointer; }
.wc-button:hover:not(:disabled) { border-color: #3396ff; }
.wc-button:disabled { opacity: 0.6; cursor: progress; }
.wc-logo { width: 30px; height: 30px; flex: none; }
.wallet-login-caption { margin: -2px 0 0; text-align: center; font-size: 0.9rem; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border, rgba(127, 127, 127, 0.3)); }

.wallet-login-consent { text-align: center; margin: 0; }
.wallet-login-consent a { color: inherit; text-decoration: underline; }
.wallet-login-security { margin: 0; padding: 8px 10px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, #3396ff 45%, transparent); background: color-mix(in srgb, #3396ff 8%, transparent); }

/* Términos y Privacidad */
.legal-body { background: var(--bg); color: var(--text); }
.legal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.legal-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.legal-brand img { border-radius: 8px; }
.legal-main { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; line-height: 1.6; }
.legal-main h1 { margin: 0 0 4px; font-size: 1.6rem; }
.legal-main h2 { margin: 36px 0 8px; padding-top: 8px; border-top: 1px solid var(--border); scroll-margin-top: 72px; }
.legal-main section { scroll-margin-top: 72px; }
.legal-main h3 { margin: 20px 0 4px; font-size: 1.02rem; font-weight: 650; }
.legal-main h1 { font-weight: 700; }
.legal-main h2 { font-size: 1.3rem; font-weight: 700; }
.legal-main a { color: inherit; }
.legal-toc { margin: 12px 0 0; }
