/* ============ TOKENS ============ */
.lockable.is-locked { opacity: 0.72; }
.lockable.is-locked input, .lockable.is-locked textarea, .lockable.is-locked select, .lockable.is-locked button, .lockable.is-locked .select, .lockable.is-locked .chk { cursor: not-allowed !important; filter: saturate(0.6); }
.lockable.is-locked .btn.primary { background: var(--bg-3) !important; color: var(--fg-2) !important; border-color: var(--line-1) !important; }
.lockable.is-locked label[style*="cursor: pointer"] { pointer-events: none; }
:root {
  --bg-0: #07070a;
  --bg-1: #0b0b10;
  --bg-2: #101016;
  --bg-3: #15151d;
  --bg-4: #1b1b25;
  --bg-hover: #1e1e28;

  --line-1: rgba(255, 255, 255, 0.055);
  --line-2: rgba(255, 255, 255, 0.095);
  --line-3: rgba(255, 255, 255, 0.14);

  --fg-0: #f4f4f7;
  --fg-1: #d9d9df;
  --fg-2: #9a9aa6;
  --fg-3: #6a6a77;
  --fg-4: #45454f;

  --accent-h: 75;
  --accent: oklch(78% 0.15 var(--accent-h));
  --accent-dim: oklch(78% 0.15 var(--accent-h) / 0.14);
  --accent-line: oklch(78% 0.15 var(--accent-h) / 0.45);

  --ok: oklch(74% 0.14 155);
  --ok-dim: oklch(74% 0.14 155 / 0.14);
  --warn: oklch(80% 0.14 70);
  --warn-dim: oklch(80% 0.14 70 / 0.14);
  --err: oklch(68% 0.2 25);
  --err-dim: oklch(68% 0.2 25 / 0.14);
  --info: oklch(72% 0.12 230);
  --info-dim: oklch(72% 0.12 230 / 0.14);
  --purple: oklch(72% 0.15 300);
  --purple-dim: oklch(72% 0.15 300 / 0.14);

  --row-h: 36px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow-lift: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.4);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px var(--line-2);
}

:root[data-theme="light"] {
  --bg-0: #f4f4f7;
  --bg-1: #ffffff;
  --bg-2: #fafafc;
  --bg-3: #eeeef2;
  --bg-4: #e4e4ea;
  --bg-hover: #e8e8ee;

  --line-1: rgba(0, 0, 0, 0.07);
  --line-2: rgba(0, 0, 0, 0.11);
  --line-3: rgba(0, 0, 0, 0.18);

  --fg-0: #0d0d12;
  --fg-1: #2a2a33;
  --fg-2: #5a5a66;
  --fg-3: #7a7a85;
  --fg-4: #a0a0aa;

  --shadow-lift: 0 1px 0 rgba(255,255,255,0.6) inset, 0 6px 18px rgba(15,15,30,0.07);
  --shadow-modal: 0 20px 60px rgba(15,15,30,0.18), 0 0 0 1px var(--line-2);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); }
:root[data-theme="light"] .backdrop { background: rgba(15,15,30,0.32); }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}
#root { height: 100vh; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); border: 2px solid transparent; background-clip: padding-box; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-rows: 32px 1fr;
  height: 100vh;
  background: var(--bg-0);
}
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 0 0 12px;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-1);
  -webkit-app-region: drag;
  user-select: none;
  font-size: 12px;
}
.titlebar-left {
  display: flex; align-items: center; gap: 8px;
  color: var(--fg-1); font-weight: 500;
}
.titlebar-left .logo {
  width: 18px; height: 18px; display: grid; place-items: center;
  color: var(--accent);
}
.titlebar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  color: var(--fg-3); font-size: 11px; font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.titlebar-right { display: flex; -webkit-app-region: no-drag; }
.titlebar-btn {
  width: 46px; height: 32px; display: grid; place-items: center;
  color: var(--fg-2);
  transition: background 0.12s;
}
.titlebar-btn:hover { background: var(--bg-3); color: var(--fg-0); }
.titlebar-btn.close:hover { background: var(--err); color: white; }

