:root {
  --bg0: #dce8f2;
  --bg1: #eef4fa;
  --ink: #000000;
  --muted: #3a4553;
  --brand: #0a3d5c;
  --brand-2: #0d8a8f;
  --brand-soft: rgba(13, 138, 143, 0.12);
  --ok: #0d7a6f;
  --ok-bg: rgba(13, 122, 111, 0.12);
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, 0.12);
  --danger: #c02626;
  --danger-bg: rgba(192, 38, 38, 0.1);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-tint: rgba(255, 255, 255, 0.22);
  --glass-edge: rgba(255, 255, 255, 0.72);
  --glass-edge-dim: rgba(255, 255, 255, 0.28);
  --glass-stroke: rgba(10, 22, 40, 0.08);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 8px 32px rgba(10, 40, 70, 0.1),
    0 2px 8px rgba(10, 40, 70, 0.06);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 20px 50px rgba(10, 40, 70, 0.14),
    0 4px 16px rgba(10, 40, 70, 0.08);
  --blur: blur(28px) saturate(180%);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "SF Pro Display", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.45;
  background: var(--bg1);
  isolation: isolate;
  overflow-x: hidden;
}

/* —— Ambient liquid canvas —— */
.lg-ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(90, 200, 250, 0.55), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(120, 220, 200, 0.45), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(180, 190, 255, 0.35), transparent 55%),
    linear-gradient(165deg, #e8f1f8 0%, #f4f7fb 45%, #e6eef6 100%);
}
.lg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.7;
  animation: lg-float 18s var(--ease) infinite alternate;
}
.lg-orb.a {
  width: 42vw; height: 42vw; max-width: 520px; max-height: 520px;
  top: -8%; left: -6%;
  background: radial-gradient(circle, rgba(64, 196, 255, 0.55), transparent 70%);
}
.lg-orb.b {
  width: 36vw; height: 36vw; max-width: 440px; max-height: 440px;
  top: 35%; right: -8%;
  background: radial-gradient(circle, rgba(80, 220, 190, 0.5), transparent 70%);
  animation-delay: -6s;
}
.lg-orb.c {
  width: 48vw; height: 48vw; max-width: 560px; max-height: 560px;
  bottom: -18%; left: 30%;
  background: radial-gradient(circle, rgba(150, 170, 255, 0.4), transparent 70%);
  animation-delay: -11s;
}
@keyframes lg-float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 6%, 0) scale(1.08); }
}

.cosmos, .orb, .scanlines, .panel-glow { display: none !important; }

/* —— Liquid glass material —— */
.glass, .card-block, .panel.auth, .qr-modal-panel, .glass-bar {
  position: relative;
  background: linear-gradient(
    155deg,
    var(--glass-strong) 0%,
    var(--glass) 42%,
    var(--glass-tint) 100%
  );
  border: 1px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
}
.glass::before, .card-block::before, .panel.auth::before, .qr-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    var(--glass-edge) 0%,
    var(--glass-edge-dim) 35%,
    transparent 55%,
    rgba(255, 255, 255, 0.35) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}
.glass::after, .card-block::after, .panel.auth::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.35) 0%,
    transparent 32%,
    transparent 68%,
    rgba(255, 255, 255, 0.12) 100%
  );
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: soft-light;
}
.glass > *, .card-block > *, .panel.auth > *, .qr-modal-panel > * {
  position: relative;
  z-index: 1;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.38));
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 28px rgba(10, 40, 70, 0.06);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.logo-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f4a6a, #0d7377);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 20px rgba(13, 115, 119, 0.35);
  transition: transform 0.45s var(--ease);
}
.logo-mark:hover { transform: scale(1.06) rotate(-3deg); }
.logo-mark svg { width: 20px; height: 20px; }
.mark {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: var(--brand);
}
.sub {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.top-right { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; flex: 1 1 auto; min-width: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 14px rgba(10, 40, 70, 0.06);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  font-size: 0.78rem;
  color: var(--brand);
  text-decoration: none;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.chip:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.65); }
