/* static/v2/app.css — base styles + component classes for the TokenCommand v2
 * primitives (static/v2/ui.js). Ported from design/ui-v2/src/ui.mjs and
 * chrome.mjs: same sizes and spacing, expressed as classes instead of the
 * design canvas's inline styles. Hairlines, not shadows. 8px control radius,
 * 12px panels, fully round only for status pills.
 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
}

a { color: inherit; }

button, input {
  font-family: inherit;
  color: inherit;
}

/* ── tone tokens: one place that maps a meaning to bg/fg/dot/line ───────── */
.tone-neutral { --tone-bg: var(--bg-3); --tone-fg: var(--text-2); --tone-dot: var(--text-3); --tone-line: var(--line); }
.tone-accent  { --tone-bg: var(--accent-bg); --tone-fg: var(--accent-text); --tone-dot: var(--accent); --tone-line: var(--accent-line); }
.tone-buy     { --tone-bg: var(--buy-bg); --tone-fg: var(--buy); --tone-dot: var(--buy); --tone-line: var(--buy-line); }
.tone-sell    { --tone-bg: var(--sell-bg); --tone-fg: var(--sell); --tone-dot: var(--sell); --tone-line: var(--sell-line); }
.tone-warn    { --tone-bg: var(--warn-bg); --tone-fg: var(--warn); --tone-dot: var(--warn); --tone-line: var(--warn-line); }

/* ── text utilities ──────────────────────────────────────────────────── */
.text-1 { color: var(--text); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-accent { color: var(--accent-text); }
.text-buy { color: var(--buy); }
.text-sell { color: var(--sell); }
.text-warn { color: var(--warn); }

.label { font-size: 12px; color: var(--text-3); }
.num { font-family: var(--font-mono); font-feature-settings: 'zero' 1; letter-spacing: -0.01em; }
.h { font-weight: 600; letter-spacing: -0.015em; color: var(--text); font-size: 16px; }
.h-lg { font-size: 22px; }

/* ── layout ──────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex-grow: 1; min-width: 0; }
.spacer { flex-grow: 1; }
.row-between { justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }
.row-stretch { align-items: stretch; }
.gap-0 { gap: 0; }

.hr { height: 1px; background: var(--line); flex-shrink: 0; }
.vr { width: 1px; align-self: stretch; background: var(--line); flex-shrink: 0; margin: 0 22px; }

.dot { width: 7px; height: 7px; border-radius: 999px; background: var(--tone-dot); flex-shrink: 0; display: inline-block; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  border-radius: var(--radius-md); font-family: var(--font-sans); font-weight: 600; white-space: nowrap;
  cursor: pointer; text-decoration: none; flex-shrink: 0; border: 1px solid transparent;
}
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn-md { height: 34px; padding: 0 14px; font-size: 13px; gap: 7px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14px; gap: 8px; }
.btn-icon-only.btn-sm { width: 28px; padding: 0; }
.btn-icon-only.btn-md { width: 34px; padding: 0; }
.btn-icon-only.btn-lg { width: 42px; padding: 0; }

.btn-primary   { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary-bg); }
.btn-secondary { background: var(--bg-3); color: var(--text); border-color: var(--line-strong); }
.btn-ghost     { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-danger    { background: transparent; color: var(--sell); border-color: var(--sell-line); }
.btn-buy       { background: var(--buy); color: var(--on-buy); border-color: var(--buy); }
.btn-sell      { background: var(--sell); color: var(--on-sell); border-color: var(--sell); }
.btn-accent    { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent-line); }

.btn-icon, .btn-icon-right { display: inline-flex; }
.btn-kbd { font-family: var(--font-mono); font-size: 11px; opacity: 0.62; font-weight: 500; }

/* ── pill (status tag — the only fully-round shape) ─────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px;
  border-radius: var(--radius-pill); background: var(--tone-bg); color: var(--tone-fg);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.pill-dot-mark { width: 6px; height: 6px; border-radius: 999px; background: var(--tone-dot); display: inline-block; flex-shrink: 0; }

/* ── chip (filter control — small radius, not a pill) ───────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; box-sizing: border-box;
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; cursor: pointer;
  white-space: nowrap; text-decoration: none; flex-shrink: 0; background: transparent; color: var(--text-2);
  border: 1px solid var(--line);
}
.chip-selected { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent-line); }
.chip-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.chip-count { font-size: 11.5px; }

/* ── segmented control ───────────────────────────────────────────────── */
.seg {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-md); background: var(--bg-0);
  border: 1px solid var(--line); box-sizing: border-box;
}
.seg-option {
  height: 26px; padding: 0 11px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; background: transparent; color: var(--text-3);
  white-space: nowrap;
}
.seg-sm .seg-option { height: 20px; font-size: 12px; }
.seg-fill .seg-option { flex-grow: 1; }
.seg-option-active { font-weight: 600; background: var(--bg-4); color: var(--text); }
.seg-option-active.tone-buy { background: var(--buy-bg); color: var(--buy); }
.seg-option-active.tone-sell { background: var(--sell-bg); color: var(--sell); }