@property --sidebar-w {
  syntax: '<length>';
  inherits: true;
  initial-value: 220px;
}
.shell {
  --sidebar-w: 220px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
  transition: --sidebar-w 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.shell[data-collapsed="true"] { --sidebar-w: 52px; }

/* ============ SIDEBAR ============ */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border-right: 1px solid var(--line-1);
  overflow: hidden;
}
.sidebar-top {
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-toggle {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-3);
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
  transition:
    background 0.12s, color 0.12s,
    padding 220ms cubic-bezier(0.4, 0, 0.2, 1),
    gap 220ms cubic-bezier(0.4, 0, 0.2, 1),
    justify-content 220ms;
}
.sidebar-toggle:hover { background: var(--bg-3); color: var(--fg-1); }
.shell[data-collapsed="true"] .sidebar-toggle {
  justify-content: center;
  padding: 0;
  gap: 0;
}
.sidebar-label {
  padding: 14px 16px 6px; font-size: 10px; color: var(--fg-4);
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
  white-space: nowrap; overflow: hidden;
  transition: opacity 160ms ease, height 220ms ease, padding 220ms ease;
}
.shell[data-collapsed="true"] .sidebar-label {
  opacity: 0; height: 10px; padding: 6px 0 0; pointer-events: none;
}
.navitem {
  display: flex; align-items: center; gap: 11px;
  height: 34px; padding: 0 10px; margin: 0 4px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: 13px; font-weight: 500;
  transition:
    background 0.1s, color 0.1s,
    padding 220ms cubic-bezier(0.4, 0, 0.2, 1),
    gap 220ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  white-space: nowrap;
}
.navitem .ni-label,
.navitem .ni-badge {
  max-width: 200px;
  min-width: 0;
  overflow: hidden;
  transition:
    opacity 140ms ease,
    max-width 220ms cubic-bezier(0.4, 0, 0.2, 1),
    margin 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.navitem .ni-icon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; }
.navitem:hover { background: var(--bg-3); color: var(--fg-0); }
.navitem.active { background: var(--bg-3); color: var(--fg-0); }
.navitem.active::before {
  content: ""; position: absolute; left: -4px; top: 6px; bottom: 6px; width: 2px;
  background: var(--accent); border-radius: 2px;
}
.navitem .ni-badge {
  margin-left: auto; background: var(--bg-4); color: var(--fg-2);
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 6px; border-radius: 4px;
}
.shell[data-collapsed="true"] .navitem {
  justify-content: center;
  padding: 0;
  gap: 0;
}
.shell[data-collapsed="true"] .navitem .ni-label,
.shell[data-collapsed="true"] .navitem .ni-badge {
  position: absolute;
  left: 0; right: 0;
  opacity: 0;
  max-width: 0;
  width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 0;
  pointer-events: none;
}

.sidebar-sep { height: 1px; background: var(--line-1); margin: 8px 12px; }
.sidebar-bottom {
  margin-top: auto; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line-1);
}
.license {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--fg-2);
}
.license .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px oklch(74% 0.14 155 / 0.2);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px oklch(74% 0.14 155 / 0.2); }
  50% { box-shadow: 0 0 0 5px oklch(74% 0.14 155 / 0.08); }
}
.rpc-dots { display: flex; gap: 4px; align-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); }
.rpc-dots .d { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.rpc-dots .d.warn { background: var(--warn); }
.rpc-dots .d.err { background: var(--err); }
.rpc-dots .d.off { background: var(--fg-4); }
.license span:not(.dot),
.rpc-dots .rpc-label {
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  transition:
    opacity 140ms ease,
    max-width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.shell[data-collapsed="true"] .license span:not(.dot),
.shell[data-collapsed="true"] .rpc-dots .rpc-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}
/* Center indicators in the narrow column and drop the gap that would
   otherwise leave an awkward 8px hole next to the collapsed labels. */
.shell[data-collapsed="true"] .license,
.shell[data-collapsed="true"] .rpc-dots {
  justify-content: center;
  gap: 3px;
}

/* ============ MAIN ============ */
.main {
  overflow: auto;
  min-width: 0;
  background:
    radial-gradient(1200px 400px at 20% -10%, oklch(78% 0.15 var(--accent-h) / 0.035), transparent 60%),
    var(--bg-0);
}
.page {
  max-width: 1600px;
  padding: 24px 32px 48px;
  min-width: 0;
  box-sizing: border-box;
}
.page:has(> .ll-root) {
  max-width: none;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--fg-0); margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.page-sub { color: var(--fg-3); font-size: 12px; margin-top: 4px; }
.crumb {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-4);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
}