.chip.soft { color: var(--muted); }
button.chip.top-meta-btn {
  cursor: pointer;
  font: inherit;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: inherit;
}
button.chip.top-meta-btn:hover {
  color: var(--text, #fff);
  border-color: rgba(91, 140, 255, 0.45);
}
#profileWelcomeName {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(91, 140, 255, 0.45);
}
#profileWelcomeName:hover {
  color: var(--accent, #5b8cff);
}
.chip svg { width: 14px; height: 14px; }

.trust-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 1180px;
  margin: 0.75rem auto 0;
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.7), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(167, 243, 208, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: var(--ok);
  font-size: 0.86rem;
}
.trust-banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.trust-banner strong { color: var(--ink); }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 3rem;
}

.panel.auth {
  max-width: 440px;
  margin: 0.35rem auto 1.25rem;
  padding: 1.2rem 1.35rem 1.15rem;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  animation: lg-rise 0.7s var(--ease) both;
  color: var(--ink);
}
.panel.auth h1,
.panel.auth .lead,
.panel.auth label,
.panel.auth .fine,
.panel.auth .hint {
  color: var(--ink);
}
.panel.auth .lead,
.panel.auth label,
.panel.auth .fine {
  color: var(--muted);
}
.panel.auth h1 {
  color: var(--ink);
  margin: 0 0 0.25rem;
  font-size: 1.42rem;
}
.panel.auth .lead {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  line-height: 1.4;
}
.panel.auth .tabs {
  margin-bottom: 0.65rem;
}
.panel.auth .tab {
  padding: 0.42rem 0.78rem;
}
.panel.auth .stack {
  gap: 0.55rem;
}
.panel.auth label {
  gap: 0.25rem;
}
.panel.auth input {
  padding: 0.62rem 0.8rem;
}
.panel.auth .btn.primary {
  margin-top: 0.15rem;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
}
.panel.auth .fine {
  margin: 0.55rem 0 0;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.65rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}
.wallet-login-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.wallet-login-row .btn {
  flex: 1 1 auto;
  min-width: 6.5rem;
  justify-content: center;
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
}
.wallet-login-hint {
  margin-top: 0.55rem !important;
  line-height: 1.35;
}
.wallet-login-pending {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(94, 224, 212, 0.35);
  background: rgba(94, 224, 212, 0.1);
}
.wallet-login-pending .btn.primary {
  width: 100%;
  justify-content: center;
  min-height: 2.8rem;
  font-size: 0.95rem;
}
.wallet-login-pending .btn.neon {
  width: 100%;
}
.panel.auth .icon-hero {
  width: 44px;
  height: 44px;
  margin-bottom: 0.55rem;
  border-radius: 14px;
}
.panel.auth .icon-hero svg {
  width: 20px;
  height: 20px;
}

