/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:           #060b0a;
  --bg-2:         #0b1312;
  --bg-3:         #101a18;
  --panel:        #0d1615;
  --panel-2:      #111e1c;
  --panel-hero:   #122220;
  --panel-recess: #091110;
  --border:       #1a2e2b;
  --border-soft:  #142220;
  --text:         #e6f0ee;
  --muted:        #6b8882;
  --muted-2:      #4a6662;

  /* Brand + semantic */
  --primary:      #1de9c6;
  --primary-dim:  rgba(29, 233, 198, 0.12);
  --primary-glow: rgba(29, 233, 198, 0.06);
  --positive:     #2ecc8e;
  --negative:     #f0556a;
  --warning:      #e8b84d;
  --color-positive: var(--positive);
  --color-negative: var(--negative);
  --surface-positive: rgba(46, 204, 142, 0.10);
  --surface-negative: rgba(240, 85, 106, 0.10);
  --surface-warning:  rgba(232, 184, 77, 0.10);

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;

  /* Elevation */
  --elev-0: none;
  --elev-1: 0 1px 0 rgba(255,255,255,0.03) inset, 0 2px 8px rgba(0,0,0,0.25);
  --elev-2: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --elev-3: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 40px rgba(0,0,0,0.45);

  /* Layout */
  --sidebar-w:    228px;
  --radius:       10px;
  --radius-sm:    7px;
  --sphere-desktop-form-gap: 88px;
  --shadow:       0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  color-scheme: dark;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}

/* ─── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; }
body.intro-active { overflow: hidden; }
button, input { font: inherit; }
h1, h2, h3, p { margin: 0; }

/* ─── INTRO / SIGN-IN SCREEN ─────────────────────────────────────────────── */
.intro-screen {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 70% at 50% 118%, rgba(29,233,198,0.10), transparent 62%),
    radial-gradient(70% 50% at 50% -12%, rgba(29,233,198,0.07), transparent 65%),
    #030706;
  overflow: hidden;
  transition: opacity 500ms ease, visibility 500ms ease;
}
.intro-screen.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }

/* Ambient sphere behind the card. The width formula mirrors
   getDesktopSphereCenterX(): centre = width − gap − radius, with
   radius ≈ 0.391 × height and --sphere-desktop-form-gap = 88px, so
   width = 2×88px + 0.782×height puts the sphere dead-centre. */
.intro-backdrop {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: calc(176px + 78.15vh);
  width: calc(176px + 78.15dvh);
  transform: translateX(-50%);
  z-index: 0; pointer-events: none;
  opacity: 0.55;
}
#networkSphere {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; pointer-events: none;
}

/* Soft veil so the stage stays readable over the mesh */
.intro-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(46% 58% at 50% 55%, rgba(3,7,6,0.42), transparent 72%),
    linear-gradient(180deg, rgba(3,7,6,0.85) 0%, transparent 24%, transparent 70%, rgba(3,7,6,0.9) 100%);
}

/* Top bar: brand + macOS pill */
.intro-topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 30px 0;
}
.intro-brand { display: flex; align-items: baseline; }
.intro-brand-mark {
  font-size: 25px; font-weight: 700; line-height: 1;
  letter-spacing: -0.03em; text-transform: lowercase;
  background: linear-gradient(90deg, #5ed9be 0%, #5ed9be 42%, #dff8f2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(94,217,190,0.28));
}
.intro-mac-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 7px 7px 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(9,17,16,0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--muted); font-size: 12px; text-decoration: none;
  transition: border-color 160ms, color 160ms;
}
.intro-mac-pill:hover { border-color: rgba(29,233,198,0.5); color: var(--text); }
.intro-mac-pill svg { flex-shrink: 0; }
.intro-mac-pill-cta {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(29,233,198,0.12); border: 1px solid rgba(29,233,198,0.35);
  color: var(--text); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}

/* Centre stage: ticker, headline, card */
.intro-stage {
  position: relative; z-index: 3; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 20px; text-align: center;
}

.intro-ticker {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 20px; padding: 7px 15px;
  border: 1px solid rgba(29,233,198,0.22); border-radius: 999px;
  background: rgba(29,233,198,0.05);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--primary);
}
.intro-ticker-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(29,233,198,0.9);
  animation: intro-dot-pulse 2.2s ease-in-out infinite;
}
@keyframes intro-dot-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
/* Rotating words stack in one grid cell so the pill keeps a stable width */
.intro-words { display: inline-grid; text-align: left; }
.intro-word {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0; transform: translateY(8px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.intro-word.active { opacity: 1; transform: translateY(0); }
.intro-word.exit {
  opacity: 0; transform: translateY(-8px);
  transition: opacity 380ms ease, transform 380ms ease;
}

.intro-headline {
  font-size: clamp(34px, 4.6vw, 56px); font-weight: 700;
  line-height: 1.05; letter-spacing: -0.03em;
  color: var(--text); margin-bottom: 14px;
}
.intro-sub {
  font-size: 14px; color: var(--muted); line-height: 1.6;
  max-width: 400px; margin-bottom: 28px;
}

/* Frosted auth card */
.intro-card {
  width: min(400px, 100%);
  padding: 24px 26px 20px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(9,17,16,0.66);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.05) inset;
  text-align: left;
}

/* Primary choice: Account vs Wallet — underline tabs */
.intro-mode {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  margin-bottom: 20px; border-bottom: 1px solid var(--border);
}
.intro-mode-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 4px 12px; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: color 160ms;
}
.intro-mode-tab:hover { color: var(--text); }
.intro-mode-tab.active { color: var(--text); }
.intro-mode-indicator {
  position: absolute; left: 0; bottom: -1px;
  width: 50%; height: 2px; border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(29,233,198,0.55);
  transition: transform 280ms cubic-bezier(0.16,1,0.3,1);
}
.intro-mode.wallet-active .intro-mode-indicator { transform: translateX(100%); }

/* Account / Wallet views */
.intro-view { display: flex; flex-direction: column; }
.intro-view[hidden] { display: none !important; }

/* Login form */
.intro-login-form { display: flex; flex-direction: column; gap: 14px; }
.intro-login-form[hidden] { display: none !important; }