/* ============ CARD ============ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line-1);
}
.card-title { font-weight: 600; font-size: 13px; color: var(--fg-0); display:flex;align-items:center;gap:8px; }
.card-desc { color: var(--fg-3); font-size: 11px; margin-top: 2px; }
.card-body { padding: 14px 18px; min-width: 0; }
.card-body.flush { padding: 0; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg-1);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-3); color: var(--fg-0); }
.btn.primary {
  background: var(--accent);
  color: #16140a;
  border-color: transparent;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--fg-0); }
.btn.danger { color: var(--err); border-color: var(--err-dim); }
.btn.danger:hover { background: var(--err-dim); border-color: var(--err); color: #fff; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 11px; }
.btn-xs { height: 22px; padding: 0 8px; font-size: 10px; gap: 4px; display: inline-flex; align-items: center; background: oklch(20% 0 0 / 0.8); border: 1px solid var(--line-2); color: var(--fg-1); border-radius: 4px; font-weight: 500; cursor: pointer; backdrop-filter: blur(8px); }
.btn-xs:hover { background: var(--bg-3); color: var(--fg-0); border-color: var(--line-3, var(--line-2)); }
.btn-xs.danger { color: var(--err); border-color: var(--err-dim); }
.btn-xs.danger:hover { background: var(--err-dim); color: #fff; }

/* media dropzone */
.media-drop {
  position: relative; width: 100%;
  border: 1.5px dashed var(--line-2); border-radius: 8px;
  background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  padding: 24px;
  text-align: center;
}

/* wallet picker */
.wpicker { position: relative; }
.wpicker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wpicker-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  width: max(420px, 100%);
  display: grid; grid-template-columns: 180px 1fr;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: 0 12px 40px oklch(0% 0 0 / 0.4);
  overflow: hidden;
  max-height: 340px;
}
.wpicker-pane { display: flex; flex-direction: column; min-height: 0; }
.wpicker-folders { border-right: 1px solid var(--line-1); background: var(--bg-2); }
.wpicker-pane-head {
  padding: 10px 12px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
  border-bottom: 1px solid var(--line-1);
}
.wpicker-wallets .wpicker-pane-head { padding: 8px 10px; }
.wpicker-list { flex: 1; overflow-y: auto; padding: 4px; }
.wpicker .wpicker-row {
  display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 10px;
  border-radius: 5px; cursor: pointer;
  font-size: 12px; color: var(--fg-1);
  transition: background 0.1s;
}
.wpicker .wpicker-row:hover { background: var(--bg-3); }
.wpicker .wpicker-row.is-active { background: var(--bg-3); color: var(--fg-0); }
.wpicker .wpicker-wrow.is-selected { background: oklch(22% 0.05 var(--accent-h, 155) / 0.4); color: var(--fg-0); }
.wpicker .wpicker-row > span { display: inline-flex; align-items: center; }
.media-drop:hover { border-color: var(--accent); background: oklch(18% 0.01 250); }
.media-drop.is-drag { border-color: var(--accent); border-style: solid; background: oklch(22% 0.05 var(--accent-h, 155) / 0.3); }
.media-drop-icon { color: var(--fg-3); margin-bottom: 4px; }
.media-drop:hover .media-drop-icon { color: var(--accent); }
.media-drop-title { font-size: 13px; font-weight: 600; color: var(--fg-1); }
.media-drop-sub { font-size: 11px; color: var(--fg-3); }
.media-drop-sub .link { color: var(--accent); cursor: pointer; }
.media-drop-sub .link:hover { text-decoration: underline; }
.media-drop-url { display: flex; gap: 8px; width: 100%; max-width: 360px; align-items: center; }

.media-preview {
  position: relative; width: 100%; border-radius: 8px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line-2);
}
.media-preview-asset { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-preview-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px;
  background: linear-gradient(to bottom, oklch(0% 0 0 / 0.5) 0%, transparent 30%, transparent 70%, oklch(0% 0 0 / 0.7) 100%);
  opacity: 0; transition: opacity 0.15s;
}
.media-preview:hover .media-preview-overlay { opacity: 1; }
.media-preview-meta { display: flex; align-items: center; gap: 8px; }
.media-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  background: oklch(0% 0 0 / 0.7); color: var(--fg-0);
  padding: 2px 6px; border-radius: 3px;
  font-family: var(--font-mono); backdrop-filter: blur(6px);
}
.btn.lg { height: 36px; padding: 0 16px; font-size: 13px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.icon-btn {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--fg-3);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg-0); }
.icon-btn.danger:hover { background: var(--err-dim); color: var(--err); }

/* ============ INPUT ============ */
.input, .select {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--fg-0); font-size: 12px;
  transition: border-color 0.12s, background 0.12s;
  width: 100%;
}
.input:focus-within, .select:focus-within { border-color: var(--accent-line); background: var(--bg-3); }
.select select option, .input select option { background: var(--bg-2); color: var(--fg-0); }
.input input { flex: 1; width: 100%; background: none; border: 0; outline: 0; color: inherit; }
.input input::placeholder, textarea::placeholder { color: var(--fg-4); }
.input .lead { color: var(--fg-3); }
.input.mono input { font-family: var(--font-mono); }
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; color: var(--fg-2); font-weight: 500; }
.field-hint { font-size: 10px; color: var(--fg-4); font-family: var(--font-mono); }

