/* ==========================================================================
   Portfolio — data terminal design system
   --------------------------------------------------------------------------
   Design rules this file follows:

   1. Hue is data. Green and red mean "up" and "down" and nothing else.
      Every category (crypto orange, defi cyan, staking purple, stocks blue…)
      already owns a hue, so the UI accent is achromatic — near-white for
      primary actions, a desaturated indigo for focus/selection only.
   2. Numbers are monospaced and tabular everywhere, so columns align and
      digits do not jitter between renders.
   3. Density over decoration. Rows are short, dividers are hairlines,
      padding is tuned so a 50-row position table reads in one screen.
   ========================================================================== */

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

:root {
  /* ── Surfaces ───────────────────────────────────────────────── */
  --bg: #0a0c10;
  --surface: #11141b;
  --surface-2: #161a22;
  --surface-3: #1c212b;
  --surface-input: #0d1015;

  /* ── Lines ──────────────────────────────────────────────────── */
  --line: rgba(255,255,255,0.075);
  --line-soft: rgba(255,255,255,0.04);
  --line-strong: rgba(255,255,255,0.14);

  /* ── Text ───────────────────────────────────────────────────── */
  --text: #e9ecf2;
  --text-2: #a2abba;
  --text-3: #6d7684;

  /* ── Accent: achromatic. Hue belongs to data, not chrome. ───── */
  --accent: #edf0f6;
  --accent-hover: #ffffff;
  --accent-ink: #0a0c10;
  --accent-soft: rgba(255,255,255,0.07);
  --accent-line: rgba(255,255,255,0.16);

  /* ── Focus / selection: the one chrome hue ──────────────────── */
  --focus: #6d83f5;
  --focus-ring: rgba(109,131,245,0.45);
  --focus-soft: rgba(109,131,245,0.12);

  /* ── Semantic: performance only ─────────────────────────────── */
  --pos: #2ebd85;
  --pos-bg: rgba(46,189,133,0.12);
  --pos-line: rgba(46,189,133,0.28);
  --neg: #f6465d;
  --neg-bg: rgba(246,70,93,0.12);
  --neg-line: rgba(246,70,93,0.28);
  --warn: #f0a92e;
  --warn-bg: rgba(240,169,46,0.12);
  --warn-line: rgba(240,169,46,0.28);
  --info: #5b8def;
  --info-bg: rgba(91,141,239,0.12);
  --info-line: rgba(91,141,239,0.28);

  /* ── Geometry ───────────────────────────────────────────────── */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;
  --sidebar-w: 216px;
  --topbar-h: 52px;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-elevated: 0 12px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
  --transition: 0.14s ease;

  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, monospace;

  /* ── Back-compat aliases ────────────────────────────────────────
     address-audit.css, claimables.css and inline styles across the JS
     views reference the old token names. Aliasing keeps one source of
     truth: change the value above, every page follows.                */
  --bg-card: var(--surface);
  --bg-card-elevated: var(--surface-2);
  --bg-hover: var(--surface-3);
  --bg-input: var(--surface-input);
  --border: var(--line);
  --border-subtle: var(--line-soft);
  --text-secondary: var(--text-2);
  --text-dim: var(--text-3);
  --green: var(--pos);
  --green-bg: var(--pos-bg);
  --red: var(--neg);
  --red-bg: var(--neg-bg);
  --yellow: var(--warn);
  --yellow-bg: var(--warn-bg);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  font-size: 14px;
  letter-spacing: -0.005em;
}

h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

a { color: inherit; }
::selection { background: var(--focus-soft); }

code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-input);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  white-space: nowrap;
}

