:root {
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --bg-deep: #030303;
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --surface: #161616;
  --surface-hover: #1f1f1f;
  --border: rgba(255, 255, 255, 0.065);
  --border-strong: rgba(217, 245, 122, 0.28);
  --text: #f4f4f5;
  --text-secondary: #9ca3af;
  --accent: #d9f57a;
  --accent-hover: #eeff99;
  --accent-dim: rgba(217, 245, 122, 0.14);
  --accent-glow: rgba(217, 245, 122, 0.38);
  --ok: #c8e660;
  --ok-bg: rgba(200, 230, 96, 0.14);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --warn: #eab308;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -40%, rgba(217, 245, 122, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(255, 255, 255, 0.03), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

/* Shell a pantalla completa (todas las páginas salvo login) */
body.dashboard-shell {
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -25%, rgba(217, 245, 122, 0.05), transparent 52%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(255, 255, 255, 0.025), transparent 42%),
    linear-gradient(180deg, #0a0a0a 0%, var(--bg-deep) 55%, #020202 100%);
}

body.dashboard-shell .app-header {
  flex-shrink: 0;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dashboard-shell .app-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px clamp(10px, 1.8vw, 22px) 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dashboard-shell .app-panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(16px, 2vw, 28px) clamp(16px, 2.5vw, 40px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 42%),
    linear-gradient(165deg, #121212 0%, var(--surface) 38%, #0c0c0c 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

body.dashboard-shell .app-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.45;
  pointer-events: none;
}

body.dashboard-shell .card {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.07);
}

body.dashboard-shell input[type="text"],
body.dashboard-shell input[type="email"],
body.dashboard-shell input[type="password"],
body.dashboard-shell input[type="number"],
body.dashboard-shell input:not([type]),
body.dashboard-shell select {
  max-width: min(560px, 100%);
}

body.dashboard-shell .page-title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

body.dashboard-shell .page-lead {
  max-width: 62ch;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}

/* —— Cabecera —— */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1a1a1a 0%, var(--accent) 100%);
  box-shadow: 0 0 24px var(--accent-glow);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #0a0a0a;
  letter-spacing: -0.02em;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand .tagline {
  display: none;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (min-width: 900px) {
  .brand .tagline { display: block; margin-top: 2px; line-height: 1; }
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.app-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.app-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--border-strong);
}

.app-nav a.nav-out {
  color: var(--danger);
}
.app-nav a.nav-out:hover {
  background: var(--danger-bg);
  color: #fca5a5;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 220px;
}