.intro-field { display: flex; flex-direction: column; gap: 6px; }
.intro-field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.14em;
}
.intro-field input {
  min-height: 46px; padding: 0 15px;
  border: 1px solid rgba(255,255,255,0.07); border-radius: 12px;
  background: rgba(255,255,255,0.035); color: var(--text);
  font-size: 13.5px; outline: none;
  transition: border-color 160ms, background 160ms, box-shadow 160ms;
}
.intro-field input::placeholder { color: var(--muted-2); }
.intro-field input:focus {
  border-color: rgba(29,233,198,0.55);
  background: rgba(29,233,198,0.04);
  box-shadow: 0 0 0 3px rgba(29,233,198,0.10);
}

/* Two actions side by side (sign in / sign up) */
.intro-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.intro-login-btn {
  width: 100%; min-height: 46px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #2bf0cf, #0fbf9f);
  color: #032019; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(29,233,198,0.22);
  transition: filter 160ms, transform 160ms, box-shadow 160ms;
}
.intro-login-btn:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(29,233,198,0.3); }
.intro-login-btn:active { transform: translateY(1px); }
.intro-login-btn:disabled { cursor: wait; opacity: 0.55; }
/* Secondary action (Sign up) */
.intro-login-btn--ghost {
  background: transparent; color: var(--muted);
  border: 1px solid rgba(255,255,255,0.1); box-shadow: none;
}
.intro-login-btn--ghost:hover {
  filter: none; box-shadow: none;
  color: var(--text); border-color: rgba(29,233,198,0.5);
  background: rgba(29,233,198,0.05);
}

/* Muted inline link (email code toggle, back) */
.intro-text-link {
  margin: 14px auto 0; border: 0; padding: 4px 6px; min-height: auto;
  background: transparent; color: var(--muted-2); font: inherit;
  font-size: 12px; cursor: pointer; transition: color 150ms; align-self: center;
}
.intro-text-link:hover { color: var(--primary); }

/* One-time email code */
.intro-code-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end;
}
.intro-code-row .intro-field { min-width: 0; margin: 0; }
.intro-send-code-btn {
  min-height: 46px; padding: 0 16px; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.intro-send-code-btn:hover { border-color: rgba(29,233,198,0.5); background: rgba(29,233,198,0.06); }
.intro-send-code-btn:disabled { opacity: 0.5; cursor: wait; }

/* Divider */
.intro-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 16px; color: var(--muted-2); font-size: 11px;
}
.intro-divider::before, .intro-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Wallet connect button */
.intro-connect {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 46px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #2bf0cf, #0fbf9f);
  color: #032019; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(29,233,198,0.22);
  transition: filter 160ms, transform 160ms;
}
.intro-connect:hover { filter: brightness(1.08); }
.intro-connect:active { transform: translateY(1px); }
.intro-connect:disabled { cursor: wait; opacity: 0.55; }

/* Read-only address form */
.intro-address-form {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px;
  width: 100%; margin-top: 2px;
}
.intro-address-form[hidden] { display: none; }
.intro-address-form input {
  min-height: 44px; padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.07); border-radius: 12px;
  background: rgba(255,255,255,0.035); color: var(--text);
  font-size: 12.5px; outline: none; font-family: 'JetBrains Mono', monospace;
  transition: border-color 160ms, box-shadow 160ms;
}
.intro-address-form input::placeholder { color: var(--muted-2); }
.intro-address-form input:focus {
  border-color: rgba(29,233,198,0.55);
  box-shadow: 0 0 0 3px rgba(29,233,198,0.10);
}
.intro-address-form button {
  min-height: 44px; padding: 0 18px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: border-color 150ms, background 150ms;
}
.intro-address-form button:hover { border-color: rgba(29,233,198,0.5); background: rgba(29,233,198,0.06); }

.intro-status {
  min-height: 16px; margin-top: 14px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.intro-status.negative { color: var(--negative); }
.intro-status.ok       { color: var(--primary); }
.intro-status.warning  { color: var(--warning); }

/* Footer strip */
.intro-foot {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 30px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--muted-2);
}
.intro-foot b { color: var(--muted); font-weight: 500; }

/* Mobile: same centred composition, tightened up */
@media (max-width: 700px) {
  body.intro-active { overflow: hidden; }

  .intro-screen {
    height: 100dvh; min-height: 100dvh; max-height: 100dvh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }

  /* Full-bleed ambient sphere (the JS mobile branch reserves a 96px header
     strip, so the canvas naturally clears the top bar) */
  .intro-backdrop { left: 0; width: 100%; transform: none; opacity: 0.4; }
  #networkSphere { top: 96px; height: auto; }

  .intro-topbar {
    padding: max(16px, env(safe-area-inset-top, 0px)) 18px 0;
  }
  .intro-brand-mark { font-size: 22px; }
  .intro-mac-pill { padding: 6px; gap: 0; }
  .intro-mac-pill svg { margin: 0 6px; }
  .intro-mac-pill-label { display: none; }

  .intro-stage { padding: 12px 18px 20px; }
  .intro-ticker { margin-bottom: 16px; font-size: 11px; }
  .intro-headline { font-size: clamp(30px, 9vw, 38px); margin-bottom: 10px; }
  .intro-sub { font-size: 13px; line-height: 1.5; margin-bottom: 20px; }

  .intro-card { padding: 18px 18px 16px; border-radius: 18px; }
  .intro-mode { margin-bottom: 16px; }
  .intro-login-form { gap: 12px; }

  /* 16px keeps iOS Safari from auto-zooming (and jumping the layout) on input focus */
  .intro-field input,
  .intro-code-row input,
  .intro-address-form input {
    min-height: 48px; font-size: 16px;
  }
  .intro-login-btn,
  .intro-connect,
  .intro-send-code-btn { min-height: 48px; font-size: 14px; }
  .intro-address-form button { min-height: 48px; }

  .intro-status { margin-top: 10px; min-height: 14px; }

  .intro-foot {
    justify-content: center;
    padding: 0 18px calc(14px + env(safe-area-inset-bottom, 0px));
    font-size: 10px;
  }
  .intro-foot-note { white-space: nowrap; }
  .intro-foot-credit { display: none; }
}