/* segmented control */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.segmented button {
  height: 24px; padding: 0 12px; font-size: 11px; color: var(--fg-2); border-radius: 4px;
  font-weight: 500;
}
.segmented button:hover { color: var(--fg-0); }

/* compact segmented for inline form rows */
.seg {
  display: inline-flex; padding: 2px; gap: 1px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 5px;
}
.seg-btn {
  height: 22px; padding: 0 9px; font-size: 10px; color: var(--fg-3);
  font-weight: 600; letter-spacing: 0.04em;
  background: transparent; border: 0; border-radius: 3px;
  font-family: var(--font-mono); cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.seg-btn:hover { color: var(--fg-1); }
.seg-btn.is-active { background: var(--bg-4, var(--bg-3)); color: var(--fg-0); }
.navitem.launched {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  padding: 6px 8px;
  height: 26px;
}
.sidebar-tlist {
  display: flex; flex-direction: column; gap: 1px;
  padding: 0 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
.sidebar-tlist::-webkit-scrollbar { width: 6px; }
.sidebar-tlist::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 3px; }
.sidebar-tlist::-webkit-scrollbar-track { background: transparent; }
.sidebar-tlist-collapsed {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 4px; align-items: center;
  max-height: 260px; overflow-y: auto;
  scrollbar-width: thin;
}

/* big tabs */
.tabs-pill {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius);
  margin-bottom: 16px;
}
.tabs-pill button {
  flex: 1; height: 34px; font-size: 12px; color: var(--fg-2); border-radius: 6px;
  font-weight: 500; transition: background 0.12s, color 0.12s;
}
.tabs-pill button:hover { color: var(--fg-0); }
.tabs-pill button[data-active="true"] {
  background: var(--bg-3); color: var(--fg-0);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.tabs-under {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line-1); margin-bottom: 16px;
}
.tabs-under button {
  height: 34px; padding: 0 14px; font-size: 12px; color: var(--fg-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs-under button:hover { color: var(--fg-0); }
.tabs-under button[data-active="true"] {
  color: var(--fg-0); border-bottom-color: var(--accent);
}

/* ============ BADGES / PILLS / TAGS ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 18px; padding: 0 7px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  font-family: var(--font-mono);
}
.badge.ok { background: var(--ok-dim); color: var(--ok); }
.badge.warn { background: var(--warn-dim); color: var(--warn); }
.badge.err { background: var(--err-dim); color: var(--err); }
.badge.info { background: var(--info-dim); color: var(--info); }
.badge.accent { background: var(--accent-dim); color: var(--accent); }
.badge.purple { background: var(--purple-dim); color: var(--purple); }
.badge.neutral { background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line-1); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: 10px;
  font-size: 10px; font-weight: 500;
  background: var(--bg-3); color: var(--fg-1);
  border: 1px solid var(--line-1);
  white-space: nowrap; flex-shrink: 0; flex: none;
  width: max-content;
}
.tag.accent { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-line); }
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--fg-1); font-family: var(--font-mono);
  text-transform: lowercase; letter-spacing: 0.02em;
}
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 0 2px oklch(74% 0.14 155 / 0.18); }
.status.warn .dot { background: var(--warn); }
.status.err .dot { background: var(--err); }
.status.idle .dot { background: var(--fg-3); }
.status.active .dot { background: var(--accent); box-shadow: 0 0 0 2px oklch(78% 0.15 var(--accent-h) / 0.18); animation: pulse 2s ease-in-out infinite; }

/* ============ STATS ============ */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px;
}
.stat {
  background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius-lg);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.stat-label { font-size: 11px; color: var(--fg-3); font-weight: 500; letter-spacing: 0.02em; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--fg-0); font-family: var(--font-mono); letter-spacing: -0.02em; }
.stat-unit { font-size: 13px; color: var(--fg-3); font-weight: 400; margin-left: 4px; }
.stat-delta { font-size: 11px; color: var(--fg-3); display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); }
.stat-delta.up { color: var(--ok); }
.stat-delta.down { color: var(--err); }
.stat-spark { position: absolute; right: 12px; top: 12px; opacity: 0.35; }