/* Crypto bubbles — solo página de acceso */
.crypto-bubbles {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
body.page-auth .crypto-bubbles {
  display: block;
}
body > .top {
  position: relative;
  z-index: 40;
}
body > .trust-banner,
body > main {
  position: relative;
  z-index: 1;
}
.cbubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 10px 28px rgba(10, 30, 60, 0.12);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  animation: crypto-bubble var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  opacity: 0.72;
}
.cbubble svg {
  width: 62%;
  height: 62%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
@keyframes crypto-bubble {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  35% {
    transform: translate3d(calc(var(--drift) * 0.55), calc(var(--drift) * -1), 0) scale(1.06);
  }
  70% {
    transform: translate3d(calc(var(--drift) * -0.4), calc(var(--drift) * -0.35), 0) scale(0.96);
  }
}
[data-theme="dark"] .cbubble {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0.8;
}
@keyframes lg-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.icon-hero {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
  margin-bottom: 1rem;
  background: linear-gradient(145deg, rgba(13, 138, 143, 0.2), rgba(255, 255, 255, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--brand-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.icon-hero svg { width: 24px; height: 24px; }

h1, h2, h3 {
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
h1 { font-size: 1.6rem; font-weight: 750; }
h2 {
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
h2 svg { width: 18px; height: 18px; color: var(--brand-2); }
h3 { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 1.1rem; font-size: 0.92rem; }
.lead.small { font-size: 0.82rem; }

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.tab {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.35s var(--ease);
}
.tab svg { width: 14px; height: 14px; }
.tab.active {
  background: linear-gradient(145deg, #0f4a6a, #0d7377);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(13, 115, 119, 0.3);
}

.stack { display: grid; gap: 0.85rem; }
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
input, select, textarea {
  font: inherit;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(13, 138, 143, 0.55);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(13, 138, 143, 0.15), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  padding: 0.72rem 1.05rem;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 4px 14px rgba(10, 40, 70, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0f4a6a 0%, #0d7377 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 24px rgba(13, 115, 119, 0.35);
}
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: lg-shine 4.5s var(--ease) infinite;
}
@keyframes lg-shine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.neon {
  border-color: rgba(153, 213, 215, 0.7);
  color: var(--brand-2);
  background: linear-gradient(145deg, rgba(230, 243, 244, 0.75), rgba(255, 255, 255, 0.45));
}
.btn.ghost {
  width: 100%;
  margin-top: 0.45rem;
  background: rgba(255, 255, 255, 0.4);
}
.btn.danger {
  color: var(--danger);
  border-color: rgba(254, 202, 202, 0.7);
  background: var(--danger-bg);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.75rem 0; }
.hint { color: var(--warn); font-size: 0.8rem; min-height: 1.1em; }
.fine { font-size: 0.75rem; color: var(--muted); }
code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.55);
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  color: var(--brand);
  font-size: 0.85em;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.hidden { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
}
.balances-panel {
  position: sticky;
  top: 4.5rem;
  z-index: 5;
}
.balances-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .balances-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .balances-panel { position: static; }
}
.balances-panel .session-actions .btn {
  flex: 0 1 auto;
}
.chip.ok-chip {
  color: var(--ok);
  border-color: rgba(34, 197, 94, 0.35);
}

.card-block {
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
  animation: lg-rise 0.65s var(--ease) both;
}
.card-block:nth-child(2) { animation-delay: 0.05s; }
.card-block:nth-child(3) { animation-delay: 0.1s; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.5);
  color: var(--brand-2);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s var(--ease);
}
.icon-btn:hover { transform: scale(1.06); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.copy {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
}

.wallet-intro { margin: 0.85rem 0 0.65rem; }
.wallet-grid { display: grid; gap: 0.5rem; }
.trust-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
  width: 100%;
}
.trust-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.86rem;
}
.custody-box {
  margin: 0 0 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.1), rgba(255, 255, 255, 0.22));
}
[data-theme="dark"] .custody-box {
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(12, 20, 34, 0.4));
  border-color: rgba(34, 197, 94, 0.22);
}
.custody-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.custody-head h3 {
  margin: 0;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.custody-head .lead {
  margin: 0.25rem 0 0;
}
.custody-gen {
  width: 100%;
  justify-content: center;
  margin: 0.45rem 0 0.35rem;
  border-radius: 12px;
}
.custody-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.custody-row {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(10, 22, 40, 0.08);
  background: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .custody-row {
  background: rgba(12, 20, 34, 0.35);
  border-color: rgba(255, 255, 255, 0.08);
}
.custody-row strong {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}
.custody-row .assets-line {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.custody-row code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  word-break: break-all;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.custody-row .custody-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.custody-row .custody-actions .btn {
  flex: 1 1 auto;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 10px;
  justify-content: center;
}
.wallet-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.wallet-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}
.wallet-card.connected {
  border-color: rgba(110, 231, 183, 0.7);
  background: linear-gradient(145deg, rgba(236, 253, 245, 0.7), rgba(255, 255, 255, 0.4));
}
.wallet-card.missing {
  border-color: rgba(252, 211, 77, 0.7);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.7), rgba(255, 255, 255, 0.4));
}
.trust-card { border-color: rgba(191, 219, 254, 0.75); }
.w-ico {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.w-ico svg { width: 18px; height: 18px; }
.w-ico.eth { background: rgba(238, 242, 255, 0.85); color: #4f46e5; }
.w-ico.tron { background: rgba(254, 226, 226, 0.85); color: #dc2626; }
.w-ico.btc { background: rgba(255, 237, 213, 0.85); color: #ea580c; }
.w-ico.trust { background: rgba(219, 234, 254, 0.85); color: #2563eb; }
.w-body { display: grid; gap: 0.12rem; min-width: 0; }
.w-body strong { font-size: 0.9rem; }
.w-body small {
  color: var(--muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.w-badge.ok { color: var(--ok); }
.w-badge.warn { color: var(--warn); }
.w-connect {
  width: 40px; height: 40px; padding: 0; border-radius: 13px;
}
.install-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--brand-2);
}
.wallet-config {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(10, 22, 40, 0.06);
  display: grid;
  gap: 0.75rem;
}
.wallet-config h3 {
  display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--ink);
}
.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.bal-section {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.72rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.wallet-folio {
  margin: 0 0 1rem;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
}
[data-theme="dark"] .wallet-folio {
  background: rgba(12, 20, 34, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
}
.wallet-folio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.wallet-folio-addr {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.wallet-folio-addr code {
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 0.8rem;
}
.wallet-folio-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(10, 22, 40, 0.08);
  font-size: 0.78rem;
  color: var(--muted);
}
.wallet-folio-total strong {
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 1rem;
}
.platform-folio {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.1), rgba(255, 255, 255, 0.22));
}
[data-theme="dark"] .platform-folio {
  border-color: rgba(34, 197, 94, 0.22);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(12, 20, 34, 0.45));
}
.platform-folio .folio-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
}
.platform-folio .folio-row:last-child {
  border-bottom: none;
}
.platform-folio .folio-amt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-family: var(--font-mono);
}
.platform-folio .folio-amt small,
.platform-folio .bal-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}
.btn.sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}
.track-link {
  color: var(--accent, #5b8cff);
  text-decoration: none;
  font-size: 0.78rem;
  white-space: nowrap;
}
.track-link:hover { text-decoration: underline; }
.folio-amt .track-link {
  display: block;
  margin-top: 0.15rem;
}
.profile-summary {
  line-height: 1.45;
  padding: 0.5rem 0;
}
.profile-card {
  margin-top: 0.75rem;
}
.profile-welcome {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
  letter-spacing: -0.01em;
}
.profile-welcome strong {
  color: var(--accent, #5b8cff);
  font-weight: 700;
}
.profile-view {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.profile-avatar-wrap {
  flex-shrink: 0;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}
.profile-avatar.fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent, #5b8cff);
}
.profile-edit-form label,
#profileForm label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.profile-edit-form input,
#profileForm input {
  width: 100%;
}
.profile-socials a {
  color: var(--accent, #5b8cff);
  text-decoration: none;
}
.profile-socials a:hover {
  text-decoration: underline;
}
.welcome-toast {
  position: fixed;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: rgba(12, 18, 32, 0.92);
  border: 1px solid rgba(91, 140, 255, 0.35);
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}
.welcome-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.welcome-toast svg {
  width: 1.1rem;
  height: 1.1rem;
}
.admin-profile-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.admin-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
#profileModal .qr-modal-panel {
  max-height: 90vh;
  overflow: auto;
}
#profileForm label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
}
#profileForm input {
  width: 100%;
}
.folio-amt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-family: var(--font-mono);
}
.folio-amt small {
  color: var(--muted);
  font-size: 0.68rem;
}
.balances.portfolio { margin-bottom: 0; }
.balances, .prices { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.balances li, .prices li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}
.muted-row { color: var(--muted); font-size: 0.8rem; border-bottom: none !important; font-family: var(--font); }
.bal-sub {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font);
}