/* ─── APP SHELL ─────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.dashboard-shell.is-hidden { display: none; }

/* ─── SIDEBAR ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
body.client-mode .sidebar-brand { color: var(--primary); }

.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-section-label {
  font-size: 10px; font-weight: 600; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0 8px; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 38px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active {
  background: var(--primary-dim); border-color: rgba(29,233,198,0.2);
  color: var(--primary); font-weight: 600;
}
.nav-item[hidden] { display: none !important; }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.nav-item-lock {
  display: none;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.55;
}
.nav-item--locked,
.nav-item--locked:disabled {
  opacity: 0.45;
  cursor: default;
}
.nav-item--locked:hover,
.nav-item--locked:disabled:hover {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.nav-item--locked .nav-item-lock { display: block; }

.sidebar-spacer { flex: 1; }

.sidebar-wallet-info {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border-soft);
}
.sidebar-section-label {
  font-size: 10px; font-weight: 600; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.sidebar-wallet-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg-2);
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: var(--text); margin-bottom: 10px;
  white-space: nowrap; overflow: hidden;
}
.sidebar-wallet-chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.connection-dot {
  width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%;
  background: var(--positive); box-shadow: 0 0 6px var(--positive);
}
.sidebar-wallet-actions { display: flex; gap: 6px; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
button {
  min-height: 38px; border: 1px solid var(--border);
  border-radius: 8px; padding: 0 14px; color: var(--text);
  background: var(--panel-2); cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: border-color 150ms, background 150ms;
}
button:hover { border-color: var(--primary); }
button:disabled { cursor: wait; opacity: 0.55; }
button.primary {
  background: var(--primary); border-color: var(--primary);
  color: #04120f; font-weight: 700;
}
button.primary:hover { background: #24f5d2; }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--bg-3); }
button.small { min-height: 30px; padding: 0 10px; font-size: 12px; }

/* ─── MAIN CONTENT ───────────────────────────────────────────────────────── */
.dashboard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-mode-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-user-email {
  font-size: 12px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-home-btn,
.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.dashboard-topbar[data-logged-in="true"] .topbar-home-btn,
.dashboard-topbar[data-logged-in="true"] .topbar-mode-label {
  display: none !important;
}

.dashboard-topbar[data-logged-in="false"] .topbar-logout,
.dashboard-topbar[data-logged-in="false"] .topbar-user-email {
  display: none !important;
}

.dashboard-topbar[data-view-only="false"] .topbar-mode-label {
  display: none !important;
}

.topbar-home-btn[hidden],
.topbar-logout[hidden],
.topbar-mode-label[hidden],
.topbar-user-email[hidden] {
  display: none !important;
}

.topbar-home-btn:hover { color: var(--text); }
.topbar-logout:hover { color: var(--negative); }

.main-content {
  flex: 1; min-width: 0;
  overflow-y: auto; overflow-x: hidden;
}

.panel {
  display: none;
  padding: 28px 32px;
  max-width: 1300px;
  animation: fadeIn 200ms ease;
}
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
.eyebrow, label, .identity-card span, .kpi span, .footer span, th, small {
  margin: 0; color: var(--muted); font-size: 11px;
  line-height: 1.4; text-transform: uppercase; letter-spacing: 0.06em;
}
h1 { font-size: clamp(22px, 2.5vw, 30px); font-weight: 700; color: var(--text); }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }

/* ─── DESIGN SYSTEM: CARDS ──────────────────────────────────────────────── */
/* ds-card — elevated surface; ds-card--hero brightest; ds-card--recess recessed */
.ds-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--elev-1);
}
.ds-card--hero {
  background: linear-gradient(145deg, var(--panel-hero) 0%, var(--panel) 100%);
  border-color: rgba(29, 233, 198, 0.18);
  box-shadow: var(--elev-2);
}
.ds-card--recess {
  background: var(--panel-recess);
  box-shadow: none;
}

/* stat-card — compact KPI tile */
.stat-card {
  display: grid; gap: var(--space-2); padding: var(--space-4);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--panel-2); box-shadow: var(--elev-0);
  transition: border-color 180ms, box-shadow 180ms;
}
.stat-card:hover { border-color: var(--border); box-shadow: var(--elev-1); }
.stat-card strong { font-size: clamp(18px, 2vw, 26px); line-height: 1.05; font-weight: 700; }

/* data-card — chart / analytics panel */
.data-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: var(--space-4) var(--space-5);
  box-shadow: var(--elev-1);
}
.data-card-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* ds-empty — unified empty state */
.ds-empty-state {
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--panel-recess); padding: var(--space-6); margin-bottom: var(--space-3);
}
.ds-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  text-align: center; max-width: 360px; margin: 0 auto;
}
.ds-empty-icon { color: var(--muted-2); opacity: 0.7; }
.ds-empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.ds-empty-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0; }

/* ─── DASHBOARD HERO ────────────────────────────────────────────────────── */
.dashboard-section {
  animation: sectionReveal 420ms cubic-bezier(.22,1,.36,1) backwards;
}
.dashboard-hero { margin-bottom: var(--space-3); animation-delay: 0ms; }
.kpi-strip { animation-delay: 60ms; }
.viz-row { animation-delay: 120ms; }
@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.dashboard-hero { display: grid; gap: var(--space-3); }
.hero-summary {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  position: relative; overflow: hidden;
}
.hero-summary::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 20% 0%, rgba(29,233,198,0.07), transparent 55%);
}
.hero-summary-main {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  position: relative; z-index: 1;
}
.hero-summary-balance { display: grid; gap: var(--space-2); min-width: 0; }
.hero-net-worth { font-size: clamp(28px, 3.5vw, 42px); line-height: 1; font-weight: 700; }
.hero-summary-balance small { font-size: 12px; color: var(--muted); }
.hero-sparkline {
  width: 140px; height: 48px; flex-shrink: 0; opacity: 0.85;
}
.hero-summary-deltas {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
  position: relative; z-index: 1; align-content: center;
}
.stat-chip {
  display: grid; gap: 4px; padding: var(--space-3);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: rgba(6, 11, 10, 0.35);
}
.stat-chip-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-chip strong { font-size: clamp(16px, 1.8vw, 22px); line-height: 1.1; font-weight: 700; }
.stat-chip small { font-size: 10px; color: var(--muted-2); }