/* ============ TABLE ============ */
.table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.table thead th {
  padding: 10px 12px;
  font-size: 10px; font-weight: 600; color: var(--fg-3);
  letter-spacing: 0.06em; text-transform: uppercase;
  text-align: left;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-1);
  position: sticky; top: 0; z-index: 1;
}
.table thead th.right { text-align: right; }
.table thead th.sortable { cursor: pointer; }
.table thead th.sortable:hover { color: var(--fg-1); }
.table tbody td {
  padding: 0 12px;
  height: var(--row-h);
  border-bottom: 1px solid var(--line-1);
  color: var(--fg-1);
  vertical-align: middle;
}
.table tbody td.right { text-align: right; }
.table tbody td.mono { font-family: var(--font-mono); font-size: 11px; }
.table tbody tr { transition: background 0.08s; }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr[data-selected="true"] { background: oklch(78% 0.15 var(--accent-h) / 0.06); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .checkcell { width: 30px; padding-left: 16px; }
.table .actions { white-space: nowrap; text-align: right; padding-right: 12px; }
.table .actions > * { margin-left: 2px; }

.copyable {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-family: var(--font-mono);
}
.copyable:hover { color: var(--fg-0); }
.copyable .copy-ico { opacity: 0; transition: opacity 0.1s; color: var(--fg-3); }
.copyable:hover .copy-ico { opacity: 1; }

/* ============ CHECKBOX ============ */
.chk {
  width: 15px; height: 15px; border-radius: 3px;
  border: 1px solid var(--line-3);
  background: var(--bg-2);
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: all 0.1s;
  flex-shrink: 0;
}
.chk[data-checked="true"] {
  background: var(--accent); border-color: var(--accent);
  color: #16140a;
}
.chk[data-checked="indeterminate"] {
  background: var(--accent); border-color: var(--accent); color: #16140a;
}
.chk:hover { border-color: var(--accent-line); }

/* ============ PAGINATION ============ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  font-size: 11px; color: var(--fg-3);
  border-top: 1px solid var(--line-1);
}
.pagination.top { border-top: 0; border-bottom: 1px solid var(--line-1); }
.pagination .group { display: flex; align-items: center; gap: 8px; }
.pagination .pager { display: flex; align-items: center; gap: 4px; }
.pagination .pager button {
  width: 26px; height: 26px; border-radius: 4px; display: grid; place-items: center;
  color: var(--fg-2); border: 1px solid var(--line-2);
}
.pagination .pager button:hover { color: var(--fg-0); background: var(--bg-3); }
.pagination .pager button[disabled] { opacity: 0.4; }
.pagination .pager input {
  width: 42px; height: 26px; text-align: center; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 4px; font-family: var(--font-mono);
}

/* ============ EMPTY ============ */
.empty {
  border: 1px dashed var(--line-3);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--fg-2); text-align: center;
}
.empty-ico {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--fg-2);
}
.empty h3 { margin: 4px 0 0; font-size: 14px; color: var(--fg-0); font-weight: 600; }
.empty p { margin: 0; color: var(--fg-3); font-size: 12px; max-width: 380px; }

/* ============ MODAL ============ */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fadein 0.15s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 460px; max-width: 92vw;
  display: flex; flex-direction: column;
  animation: modalin 0.18s ease;
}
@keyframes modalin { from { opacity: 0; transform: translateY(4px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-1);
}
.modal-title { font-weight: 600; font-size: 13px; flex: 1; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 12px 18px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--line-1); background: var(--bg-0);
}

/* ============ TOAST ============ */
.toasts {
  position: fixed; top: 42px; right: 14px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px; max-width: 360px;
  padding: 10px 14px 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--info);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px;
  animation: toastin 0.22s ease;
}
@keyframes toastin { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast-ico { margin-top: 1px; }
.toast .t-title { font-weight: 600; color: var(--fg-0); }
.toast .t-msg { color: var(--fg-2); margin-top: 2px; font-size: 11px; }

/* ============ GROUPS SIDEBAR (wallets page) ============ */
.wallets-layout {
  display: grid; grid-template-columns: 250px 1fr; gap: 14px;
}
.groups-list { display: flex; flex-direction: column; }
.group-item {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; margin: 0 6px;
  border-radius: var(--radius-sm);
  color: var(--fg-1); font-size: 12px;
  cursor: pointer;
  position: relative;
}
.group-item:hover { background: var(--bg-3); }
.group-item[data-active="true"] { background: var(--bg-3); color: var(--fg-0); box-shadow: inset 0 0 0 1px var(--line-2); }
.group-item .g-name { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.group-item .g-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-item .g-count { color: var(--fg-3); font-family: var(--font-mono); font-size: 10px; }
.group-item .g-actions { display: none; gap: 2px; }
.group-item:hover .g-actions { display: flex; }
.group-item:hover .g-count { display: none; }

.g-section-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 4px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  cursor: pointer;
  user-select: none;
}
.g-section-h > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.g-section-h:hover { color: var(--fg-1); }
.g-empty {
  padding: 6px 14px 8px;
  font-size: 10.5px;
  color: var(--fg-4);
  font-style: italic;
}

/* ============ WORKSPACE TABS ============ */
.ws-tabbar {
  display: flex; align-items: stretch;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-lg);
  margin: -4px 0 16px;
  overflow: hidden;
}
.ws-folders {
  display: flex; flex-direction: column;
  width: 210px;
  border-right: 1px solid var(--line-1);
  background: var(--bg-0);
  padding: 6px;
  gap: 2px;
}
.ws-folder {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.ws-folder:hover { background: var(--bg-2); color: var(--fg-0); }
.ws-folder[data-active="true"] { background: var(--bg-3); color: var(--fg-0); box-shadow: inset 0 0 0 1px var(--line-2); }
.ws-folder .f-ico { width: 14px; height: 14px; display: grid; place-items: center; flex: 0 0 14px; color: var(--fg-3); }
.ws-folder[data-active="true"] .f-ico { color: var(--accent); }
.ws-folder .f-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-folder .f-count { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); background: var(--bg-3); padding: 1px 6px; border-radius: 4px; min-width: 20px; text-align: center; }
.ws-folder[data-active="true"] .f-count { background: var(--accent-dim); color: var(--accent); }
.ws-folder .f-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px oklch(78% 0.15 var(--accent-h) / 0.22); animation: pulse 2s ease-in-out infinite; }
.ws-folder .f-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px oklch(74% 0.14 155 / 0.22); }