.user-chip .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #334155, #1e293b);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.user-chip span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Contenido —— */
.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-lead {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 52ch;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card h2, .card h3 {
  margin-top: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card h2 { font-size: 1.2rem; }
.card h3 { font-size: 1.05rem; color: var(--text); }

.muted {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px 18px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.stat:hover {
  border-color: var(--border-strong);
}

.stat .muted {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat strong {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  display: block;
  color: var(--text);
}

.stat strong.stat-sm {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.2);
}

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover {
  background: rgba(217, 245, 122, 0.05);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.buy {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(200, 230, 96, 0.35);
}

.badge.sell {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge.hold {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge.err {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge.info {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(217, 245, 122, 0.28);
}

.cell-mono {
  word-break: break-all;
  max-width: 420px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.form-actions { margin-top: 4px; }
.form-actions button { margin-top: 12px; }

label {
  display: block;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input:not([type]),
select {
  width: 100%;
  max-width: 440px;
  padding: 11px 14px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

label:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
}

label:has(input[type="checkbox"]) input {
  margin-top: 3px;
  width: auto;
  max-width: none;
  accent-color: var(--accent);
}

button, .btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #b8e04a 0%, var(--accent) 45%, var(--accent-hover) 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  transition: transform 0.15s, box-shadow 0.2s, background-position 0.25s;
  box-shadow: 0 4px 20px rgba(217, 245, 122, 0.22);
}

button:hover, .btn:hover {
  transform: translateY(-1px);
  background-position: 100% 50%;
  box-shadow: 0 6px 28px rgba(217, 245, 122, 0.32);
}

button:active, .btn:active {
  transform: translateY(0);
}

button.secondary, .btn.secondary {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}

button.secondary:hover, .btn.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.err {
  background: var(--danger-bg);
  color: #fecaca;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  font-size: 0.9rem;
}

.err-detail {
  font-size: 0.85rem;
  line-height: 1.55;
  max-height: 320px;
  overflow-y: auto;
}

.ok {
  background: var(--ok-bg);
  color: #e8f5b8;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid rgba(200, 230, 96, 0.35);
  font-size: 0.9rem;
}

/* —— Login —— */
body.page-auth .app-header {
  justify-content: center;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
}

body.page-auth .brand { flex-direction: column; text-align: center; gap: 10px; }
body.page-auth .brand-mark { width: 48px; height: 48px; font-size: 1.1rem; }
body.page-auth .brand h1 { font-size: 1.35rem; }
body.page-auth .brand .tagline { display: block; }

body.page-auth .app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 80px);
  padding-top: 0;
}

body.page-auth .auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

body.page-auth .auth-card h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

body.page-auth .auth-card button {
  width: 100%;
  margin-top: 22px;
}

.text-ok { color: var(--ok); font-weight: 600; }
.text-off { color: var(--text-secondary); font-weight: 500; }
.text-danger-cell { color: var(--danger); }

/* —— Página inicio (home) —— */
body.page-home .page-title {
  margin-bottom: 6px;
}

body.page-home .page-lead {
  margin-bottom: 0;
}

.home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.home-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-hero-aside {
  flex-shrink: 0;
  align-self: center;
}

.home-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 245, 122, 0.22);
}

.home-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(217, 245, 122, 0.5);
  animation: home-pulse 2s ease-out infinite;
}

@keyframes home-pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 245, 122, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(217, 245, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 245, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-live-dot {
    animation: none;
  }
}

.home-tenant h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.home-tenant-sub {
  margin: 0;
  font-size: 0.88rem;
}

.home-tenant-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-status-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-status-pill--on {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 245, 122, 0.32);
}

.home-status-pill--off {
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border);
}

.home-chip-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.home-chip-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.home-chip-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.home-chip code.home-chip-value {
  font-size: 0.85rem;
  font-weight: 500;
}

.home-metrics {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 4px;
}

@media (min-width: 900px) {
  .home-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  body.page-home .home-metrics--summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-stat--wide {
    grid-column: span 1;
  }
}

.home-stat--price {
  min-width: 0;
}

.home-stat--price strong.home-price-value {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.home-price-meta {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  min-height: 1em;
}

/* Precio spot tabla home: vs tick anterior (ticker_batch_api) */
body.page-home .home-ticker-price {
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

body.page-home .home-ticker-price.home-ticker-price--up {
  color: var(--ok);
  font-weight: 600;
}

body.page-home .home-ticker-price.home-ticker-price--down {
  color: var(--danger);
  font-weight: 600;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.home-section-head h3 {
  margin: 0 0 4px;
}

.home-section-desc {
  margin: 0;
  font-size: 0.88rem;
}

a.btn-inline {
  margin-top: 0;
  text-decoration: none;
  align-self: center;
}

.home-wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.home-wallet-tile {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid rgba(217, 245, 122, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-wallet-tile .muted {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-wallet-tile strong {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.home-wallet-sync {
  margin: 16px 0 0;
  font-size: 0.82rem;
}

.home-wallet-empty {
  padding: 18px 22px;
}

.home-indicators h3 {
  margin-bottom: 6px;
}

.home-kv {
  margin: 0;
}

.home-kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 12px 20px;
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.home-kv-row:last-child {
  border-bottom: none;
}

.home-kv-row dt,
.home-kv-row dd {
  margin: 0;
  padding: 12px 0;
}

.home-kv-row dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.home-kv-row dd {
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-mono);
  word-break: break-word;
}

.home-kv-row--danger dd {
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .home-kv-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .home-kv-row dt {
    padding-bottom: 0;
  }
  .home-kv-row dd {
    padding-top: 4px;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .app-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .user-chip { max-width: none; }
  body.dashboard-shell .app-main {
    padding: 8px 10px 12px;
  }
  body.dashboard-shell .app-panel {
    padding: 14px 14px 18px;
    border-radius: var(--radius);
  }
  body.dashboard-shell .app-panel::before {
    left: 14px;
    right: 14px;
  }
}

/* —— UX / accesibilidad / rendimiento —— */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10001;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  clip: auto;
  overflow: visible;
  white-space: normal;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.app-nav a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button:hover,
  .btn:hover {
    transform: none;
  }
}

/* LLM traces */
.page-llm-traces .llm-detail-row {
  display: none;
}

.page-llm-traces .llm-detail-row.llm-detail--open {
  display: table-row;
}

.page-llm-traces .llm-pre {
  margin: 0 0 14px;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  line-height: 1.45;
}

.page-llm-traces .llm-pre--http {
  font-size: 0.75rem;
  word-break: break-all;
  max-height: 280px;
}

.page-llm-traces .llm-pre--json {
  max-height: 160px;
  margin-bottom: 0;
}

.page-llm-traces .llm-detail-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-llm-traces .llm-detail-cell {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  vertical-align: top;
}

.page-llm-traces .llm-hero--spaced {
  margin-bottom: 1.25rem;
}

.page-llm-traces .llm-toolbar {
  margin: 0 0 1.25rem;
}

.page-llm-traces .llm-card-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.page-llm-traces .llm-file-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.page-llm-traces .llm-toggle-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
  margin-top: 0;
}

/* Instalación: crear usuario (sin shell del panel) */
body.page-create-user {
  margin: 0;
  min-height: 100vh;
  padding: 24px clamp(16px, 4vw, 32px) 48px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

body.page-create-user h1 {
  font-size: 1.35rem;
  margin-top: 0;
  letter-spacing: -0.02em;
}

body.page-create-user .cu-lead {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

body.page-create-user button {
  width: 100%;
  margin-top: 8px;
}

body.page-create-user label {
  margin-top: 14px;
}

body.page-create-user form > label:first-of-type {
  margin-top: 0;
}

body.page-create-user .cu-newblock--hidden {
  display: none !important;
}

body.page-create-user .cu-footer-link {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* Guía de estrategias */
body.page-help .help-hero-spaced {
  margin-bottom: 1.25rem;
}

body.page-help .help-toolbar {
  margin: 0 0 1.25rem;
}

body.page-help .help-card {
  margin-bottom: 1.25rem;
}

body.page-help .help-card--tight {
  margin-bottom: 0.5rem;
}

body.page-help .help-strat-title {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

body.page-help .help-p-lead {
  margin: 0 0 12px;
}

body.page-help .help-p-tight {
  margin: 0 0 8px;
}

body.page-help .help-h3 {
  font-size: 0.95rem;
  margin: 14px 0 8px;
  color: var(--accent);
}

body.page-help .help-list {
  margin: 0;
  padding-left: 1.2rem;
}

body.page-help .help-table-wrap {
  margin-top: 8px;
}

body.page-help .help-footnote {
  margin: 12px 0 0;
  font-size: 0.88rem;
}

/* Home: texto de configuración en bloque KPI */
body.page-home .home-kv-row dd.home-kv-note {
  font-size: 0.92rem;
  font-family: inherit;
}

body.page-home .home-ticker-desc {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

body.page-home .home-table-wrap-tight {
  margin-top: 4px;
}

body.page-home .home-reparto-note {
  margin-top: 14px;
  font-size: 0.88rem;
}

/* Eventos */
body.page-events .events-toolbar {
  margin-top: -6px;
}

body.page-events .events-status-card {
  margin-bottom: 1.25rem;
}

body.page-events .home-kv--flush {
  margin: 0;
}

.text-danger-plain {
  color: var(--danger);
}

.cell-mono--accent {
  font-weight: 600;
  color: var(--accent);
}

.cell-mono--muted-strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.events-usdc-suffix {
  font-weight: 500;
  font-size: 0.85em;
}

.events-comm-asterisk {
  font-size: 0.75em;
}

.text-accent-strong {
  color: var(--accent);
}

.text-body-strong {
  color: var(--text);
}

.events-payload-code {
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Valor USDC */
body.page-value .card--warn {
  border-color: var(--warn);
}

body.page-value .migration-pre {
  overflow: auto;
  font-size: 0.85rem;
}

body.page-value .card--section-spaced {
  margin-bottom: 1.25rem;
}

body.page-value .value-total-big {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.25rem 0;
}

body.page-value .value-meta-line {
  margin: 0;
}

body.page-value .value-chart-wrap {
  position: relative;
  height: 320px;
  margin-top: 12px;
}

body.page-value .value-unpriced-lead {
  margin-top: 12px;
}

body.page-value .value-unpriced-list {
  font-size: 0.9rem;
}

body.page-value .table-wrap--scroll {
  max-height: 360px;
  overflow: auto;
}

/* Billetera */
body.page-wallet .wallet-sync-line {
  margin-top: 12px;
}

/* LLM lista vacía */
.page-llm-traces .llm-empty-hints {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}
