/* ============ DashKee — fresh modern look ============ */
/* Design system: deep slate surfaces, indigo accent, Inter + JetBrains Mono,
   glassmorphic cards, soft shadows, rounded everything. Light mode follows.
   All existing class names are preserved so app.js keeps working unchanged. */

/* ---------- tokens ---------- */
:root {
  --bg: #0b0d15;           /* deep slate background */
  --surface: #131722;      /* card surface */
  --surface-hover: #191e2e;
  --surface-raised: #161c29;
  --border: #1f2637;       /* subtle borders */
  --border-soft: #262d41;
  --ring: rgba(99, 102, 241, 0.35);  /* indigo focus ring */
  --text: #e8eaf5;         /* near-white body */
  --text-muted: #94a3b8;   /* slate muted */
  --text-faint: #5b647e;   /* slate faint */
  --accent: #6366f1;       /* indigo */
  --accent-glow: rgba(99, 102, 241, 0.18);
  --success: #22c55e;      /* emerald */
  --success-glow: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;      /* amber */
  --warning-glow: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;       /* rose */
  --danger-glow: rgba(239, 68, 68, 0.12);
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 35px 60px -12px rgba(0, 0, 0, 0.5), 0 10px 15px -3px rgba(0, 0, 0, 0.25);
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- light theme ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-hover: #f1f3f8;
  --surface-raised: #ffffff;
  --border: #d9deea;
  --border-soft: #e4e8f2;
  --ring: rgba(79, 70, 229, 0.25);
  --text: #1e2233;
  --text-muted: #5b647e;
  --text-faint: #8b93a8;
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --success: #15803d;
  --success-glow: rgba(21, 128, 61, 0.12);
  --warning: #b45309;
  --warning-glow: rgba(180, 83, 9, 0.12);
  --danger: #b91c1c;
  --danger-glow: rgba(185, 28, 28, 0.12);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.88em; color: var(--accent); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.right { text-align: right; }
.strong { font-weight: 700; color: var(--text); }
.empty { text-align: center; padding: 24px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: rgba(11, 13, 21, 0.7);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
}
[data-theme="light"] .topbar { background: rgba(247, 248, 251, 0.75); border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px; font-family: var(--mono);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.brand-name { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.2px; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 9.5px; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }
.tabs button {
  border: none; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); padding: 7px 14px; border-radius: 10px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); background: var(--surface-hover); }
.tabs button.active { color: var(--accent); background: var(--accent-glow); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.net-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--success);
  background: var(--success-glow); border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 5px 12px; border-radius: 999px;
}
[data-theme="light"] .net-pill {
  color: var(--success); border-color: rgba(21, 128, 61, 0.25); background: var(--success-glow);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: var(--surface-hover); }