.ws-folder-label {
  padding: 10px 10px 4px;
  font-size: 9px; color: var(--fg-4);
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
}
.ws-tabs-col {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}
.ws-tabs-header {
  padding: 8px 12px 6px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-1);
  font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.ws-tabs {
  display: flex; align-items: center;
  padding: 6px 8px;
  min-height: 44px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.ws-tabs.legacy {
  border-bottom: 1px solid var(--line-1);
  padding-left: 2px;
  margin: -4px 0 16px;
  min-height: auto;
}
.ws-tab {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border-radius: 6px;
  color: var(--fg-2); font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-1);
  background: var(--bg-2);
  cursor: pointer;
  max-width: 240px;
  flex-shrink: 0;
}
.ws-tab:hover { color: var(--fg-0); background: var(--bg-3); border-color: var(--line-2); }
.ws-tab[data-active="true"] {
  background: var(--bg-3); color: var(--fg-0);
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line);
}
.ws-tab .ws-hash {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-3); background: var(--bg-0);
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.04em;
}
.ws-tab[data-active="true"] .ws-hash { color: var(--accent); background: color-mix(in oklch, var(--accent) 14%, transparent); }
.ws-tab .ws-token {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.ws-tab .ws-close { opacity: 0; width: 16px; height: 16px; border-radius: 3px; display: grid; place-items: center; color: var(--fg-3); }
.ws-tab:hover .ws-close { opacity: 1; }
.ws-tab .ws-close:hover { background: var(--bg-4); color: var(--fg-0); }
.ws-tab-add {
  width: 28px; height: 28px; display: grid; place-items: center;
  color: var(--fg-3); border-radius: 6px; margin-left: 4px;
}
.ws-tab-add:hover { color: var(--fg-0); background: var(--bg-2); }

/* ============ PROGRESS BAR ============ */
.progress {
  height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden;
  min-width: 100px;
}
.progress > div { height: 100%; background: var(--accent); transition: width 0.3s ease; }

/* ============ LOGS ============ */
.logs {
  background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius-lg);
  font-family: var(--font-mono); font-size: 11.5px;
  overflow: hidden;
}
.logs-head {
  display: grid;
  grid-template-columns: 88px 90px 64px 1fr;
  padding: 8px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-1);
  font-size: 10px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase;
}
.logs-rows { max-height: calc(100vh - 320px); overflow-y: auto; }
.log-row {
  display: grid;
  grid-template-columns: 88px 90px 64px 1fr;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  cursor: pointer;
  transition: background 0.08s;
}
.log-row:hover { background: var(--bg-2); }
.log-row .l-time { color: var(--fg-3); }
.log-row .l-mod { color: var(--fg-2); }
.log-row .l-lvl { font-weight: 600; letter-spacing: 0.04em; font-size: 10px; padding-top: 1px; }
.log-row .l-lvl.info { color: var(--info); }
.log-row .l-lvl.warn { color: var(--warn); }
.log-row .l-lvl.err { color: var(--err); }
.log-row .l-lvl.ok { color: var(--ok); }
.log-row .l-lvl.debug { color: var(--fg-3); }
.log-row .l-msg { color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ AUTH ============ */
.auth-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 32px 1fr;
  background:
    radial-gradient(800px 500px at 50% 30%, oklch(78% 0.15 var(--accent-h) / 0.08), transparent 60%),
    var(--bg-0);
}
.auth-body {
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.auth-card {
  width: 420px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-modal);
  position: relative; z-index: 1;
}
.auth-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, oklch(70% 0.16 var(--accent-h)) 100%);
  display: grid; place-items: center;
  margin: 0 auto 16px;
  color: #1a1a20;
  box-shadow: 0 8px 24px oklch(78% 0.15 var(--accent-h) / 0.3);
}
.auth h1 { margin: 0; text-align: center; font-size: 20px; font-weight: 600; }
.auth-sub { text-align: center; color: var(--fg-3); font-size: 12px; margin: 6px 0 22px; }
.auth .input { height: 38px; font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.auth .input input { text-align: center; }
.auth-foot {
  text-align: center; font-size: 10px; color: var(--fg-4);
  margin-top: 14px; font-family: var(--font-mono); letter-spacing: 0.06em;
}

/* bg grid for auth */
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ============ MICRO: SPARK ============ */
.spark { stroke: var(--accent); fill: none; stroke-width: 1.25; }
.spark-fill { fill: var(--accent); opacity: 0.1; }

/* ============ UTIL ============ */
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.flex1 { flex: 1; }
.muted { color: var(--fg-3); }
.dim { color: var(--fg-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; min-width: 0; }
.grid-3 > * { min-width: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; min-width: 0; }
.grid-4 > * { min-width: 0; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hairline { height: 1px; background: var(--line-1); }

/* ============ TWEAKS PANEL ============ */
.tweaks {
  position: fixed; right: 16px; bottom: 16px;
  width: 280px; z-index: 50;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.tweaks-head {
  padding: 10px 14px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-1);
  font-size: 12px; font-weight: 600;
}
.tweaks-head .hint { font-size: 10px; color: var(--fg-4); font-weight: 500; font-family: var(--font-mono); letter-spacing: 0.04em; }
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; font-size: 12px; }
.tweaks-body .field-label { font-size: 11px; color: var(--fg-2); }
.tweaks-body .hues { display: flex; gap: 6px; }
.tweaks-body .hue {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}
.tweaks-body .hue:hover { transform: scale(1.08); }
.tweaks-body .hue[data-active="true"] { border-color: var(--fg-0); }

/* ============ ROW MENU (popover) ============ */
.row-menu {
  min-width: 180px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 4px;
  display: flex; flex-direction: column;
  animation: fadein 0.08s ease-out;
}
.row-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--fg-1);
  background: transparent;
  border: 0;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.row-menu-item:hover { background: var(--bg-3); color: var(--fg-0); }
.row-menu-item.danger { color: var(--err); }
.row-menu-item.danger:hover { background: var(--err-dim); color: #fff; }
.row-menu-item svg { color: var(--fg-3); flex-shrink: 0; }
.row-menu-item:hover svg { color: var(--fg-1); }
.row-menu-item.danger svg { color: var(--err); }
.row-menu-item.danger:hover svg { color: #fff; }
.row-menu-sep { height: 1px; background: var(--line-1); margin: 4px 2px; }
.icon-btn[data-active="true"] { background: var(--bg-3); color: var(--fg-0); }

/* ============ WALLET HISTORY DRAWER ============ */
.wh-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end;
  animation: fadein 0.12s ease-out;
}
.wh-drawer {
  width: min(1240px, 92vw);
  height: 100%;
  background: var(--bg-0);
  border-left: 1px solid var(--line-2);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column;
  animation: wh-slide 0.18s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes wh-slide {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.wh-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-1);
}
.wh-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  flex-shrink: 0;
}
.wh-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line-1);
  border-bottom: 1px solid var(--line-1);
}
.wh-stat {
  background: var(--bg-1);
  padding: 12px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.wh-stat-l { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.06em; }
.wh-stat-v { font-size: 16px; font-weight: 600; color: var(--fg-0); }
.wh-stat-v.pos { color: oklch(72% 0.18 145); }
.wh-stat-v.neg { color: oklch(72% 0.18 25); }

.wh-tabbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-1);
}
.wh-tabs {
  display: flex; gap: 2px;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}