.dashboard-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-1); font-size: 12px; color: var(--muted);
}
.meta-item { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.meta-item strong {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
.meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.meta-sep { color: var(--muted-2); user-select: none; }
.meta-item--end { margin-left: auto; }

/* ─── KPI STRIP ─────────────────────────────────────────────────────────── */
.kpi-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* ─── VIZ ROW ───────────────────────────────────────────────────────────── */
.viz-row {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.allocation-chart-wrap {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: center;
}
.allocation-canvas { width: 120px; height: 120px; flex-shrink: 0; }
.allocation-legend { display: grid; gap: 6px; }
.allocation-legend-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
}
.allocation-legend-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.allocation-legend-item strong {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text);
}
.history-canvas { width: 100%; height: 160px; display: block; margin-top: var(--space-2); }

/* Skeleton text shimmer (hero loading) */
.skeleton-text {
  display: inline-block; border-radius: 6px; color: transparent !important;
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
  user-select: none; min-width: 80px;
}
.skeleton-text--hero { min-width: 180px; min-height: 36px; }

/* ─── INCOME OVERVIEW (legacy, kept for client preview compat) ────────────── */
.income-overview {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.income-tile {
  display: grid; gap: 8px; min-height: 126px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; background: var(--panel); position: relative; overflow: hidden;
}
.income-tile::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top left, rgba(29,233,198,0.04), transparent 60%);
}
.income-tile--primary::before {
  background: radial-gradient(ellipse at top left, rgba(29,233,198,0.08), transparent 60%);
}
.tile-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.income-tile strong { font-size: clamp(22px, 2.5vw, 34px); line-height: 1; font-weight: 700; }
.income-tile small { display: flex; gap: 10px; align-items: center; font-size: 11px; }
.alt-value { display: none; color: var(--primary); }
.reveal-alt:hover .alt-value,
.reveal-alt:focus .alt-value,
.reveal-alt.is-alt-visible .alt-value { display: inline; }

/* ─── CONTROL PANEL ──────────────────────────────────────────────────────── */
.control-panel {
  display: grid; gap: 10px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 16px;
}
.wallet-form { display: flex; gap: 10px; align-items: stretch; }
.wallet-form input {
  flex: 1; min-height: 42px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; background: var(--bg); color: var(--text); font-size: 13px;
  font-family: 'JetBrains Mono', monospace; outline: none;
  transition: border-color 150ms;
}
.wallet-form input:focus { border-color: var(--primary); }
.status-line { color: var(--muted); font-size: 12px; min-height: 18px; }
.status-line.negative { color: var(--negative); }
.status-line.warning  { color: var(--warning); }

.load-progress {
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
  position: relative;
}
.load-progress-host { display: block; }
.load-progress-global {
  position: sticky;
  top: 8px;
  z-index: 14;
  margin-top: -2px;
  margin-bottom: 12px;
  height: 5px;
  box-shadow: inset 0 0 0 1px rgba(29, 233, 198, 0.08), 0 0 0 1px rgba(26, 46, 43, 0.55);
}
.load-progress[hidden] { display: none; }
.load-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--positive), var(--primary));
  background-size: 200% 100%;
  transition: width 180ms ease;
  animation: progressShine 1200ms linear infinite;
}
.load-progress.warning .load-progress-bar {
  background: linear-gradient(90deg, var(--warning), var(--primary), var(--warning));
}
.load-progress.negative .load-progress-bar {
  background: linear-gradient(90deg, var(--negative), #ff7a8c, var(--negative));
}
.load-progress.indeterminate .load-progress-bar {
  width: 35%;
  animation: progressSweep 950ms ease-in-out infinite;
}

@keyframes progressShine {
  from { background-position: 0% 0; }
  to { background-position: 200% 0; }
}
@keyframes progressSweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

/* ─── IDENTITY GRID (legacy) ─────────────────────────────────────────────── */
.identity-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 12px;
}
.identity-card {
  display: grid; gap: 6px; padding: 14px;
  border: 1px solid var(--border-soft); border-radius: 8px; background: var(--panel-2);
}
.identity-card strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
}

/* ─── KPI GRID (legacy) ──────────────────────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  display: grid; gap: 8px; padding: 18px; min-height: 118px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--panel-2); position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0;
  transition: opacity 200ms;
}
.kpi:hover::after { opacity: 1; }
.kpi strong { font-size: clamp(20px, 2.2vw, 30px); line-height: 1.05; font-weight: 700; }

/* ─── SUMMARY CARD ───────────────────────────────────────────────────────── */
.summary-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 18px; margin-bottom: 16px;
}
.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.section-heading.tight { align-items: center; }
.bars { display: grid; gap: 9px; margin-top: 16px; }
.bar-row {
  display: grid; grid-template-columns: 150px 1fr 120px;
  gap: 12px; align-items: center; font-size: 12px;
}
.bar-track {
  height: 10px; overflow: hidden; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border-soft);
}
.bar-fill {
  display: block; height: 100%;
  width: var(--width, 0%); margin-left: var(--offset, 0%);
  background: var(--bar-color, var(--primary));
  transition: width 600ms cubic-bezier(.22,1,.36,1);
}

/* ─── PROTOCOL BLOCKS ─────────────────────────────────────────────────────── */
.protocol {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--panel-recess); overflow: hidden; margin-bottom: var(--space-3);
  box-shadow: none;
}
details.protocol[open] > summary { border-bottom: 1px solid var(--border-soft); }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; cursor: pointer;
  transition: background 150ms;
}
summary:hover { background: var(--bg-3); }
summary::-webkit-details-marker { display: none; }
.summary-left {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.summary-left svg { opacity: 0.6; flex-shrink: 0; }
summary strong { font-size: 14px; font-family: 'JetBrains Mono', monospace; }
.summary-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.summary-sub { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.protocol-body { padding: 18px; }
.position-table-block[hidden], .empty-state[hidden] { display: none; }
[data-module][hidden],
[data-identity][hidden],
.wallet-bar[hidden],
.identity-grid[hidden],
.dashboard-meta[hidden] { display: none !important; }
.position-table-block + .position-table-block { margin-top: 24px; }
.gap-top { margin-top: 24px; }

/* ─── TABLES ─────────────────────────────────────────────────────────────── */
.table-toolbar {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: var(--space-2);
}
.dust-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted); cursor: pointer; user-select: none;
}
.dust-toggle input { accent-color: var(--primary); width: 13px; height: 13px; }