.primary-btn {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  color: #fff; border: none; cursor: pointer;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  padding: 10px 20px; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  transition: transform .05s, filter .15s, box-shadow .15s;
}
.primary-btn:hover { filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(99,102,241,0.25); }
.primary-btn:active { transform: scale(0.97); }
.primary-btn.big { padding: 13px 28px; font-size: 14px; }
.primary-btn.full { width: 100%; margin-top: 10px; }
.primary-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.link-btn {
  border: none; background: none; color: var(--accent);
  font-family: var(--mono); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.x-btn { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 13px; line-height: 1; }
.x-btn:hover { color: var(--danger); }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 26px 28px 64px; }
.page-head { display: flex; align-items: center; gap: 16px; margin: 2px 0 24px; }
.page-head h1 { margin: 0; font-size: 20px; color: var(--text); font-family: var(--mono); letter-spacing: -0.4px; font-weight: 700; }
.sub-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 14px; }
.sub-head h2 { margin: 0; font-size: 13.5px; color: var(--text-muted); font-family: var(--mono); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--border-soft); }
.card-pad { padding: 8px 2px; }
.panel-title { font-size: 11px; font-weight: 700; color: var(--text-muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.8px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 110px 20px 80px; }
.empty-icon { font-size: 56px; margin-bottom: 24px; opacity: 0.85; }
.empty-state h1 { font-size: 28px; color: var(--text); font-family: var(--mono); letter-spacing: -0.5px; margin: 0 0 12px; font-weight: 800; }
.empty-state p { max-width: 560px; margin: 0 auto 30px; line-height: 1.7; color: var(--text-muted); font-size: 14.5px; }

/* ---------- connect modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 11, 20, 0.55); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
[data-theme="light"] .modal { background: rgba(31, 36, 64, 0.3); }
.modal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 820px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 28px 32px;
}
[data-theme="light"] .modal-card { box-shadow: 0 24px 60px rgba(31,36,64,0.16); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h2 { margin: 0; font-size: 19px; color: var(--text); font-family: var(--mono); font-weight: 800; letter-spacing: -0.3px; }
.modal-body > .muted { margin-top: 0; line-height: 1.65; font-size: 13.5px; }
.connect-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.method-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 22px; background: var(--surface);
  transition: border-color .15s, transform .15s;
}
.method-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.method-card h3 { margin: 0 0 8px; font-size: 14px; color: var(--text); font-family: var(--mono); font-weight: 700; }
.method-card p { margin: 0 0 14px; line-height: 1.6; color: var(--text-muted); font-size: 13px; }
.method-card textarea, .method-card input[type="password"] {
  width: 100%; border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 14px; font-family: var(--mono); font-size: 13px; outline: none;
  background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.method-card textarea:focus, .method-card input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring);
}
.seed-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.seed-row select { border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; background: var(--bg); color: var(--text); font-size: 12.5px; font-family: var(--mono); cursor: pointer; }
.seed-results { margin-top: 16px; }
.seed-list {
  max-height: 220px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg);
}
.seed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft);
  cursor: pointer; font-size: 12.5px; color: var(--text); transition: background .1s;
}
.seed-item:last-child { border-bottom: none; }
.seed-item:hover { background: var(--surface-hover); }
.seed-item .right { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.seed-item.exists { background: var(--success-glow); border-color: rgba(34,197,94,0.25); }
.security-note {
  margin-top: 18px; padding: 14px 18px; border-radius: 12px;
  background: var(--accent-glow); border: 1px solid rgba(99,102,241,0.25);
  line-height: 1.65; font-size: 12.5px; color: var(--text-muted);
}

/* ---------- overview ---------- */
.hero-row { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; margin-bottom: 20px; }
.hero-card {
  background: linear-gradient(135deg, rgba(15,18,35,0.6), rgba(25,30,46,0.45));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 28px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 600px at 110% -10%, rgba(99,102,241,0.12), transparent 60%);
  pointer-events: none;
}
.hero-label { font-size: 10.5px; color: var(--text-muted); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--mono); }
.hero-value { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; margin: 10px 0 6px; font-variant-numeric: tabular-nums; color: var(--text); font-family: var(--mono); }
.hero-sub { color: var(--text-muted); font-size: 13px; font-family: var(--mono); line-height: 1.5; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.kta-line {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface-hover); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 11px 14px; margin-top: 10px;
}
.kta-name { font-weight: 700; font-size: 13.5px; color: var(--text); font-family: var(--mono); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; position: relative; z-index: 1; }
.alloc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
#chart-alloc { height: 210px; }
.empty-noline { text-align: center; padding-top: 80px; font-size: 13px; color: var(--text-muted); }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.mini-assets, .mini-accounts { display: flex; flex-direction: column; gap: 8px; }
.mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border-soft);
}
.mini-row:last-child { border-bottom: none; }
.mini-main { flex: 1; min-width: 0; }
.mini-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.mini-num { text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--text-muted); font-family: var(--mono); }