.asset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-family: var(--font);
}
.asset-ico {
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(11, 31, 58, 0.14);
}
.asset-ico svg, .asset-ico img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok);
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(167, 243, 208, 0.7);
  background: rgba(236, 253, 245, 0.65);
  backdrop-filter: blur(10px);
}
.live-pill.stale { color: var(--warn); border-color: rgba(252, 211, 77, 0.7); background: var(--warn-bg); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: lg-pulse 1.8s ease-out infinite;
}
@keyframes lg-pulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 122, 111, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(13, 122, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 122, 111, 0); }
}
.oracle-meta { margin: 0.35rem 0 0; font-size: 0.72rem; color: var(--muted); }

.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.3s var(--ease);
}
.price-row:hover, .price-row.active {
  background: rgba(255, 255, 255, 0.45);
}
.price-main { font-family: var(--font-mono); font-weight: 700; }
.price-metrics {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.55rem;
  font-size: 0.68rem; color: var(--muted);
}
.chg {
  font-weight: 700; font-size: 0.72rem;
  padding: 0.12rem 0.4rem; border-radius: var(--radius-pill);
}
.chg.up { color: var(--ok); background: var(--ok-bg); }
.chg.down { color: var(--danger); background: var(--danger-bg); }
.chg.flat { color: var(--muted); background: rgba(241, 245, 249, 0.8); }