.table-wrap {
  margin-top: 10px; overflow-x: auto;
  border: 1px solid var(--border-soft); border-radius: 8px;
}
.table-wrap--sticky thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2);
  box-shadow: 0 1px 0 var(--border-soft);
}
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--border-soft); }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even):not(.total-row):not(.chain-header-row) { background: rgba(16, 26, 24, 0.45); }
tbody tr:hover:not(.chain-header-row) { background: var(--bg-3); }
td { color: #d2e5e0; font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.empty { color: var(--muted); text-align: center; font-family: 'Space Grotesk', sans-serif; }

/* Chain badges */
.chain-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 22px; padding: 0 7px;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif; letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.chain-badge--ethereum { background: rgba(98,126,234,0.15); color: #8fa4f0; border-color: rgba(98,126,234,0.3); }
.chain-badge--base     { background: rgba(0,82,255,0.15); color: #6b9fff; border-color: rgba(0,82,255,0.3); }
.chain-badge--polygon  { background: rgba(130,71,229,0.15); color: #b794f6; border-color: rgba(130,71,229,0.3); }
.chain-badge--arbitrum { background: rgba(40,160,240,0.15); color: #6ec8ff; border-color: rgba(40,160,240,0.3); }
.chain-badge--optimism { background: rgba(255,4,32,0.12); color: #ff8a9a; border-color: rgba(255,4,32,0.25); }
.chain-badge--generic  { background: var(--bg-3); color: var(--muted); border-color: var(--border-soft); }

/* Chain group rows */
.chain-group summary {
  padding: 10px 14px; font-size: 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--border-soft);
}
.chain-group summary strong { font-size: 12px; }
.chain-subtotal-row td {
  background: var(--bg-2) !important;
  font-weight: 600; font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ─── POSITION CARDS (Uniswap) ──────────────────────────────────────────── */
.position-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.position-card {
  padding: 16px; border: 1px solid var(--border-soft); border-radius: 8px;
  background: var(--panel-2); box-shadow: var(--elev-1);
}
.position-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.position-head strong { font-size: 15px; }
.position-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.position-title > div { min-width: 0; }
.position-title small {
  display: block; margin-top: 4px; color: var(--muted); font-size: 11px;
  line-height: 1.45; overflow-wrap: anywhere;
}
.pair-icons { display: flex; flex-shrink: 0; }
.token-badge {
  width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-3);
  color: var(--text); font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.token-badge + .token-badge { margin-left: -8px; }
.lp-total-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 12px 14px;
  border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-2);
}
.lp-total-bar span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.lp-total-bar strong { font-size: 16px; font-family: 'JetBrains Mono', monospace; }
.pill { height: fit-content; border: 1px solid currentColor; border-radius: 999px; padding: 3px 9px; font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric {
  display: grid; gap: 4px; padding: 9px;
  border: 1px solid var(--border-soft); border-radius: 6px; background: var(--bg-2);
}
.metric span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.metric strong { font-size: 12px; overflow-wrap: anywhere; font-family: 'JetBrains Mono', monospace; }
.metric-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-transform: none;
  letter-spacing: normal;
}

/* ─── STATE COLORS ───────────────────────────────────────────────────────── */
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.warning  { color: var(--warning); }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.footer {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  margin-top: 24px; padding-bottom: 24px; color: var(--muted); font-size: 11px;
}
.footer strong { display: block; margin-top: 4px; color: var(--text); font-weight: 400; font-size: 11px; }
#sourceTimestamps { text-align: right; }

/* ─── PANEL HEADER ───────────────────────────────────────────────────────── */
.panel-header { margin-bottom: 28px; }
.panel-subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* ─── ACTIONS PANEL ──────────────────────────────────────────────────────── */
.actions-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.action-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 200ms, background 200ms;
}
.action-card:hover { border-color: rgba(29,233,198,0.3); background: var(--panel-2); }
.action-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.action-icon--supply  { background: rgba(46,204,142,0.15); color: var(--positive); }
.action-icon--borrow  { background: rgba(240,85,106,0.12); color: var(--negative); }
.action-icon--repay   { background: rgba(29,233,198,0.12); color: var(--primary); }
.action-icon--withdraw{ background: rgba(232,184,77,0.12); color: var(--warning); }
.action-icon--lp      { background: rgba(100,149,237,0.12); color: #90b8f0; }
.action-icon--claim   { background: rgba(185,130,240,0.12); color: #d4a8f5; }
.action-card h3 { font-size: 14px; font-weight: 600; }
.action-card p { font-size: 12px; color: var(--muted); line-height: 1.6; flex: 1; }
.action-btn {
  width: 100%; min-height: 36px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 150ms;
}
.action-btn:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
.actions-notice {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: var(--bg-2);
  color: var(--muted); font-size: 12px;
}

/* ─── RESEARCH PANEL ─────────────────────────────────────────────────────── */
.research-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.research-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 20px;
}
.research-card--wide { grid-column: 1 / -1; }
.research-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.research-badge {
  font-size: 10px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; border: 1px solid rgba(29,233,198,0.4);
  color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em;
}
.yield-table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 8px; }
.yield-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.yield-table th, .yield-table td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--border-soft); }
.yield-table th:first-child, .yield-table td:first-child { text-align: left; }
.yield-table tbody tr:last-child td { border-bottom: 0; }
.yield-table tbody tr:hover { background: var(--bg-3); }
.yield-table td { font-size: 13px; color: var(--text); }
.research-note { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }

.risk-pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.risk-low  { background: rgba(46,204,142,0.15); color: var(--positive); }
.risk-med  { background: rgba(232,184,77,0.15); color: var(--warning); }
.risk-high { background: rgba(240,85,106,0.15); color: var(--negative); }

.protocol-health-list { display: flex; flex-direction: column; gap: 10px; }
.health-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border-soft); background: var(--bg-2);
  font-size: 12px;
}
.health-label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health-dot--green { background: var(--positive); box-shadow: 0 0 5px var(--positive); }
.health-dot--yellow { background: var(--warning); }
.health-dot--red    { background: var(--negative); }
.health-value { font-size: 11px; color: var(--positive); font-weight: 600; }

.market-rates-list { display: flex; flex-direction: column; gap: 10px; }
.rate-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border-soft); background: var(--bg-2);
  font-size: 12px; color: var(--muted);
}
.rate-row strong { font-size: 13px; font-family: 'JetBrains Mono', monospace; }