.wh-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  background: transparent;
  color: var(--fg-2);
  border: 0;
  border-radius: 4px;
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.wh-tab:hover { color: var(--fg-0); }
.wh-tab[data-active="true"] {
  background: var(--bg-3);
  color: var(--fg-0);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.wh-tab-c {
  font-size: 10px;
  color: var(--fg-4);
  background: var(--bg-1);
  padding: 1px 5px;
  border-radius: 3px;
}
.wh-tab[data-active="true"] .wh-tab-c { color: var(--fg-2); background: var(--bg-1); }

.wh-filters { display: flex; align-items: center; gap: 14px; }
.wh-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--fg-2);
  cursor: pointer;
}
.wh-toggle:hover { color: var(--fg-0); }

.wh-body {
  flex: 1;
  overflow: auto;
  background: var(--bg-0);
}
.wh-empty {
  padding: 60px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--fg-3);
}

.wh-tbl-wrap { padding: 0; }
.wh-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.wh-tbl thead th {
  position: sticky; top: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-1);
  padding: 10px 12px;
  text-align: left;
  font-size: 10px; font-weight: 500;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}
.wh-tbl thead th.right { text-align: right; }
.wh-tbl tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-1);
  vertical-align: middle;
}
.wh-tbl tbody td.right { text-align: right; }
.wh-tbl tbody tr:hover { background: var(--bg-1); }