.chip-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.7rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease);
}
.chip-btn.active {
  color: #fff;
  background: linear-gradient(145deg, #0f4a6a, #0d7377);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(13, 115, 119, 0.28);
}
.chart-intervals, .chart-assets {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.chart-assets { margin: 0 0 0.75rem; }
.chart-wrap {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  backdrop-filter: blur(12px);
}
#mainChart { display: block; width: 100%; height: 280px; }
.chart-crosshair {
  position: absolute; top: 10px; right: 12px;
  font-size: 0.75rem; font-family: var(--font-mono);
  color: var(--brand);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0;
}
@media (max-width: 700px) { .row { grid-template-columns: 1fr; } }

.addr-box {
  position: relative;
  margin-top: 0.75rem;
  padding: 1rem 2.5rem 1rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(13, 138, 143, 0.35);
  word-break: break-all;
  backdrop-filter: blur(12px);
}
.addr-qr-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 560px) {
  .addr-qr-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
.addr-qr {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 6px;
  box-shadow: var(--shadow);
}
.addr-qr-body { min-width: 0; }
.addr-label {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; color: var(--muted);
  margin-bottom: 0.35rem; text-transform: uppercase; font-weight: 700;
}
.addr-box code {
  display: block; background: transparent; padding: 0;
  color: var(--ink); font-size: 0.84rem; border: none;
}

.qr-modal.hidden { display: none; }
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: lg-rise 0.35s var(--ease);
}
.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.35);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.qr-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: 1.25rem 1.3rem 1.4rem;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}
.qr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.qr-modal-head h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 1.05rem;
}
.qr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}
.qr-stage {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
}
@media (max-width: 640px) {
  .qr-stage { grid-template-columns: 1fr; justify-items: center; }
}
.connect-qr {
  width: 240px;
  height: 240px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 10px;
  box-shadow: var(--shadow);
}
.qr-meta {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}
.qr-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.qr-steps li { margin: 0.25rem 0; }
.trust-actions { flex-wrap: wrap; }

.swap-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: end;
  margin: 0.5rem 0 1rem;
}
@media (max-width: 700px) { .swap-stage { grid-template-columns: 1fr; } }
.swap-side {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(12px);
}
.swap-side input { width: 100%; margin-top: 0.55rem; }
.swap-flip {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.55);
  color: var(--brand-2);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: transform 0.45s var(--ease);
}
.swap-flip:hover { transform: rotate(180deg) scale(1.05); }
.swap-flip svg { width: 18px; height: 18px; }
.dex-panel .dex-disclaimer {
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.dex-custom-wrap { margin-top: 0.45rem; }
.dex-slip-row { margin: 0.65rem 0 0.35rem; max-width: 10rem; }
.dex-panel #dexResultBox {
  margin-top: 0.75rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.85rem;
}
.quote {
  margin-top: 0.55rem;
  min-height: 2.6rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--brand-2);
  font-size: 0.84rem;
  color: var(--ink);
  font-family: var(--font-mono);
}

.tables { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .tables { grid-template-columns: 1fr; } }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; font-family: var(--font-mono); }
th, td { text-align: left; padding: 0.45rem 0.3rem; border-bottom: 1px solid rgba(10, 22, 40, 0.06); }
th { color: var(--muted); font-weight: 600; font-family: var(--font); }

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) { .security-grid { grid-template-columns: 1fr; } }
.sec-list { list-style: none; padding: 0; margin: 0; }
.sec-list li {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
  font-size: 0.88rem;
}
.sec-list .ok { color: var(--ok); }
.sec-list .warn { color: var(--warn); }
.sec-list svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.sec-note {
  background: rgba(255, 251, 235, 0.7);
  border: 1px solid rgba(252, 211, 77, 0.65);
  border-radius: 14px;
  padding: 0.85rem;
  font-size: 0.84rem;
  color: #92400e;
  margin-top: 0.75rem;
  backdrop-filter: blur(10px);
}