.risk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.risk-item {
  padding: 14px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-2);
}
.risk-item-head { margin-bottom: 8px; }
.risk-item p { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 0; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid, .identity-grid, .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .viz-row { grid-template-columns: 1fr; }
  .hero-summary { grid-template-columns: 1fr; gap: var(--space-4); }
  .income-overview { grid-template-columns: 1fr 1fr; }
  .income-overview .income-tile--primary { grid-column: 1 / -1; }
  .load-progress-global { margin-bottom: 10px; }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 56px; }
  .sidebar-brand, .nav-section-label, .nav-item span,
  .sidebar-section-label, .sidebar-wallet-chip,
  .sidebar-wallet-actions { display: none; }
  .sidebar-logo { justify-content: center; padding: 18px 0; }
  .nav-item { justify-content: center; padding: 0; width: 40px; margin: 0 auto; }
  .sidebar-wallet-info { padding: 12px 8px; }
  .panel { padding: 20px 16px; }
}
@media (max-width: 680px) {
  .income-overview, .kpi-grid, .identity-grid, .kpi-strip, .position-grid,
  .actions-grid, .research-grid, .risk-grid, .explore-grid, .explore-cta { grid-template-columns: 1fr; }
  .hero-summary-deltas { grid-template-columns: 1fr 1fr; }
  .hero-sparkline { width: 100px; height: 40px; }
  .allocation-chart-wrap { grid-template-columns: 1fr; justify-items: center; }
  .research-card--wide { grid-column: 1; }
  .bar-row { grid-template-columns: 100px 1fr 90px; gap: 8px; }
  .intro-address-form { grid-template-columns: 1fr; }
  .panel { padding: 16px 12px; }
}

/* ─── HEALTH FACTOR GAUGE ───────────────────────────────────────────────── */
.hf-gauge {
  margin-top: 6px;
}
.hf-track {
  position: relative;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  overflow: visible;
}
.hf-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 700ms cubic-bezier(.22,1,.36,1), background 400ms;
  background: var(--primary);
}
.hf-fill.warning  { background: var(--warning); }
.hf-fill.negative { background: var(--negative); }

/* Solid liquidation line pinned at left edge (HF = 1.0) */
.hf-liquidation-marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--negative);
  box-shadow: 0 0 6px var(--negative);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  border-radius: 1px;
}

.hf-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 9px;
  color: var(--muted-2);
}
.hf-scale-liq {
  color: var(--negative) !important;
  font-weight: 600;
}

/* ─── TABLE TOTAL ROWS ──────────────────────────────────────────────────── */
tr.total-row td {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
}
.total-label {
  color: var(--muted) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Space Grotesk', sans-serif !important;
}

/* ─── SIDEBAR BOTTOM ─────────────────────────────────────────────────────── */
.sidebar-bottom {
  border-top: 1px solid var(--border-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--bg-2);
  gap: 8px;
}
.sidebar-user[hidden] { display: none !important; }
.sidebar-user-email {
  font-size: 11px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sidebar-logout {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  min-height: 26px;
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
}
.sidebar-logout:hover { color: var(--negative); border-color: transparent; }

.sidebar-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.sidebar-wallet-chip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg-2);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.sidebar-wallet-chip-item .chip-addr {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-size: 10px;
}
.sidebar-wallet-chip-item .chip-label {
  font-size: 9px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chip-remove {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}
.chip-remove:hover { color: var(--negative); background: rgba(240,85,106,0.1); }

.sidebar-exit-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}
.sidebar-exit-btn:hover { color: var(--text); border-color: var(--border); }

/* ─── MULTI-WALLET BAR ────────────────────────────────────────────────────── */
.wallet-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.wallet-bar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wallet-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.wallet-bar-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.wallet-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  transition: border-color 200ms;
}
.wallet-chip-pill:hover { border-color: var(--primary); }
.wallet-chip-pill.active-wallet { border-color: var(--primary); background: var(--primary-dim); }
.wallet-chip-pill .pill-label {
  font-size: 9px;
  color: var(--primary);
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill-remove {
  width: 14px; height: 14px;
  min-height: auto; padding: 0;
  border: none; background: transparent;
  color: var(--muted-2); font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.pill-remove:hover { color: var(--negative); }

.wallet-bar-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wallet-bar-add input {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  width: 200px;
  transition: border-color 150ms;
}
.wallet-bar-add input:focus { border-color: var(--primary); }

/* ─── CLIENT ZONE PANEL ──────────────────────────────────────────────────── */
.cz-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  max-width: 800px;
  margin: 0 auto;
}
.cz-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.cz-card h2 { margin-bottom: 6px; }
.cz-divider-v {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  color: var(--muted-2);
  font-size: 12px;
}
.cz-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}
.cz-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cz-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cz-field input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms;
}
.cz-field input:focus { border-color: var(--primary); }
.cz-status {
  font-size: 12px;
  min-height: 16px;
  color: var(--muted);
}
.cz-status.ok { color: var(--positive); }
.cz-status.err { color: var(--negative); }

.cz-logged-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.cz-logged-header h1 { margin: 0; }
.cz-role-badge { flex-shrink: 0; }

.cz-wallets-section { margin-bottom: 16px; }

.cz-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cz-menu-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.cz-menu-details--inline {
  margin-top: 4px;
  background: transparent;
  border-color: var(--border-soft);
}
.cz-menu-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 150ms, color 150ms;
}
.cz-menu-details--inline > summary {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cz-menu-details > summary::-webkit-details-marker { display: none; }
.cz-menu-details > summary::after {
  content: "›";
  font-size: 16px;
  line-height: 1;
  color: var(--muted-2);
  transform: rotate(90deg);
  transition: transform 180ms, color 150ms;
}
.cz-menu-details[open] > summary::after {
  transform: rotate(-90deg);
  color: var(--primary);
}
.cz-menu-details > summary:hover { background: var(--bg-2); color: var(--text); }
.cz-menu-details[open] > summary {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-2);
}
.cz-menu-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cz-menu-details--inline .cz-menu-body { padding: 10px 12px 12px; }

.cz-form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cz-form-stack input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.cz-form-stack input:focus { border-color: var(--primary); }
.cz-form-stack input[hidden] { display: none; }
.cz-form-stack button { align-self: flex-start; }