/* ==========================================================================
   App shell — fixed sidebar + sticky topbar
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 14px 10px 10px;
  overflow-y: auto;
  z-index: 60;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 16px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sidebar-mark {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--text) 0%, var(--text-3) 100%);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-group { margin-bottom: 14px; }
.sidebar-group-label {
  padding: 0 8px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  border-radius: 0 2px 2px 0;
  background: var(--text);
}
.nav-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.4;
}
.nav-link.active .nav-dot { opacity: 1; }

.sidebar-foot {
  margin-top: auto;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sidebar-foot-row { display: flex; justify-content: space-between; gap: 8px; }
.sidebar-foot-row span:last-child { color: var(--text-2); }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: rgba(10,12,16,0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.topbar-spacer { flex: 1 1 auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Live status pip next to the freshness chips */
.pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
}
.pip-live { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-bg); }
.pip-stale { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.pip-busy {
  background: var(--info);
  box-shadow: 0 0 0 3px var(--info-bg);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Legacy top nav — kept so any page not yet migrated still renders sanely */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav-brand { font-size: 15px; font-weight: 700; margin-right: 10px; }
.nav-links { display: flex; gap: 2px; flex: 1 1 auto; flex-wrap: wrap; }

/* ── Main ────────────────────────────────────────────────────── */
.main {
  padding: 20px;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
}
.hidden { display: none !important; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head p { color: var(--text-3); font-size: 13px; margin-top: 3px; }

/* ==========================================================================
   Buttons & controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--line);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-3); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--text-3); border-color: transparent; }
.btn-danger:hover:not(:disabled) {
  background: var(--neg-bg);
  color: var(--neg);
  border-color: var(--neg-line);
}

.mini-btn {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--transition);
}
.mini-btn:hover { background: var(--surface-3); color: var(--text); }
.mini-btn-danger:hover { background: var(--neg-bg); color: var(--neg); border-color: var(--neg-line); }

/* Segmented control (P&L toggle) */
.pnl-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.pnl-toggle .btn {
  border-radius: var(--radius-xs);
  padding: 4px 12px;
  font-size: 12px;
  border-color: transparent;
}
.pnl-toggle .btn-primary { background: var(--surface-3); color: var(--text); }
.pnl-toggle .btn-secondary { background: transparent; color: var(--text-3); }
.pnl-toggle .btn-secondary:hover { background: transparent; color: var(--text-2); }

/* ==========================================================================
   Cards & panels
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head .section-title { margin-bottom: 0; }

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.section-note { color: var(--text-3); font-size: 12px; margin-bottom: 10px; }

.hint { font-size: 12px; color: var(--text-3); }
.muted-line { color: var(--text-3); font-size: 12px; }

/* ==========================================================================
   Dashboard — KPI strip, hero, attention
   ========================================================================== */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.kpi {
  background: var(--surface);
  padding: 12px 14px;
  min-width: 0;
}
.kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kpi-value {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.kpi-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.net-worth,
.portfolio-summary {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 62%);
}
.summary-primary {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: center;
}
.summary-total { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.net-worth-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.net-worth-value {
  font-size: 42px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.net-worth-delta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.net-worth-delta .delta-label { color: var(--text-3); font-weight: 500; font-size: 12px; }

/* Sparkline sits flush against the hero's right edge */
.sparkline-wrap { position: relative; min-width: 0; }
.sparkline-wrap canvas { display: block; width: 100%; height: 108px; }
.sparkline-wrap .chart-tooltip { line-height: 1.35; }
.sparkline-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Snapshot action lives with the number it snapshots, and carries the date of
   the last one so the button has context rather than being a bare verb. */
.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.summary-metrics,
.summary-change-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.summary-metric,
.summary-change {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.022);
}
.summary-metric-label {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}
.summary-metric-value {
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.summary-metric-sub { margin-top: 3px; color: var(--text-3); font-size: 11px; }
.summary-change { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-change-value {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.summary-muted { color: var(--text-3); }

.summary-freshness { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-freshness span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.change-positive { color: var(--pos); }
.change-negative { color: var(--neg); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.dashboard-grid > .card { margin-bottom: 0; }

/* ── Attention panel ───────────────────────────────────────────
   Same chrome as every other card: a .card-head with a .section-title, a
   hairline rule, then rows. It used to carry a bespoke tinted header that made
   it read as an alert bar rather than as part of the dashboard. */
.attention .card-head {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.attention .section-title {
  display: flex;
  align-items: center;
  gap: 7px;
}
.attention-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.attention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--text-2);
}
.attention-item:last-child { border-bottom: none; }
.attention-list > :last-child .attention-item:last-child { border-bottom: none; }
.attention-clickable { cursor: pointer; transition: background var(--transition); }
.attention-clickable:hover { background: var(--surface-2); }
.attention-item .attention-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.attention-warn { background: var(--warn-bg); color: var(--warn); }
.attention-info { background: var(--info-bg); color: var(--info); }
.attention-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.attention-stake {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.attention-item a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.attention-empty {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 12px 14px;
  color: var(--text-3);
  font-size: 13px;
}

/* Legacy warning banner */
.warning {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--warn);
  font-weight: 500;
}
.warning a { color: var(--warn); }

/* ==========================================================================
   Tables — dense
   ========================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 7px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text-2); }

.text-right { text-align: right; }
.text-mono, .number-cell, .numeric {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: -0.02em;
}
.text-mono, .number-cell, .numeric,
td.text-right, th.text-right { font-variant-numeric: tabular-nums; }
.number-cell, .numeric { text-align: right; }
.cell-strong { color: var(--text); font-weight: 600; }
.empty-cell { color: var(--text-3); }

/* ==========================================================================
   Badges, pills, tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-cat {
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.badge-dot { width: 6px; height: 6px; border-radius: 2px; display: inline-block; flex: none; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.src-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}
.tag-link { color: var(--text-2); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.tag-link:hover { color: var(--text); }

/* ==========================================================================
   Allocation rows
   ========================================================================== */

.alloc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(96px, auto);
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.alloc-row:hover { background: var(--surface-2); }
.alloc-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alloc-value {
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.alloc-value .alloc-pct { color: var(--text-3); font-weight: 400; font-size: 11px; margin-left: 5px; }
.alloc-change {
  text-align: right;
  font-size: 11px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.alloc-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.liability-row .alloc-value { color: var(--text-2); }

/* ==========================================================================
   Charts
   ========================================================================== */

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}
.chart-tooltip {
  display: none;
  position: absolute;
  z-index: 90;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-elevated);
}
.chart-tooltip.visible { display: block; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.form-group input,
.form-group select,
.form-group textarea,
.settings-group input,
.urbit-search,
input[type="search"],
select {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.settings-group input:focus,
.urbit-search:focus,
input[type="search"]:focus,
select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-soft);
}
.form-group input::placeholder,
.form-group textarea::placeholder,
input::placeholder { color: var(--text-3); opacity: 0.75; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Repeating address rows inside the position modal */
.addr-list { display: grid; gap: 6px; }
.addr-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}
.addr-row select { padding: 6px 8px; font-size: 12px; }
.addr-row input {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 9px;
}
.addr-remove {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
}
.addr-remove:hover { background: var(--neg-bg); color: var(--neg); border-color: var(--neg-line); }
.addr-status {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
  padding-left: 2px;
}
.addr-status.ok { color: var(--pos); }
.addr-status.err { color: var(--neg); }

/* ==========================================================================
   Modal & toast
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,6,9,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  width: 620px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
}
.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 1;
}
.modal-header h2 { font-size: 15px; font-weight: 650; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 18px; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(460px, calc(100vw - 40px));
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-elevated);
  animation: toastIn 0.22s cubic-bezier(0.16,1,0.3,1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Update walkthrough
   ========================================================================== */

.review-modal { width: 620px; }

.review-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.review-progress {
  height: 2px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.review-progress-fill {
  height: 100%;
  background: var(--text-2);
  transition: width 0.2s ease;
}

.review-counter {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.review-counter .muted-line { text-transform: none; letter-spacing: 0; }

.review-asset {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.review-asset h2 { font-size: 19px; letter-spacing: -0.02em; }
.review-asset .empty-cell { font-size: 13px; font-weight: 400; }

.review-reasons { display: grid; gap: 6px; margin-bottom: 12px; }
.review-reason {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-input);
  font-size: 12.5px;
  color: var(--text-2);
}
.review-reason-high { border-color: var(--warn-line); background: var(--warn-bg); }
.review-reason-label {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.review-reason-high .review-reason-label { color: var(--warn); }

.review-suggest {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 13px;
  margin-bottom: 10px;
}
.review-suggest-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.review-suggest-label { font-size: 13px; font-weight: 600; color: var(--text); }
.review-suggest-price {
  text-align: right;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.review-delta { font-size: 11px; font-weight: 600; margin-top: 2px; }
.review-suggest .btn { width: 100%; }

/* Confidence is a property of the feed, not the number — a thin market gets a
   visible warning rather than being quietly presented as fact. */
.review-confidence-high { border-color: var(--pos-line); }
.review-confidence-low { border-color: var(--warn-line); }
.review-caveat {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.45;
}

.review-manual {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.review-manual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-manual .form-group { margin-bottom: 8px; }
.review-manual .btn { width: 100%; }

.review-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.review-actions-right { display: flex; gap: 6px; flex-wrap: wrap; }

kbd {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,0.28);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  opacity: 0.75;
}
.btn-primary kbd { border-color: rgba(0,0,0,0.2); background: rgba(0,0,0,0.1); }

.review-empty { text-align: center; padding: 28px 12px; display: grid; gap: 10px; justify-items: center; }
.review-empty h2 { font-size: 18px; }
.review-done-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pos-bg);
  border: 1px solid var(--pos-line);
  color: var(--pos);
  font-size: 18px;
}
.review-summary {
  list-style: none;
  text-align: left;
  width: 100%;
  display: grid;
  gap: 5px;
  margin-top: 4px;
}
.review-summary li {
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-input);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.review-remaining {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 7px;
  justify-items: start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  font-size: 12.5px;
  color: var(--text-2);
}
.review-remaining strong { color: var(--warn); }

/* ==========================================================================
   Positions
   ========================================================================== */

.pos-actions { display: flex; gap: 4px; justify-content: flex-end; }
.pos-actions button { padding: 3px 8px; font-size: 11px; }
/* Quiet row actions: 50 loud buttons on screen drown out the data. */
.pos-actions .btn-secondary { background: transparent; border-color: transparent; color: var(--text-3); }
.pos-actions .btn-secondary:hover { background: var(--surface-3); color: var(--text); }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.search-wrap { flex: 1 1 260px; min-width: 0; }
.table-toolbar select { width: auto; min-width: 150px; }

/* ==========================================================================
   Snapshots
   ========================================================================== */

.snap-card { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.snap-info { flex: 1; min-width: 0; }
.snap-date { font-weight: 600; font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.snap-value {
  font-size: 19px;
  font-weight: 650;
  margin-top: 3px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.snap-notes { color: var(--text-3); font-size: 12px; margin-top: 4px; }

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-group { margin-bottom: 18px; }
.settings-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.settings-group input { max-width: 420px; }
.settings-group .hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }

/* ==========================================================================
   Venture
   ========================================================================== */

.venture-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.venture-stat { text-align: left; padding: 12px 14px; background: var(--surface); margin: 0; border: none; border-radius: 0; }
.venture-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 5px;
}
.venture-stat-value {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.tranche-detail td { background: var(--surface-input) !important; }
.tranche-table { padding: 6px 12px 6px 28px; }
.tranche-table table { font-size: 12px; }
.tranche-table th { position: static; font-size: 10px; background: transparent; }

/* ==========================================================================
   Urbit holdings
   ========================================================================== */

.urbit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}
.urbit-header h2 { font-size: 22px; font-weight: 680; letter-spacing: -0.025em; }
.urbit-subtitle, .urbit-updated { color: var(--text-3); font-size: 12px; }
.urbit-subtitle { margin-top: 4px; font-family: var(--mono); overflow-wrap: anywhere; }
.urbit-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.urbit-metric { background: var(--surface); border: none; border-radius: 0; padding: 12px 14px; box-shadow: none; }
.urbit-metric-value {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.urbit-valuation {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-2);
  font-size: 13px;
}
.urbit-valuation span:first-child { color: var(--text); font-weight: 650; }
.urbit-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.urbit-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.urbit-count { margin-left: 4px; opacity: 0.7; }
.urbit-search { width: 240px; max-width: 100%; }
.urbit-table { width: 100%; min-width: 860px; border-collapse: collapse; }
.urbit-table th, .urbit-table td { padding: 7px 10px; vertical-align: middle; }
.urbit-table td { font-size: 13px; }
.urbit-table .sortable { cursor: pointer; user-select: none; }
.urbit-table a { color: var(--text); text-decoration: none; font-weight: 550; border-bottom: 1px solid var(--line-strong); }
.urbit-table a:hover { border-bottom-color: var(--text); }
.urbit-sigil-cell { width: 56px; }
.urbit-sigil {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.urbit-sigil svg { display: block; width: 40px; height: 40px; }
.urbit-source-new { background: var(--pos-bg); color: var(--pos); }
.urbit-source-existing { background: rgba(255,255,255,0.06); color: var(--text-2); }
.urbit-source-account { background: var(--warn-bg); color: var(--warn); }
.urbit-holder { color: var(--text-3); font-family: var(--mono); font-size: 11px; }

/* ==========================================================================
   Reports
   ========================================================================== */

.report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-xs);
  border-bottom: 1px solid var(--line-soft);
}
.report-item:last-child { border-bottom: none; }
.report-item-active { background: var(--surface-2); }
.report-item-info { display: flex; gap: 14px; align-items: center; min-width: 0; }
.report-date { font-weight: 600; font-size: 13px; color: var(--text); font-family: var(--mono); }
.report-size { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.report-item-actions { display: flex; gap: 6px; flex: none; }

.report-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 8px;
}
.report-content h2 { font-size: 17px; color: var(--text); margin: 22px 0 8px; }
.report-content h3 { font-size: 15px; color: var(--text); margin: 18px 0 6px; }
.report-content h4 { font-size: 13px; color: var(--text); margin: 14px 0 5px; }
.report-content strong { color: var(--text); }
.report-content ul { margin: 6px 0 10px 20px; list-style: disc; }
.report-content li { margin: 3px 0; }
.report-content hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.report-content p { margin: 8px 0; }

.report-textarea {
  width: 100%;
  min-height: 480px;
  background: var(--surface-input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}
.report-textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }

/* ==========================================================================
   Strategy dashboard
   ========================================================================== */

.strategy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}
.strategy-header h2 { font-size: 22px; font-weight: 680; letter-spacing: -0.025em; }
.strategy-subtitle,
.strategy-muted,
.strategy-confidence,
.strategy-ticket-note { color: var(--text-3); font-size: 12px; }
.strategy-header-status { text-align: right; }
.strategy-badge {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-line);
  margin-bottom: 5px;
}

.strategy-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.strategy-metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
}
.strategy-metric-label {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.strategy-metric-value {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.strategy-metric-sub { margin-top: 3px; color: var(--text-3); font-size: 11px; }
.strategy-metric-danger { border-color: var(--neg-line); background: var(--neg-bg); }
.strategy-metric-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.strategy-metric-good { border-color: var(--pos-line); background: var(--pos-bg); }

.strategy-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.strategy-scenarios > .card, .strategy-two-col > .card { min-width: 0; margin-bottom: 0; }
.strategy-scenario { border-radius: var(--radius-sm); }
.strategy-scenario-active {
  border-color: var(--accent-line);
  box-shadow: inset 0 0 0 1px var(--accent-soft), var(--shadow-card);
}
.strategy-scenario-top,
.strategy-card-head,
.strategy-section-row,
.strategy-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.strategy-scenario h3 { margin: 11px 0 6px; font-size: 15px; font-weight: 650; }
.strategy-scenario p, .strategy-scenario-strategy { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.strategy-scenario-strategy { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.strategy-prob { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.strategy-prob-track { height: 4px; background: var(--surface-input); border-radius: 999px; overflow: hidden; }
.strategy-prob-fill { height: 100%; background: var(--text-2); }
.strategy-regime-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin: 2px 0 10px;
}
.strategy-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
}
.strategy-action-plan {
  border-color: var(--accent-line);
  background: linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 60%);
}
.strategy-action-label {
  padding: 4px 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.strategy-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.strategy-action-block {
  min-width: 0;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.strategy-action-primary { border-color: var(--accent-line); background: var(--accent-soft); }
.strategy-action-kicker {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.strategy-action-block h3 { font-size: 15px; line-height: 1.25; margin-bottom: 8px; }
.strategy-action-number {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.strategy-action-delta,
.strategy-action-meta,
.strategy-action-next { font-size: 12.5px; font-weight: 600; }
.strategy-action-block p, .strategy-action-block li { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.strategy-action-block p { margin-top: 8px; }
.strategy-action-next { color: var(--text); margin-top: 10px; }
.strategy-action-block ul { margin: 6px 0 0 18px; }

.strategy-price-strip { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.strategy-price-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.strategy-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.strategy-price-card {
  min-width: 0;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}
.strategy-price-symbol { color: var(--text); font-weight: 700; letter-spacing: 0.04em; font-size: 12px; }
.strategy-price-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.strategy-price-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.strategy-price-source { margin-top: 6px; color: var(--text-3); font-size: 10px; overflow-wrap: anywhere; }

.strategy-factor-list {
  margin-top: 14px;
  background: rgba(255,255,255,0.022);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
}
.strategy-factor-list ul { margin: 0 0 0 18px; }
.strategy-factor-list li { color: var(--text-2); font-size: 12.5px; line-height: 1.5; margin: 3px 0; }

.strategy-signals { margin-bottom: 14px; border-color: var(--info-line); }
.strategy-signal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.strategy-signal-stats div {
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.strategy-signal-stats span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.strategy-signal-stats strong { display: block; margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
.strategy-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.strategy-signal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  padding: 12px;
}
.strategy-signal-good { border-color: var(--pos-line); background: var(--pos-bg); }
.strategy-signal-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.strategy-signal-muted { opacity: 0.82; }
.strategy-signal-top { display: flex; justify-content: space-between; gap: 10px; }
.strategy-signal-card h3 { margin: 0; font-size: 14px; line-height: 1.25; }
.strategy-signal-card p, .strategy-signal-card li { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.strategy-signal-card p { margin-top: 8px; }
.strategy-signal-card ul { margin: 8px 0 0 18px; }
.strategy-signal-score { flex: 0 0 auto; color: var(--text); font-size: 11px; font-weight: 800; text-align: right; }
.strategy-signal-evidence-title { color: var(--text-3); font-size: 11px; margin-top: 2px; }

.strategy-suggestion-table { margin-top: 12px; }
.strategy-history-card { margin-bottom: 14px; }
.strategy-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.strategy-history-stat {
  min-width: 0;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
}
.strategy-history-stat span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.strategy-history-stat strong { display: block; margin-top: 3px; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.strategy-history-chart { margin-top: 12px; min-height: 340px; }
.strategy-history-chart canvas { display: block; max-width: 100%; }

.strategy-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.strategy-section-row { margin: 18px 0 8px; }
.strategy-edit-table { min-width: 760px; }
.strategy-wide-table { min-width: 1040px; }
.strategy-milestone-table { min-width: 1180px; }
.strategy-edit-table input,
.strategy-edit-table select,
.strategy-edit-table textarea,
.strategy-eval-actions input {
  width: 100%;
  padding: 6px 9px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}
.strategy-edit-table textarea { min-width: 220px; resize: vertical; }
.strategy-category-row td {
  background: var(--surface-2) !important;
  color: var(--text);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.strategy-ticket-stance {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-transform: capitalize;
}
.strategy-ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.strategy-ticket-item {
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
}
.strategy-ticket-item span {
  display: block;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.strategy-ticket-item strong { display: block; margin-top: 3px; font-size: 16px; font-variant-numeric: tabular-nums; }
.strategy-eval-actions { margin-top: 12px; }
.strategy-eval-actions input { max-width: 260px; }
.strategy-alerts { margin-bottom: 14px; }

/* ==========================================================================
   Audit / claimables shells (standalone pages share the shell)
   ========================================================================== */

.audit-shell, .claimables-shell {
  padding: 20px;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  gap: 14px;
}
.audit-header, .claimables-header, .value-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.audit-header h1, .claimables-header h1, .value-header h1 {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.025em;
}
.audit-header p, .claimables-header p { color: var(--text-3); font-size: 13px; margin-top: 4px; max-width: 68ch; }
.value-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.value-address-line { color: var(--text-3); font-size: 12px; font-family: var(--mono); margin-top: 4px; overflow-wrap: anywhere; }
.value-actions, .audit-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.status-strip, .summary-strip, .value-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.status-strip > div, .summary-strip > div, .value-summary > div {
  background: var(--surface);
  padding: 11px 13px;
  min-width: 0;
}
.status-label, .summary-label, .value-cell span:first-child {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.status-strip strong, .summary-strip strong, .value-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.value-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.value-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.value-section-header h2 { font-size: 13px; font-weight: 650; }
.value-section-header span { color: var(--text-3); font-size: 11px; }
.value-section-body { padding: 12px 14px; }
.value-subsection { margin-top: 12px; }
.value-table, .audit-table, .claimables-table, .reconcile-table,
.scan-only-table, .out-of-scope-table { width: 100%; }
.audit-table-panel, .claimables-table-panel, .adapter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.adapter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.adapter-panel h2 { font-size: 13px; margin-bottom: 10px; }
.adapter-row, .source-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.adapter-row:last-child, .source-row:last-child { border-bottom: none; }
.adapter-name, .source-name { color: var(--text); font-weight: 550; }
.claimables-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.claimables-controls input { flex: 1 1 260px; }
.claimables-controls select { width: auto; min-width: 160px; }
.scan-status { color: var(--text-3); font-size: 12px; }
.empty-value-state { color: var(--text-3); font-size: 13px; padding: 8px 0; }
.value-note-list { margin: 0 0 0 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.55; }
.address-cell, .nonce-cell, .metamask-order, .key-file-tag, .wallet-label {
  font-family: var(--mono);
  font-size: 11.5px;
}
.asset-label { color: var(--text); font-weight: 550; }
.asset-muted { color: var(--text-3); font-size: 11px; }
.component-stack { display: grid; gap: 2px; }
.chain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.opportunity-title { color: var(--text); font-weight: 550; }
.permission-summary { color: var(--text-3); font-size: 12px; }
.sort-header {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort-indicator { color: var(--text-3); font-size: 9px; }
.audit-status-chip, .audit-row-action, .row-action, .actions-cell { white-space: nowrap; }
.workflow-help { position: relative; display: inline-block; }
.help-trigger {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.workflow-popover {
  display: none;
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 80;
  width: 360px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-elevated);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.workflow-popover ol { margin-left: 16px; }
.workflow-help:hover .workflow-popover, .help-trigger:focus + .workflow-popover { display: block; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  :root { --sidebar-w: 188px; }
  .summary-primary { grid-template-columns: 1fr; }
  .strategy-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand { padding: 0 8px 0 0; flex: none; }
  .sidebar-group { margin-bottom: 0; display: flex; gap: 2px; }
  .sidebar-group-label { display: none; }
  .nav-link { white-space: nowrap; padding: 6px 10px; }
  .nav-link.active::before { display: none; }
  .sidebar-foot { display: none; }
  .main, .audit-shell, .claimables-shell { padding: 14px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .review-manual-fields { grid-template-columns: 1fr; }
  .review-actions, .review-actions-right { flex-direction: column; align-items: stretch; }
  .addr-row { grid-template-columns: 1fr 28px; }
  .addr-row select { grid-column: 1 / -1; }
  .net-worth-value { font-size: 32px; }
  .urbit-header, .strategy-header, .urbit-toolbar { display: block; }
  .urbit-updated, .strategy-header-status { margin-top: 8px; text-align: left; }
  .urbit-search { width: 100%; }
  .urbit-filters { margin-bottom: 10px; }
  .strategy-card-head,
  .strategy-section-row,
  .strategy-actions,
  .strategy-eval-actions { align-items: stretch; flex-direction: column; }
  .strategy-eval-actions input { max-width: none; }
  .topbar { padding: 0 14px; }
  .topbar .chip { display: none; }

  /* Mobile table: stack cells */
  table.mobile-stack thead { display: none; }
  table.mobile-stack tbody tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.mobile-stack tbody td { display: flex; justify-content: space-between; padding: 3px 0; border: none; }
  table.mobile-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .snap-card { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 520px) {
  .net-worth-value { font-size: 27px; }
  .kpi-value, .summary-metric-value { font-size: 16px; }
  .strategy-ticket-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Scrollbars
   ========================================================================== */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ── Venture rows are editable in place ── */
.venture-row { cursor: pointer; }
.venture-row:hover td { background: var(--surface-2); }
.venture-stale {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 10px;
}
.venture-stat-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* A dead position is history, not a live holding — muted, but still legible. */
.venture-row-dead td { opacity: 0.62; }
.venture-row-dead:hover td { opacity: 1; }