/* ── input ───────────────────────────────────────────────────────────── */
.input {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px;
  border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--line);
  box-sizing: border-box; min-width: 0; flex-grow: 1;
}
.input-lg { height: 44px; }
.input-invalid { border-color: var(--sell-line); }
.input-field {
  flex-grow: 1; min-width: 0; width: 100%; height: 100%; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 13px; font-family: var(--font-mono); font-weight: 400; padding: 0;
}
.input-lg .input-field { font-size: 18px; font-weight: 500; }
.input-field.font-sans { font-family: var(--font-sans); }
.input-field::placeholder { color: var(--text-3); }
.input-icon { color: var(--text-3); display: flex; flex-shrink: 0; }
.input-prefix { color: var(--text-3); font-family: var(--font-mono); font-size: 13px; flex-shrink: 0; }
.input-suffix { color: var(--text-3); font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }

/* ── select-look button ──────────────────────────────────────────────── */
.select-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 11px;
  border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; font-family: var(--font-sans); font-size: 13px; font-weight: 500; box-sizing: border-box;
  justify-content: space-between; flex-shrink: 0; white-space: nowrap;
}
.select-btn-sm { height: 28px; font-size: 12.5px; }
.select-btn-value { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.select-btn-value span { overflow: hidden; text-overflow: ellipsis; }
.select-btn-chevron { color: var(--text-3); display: flex; }

/* ── checkbox / toggle ───────────────────────────────────────────────── */
.check {
  width: 16px; height: 16px; border-radius: 4px; box-sizing: border-box; padding: 0; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; background: transparent;
  border: 1px solid var(--line-strong); color: var(--on-light);
}
.check-on { background: var(--accent); border-color: var(--accent); }
.check-mixed-mark { width: 8px; height: 2px; background: var(--on-light); border-radius: 1px; }

.toggle {
  width: 32px; height: 18px; border-radius: 999px; padding: 2px; box-sizing: border-box; cursor: pointer;
  border: none; flex-shrink: 0; background: var(--bg-4); display: inline-flex; justify-content: flex-start; align-items: center;
}
.toggle-on { background: var(--accent); justify-content: flex-end; }
.toggle-thumb { width: 14px; height: 14px; border-radius: 999px; background: var(--text-2); }
.toggle-on .toggle-thumb { background: var(--on-light); }

/* ── field (label + control + hint) ─────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.field-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.field-aside { font-size: 12px; color: var(--text-3); }
.field-hint { font-size: 12px; color: var(--text-3); }
.field-hint-warn { color: var(--warn); }
.field-hint-sell { color: var(--sell); }

/* ── panel / cell ────────────────────────────────────────────────────── */
.panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-lg); box-sizing: border-box; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--line); gap: 12px; min-height: 28px; flex-wrap: wrap;
}
.panel-head-norule { border-bottom: none; }
.panel-head-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.panel-head-title { font-size: 13.5px; }

.cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell-label { font-size: 11.5px; color: var(--text-3); }
.cell-row { display: flex; align-items: baseline; gap: 6px; }
.cell-value { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; }
.cell-value-lg { font-size: 20px; }
.cell-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* ── avatar ──────────────────────────────────────────────────────────── */
.avatar {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center;
  justify-content: center; background: var(--bg-4); color: var(--text); font-size: 11px; font-weight: 700;
  letter-spacing: -0.02em; border: 1px solid var(--line-strong); box-sizing: border-box;
}
.avatar-xs { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; }
.avatar-sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.avatar-lg { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.avatar-xl { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.avatar-ghost { background: transparent; }

/* ── chain badge / address / progress / kbd ─────────────────────────── */
.chain-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 6px; border-radius: var(--radius-xs);
  border: 1px solid var(--line); color: var(--text-3); font-family: var(--font-mono); font-size: 10.5px;
  font-weight: 500; flex-shrink: 0; white-space: nowrap;
}
.chain-badge-swatch { width: 6px; height: 6px; border-radius: 1.5px; flex-shrink: 0; }

.addr { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.addr-copy { border: none; background: transparent; color: var(--text-3); padding: 0; cursor: pointer; display: flex; }
.addr-copy-done { color: var(--buy); }

.progress { height: 4px; border-radius: 999px; background: var(--bg-4); overflow: hidden; flex-shrink: 0; min-width: 40px; width: 100%; }
.progress-grow { flex-grow: 1; width: auto; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--accent); }

.kbd {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg-0);
}

/* ── sortable table header cell (ui.js's sortHead) ──────────────────────── */
.sort-head {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: none; padding: 0;
  color: inherit; font: inherit; font-weight: inherit; cursor: pointer;
}
.sort-head-right { justify-content: flex-end; width: 100%; }
.sort-head-arrow { display: inline-flex; color: var(--text-2); }
.sort-head-arrow-asc { transform: rotate(180deg); }

/* ── tabs ────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); align-items: stretch; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; height: 40px; box-sizing: border-box;
  text-decoration: none; font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--text-3); border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; background: transparent; white-space: nowrap;
}
.tab-active { font-weight: 600; color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: 11.5px; color: var(--text-3); }

/* ── Who / How much / How ───────────────────────────────────────────── */
.who {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 11px; box-sizing: border-box;
  border-radius: var(--radius-md); background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; font-family: var(--font-sans); text-align: left;
}
.who-open { border-color: var(--accent-line); }
.who-icon, .who-chevron { color: var(--text-3); display: flex; flex-shrink: 0; }
.who-body { display: flex; flex-direction: column; gap: 1px; flex-grow: 1; min-width: 0; }
.who-summary { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-detail { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

.how {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 11px; box-sizing: border-box;
  border-radius: var(--radius-md); background: transparent; border: 1px dashed var(--line-strong); color: var(--text-2);
  cursor: pointer; font-family: var(--font-sans); font-size: 12.5px; text-align: left;
}
.how-icon { color: var(--text-3); display: flex; flex-shrink: 0; }
.how-summary { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.how-action { color: var(--text-3); font-size: 12px; }

.amount-unit {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px 0 10px; border-radius: var(--radius-sm);
  cursor: pointer; background: var(--bg-4); border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; flex-shrink: 0; white-space: nowrap;
}

/* ── notice (callout strip) ──────────────────────────────────────────── */
.notice {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md);
  background: var(--tone-bg); border: 1px solid var(--tone-line); color: var(--tone-fg); font-size: 13px;
}
.notice-icon { display: flex; flex-shrink: 0; }
.notice-body { flex-grow: 1; color: var(--text); min-width: 0; }

/* ── app shell: rail + top bar ───────────────────────────────────────── */
.tc-shell { width: 100%; min-height: 100vh; box-sizing: border-box; display: flex; background: var(--bg-0); position: relative; }
.rail { width: 236px; flex-shrink: 0; background: var(--bg-1); border-right: 1px solid var(--line); box-sizing: border-box; }
.rail-inner { display: flex; flex-direction: column; box-sizing: border-box; padding: 14px 12px 12px; gap: 14px; height: 100%; position: sticky; top: 0; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.rail-search {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--radius-md);
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text-3); font-family: inherit; font-size: 12.5px;
  cursor: pointer; width: 100%; box-sizing: border-box;
}
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius-md);
  text-decoration: none; font-size: 13px; font-weight: 500; color: var(--text-2); background: transparent;
  border: 1px solid transparent; box-sizing: border-box; cursor: pointer;
}
button.rail-item { width: 100%; font: inherit; text-align: left; }
.rail-item-active { font-weight: 600; color: var(--text); background: var(--bg-3); border-color: var(--line); }
.rail-item-icon { color: var(--text-3); display: flex; flex-shrink: 0; }
.rail-item-active .rail-item-icon { color: var(--accent); }
.rail-tokens { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; min-height: 0; overflow-y: auto; }
.rail-tokens-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 2px; }
.token-row {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 9px; border-radius: var(--radius-md);
  text-decoration: none; background: transparent; border: 1px solid transparent; box-sizing: border-box;
  color: var(--text); cursor: pointer;
}
.token-row-active { background: var(--bg-3); border-color: var(--line); }
.token-row-body { display: flex; flex-direction: column; gap: 0; flex-grow: 1; min-width: 0; }
.token-row-symbol { font-size: 13px; font-weight: 600; }
.token-row-sub { font-size: 11px; color: var(--text-3); }
.token-row-attention {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg);
  border-radius: 999px; padding: 1px 6px;
}
.rail-funding { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-0); overflow: hidden; }
.rail-funding-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px 7px; }
.rail-funding-row { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-top: 1px solid var(--line); }
.rail-funding-empty { padding: 7px 11px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.rail-status { display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--text-3); font-size: 11.5px; }

.topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--line); box-sizing: border-box; background: var(--bg-0); position: sticky; top: 0; z-index: 1;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumb-active { color: var(--text); font-weight: 600; }
.crumb-sep { display: flex; color: var(--text-3); }
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-2);
  flex-shrink: 0; text-decoration: none;
}
.tc-main-col { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.tc-main { flex-grow: 1; min-height: 0; padding: 20px 24px 24px; box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; }

/* ── page-level bits shared across pages/*.js ───────────────────────── */
.page-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-sub { font-size: 13px; color: var(--text-3); }
.empty-state { padding: 24px 16px; color: var(--text-3); font-size: 13px; text-align: center; }

.kpi-strip { padding: 16px 20px; }

.tokens-grid-head, .tokens-grid-row {
  display: grid;
  grid-template-columns: minmax(0,1.5fr) 120px 130px 150px 110px 70px minmax(0,1.2fr) 100px 28px;
  gap: 14px; align-items: center; padding: 0 16px;
}
.tokens-grid-head { height: 34px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.tokens-grid-row { height: 60px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.tokens-grid-row:hover { background: var(--bg-2); }
.tokens-grid-row:last-child { border-bottom: none; }

.attention-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.activity-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: none; }

/* ── layout utility helpers (extra classes for row()/col()) ────────────── */
.row-end { justify-content: flex-end; }
.row-center { justify-content: center; }
.col-end { align-items: flex-end; }
.gap-14 { gap: 14px; }

/* ── token workspace: page layout ───────────────────────────────────────── */
.workspace-cols { display: flex; gap: 16px; align-items: stretch; flex-grow: 1; min-height: 0; }
.workspace-main { display: flex; flex-direction: column; gap: 16px; flex-grow: 1; min-width: 0; }
.workspace-rail { display: flex; flex-direction: column; gap: 16px; width: 344px; flex-shrink: 0; }
.token-header { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.workspace-tabbar { flex-shrink: 0; }
.workspace-tab-slot { min-height: 1px; }

/* ── holders table ───────────────────────────────────────────────────────── */
.holders-table-head, .holders-table-row {
  display: grid; grid-template-columns: minmax(0,1.4fr) 130px 100px 110px;
  gap: 12px; align-items: center; padding: 0 16px; box-sizing: border-box;
}
.holders-table-head { height: 34px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.holders-table-row { height: 44px; border-bottom: 1px solid var(--line); }
.holders-table-row:last-child { border-bottom: none; }

/* ── token settings ──────────────────────────────────────────────────────── */
.settings-danger { border-color: var(--sell-line); }

/* ── chart panel ─────────────────────────────────────────────────────────── */
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.chart-frame-wrap { padding: 10px 8px 4px 16px; }
.chart-frame { width: 100%; height: 380px; border: 0; display: block; border-radius: var(--radius-md); background: var(--bg-2); }
.next-levels { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); align-items: center; }

/* ── wallets panel ───────────────────────────────────────────────────────── */
.wallets-toolbar { display: flex; gap: 10px; padding: 12px 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.wallet-status-select { min-width: 108px; }

.selection-bar { gap: 6px; margin: 0 16px 8px; padding: 7px 8px 7px 12px; border-radius: var(--radius-md); background: var(--accent-bg); border: 1px solid var(--accent-line); }
.selection-bar-count { font-size: 13px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.selection-bar-total { font-size: 12px; white-space: nowrap; margin-left: 4px; }

.wallet-row-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.wallet-table-head, .wallet-table-row, .wallet-table-foot {
  display: grid; grid-template-columns: 24px 92px 108px minmax(0,1fr) 84px 84px 80px 84px 28px;
  gap: 10px; align-items: center; padding: 0 12px; box-sizing: border-box;
}
.wallet-table-head { height: 34px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.wallet-table-row { height: 40px; border-bottom: 1px solid var(--line); }
.wallet-table-row-selected { background: var(--accent-bg); }
.wallet-table-foot { height: 38px; font-size: 12.5px; color: var(--text-3); }

/* ── trade panel ─────────────────────────────────────────────────────────── */
.trade-panel-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.unit-select {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 22px 0 10px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--bg-4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23808B98' stroke-width='1.7'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E") no-repeat right 6px center;
  border: 1px solid var(--line-strong); color: var(--text); font-family: var(--font-sans); font-size: 12.5px;
  font-weight: 600; flex-shrink: 0; white-space: nowrap;
}
.who-detail-line { font-size: 11.5px; }
.trade-review-btn { width: 100%; }

/* ── automations mini (right rail) ──────────────────────────────────────── */
.automation-mini-row { padding: 9px 16px; border-top: 1px solid var(--line); }
.automation-mini-row-first { border-top: none; }
.automation-mini-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── live feed (right rail) ──────────────────────────────────────────────── */
.feed-row { padding: 8px 16px; border-top: 1px solid var(--line); }
.feed-row-first { border-top: none; }
.feed-usd { font-size: 12.5px; font-weight: 500; width: 52px; flex-shrink: 0; }
.feed-who { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-who-ours { color: var(--text); font-weight: 600; }
.feed-wallet { font-size: 11px; }
.feed-disabled-hint { font-size: 11px; color: var(--text-3); padding: 0 16px 8px; }

/* ── market-cap ladder ───────────────────────────────────────────────────── */
.ladder { position: relative; }
.ladder-lane { height: 30px; }
.ladder-lane-label { width: 148px; flex-shrink: 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.ladder-lane-track { position: relative; flex-grow: 1; height: 100%; }
.ladder-band {
  position: absolute; top: 3px; bottom: 3px; border-radius: var(--radius-xs); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  background: var(--tone-bg); border: 1px solid var(--tone-line); color: var(--tone-fg);
}
.ladder-mark { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--tone-dot); padding-left: 6px; display: flex; align-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tone-fg); white-space: nowrap; }
.ladder-now { position: absolute; top: -14px; bottom: 0; border-left: 1px solid var(--text); }
.ladder-now span { position: absolute; bottom: -22px; transform: translateX(-50%); background: var(--text); color: var(--bg-0); font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* ── trade review overlay ────────────────────────────────────────────────── */
.tc-overlay {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: var(--scrim);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 64px; box-sizing: border-box; z-index: 10;
}
.review-card { width: 420px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.review-rows { overflow-y: auto; flex-grow: 1; }
.trade-review-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.trade-review-row:first-child { border-top: none; }
.trade-review-row-blocked { color: var(--warn); }
.review-footer { padding: 10px 16px; border-top: 1px solid var(--line); }

/* ── help sheet ──────────────────────────────────────────────────────────── */
.help-sheet { width: 640px; max-width: 92vw; max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; }
.help-sheet-body { display: flex; flex-grow: 1; min-height: 0; }
.help-topic-nav { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); overflow-y: auto; box-sizing: border-box; }
.help-topic-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); font: inherit;
  border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.help-topic-item-active { background: var(--bg-3); border-color: var(--line); color: var(--text); font-weight: 600; }
.help-topic-content { flex-grow: 1; min-width: 0; overflow-y: auto; padding: 16px 20px; font-size: 13px; line-height: 1.55; color: var(--text-2); box-sizing: border-box; }
.help-topic-content h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--text); }
.help-topic-content p { margin: 0 0 10px; }
.help-topic-content ul { margin: 0 0 10px; padding-left: 18px; }
.help-topic-content li { margin-bottom: 6px; }

/* ── toast ───────────────────────────────────────────────────────────────── */
.tc-toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--bg-3); border: 1px solid var(--line-strong);
  color: var(--text); padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.24); max-width: 320px;
}
.tc-toast.tone-sell { border-color: var(--sell-line); color: var(--sell); }
.tc-toast.tone-buy { border-color: var(--buy-line); color: var(--buy); }