.cz-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  margin-bottom: 16px;
}
.cz-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cz-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.cz-wallet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-2);
  font-size: 12px;
}
.cz-wallet-row .cz-addr {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cz-wallet-row .cz-lbl {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.cz-wallet-row .cz-load-btn {
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 5px;
  background: var(--primary-dim);
  border-color: rgba(29,233,198,0.3);
  color: var(--primary);
  white-space: nowrap;
}
.cz-wallet-row .cz-del-btn {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 5px;
  background: transparent;
  border-color: transparent;
  color: var(--muted-2);
}
.cz-wallet-row .cz-del-btn:hover { color: var(--negative); }

.cz-add-wallet-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cz-add-wallet-row input {
  flex: 1;
  min-width: 160px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms;
}
.cz-add-wallet-row input:focus { border-color: var(--primary); }

.cz-client-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.cz-client-row {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
}
.cz-client-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.cz-client-email { flex: 1; font-size: 13px; }
.cz-client-wallets-count { font-size: 11px; color: var(--muted); }
.cz-client-del {
  min-height: 24px; padding: 0 8px; font-size: 11px;
  background: transparent; border-color: transparent; color: var(--muted-2);
}
.cz-client-del:hover { color: var(--negative); }
.cz-client-wallets {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

@media (max-width: 680px) {
  .cz-split { grid-template-columns: 1fr; }
  .cz-divider-v { padding: 12px 0; flex-direction: row; }
  .cz-divider-v::before, .cz-divider-v::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .wallet-bar-header { flex-direction: column; align-items: flex-start; }
  .wallet-bar-add input { width: 100%; }
}

/* ─── CLIENT ZONE SINGLE CARD ───────────────────────────────────────────── */
.cz-single-card {
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 36px;
}
.cz-auth-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 18px 0 16px; padding: 3px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
}
.cz-auth-indicator {
  position: absolute; top: 3px; left: 3px; bottom: 3px;
  width: calc(50% - 3px); border-radius: 7px;
  background: rgba(29,233,198,0.10); border: 1px solid rgba(29,233,198,0.35);
  transition: transform 280ms cubic-bezier(0.16,1,0.3,1);
  z-index: 0;
}
.cz-auth-tabs.code-active .cz-auth-indicator { transform: translateX(100%); }
.cz-auth-tab {
  position: relative; z-index: 1;
  border: 0; background: transparent; color: var(--muted);
  border-radius: 7px; padding: 9px 10px; font: inherit; font-weight: 600;
  font-size: 12px; cursor: pointer; transition: color 180ms;
}
.cz-auth-tab.active { color: var(--text); }
.cz-code-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end;
}
.cz-code-row .cz-field { min-width: 0; }
.cz-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  min-height: auto;
  text-align: left;
  transition: color 150ms;
}
.cz-toggle-btn:hover {
  color: var(--primary);
  border-color: transparent;
}

/* ─── LOADING STATES ────────────────────────────────────────────────────── */
.loading-row {
  text-align: center !important;
  padding: 18px !important;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
}
.loading-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.loading-pulse::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* Skeleton rows for table loading */
.skeleton-row td {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  user-select: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── CLIENT ZONE ADDITIONS ─────────────────────────────────────────────── */
.cz-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cz-settings-block { display: flex; flex-direction: column; gap: 8px; }
.cz-settings-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cz-form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.cz-form-inline input { flex: 1; min-width: 120px; min-height: 36px; border: 1px solid var(--border); border-radius: 7px; padding: 0 10px; background: var(--bg); color: var(--text); font-size: 12px; font-family: inherit; outline: none; }
.cz-form-inline input[hidden] { display: none; }
.cz-form-inline input:focus { border-color: var(--primary); }

.cz-add-client-form { display: flex; flex-direction: column; gap: 0; }
.cz-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.cz-profile-toggles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.cz-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--bg-2);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.cz-toggle:hover { border-color: var(--primary); color: var(--text); }
.cz-toggle input[type=checkbox] { accent-color: var(--primary); width: 13px; height: 13px; }

.cz-premium-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 7px;
  background: rgba(232,184,77,0.08);
  border: 1px solid rgba(232,184,77,0.2);
  color: var(--warning);
  font-size: 12px;
}
.cz-premium-note strong { color: var(--text); }

/* Client row in manage list */
.cz-client-row { border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-2); margin-bottom: 8px; overflow: hidden; }
.cz-client-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.cz-client-head:hover { background: var(--bg-3); }
.cz-client-email { flex: 1; font-size: 13px; }
.cz-client-meta { font-size: 11px; color: var(--muted); }
.cz-client-expand { font-size: 10px; color: var(--muted-2); }
.cz-client-body { padding: 0 14px 14px; display: none; }
.cz-client-body.open { display: block; }

.cz-client-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.cz-client-wallets-section h4 { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin: 0 0 8px; }

.cz-mini-wallet-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--bg); margin-bottom: 5px; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.cz-mini-wallet-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-mini-del { min-height: auto; padding: 2px 6px; font-size: 11px; border: none; background: transparent; color: var(--muted-2); cursor: pointer; }
.cz-mini-del:hover { color: var(--negative); }

.cz-mini-add-row { display: flex; gap: 6px; margin-top: 8px; }
.cz-mini-add-row input { flex: 1; min-height: 30px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; background: var(--bg); color: var(--text); font-size: 11px; font-family: inherit; outline: none; }
.cz-mini-add-row input:focus { border-color: var(--primary); }

.cz-profile-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.cz-profile-mini label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); cursor: pointer; }
.cz-profile-mini input[type=checkbox] { accent-color: var(--primary); }

.cz-client-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); }

@media (max-width: 900px) {
  .cz-settings-grid, .cz-form-row, .cz-client-body-grid { grid-template-columns: 1fr; }
  .cz-profile-toggles { grid-template-columns: repeat(2,1fr); }
}

.cz-role-select {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ─── GEAR / ICON BUTTON ────────────────────────────────────────────────── */
.icon-btn {
  min-height: 36px; width: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--primary); }

/* ─── SETTINGS DRAWER ───────────────────────────────────────────────────── */
.cz-settings-drawer {
  margin-bottom: 16px;
  animation: fadeIn 180ms ease;
}