.wh-tok { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wh-tok-ico {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
}
.wh-tok-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wh-tok-name { font-size: 12px; font-weight: 500; color: var(--fg-0); white-space: nowrap; }
.wh-tok-age { font-size: 10px; }

.wh-stack { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.wh-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
}
.wh-pill.hodl { background: oklch(28% 0.06 145 / 0.4); color: oklch(78% 0.16 145); border: 1px solid oklch(50% 0.12 145 / 0.4); }
.wh-pill.sellall { background: oklch(28% 0.08 25 / 0.4); color: oklch(78% 0.18 25); border: 1px solid oklch(50% 0.14 25 / 0.4); }

.wh-trade-kind {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.wh-trade-kind.buy  { background: oklch(28% 0.08 155 / 0.5); color: oklch(80% 0.16 155); }
.wh-trade-kind.sell { background: oklch(28% 0.08 25 / 0.5);  color: oklch(80% 0.18 25);  }

.wh-star {
  background: transparent; border: 0;
  color: var(--fg-4); cursor: pointer;
  padding: 2px;
  display: grid; place-items: center;
  border-radius: 3px;
}
.wh-star:hover { color: oklch(82% 0.16 80); background: var(--bg-2); }

.wh-tbl .pos { color: oklch(75% 0.18 145); }
.wh-tbl .neg { color: oklch(72% 0.18 25); }

/* Deployed tab */
.wh-deployed {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 0;
  height: 100%;
}
.wh-deployed-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 60px;
  border-right: 1px solid var(--line-1);
}
.wh-deployed-ico {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  display: grid; place-items: center;
  color: var(--fg-4);
}
.wh-deployed-side {
  padding: 18px 20px;
  background: var(--bg-1);
  display: flex; flex-direction: column; gap: 10px;
}
.wh-deployed-title {
  font-size: 11px; font-weight: 600;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-1);
}
.wh-deployed-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  padding: 4px 0;
}

/* Compare chip in bulk bar */
.wh-cmp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  background: oklch(28% 0.04 270 / 0.5);
  border: 1px solid oklch(50% 0.10 270 / 0.5);
  color: oklch(82% 0.12 270);
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.wh-cmp-chip > * { display: inline-flex; align-items: center; line-height: 1; }
.wh-cmp-chip:hover { background: oklch(32% 0.06 270 / 0.6); border-color: oklch(60% 0.14 270 / 0.7); }
.wh-cmp-chip b { color: oklch(88% 0.14 270); font-weight: 700; }
.wh-cmp-chip-sep {
  display: inline-block;
  width: 1px; height: 11px;
  background: oklch(50% 0.06 270 / 0.5);
  flex-shrink: 0;
}

/* Compare drawer extras */
.wh-cmp-control { display: flex; flex-direction: column; gap: 4px; }
.wh-cmp-row { cursor: pointer; }
.wh-cmp-row:hover { background: var(--bg-2) !important; }
.wh-cmp-caret {
  display: inline-block;
  font-size: 14px; color: var(--fg-3);
  transition: transform 0.12s;
  width: 12px;
}
.wh-cmp-caret[data-open="true"] { transform: rotate(90deg); color: var(--fg-1); }
.wh-cmp-sub td {
  background: oklch(20% 0.01 270 / 0.4);
  border-bottom: 1px solid var(--line-1);
  font-size: 11px;
  padding-top: 6px; padding-bottom: 6px;
}
.wh-cov-bar {
  display: inline-block;
  width: 80px; height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  vertical-align: middle;
}
.wh-cov-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, oklch(60% 0.14 270), oklch(72% 0.16 290));
  border-radius: 3px;
}