/* ---------- icons ---------- */
.asset-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13.5px; color: #10131c; flex-shrink: 0;
  background: var(--surface-hover); color: var(--text);
  border: 1px solid var(--border); overflow: hidden; font-family: var(--mono);
}
.asset-ico img { width: 100%; height: 100%; object-fit: cover; }
.asset-ico.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.kta-bg { background: rgba(99,102,241,0.12); color: var(--accent); border-color: rgba(99,102,241,0.3); }
.usd-bg { background: rgba(34,197,94,0.12); color: var(--success); border-color: rgba(34,197,94,0.3); }
.st-bg { background: rgba(245,158,11,0.12); color: var(--warning); border-color: rgba(245,158,11,0.3); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
table.bank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bank-table thead th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); font-weight: 800; padding: 12px 12px; font-family: var(--mono);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
  z-index: 2;
}
table.bank-table tbody td {
  padding: 13px 12px; border-bottom: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums; vertical-align: middle; color: var(--text);
}
table.bank-table tbody tr { transition: background .1s; }
table.bank-table tbody tr:hover { background: var(--surface-hover); }
.assets-table .asset-cell { display: flex; align-items: center; gap: 12px; }
.bar-row { width: 92px; height: 7px; background: var(--border-soft); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar { height: 100%; border-radius: 4px; }

/* op/activity */
.op-cell { display: flex; align-items: center; gap: 11px; }
.op-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.op-out { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.op-in { background: var(--success); box-shadow: 0 0 10px var(--success); }
.op-info { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tag {
  display: inline-block; font-size: 10px; font-weight: 800; padding: 2.5px 8px;
  border-radius: 7px; margin: 1px 4px 1px 0; font-family: var(--mono); letter-spacing: 0.4px;
}
.tag-out { background: var(--danger-glow); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.tag-in { background: var(--success-glow); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.tag-info { background: rgba(99,102,241,0.12); color: var(--accent); border: 1px solid rgba(99,102,241,0.2); }
.tag-owner { background: var(--success-glow); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.tag-managed { background: var(--warning-glow); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.tag-savings {
  background: var(--success-glow); color: var(--success);
  font-size: 9px; padding: 2px 7px; border-radius: 6px;
  font-weight: 800; letter-spacing: 0.5px; margin-right: 6px; vertical-align: 1px;
  border: 1px solid rgba(34,197,94,0.2);
}
.chip { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(99,102,241,0.12); color: var(--accent); font-family: var(--mono); border: 1px solid rgba(99,102,241,0.2); }
.chip.live-chip { background: var(--success-glow); color: var(--success); border-color: rgba(34,197,94,0.2); }

/* ---------- accounts ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.account-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.account-card:hover { transform: translateY(-2px); border-color: var(--border-soft); box-shadow: var(--shadow); }
.account-card.storage { border-left: 3px solid var(--warning); }
.account-card.savings {
  border-left: 3px solid var(--success);
  background: linear-gradient(180deg, rgba(34,197,94,0.07), transparent 45%), var(--surface);
}
.account-card.bank-card {
  border-left: 3px solid #a855f7;
  background: linear-gradient(180deg, rgba(168,85,247,0.06), transparent 45%), var(--surface);
}
.account-card.verified { border-left: 3px solid var(--accent); }
[data-theme="light"] .account-card.savings { background: linear-gradient(180deg, rgba(21,128,61,0.06), transparent 45%), var(--surface); }
[data-theme="light"] .account-card.bank-card { background: linear-gradient(180deg, rgba(124,77,196,0.05), transparent 45%), var(--surface); }
[data-theme="light"] .account-card.storage { border-left: 3px solid var(--warning); }
[data-theme="light"] .account-card.savings { border-left: 3px solid var(--success); }
[data-theme="light"] .account-card.bank-card { border-left: 3px solid #7c3aed; }
[data-theme="light"] .account-card.verified { border-left: 3px solid var(--accent); }
.acc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acc-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--text); }
.acc-name .sub { display: block; font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); margin-top: 4px; }
.acc-total { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px; font-variant-numeric: tabular-nums; color: var(--text); font-family: var(--mono); }
.acc-bals { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; background: var(--surface-hover);
  border: 1px solid var(--border-soft); padding: 5px 11px; border-radius: 999px;
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-family: var(--mono);
  transition: all .1s;
}
.chip-item:hover { border-color: var(--accent); color: var(--text); }
.chip-item.usd-chip { background: var(--success-glow); border-color: rgba(34,197,94,0.25); color: var(--success); }
.acc-foot { border-top: 1px dashed var(--border-soft); padding-top: 10px; color: var(--text-muted); font-size: 12px; }
.perm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.storage-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warning-glow); border: 1px solid rgba(245,158,11,0.22);
  border-radius: 12px; padding: 14px 18px; margin: 14px 0 18px;
  font-size: 13px; line-height: 1.65; color: var(--text);
}
[data-theme="light"] .storage-note { background: var(--warning-glow); border-color: rgba(180,83,9,0.22); }
.storage-note .icon { flex-shrink: 0; font-size: 17px; }
details.empty-storage { margin: 12px 0 0; }
details.empty-storage summary {
  cursor: pointer; color: var(--text-muted); font-size: 12.5px; font-family: var(--mono);
  padding: 9px 0; list-style: none; font-weight: 600;
}
details.empty-storage summary:hover { color: var(--accent); }
details.empty-storage summary::before { content: '▸ '; color: var(--accent); font-weight: 700; margin-right: 4px; }
details.empty-storage[open] summary::before { content: '▾ '; }
.empty-storage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; margin-top: 10px; }
.empty-storage-item {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: var(--surface-hover); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 12px; font-size: 11.5px; color: var(--text-muted);
}

/* ---------- network tab ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.card.stat .stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--text-faint); font-weight: 800; margin-bottom: 10px; font-family: var(--mono); }
.card.stat .stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--text); font-family: var(--mono); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.feed-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.chart { width: 100%; height: 250px; }
.side-col { display: flex; flex-direction: column; gap: 14px; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-right: 8px; box-shadow: 0 0 10px var(--success); }
.live-dot.on { background: var(--success); animation: pulse 2s infinite; }
.live-dot.err { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); } 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.net-status-inline { display: inline-flex; align-items: center; font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.kv > div:last-child { border-bottom: none; }
.kv dt { color: var(--text-muted); flex-shrink: 0; font-size: 12.5px; }
.kv dd { margin: 0; text-align: right; word-break: break-all; font-size: 12px; font-family: var(--mono); color: var(--text); }
.stable-note { margin-top: 14px; line-height: 1.7; font-size: 13px; color: var(--text-muted); }

/* ---------- footer & toast ---------- */
footer { border-top: 1px solid var(--border-soft); padding: 20px 28px; font-size: 12px; color: var(--text-muted); background: var(--surface); margin-top: 30px; }
.foot-inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 20px; font-size: 13px;
  box-shadow: var(--shadow-lg); z-index: 200;
  animation: toastIn 200ms cubic-bezier(0.4,0,0.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-row, .ov-grid, .chart-grid, .feed-grid, .connect-methods { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .tabs { order: 3; min-width: 100%; overflow-x: auto; padding-bottom: 4px; }
  main { padding: 18px 14px 40px; }
}
@media (max-width: 640px) {
  main { padding: 12px 10px 28px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand-sub { display: none; }
  .top-actions { margin-left: auto; gap: 8px; }
  .hero-value { font-size: 30px; }
  .card { padding: 14px; border-radius: 14px; }
  .page-head h1 { font-size: 19px; }
  .tabs button { padding: 9px 12px; font-size: 12px; }
  .primary-btn, .mini-btn { min-height: 42px; }
  .table-wrap, .table-x { overflow-x: auto; max-height: none; }
  .table-x table { min-width: 640px; }
  .modal-card { padding: 20px; }
  .connect-methods { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  footer { padding: 16px 12px; }
}

/* ---------- portfolio history (assets tab) ---------- */
.pl-card { margin-bottom: 14px; }
.pl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pl-title { font-weight: 700; color: var(--text); font-size: 15px; min-width: 0; }
.pl-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.mini-btn {
  border: 1px solid var(--border); background: var(--surface-hover); color: var(--text);
  font-size: 11.5px; font-weight: 700; padding: 7px 14px; border-radius: 10px; cursor: pointer;
  font-family: var(--mono); transition: all .15s;
}
.mini-btn:hover { background: var(--card); color: var(--accent); border-color: var(--accent); }
.mini-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.pl-stats { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.pl-big { font-size: 27px; font-weight: 800; color: var(--text); font-family: var(--mono); }
.pl-chg { font-size: 13px; font-weight: 800; font-family: var(--mono); }
.pl-chart { height: 200px; margin-top: 10px; }

/* ---------- historical P&L ---------- */
.pl-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pl-range select, .pl-range input[type="date"] {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--mono); font-size: 12px; padding: 7px 11px; border-radius: 10px;
}
.pl-range select:focus, .pl-range input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.hpl-table { font-size: 12.5px; margin-top: 12px; }
.hpl-charts { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; margin-top: 16px; }
.pl-chart.tall { height: 235px; }
.hpl-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.hpl-stat { background: var(--surface-hover); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 16px; min-width: 0; }
@media (max-width: 980px) {
  .hpl-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hpl-stats-grid { grid-template-columns: 1fr; }
  .hpl-stat { padding: 10px 14px; }
  .hpl-stat-val { font-size: 17px; }
}
.hpl-stat-val { font-size: 19px; font-weight: 800; font-family: var(--mono); color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hpl-group td { background: var(--surface-hover); color: var(--text); font-weight: 800; font-size: 12px; padding: 9px 11px; }

/* ---------- collapsible account sections ---------- */
.acc-section {
  margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.acc-section > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; cursor: pointer; user-select: none;
  background: linear-gradient(180deg, var(--surface-hover), var(--surface));
  list-style: none; font-weight: 700; font-size: 13.5px; color: var(--text); font-family: var(--mono);
}
.acc-section > summary::-webkit-details-marker { display: none; }
.acc-section > summary:hover { background: var(--surface-hover); color: var(--accent); }
.acc-section > summary .sec-title { font-weight: 800; color: var(--text); font-size: 13.5px; }
.acc-section > summary .chev {
  margin-left: auto; color: var(--text-faint); transition: transform 0.18s ease; font-size: 11px;
}
.acc-section[open] > summary .chev { transform: rotate(180deg); }
.acc-section > *:not(summary) { margin-left: 20px; margin-right: 20px; }
.acc-section > *:last-child { margin-bottom: 16px; }
.sec-desc { margin-top: 10px; color: var(--text-muted); font-size: 12.5px; line-height: 1.6; }

/* ---------- identity + banking ---------- */
.id-line { font-size: 12.5px; margin-top: 8px; }
.id-line.ok { color: var(--success); font-weight: 700; }
.bank-bg { background: rgba(168,85,247,0.12); color: #a855f7; }
.bank-note { margin: 10px 0 8px; line-height: 1.6; font-size: 12.5px; color: var(--text-muted); }
.bank-fetch-row { display: flex; gap: 10px; align-items: stretch; }
.bank-seed {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 14px; font-family: var(--mono); font-size: 16px; outline: none;
  background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.bank-seed:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.bank-fetch-btn { white-space: nowrap; height: 46px; }
.bank-status { margin-top: 8px; }
.bank-err { color: var(--danger); font-size: 12.5px; margin: 8px 0; line-height: 1.5; }
.bank-row { margin: 10px 0; padding: 12px; background: var(--surface-hover); border: 1px solid var(--border-soft); border-radius: 11px; }
.bank-fields { display: flex; gap: 24px; flex-wrap: wrap; }
.bank-field .bank-val { font-size: 15px; margin-top: 3px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bank-reveal { margin-left: 8px; }
.bank-meta { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.bank-locked { margin: 10px 0 6px; line-height: 1.6; padding: 12px 16px; background: var(--surface-hover); border: 1px dashed var(--border-soft); border-radius: 11px; color: var(--text-muted); }
.bank-owner-toggle summary { cursor: pointer; padding: 7px 0; user-select: none; color: var(--accent); font-size: 12.5px; font-weight: 700; font-family: var(--mono); }
.bank-owner-toggle summary:hover { color: var(--text); }

/* ---------- security guarantees box ---------- */
.sec-box {
  margin: 10px 0 14px; padding: 12px 16px; border-radius: 11px;
  background: var(--surface-hover); border: 1px dashed var(--border-soft); font-size: 12.5px;
}
.sec-box summary { cursor: pointer; color: var(--accent); font-weight: 700; user-select: none; font-family: var(--mono); }
.sec-box summary:hover { color: var(--text); }
.sec-list { margin: 9px 0 5px; padding-left: 20px; line-height: 1.7; color: var(--text-muted); font-size: 12.5px; }
.sec-list b { color: var(--text); }
.sec-list code { font-family: var(--mono); font-size: 11px; color: var(--accent); }