.app-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  backdrop-filter: blur(16px) saturate(160%);
  width: fit-content;
  max-width: 100%;
}
.app-nav .nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.35s var(--ease);
}
.app-nav .nav-btn svg { width: 15px; height: 15px; }
.app-nav .nav-btn.active {
  background: linear-gradient(145deg, #0f4a6a, #0d7377);
  color: #fff;
  box-shadow: 0 8px 20px rgba(13, 115, 119, 0.3);
}

.view.hidden { display: none !important; }

.foot {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(16px);
  margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .lg-orb { animation: none; }
  .cbubble { animation: none; }
}

/* —— Prefs (tema / idioma) —— */
.pref-control {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.pref-control .pref-ico {
  display: grid;
  place-items: center;
  color: var(--brand-2);
}
.pref-control .pref-ico svg,
.pref-control .pref-caret {
  width: 14px;
  height: 14px;
}
.pref-caret { opacity: 0.7; }
.pref-menu {
  position: relative;
  display: inline-flex;
}
.pref-list {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 100;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 14px;
  border: 1px solid rgba(10, 22, 40, 0.1);
  background: #ffffff;
  color: #111111;
  box-shadow: 0 12px 32px rgba(10, 40, 70, 0.18);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.pref-list[hidden] { display: none !important; }
.pref-list li {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  color: #111111 !important;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.pref-list li:hover,
.pref-list li[aria-selected="true"] {
  background: #e8f4f8;
  color: #0a3d5c !important;
}
[data-theme="dark"] .pref-list {
  background: #1a2436;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .pref-list li {
  color: #ffffff !important;
}
[data-theme="dark"] .pref-list li:hover,
[data-theme="dark"] .pref-list li[aria-selected="true"] {
  background: rgba(94, 224, 212, 0.18);
  color: #ffffff !important;
}
[data-theme="dark"] .pref-control {
  color: #ffffff;
}
[dir="rtl"] .pref-list { inset-inline-start: auto; inset-inline-end: 0; }

/* —— Dark liquid glass —— */
[data-theme="dark"] {
  --ink: #ffffff;
  --muted: #d1d9e6;
  --brand: #8ec8ff;
  --brand-2: #5ee0d4;
  --brand-soft: rgba(94, 224, 212, 0.14);
  --ok: #4adeb0;
  --ok-bg: rgba(74, 222, 176, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.12);
  --glass: rgba(18, 28, 44, 0.55);
  --glass-strong: rgba(28, 40, 60, 0.72);
  --glass-tint: rgba(12, 20, 34, 0.45);
  --glass-edge: rgba(255, 255, 255, 0.28);
  --glass-edge-dim: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 36px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
[data-theme="dark"] body { background: #070d16; color: #ffffff; }
[data-theme="dark"] .chip,
[data-theme="dark"] .mark,
[data-theme="dark"] .panel.auth h1,
[data-theme="dark"] .wallet-card,
[data-theme="dark"] .w-body strong,
[data-theme="dark"] .quote,
[data-theme="dark"] .btn:not(.primary):not(.neon) {
  color: #ffffff;
}
[data-theme="dark"] select {
  color: #ffffff;
}
[data-theme="dark"] select option {
  color: #111111 !important;
  background: #ffffff !important;
}
[data-theme="dark"] .lead,
[data-theme="dark"] .sub,
[data-theme="dark"] .fine,
[data-theme="dark"] label,
[data-theme="dark"] .muted-row,
[data-theme="dark"] .oracle-meta,
[data-theme="dark"] .w-body small,
[data-theme="dark"] .w-badge,
[data-theme="dark"] .panel.auth .lead,
[data-theme="dark"] .panel.auth label,
[data-theme="dark"] .panel.auth .fine {
  color: #d1d9e6;
}
[data-theme="light"] {
  --ink: #000000;
  --muted: #3a4553;
}
[data-theme="light"] body,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .panel.auth h1,
[data-theme="light"] .mark {
  color: #000000;
}
[data-theme="light"] .lead,
[data-theme="light"] .sub,
[data-theme="light"] label,
[data-theme="light"] .fine,
[data-theme="light"] .panel.auth .lead,
[data-theme="light"] .panel.auth label {
  color: #3a4553;
}
[data-theme="dark"] .lg-ambient {
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(30, 90, 160, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(20, 120, 110, 0.35), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(60, 50, 140, 0.3), transparent 55%),
    linear-gradient(165deg, #0a1220 0%, #0d1524 45%, #0a101a 100%);
}
[data-theme="dark"] .lg-orb.a { background: radial-gradient(circle, rgba(40, 120, 220, 0.4), transparent 70%); }
[data-theme="dark"] .lg-orb.b { background: radial-gradient(circle, rgba(30, 180, 150, 0.35), transparent 70%); }
[data-theme="dark"] .lg-orb.c { background: radial-gradient(circle, rgba(90, 80, 200, 0.3), transparent 70%); }
[data-theme="dark"] .top {
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.75), rgba(12, 20, 34, 0.55));
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .chip,
[data-theme="dark"] .pref-control,
[data-theme="dark"] .tab,
[data-theme="dark"] .btn:not(.primary),
[data-theme="dark"] .wallet-card,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .chip-btn,
[data-theme="dark"] .app-nav,
[data-theme="dark"] .swap-side,
[data-theme="dark"] .chart-wrap,
[data-theme="dark"] .addr-box,
[data-theme="dark"] .quote,
[data-theme="dark"] .foot {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}
[data-theme="dark"] .btn.primary {
  background: linear-gradient(145deg, #1a6a9a, #0f9a96);
}
[data-theme="dark"] .tab.active,
[data-theme="dark"] .chip-btn.active,
[data-theme="dark"] .app-nav .nav-btn.active {
  background: linear-gradient(145deg, #1a6a9a, #0f9a96);
  color: #fff;
}
[data-theme="dark"] .logo-mark {
  background: linear-gradient(145deg, #1a6a9a, #0f9a96);
}
[data-theme="dark"] .trust-banner {
  background: linear-gradient(135deg, rgba(13, 122, 111, 0.2), rgba(255, 255, 255, 0.04));
  border-color: rgba(74, 222, 176, 0.25);
}
[data-theme="dark"] code {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--brand-2);
}
[data-theme="dark"] .price-row:hover,
[data-theme="dark"] .price-row.active {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .sec-note {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}
[data-theme="dark"] .qr-modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .connect-qr,
[data-theme="dark"] .addr-qr {
  background: #fff;
}

/* RTL tweaks */
[dir="rtl"] .top-right { flex-direction: row-reverse; }
[dir="rtl"] .brand { flex-direction: row-reverse; }
[dir="rtl"] .wallet-card {
  grid-template-columns: auto 1fr auto;
}
[dir="rtl"] .inline-field { direction: rtl; }
[dir="rtl"] .quote { border-left: none; border-right: 3px solid var(--brand-2); }

/* —— Responsive / armonía —— */
.prefs-group, .status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

main {
  width: 100%;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

.top {
  padding-left: max(0.85rem, env(safe-area-inset-left));
  padding-right: max(0.85rem, env(safe-area-inset-right));
  flex-wrap: wrap;
  row-gap: 0.65rem;
}

.trust-banner {
  width: calc(100% - 2rem);
  margin-left: auto;
  margin-right: auto;
}

.panel.auth {
  width: min(440px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.btn-row { width: 100%; }
.btn-row .btn { flex: 1 1 auto; min-width: min(100%, 9.5rem); }

.app-nav {
  max-width: 100%;
  width: 100%;
  justify-content: stretch;
}
.app-nav .nav-btn { flex: 1 1 auto; justify-content: center; }

.qr-modal {
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}
.qr-modal-panel {
  width: min(640px, 100%);
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 300px 1fr; gap: 0.85rem; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .top {
    align-items: flex-start;
  }
  .top-right {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .prefs-group, .status-group {
    flex: 1 1 auto;
  }
  .status-group { justify-content: flex-end; }
  .chart-wrap #mainChart,
  #mainChart { height: 240px; }
}

@media (max-width: 720px) {
  .mark { font-size: 1.05rem; }
  .sub { font-size: 0.62rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel.auth {
    margin: 0.35rem auto 1rem;
    padding: 1rem 0.95rem 0.95rem;
    border-radius: 22px;
  }
  .card-block {
    padding: 1rem;
    border-radius: 18px;
  }
  .trust-banner {
    width: calc(100% - 1.5rem);
    font-size: 0.8rem;
    padding: 0.75rem 0.85rem;
  }
  .row {
    grid-template-columns: 1fr;
  }
  .swap-stage { grid-template-columns: 1fr; justify-items: stretch; }
  .swap-flip { margin: 0.15rem auto; }
  .tables { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .btn-row .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
  .chip span:not(#netLabel) {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .addr-qr-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qr-stage { grid-template-columns: 1fr; justify-items: center; }
  .connect-qr { width: min(240px, 78vw); height: auto; aspect-ratio: 1; }
  .inline-field { grid-template-columns: 1fr; }
  .inline-field .btn { width: 100%; }
}

@media (max-width: 480px) {
  .top { padding-top: 0.65rem; padding-bottom: 0.65rem; gap: 0.55rem; }
  .logo-mark { width: 36px; height: 36px; border-radius: 12px; }
  .brand { gap: 0.55rem; min-width: 0; flex: 1 1 auto; }
  .brand > div { min-width: 0; }
  .sub { display: none; }
  .top-right {
    flex-direction: column;
    align-items: stretch;
  }
  .prefs-group, .status-group {
    width: 100%;
    justify-content: stretch;
  }
  .pref-control { flex: 1 1 0; min-width: 0; }
  .pref-control select { width: 100%; font-size: 0.72rem; }
  .status-group .chip { flex: 1 1 0; justify-content: center; min-width: 0; }
  .status-group .chip span {
    max-width: 100%;
  }
  #adminLink span { display: none; }
  main { padding: 0.85rem 0.75rem 2rem; }
  h1 { font-size: 1.35rem; }
  .tabs { width: 100%; }
  .tab { flex: 1 1 0; justify-content: center; padding: 0.55rem 0.5rem; font-size: 0.85rem; }
  .wallet-card { padding: 0.7rem; gap: 0.55rem; }
  .w-connect { width: 36px; height: 36px; }
  #mainChart { height: 200px; }
  .foot { padding: 1.1rem 0.75rem 1.5rem; font-size: 0.68rem; line-height: 1.4; }
}

@media (max-width: 360px) {
  .pref-control .pref-ico { display: none; }
  .chip { padding: 0.35rem 0.5rem; font-size: 0.7rem; }
  .panel.auth { padding: 1rem 0.85rem; }
}

/* Pantallas altas / escritorio cómodo */
@media (min-width: 1200px) {
  main { padding-top: 0.85rem; }
  .panel.auth { margin-top: 0.5rem; }
}

/* Evitar zoom raro en iOS en inputs */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px; }
}

.wallet-net-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.55rem 0 0.35rem;
}
.wallet-net-row .chip-btn {
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
}
#walletNetHint {
  margin: 0 0 0.55rem;
}
#btnDisconnectWallet {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(255, 80, 80, 0.08);
}
#btnDisconnectWallet:hover {
  background: rgba(225, 29, 72, 0.14);
  color: #be123c;
  transform: translateY(-1px);
}
[data-theme="dark"] #btnDisconnectWallet {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
}
@media (min-width: 961px) {
  .status-group {
    flex-wrap: nowrap;
  }
  #btnDisconnectWallet {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
  }
}
@media (max-width: 720px) {
  #btnDisconnectWallet span {
    /* En pantallas estrechas: solo icono + title */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  #btnDisconnectWallet {
    position: relative;
    padding: 0.4rem 0.65rem;
  }
}
.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.session-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}
#idleHint {
  margin-top: 0.45rem;
}
#walletBridgeOk .icon-hero {
  color: #5dffb1;
}
.wallet-pair-box {
  margin: 0.65rem 0 0.4rem;
}
.wallet-pair-box .inline-field {
  margin-top: 0.35rem;
}
.pair-code-panel {
  margin: 0.65rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px dashed rgba(94, 224, 212, 0.45);
  background: rgba(94, 224, 212, 0.08);
  text-align: center;
}
.pair-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.85rem;
  letter-spacing: 0.35rem;
  font-weight: 700;
  margin: 0.25rem 0;
}