/* ─── AUM SECTION ───────────────────────────────────────────────────────── */
.cz-aum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.cz-aum-tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-2);
}
.cz-aum-tile span {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.cz-aum-tile strong { font-size: 22px; font-weight: 700; line-height: 1; }

@media (max-width: 900px) {
  .cz-aum-grid { grid-template-columns: repeat(2,1fr); }
}

/* ─── PROFILE EDITOR FIELDS ─────────────────────────────────────────────── */
.cp-field {
  width: 100%; min-height: 34px;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0 10px; background: var(--bg); color: var(--text);
  font-size: 12px; font-family: inherit; outline: none;
  transition: border-color 150ms;
}
.cp-field:focus { border-color: var(--primary); }

/* ─── CLIENT BANNER ──────────────────────────────────────────────────────── */
.client-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px 32px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.client-banner::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top left, rgba(29,233,198,0.06), transparent 60%);
}
.client-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.client-banner h1 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  margin-top: 6px;
}
.client-banner-stats {
  display: flex;
  gap: 32px;
  flex-shrink: 0;
}
.client-stat {
  display: flex; flex-direction: column; gap: 5px;
  text-align: right;
}
.client-stat span {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.client-stat strong { font-size: 22px; font-weight: 700; line-height: 1; }

/* ─── GROWTH CHART ───────────────────────────────────────────────────────── */
.growth-chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px 24px;
  margin-bottom: 16px;
  position: relative;
}
.growth-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.growth-chart-legend {
  display: flex; gap: 16px;
  font-size: 11px; color: var(--muted);
}
.growth-chart-legend span {
  display: flex; align-items: center; gap: 5px;
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.growth-chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(11, 18, 17, 0.96);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.growth-chart-tooltip strong {
  font-size: 11px;
  color: var(--muted);
}
.growth-chart-tooltip span {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ─── CLIENT MODE: hide manager-only chrome ──────────────────────────────── */
body.client-mode .sidebar-wallet-info,
body.client-mode [data-role="manager admin"],
body.client-mode [data-role="admin"] {
  display: none !important;
}
body:not(.client-mode) .nav-item[data-role="client"] {
  display: none !important;
}

/* ─── EXPLORE CRYPTO PANEL ───────────────────────────────────────────────── */
.explore-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin-bottom: 28px;
}
.explore-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.explore-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.explore-icon--fees    { background: rgba(46,204,142,0.15); color: var(--positive); }
.explore-icon--yield   { background: rgba(29,233,198,0.12); color: var(--primary); }
.explore-icon--range   { background: rgba(100,149,237,0.12); color: #90b8f0; }
.explore-icon--onchain { background: rgba(185,130,240,0.12); color: #d4a8f5; }
.explore-card h3 { font-size: 14px; font-weight: 600; }
.explore-card p { font-size: 12px; color: var(--muted); line-height: 1.6; }

.explore-cta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 28px;
}
.explore-cta h2 { font-size: 20px; margin-top: 6px; }
.explore-cta-desc { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.65; text-transform: none; letter-spacing: normal; }
.explore-signup-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--bg-2); padding: 24px;
}
.explore-signup-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }

@media (max-width: 680px) {
  .client-banner-inner { flex-direction: column; align-items: flex-start; }
  .client-banner-stats { flex-direction: column; gap: 12px; text-align: left; }
  .client-stat { text-align: left; }
}

.client-preview-bar[hidden] {
  display: none !important;
}

.client-preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(12, 24, 22, 0.95);
  border-bottom: 1px solid var(--primary);
  font-size: 12px;
  color: var(--muted);
}
.client-preview-bar button {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.client-preview-bar button:hover { border-color: var(--primary); color: var(--primary); }
body:has(.client-preview-bar:not([hidden])) { padding-top: 40px; }

/* ─── MOBILE DASHBOARD (full layout) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: auto;
    bottom: 0;
    z-index: 30;
    border-right: none;
    border-top: 1px solid var(--border);
    order: 2;
    /* clear the iPhone home-indicator so the bottom nav stays tappable */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--panel);
  }

  .dashboard-main {
    order: 1;
    width: 100%;
    flex: 1;
    min-height: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    overflow-x: auto;
    padding: 8px 10px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-section-label,
  .sidebar-spacer,
  .sidebar-section-label,
  .sidebar-wallet-chip,
  .sidebar-wallet-actions,
  .sidebar-user-email,
  .sidebar-logout {
    display: none !important;
  }

  .sidebar-logo {
    display: none;
  }

  .sidebar-bottom {
    display: none;
  }

  .nav-item {
    flex-shrink: 0;
    width: auto;
    min-width: 48px;
    min-height: 44px;
    justify-content: center;
    padding: 0 14px;
  }

  .nav-item span {
    display: none;
  }

  .main-content {
    order: 1;
    width: 100%;
    padding-bottom: 8px;
  }

  .dashboard-topbar {
    order: 0;
    padding: 10px 14px;
  }

  .panel {
    padding: 16px 12px;
    max-width: none;
  }

  .income-overview {
    grid-template-columns: 1fr;
  }

  .income-overview .income-tile--primary {
    grid-column: auto;
  }

  .hero-summary {
    padding: var(--space-4);
  }

  .hero-summary-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-sparkline {
    width: 100%;
    max-width: 200px;
    height: 44px;
  }

  .hero-summary-deltas {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .stat-chip {
    padding: var(--space-2);
  }

  .kpi-grid,
  .identity-grid,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .meta-sep { display: none; }

  .meta-item--end {
    margin-left: 0;
  }

  .wallet-bar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .wallet-bar-add {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .wallet-bar-add input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .wallet-bar-add .primary.small,
  .wallet-bar-add .ghost.small {
    flex: 0 0 auto;
  }

  .table-wrap,
  .position-grid,
  details {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 520px;
  }

  .client-banner {
    padding: 20px 16px;
  }

  .client-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-banner-stats {
    flex-direction: column;
    gap: 12px;
    text-align: left;
    width: 100%;
  }

  .client-stat {
    text-align: left;
  }

  .growth-chart-header {
    flex-direction: column;
    gap: 10px;
  }

  .cz-single-card {
    max-width: none;
    padding: 24px 18px;
  }

  .cz-settings-grid,
  .cz-form-row,
  .cz-client-body-grid,
  .cz-profile-toggles {
    grid-template-columns: 1fr;
  }

  /* iOS Safari auto-zooms (and jumps the layout) on focus of any field under 16px */
  .dashboard-shell input:not([type="checkbox"]):not([type="radio"]),
  .dashboard-shell select,
  .dashboard-shell textarea {
    font-size: 16px;
  }

  /* Roomier tap targets for the compact controls that live on the dashboard */
  .wallet-bar-add input,
  .wallet-bar-add .primary.small,
  .wallet-bar-add .ghost.small,
  .table-toolbar button,
  .dashboard-topbar button {
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .intro-headline { font-size: clamp(27px, 8.5vw, 32px); }
  .intro-sub { max-width: 300px; }

  .bar-row {
    grid-template-columns: 72px 1fr 72px;
    font-size: 11px;
  }

  .income-tile strong {
    font-size: 22px;
  }
}
