:root {
  --primary: #6366f1;
  --primary-soft: rgba(99,102,241,.15);
  --bg: #0b1120;
  --bg-soft: #141c2e;
  --bg-card: rgba(20,28,46,.92);
  --bg-card-hover: rgba(26,36,58,.95);
  --text: #e2e8f0;
  --text-muted: #7a8ba8;
  --text-dim: #4a5a75;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --border: rgba(255,255,255,.06);
  --border-light: rgba(255,255,255,.1);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --role-IN: #ef4444; --role-BA: #a78bfa; --role-CL: #38bdf8;
  --role-SH: #94a3b8; --role-DS: #22c55e; --role-OR: #f59e0b;
  --role-CT: #fbbf24; --role-EX: #fb923c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; font-size: 14px; overflow-x: hidden;
}

/* ── Header ── */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px,4vw,48px);
  background: rgba(11,17,32,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-weight: 800; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.logo span { color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 10px; }

/* Search */
.search-box {
  position: relative;
}
.search-input {
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px 6px 30px;
  color: var(--text); font-size: .78rem; width: 200px;
  outline: none; transition: all .2s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--primary); width: 280px; background: rgba(255,255,255,.08); }
.search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: .8rem; pointer-events: none;
}
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); max-height: 320px; overflow-y: auto;
  z-index: 60; display: none; box-shadow: var(--shadow);
}
.search-results.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; font-size: .82rem;
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.focused { background: rgba(255,255,255,.05); }
.search-result-name { flex: 1; }
.search-result-balance { color: var(--success); font-size: .75rem; font-variant-numeric: tabular-nums; }

.badge {
  font-size: .65rem; padding: 3px 10px; border-radius: 999px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge-synced { background: rgba(34,197,94,.12); color: var(--success); }
.badge-lag    { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-stale  { background: rgba(239,68,68,.12); color: var(--danger); }
#status-seq { font-size: .72rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.app { position: relative; }
.view { transition: opacity .35s ease, transform .35s ease; }
.view.hidden { opacity: 0; pointer-events: none; position: absolute; inset: 0; transform: scale(.97); }
.view.visible { opacity: 1; pointer-events: auto; position: relative; transform: scale(1); }

/* ══ LANDING ══ */
.landing { padding: clamp(20px,4vw,48px) clamp(16px,4vw,48px); max-width: 1280px; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 36px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 22px 24px; position: relative; overflow: hidden; cursor: pointer;
  transition: all .15s;
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.sc-tx::before    { background: var(--info); }
.stat-card.sc-epoch::before { background: var(--primary); }
.stat-card.sc-wallet::before{ background: var(--success); }
.stat-card.sc-lag::before   { background: var(--warning); }
.stat-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-sub { font-size: .72rem; color: var(--text-dim); margin-top: 4px; }

.section-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin-bottom: 16px;
}

/* Pipeline */
.flow-pipeline {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 40px; flex-wrap: wrap;
  padding: 28px 20px;
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
}
.pipeline-node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 20px; border-radius: var(--radius-sm); min-width: 80px;
  background: rgba(255,255,255,.03); border: 2px solid transparent;
  cursor: pointer; transition: all .15s; user-select: none;
}
.pipeline-node:hover { background: rgba(255,255,255,.07); transform: translateY(-2px); }
.pipeline-node.active { border-color: var(--primary); background: rgba(99,102,241,.08); }
.pipeline-role { font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 6px; }
.pipeline-balance { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipeline-count { font-size: .65rem; color: var(--text-dim); }
.pipeline-arrow { font-size: 1.2rem; color: var(--text-dim); padding: 0 8px; flex-shrink: 0; user-select: none; }

/* Wallet Grid */
.wallet-grid { margin-bottom: 40px; }
.wallet-group { margin-bottom: 24px; }
.wallet-group.filtered-out { display: none; }
.wallet-group-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.wallet-group-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wallet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.wallet-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; position: relative;
}
.wallet-card:hover {
  background: var(--bg-card-hover); border-color: var(--border-light);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.wallet-card .role-tag { font-size: .65rem; font-weight: 800; padding: 3px 7px; border-radius: 5px; letter-spacing: .05em; flex-shrink: 0; }
.wallet-card-info { flex: 1; min-width: 0; }
.wallet-card-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-card-balance { font-size: .75rem; color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.wallet-card-source { font-size: .65rem; color: var(--text-dim); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.type-chip {
  font-size: .58rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.06); color: var(--text-muted); flex-shrink: 0;
}
.type-chip.t-website { background: rgba(56,189,248,.12); color: var(--info); }
.type-chip.t-addon   { background: rgba(167,139,250,.12); color: var(--role-BA); }

/* Anon Blocks */
.anon-section { margin-bottom: 40px; }
.anon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.anon-block {
  background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--border); padding: 14px 16px;
  cursor: pointer; transition: all .15s;
}
.anon-block:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.anon-block.expanded { border-color: var(--primary); }
.anon-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .8rem; }
.anon-header-num { font-weight: 700; }
.anon-header-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.anon-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.anon-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }
.anon-fill.open { background: linear-gradient(90deg, var(--info), #818cf8); animation: pulse-bar 2s ease-in-out infinite; }
.anon-fill.sealed { background: var(--success); }
@keyframes pulse-bar { 0%,100%{opacity:1}50%{opacity:.6} }
.anon-meta { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-dim); }
.anon-status-open { color: var(--info); font-weight: 600; }
.anon-status-sealed { color: var(--success); }
.anon-detail {
  display: none; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: .75rem;
}
.anon-block.expanded .anon-detail { display: block; }
.anon-detail-row { display: flex; justify-content: space-between; padding: 4px 0; }
.anon-detail-label { color: var(--text-dim); }

/* ══ MODAL ══ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); animation: modal-in .2s ease;
}
@keyframes modal-in { from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)} }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head-title { font-weight: 700; font-size: .95rem; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.modal-close:hover { background: rgba(255,255,255,.05); color: var(--text); }
.modal-content {
  overflow-y: auto; padding: 20px; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.modal-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.modal-row:last-child { border-bottom: none; }
.modal-row-label { color: var(--text-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.modal-row-value { text-align: right; max-width: 65%; word-break: break-all; }
.modal-row-value.clickable { color: var(--primary); cursor: pointer; }
.modal-row-value.clickable:hover { text-decoration: underline; }
.modal-row-value.amount { color: var(--success); font-size: 1.1rem; font-weight: 700; }
.modal-json {
  background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; font-family: monospace; font-size: .75rem; color: #a5b4fc;
  white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; margin-top: 4px;
}

/* ══ EXPLORER ══ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px clamp(16px,4vw,48px);
  background: rgba(11,17,32,.6); border-bottom: 1px solid var(--border);
  font-size: .78rem; min-height: 42px;
}
.bc-item {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted); cursor: pointer; padding: 3px 8px;
  border-radius: 6px; transition: all .12s; background: none; border: none; font: inherit;
}
.bc-item:hover { color: var(--text); background: rgba(255,255,255,.05); }
.bc-item.active { color: var(--text); font-weight: 600; cursor: default; }
.bc-item.active:hover { background: none; }
.bc-sep { color: var(--text-dim); font-size: .7rem; user-select: none; }

.stage-viewport { overflow: hidden; position: relative; }
.stage-track { display: flex; width: 200%; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.stage-track.no-transition { transition: none; }
.wallet-stage { width: 50%; flex-shrink: 0; }

.explorer-columns {
  display: grid; grid-template-columns: 1fr 1.6fr 1fr;
  gap: 0; height: calc(100vh - 100px);
}
.col-flows {
  overflow-y: auto; padding: 20px 14px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.col-flows::-webkit-scrollbar { width: 4px; }
.col-flows::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.col-center {
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 28px 24px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.col-center::-webkit-scrollbar { width: 4px; }
.col-center::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.col-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-dim); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.col-title-count { font-weight: 500; color: var(--text-dim); font-size: .65rem; }

/* Flow cards */
.flow-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; margin-bottom: 8px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; position: relative;
}
.flow-card::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 3px;
}
.col-inflows .flow-card::after { left: 0; background: var(--fc-color, var(--text-dim)); }
.col-outflows .flow-card::after { right: 0; background: var(--fc-color, var(--text-dim)); }
.col-inflows .flow-card:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--border-light); }
.col-outflows .flow-card:hover { transform: translateX(-4px); box-shadow: var(--shadow); border-color: var(--border-light); }
.flow-card-info { flex: 1; min-width: 0; }
.flow-card-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-card-detail { font-size: .7rem; color: var(--text-muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.flow-card-amount { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.col-inflows .flow-card-amount { color: var(--success); }
.col-outflows .flow-card-amount { color: var(--danger); }
.flow-card-arrow { font-size: .9rem; color: var(--text-dim); flex-shrink: 0; }

/* Flow card hover preview */
.flow-card-preview {
  display: none; position: absolute; z-index: 30;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 10px 12px;
  box-shadow: var(--shadow); width: 260px; font-size: .75rem;
  animation: fade-in .15s ease;
}
@keyframes fade-in { from{opacity:0}to{opacity:1} }
.col-inflows .flow-card:hover .flow-card-preview { display: block; left: 100%; top: 0; margin-left: 6px; }
.col-outflows .flow-card:hover .flow-card-preview { display: block; right: 100%; top: 0; margin-right: 6px; }
.preview-tx { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border); }
.preview-tx:last-child { border-bottom: none; }
.preview-tx-amount { font-weight: 600; }
.preview-tx-time { color: var(--text-dim); }

/* Role tags */
.role-tag {
  display: inline-block; font-size: .6rem; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .05em;
  flex-shrink: 0; line-height: 1.4;
}
.role-IN { background: rgba(239,68,68,.15); color: var(--role-IN); }
.role-BA { background: rgba(167,139,250,.15); color: var(--role-BA); }
.role-CL { background: rgba(56,189,248,.15); color: var(--role-CL); }
.role-SH { background: rgba(148,163,184,.12); color: var(--role-SH); }
.role-DS { background: rgba(34,197,94,.15); color: var(--role-DS); }
.role-OR { background: rgba(245,158,11,.15); color: var(--role-OR); }
.role-CT { background: rgba(251,191,36,.15); color: var(--role-CT); }
.role-EX { background: rgba(251,146,60,.15); color: var(--role-EX); }
.role-unknown { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* Center panel */
.center-hero { text-align: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.center-name { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; word-break: break-all; }
.center-role-tag { font-size: .75rem; padding: 4px 12px; border-radius: 6px; }
.center-balance { font-size: 2.2rem; font-weight: 800; margin-top: 16px; font-variant-numeric: tabular-nums; }
.center-balance-unit { font-size: .9rem; font-weight: 500; color: var(--text-muted); margin-left: 6px; }

.center-addr {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: monospace; font-size: .62rem; color: var(--text-dim);
  margin-top: 10px; padding: 3px 8px; border-radius: 5px;
  background: rgba(255,255,255,.02); cursor: pointer; transition: all .15s;
  max-width: 100%; overflow: hidden; opacity: .55;
}
.center-addr:hover { background: rgba(255,255,255,.06); color: var(--text-muted); opacity: 1; }
.center-addr .copy-icon { font-size: .7rem; flex-shrink: 0; }
.center-addr.copied { background: rgba(34,197,94,.1); color: var(--success); opacity: 1; }
.center-addr-short { display: inline; }
.center-addr-full  { display: none; }
.center-addr.expanded .center-addr-short { display: none; }
.center-addr.expanded .center-addr-full  { display: inline; word-break: break-all; }
.center-domain {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: .82rem; color: var(--text-muted);
}
.center-domain a { color: var(--info); text-decoration: none; }
.center-domain a:hover { text-decoration: underline; }

.alloc-section { margin-bottom: 24px; }
.alloc-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.alloc-bar-track { flex: 1; height: 10px; background: rgba(255,255,255,.05); border-radius: 5px; overflow: hidden; }
.alloc-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.alloc-bar-label {
  font-size: .78rem; min-width: 100px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.alloc-bar-label:hover { color: var(--primary); }
.alloc-bar-pct { font-size: .75rem; font-weight: 700; color: var(--text-muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.meta-section { margin-bottom: 24px; }
.meta-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .82rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.meta-value { color: var(--text); text-align: right; max-width: 60%; word-break: break-all; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.tag-chip { font-size: .65rem; padding: 2px 8px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--text-muted); }

/* Timeline */
.timeline-section { margin-top: 4px; }
.tl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: .8rem; cursor: pointer; transition: background .1s;
  margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px;
}
.tl-item:hover { background: rgba(255,255,255,.03); }
.tl-item:last-child { border-bottom: none; }
.tl-dir {
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0;
}
.tl-dir-in  { background: rgba(34,197,94,.12); color: var(--success); }
.tl-dir-out { background: rgba(239,68,68,.12); color: var(--danger); }
.tl-info { flex: 1; min-width: 0; }
.tl-cp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-time { font-size: .68rem; color: var(--text-dim); margin-top: 1px; }
.tl-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-amount-in  { color: var(--success); }
.tl-amount-out { color: var(--danger); }
.tl-show-more {
  display: block; width: 100%; padding: 10px; text-align: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .78rem; cursor: pointer; margin-top: 8px;
  transition: all .15s;
}
.tl-show-more:hover { background: rgba(255,255,255,.04); color: var(--text); border-color: var(--border-light); }

/* Context menu */
.ctx-menu {
  position: fixed; z-index: 80;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-width: 180px; padding: 4px 0; animation: fade-in .1s ease;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: .78rem; cursor: pointer;
  color: var(--text); transition: background .1s;
}
.ctx-item:hover { background: rgba(255,255,255,.05); }
.ctx-item-icon { color: var(--text-dim); font-size: .9rem; width: 16px; text-align: center; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Copyable values */
.copyable {
  cursor: pointer; position: relative; transition: color .15s;
}
.copyable:hover { color: var(--primary); }
.copyable::after {
  content: '\u2398'; margin-left: 4px; font-size: .7rem; opacity: 0;
  transition: opacity .15s; color: var(--text-dim);
}
.copyable:hover::after { opacity: 1; }

/* Flow totals in column header */
.col-title-total {
  font-size: .72rem; font-weight: 700; margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.col-title-total.positive { color: var(--success); }
.col-title-total.negative { color: var(--danger); }

/* Allocation row hover */
.alloc-bar-row {
  cursor: pointer; padding: 6px 8px; margin: 0 -8px; border-radius: 6px;
  transition: background .1s;
}
.alloc-bar-row:hover { background: rgba(255,255,255,.03); }

/* Wallet card tooltip */
.wallet-card-tip {
  display: none; position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); margin-bottom: 6px;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: .72rem; white-space: nowrap; z-index: 20;
  box-shadow: var(--shadow); pointer-events: none;
}
.wallet-card:hover .wallet-card-tip { display: block; }
.wallet-card-tip-row { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }
.wallet-card-tip-label { color: var(--text-dim); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 8px 18px; font-size: .8rem;
  color: var(--success); box-shadow: var(--shadow); z-index: 200;
  animation: toast-in .2s ease, toast-out .2s ease 1.6s forwards;
}
@keyframes toast-in { from{opacity:0;transform:translateX(-50%) translateY(10px)}to{opacity:1;transform:translateX(-50%) translateY(0)} }
@keyframes toast-out { to{opacity:0;transform:translateX(-50%) translateY(10px)} }

.empty { padding: 40px 16px; text-align: center; color: var(--text-dim); font-size: .85rem; }
.loading-spinner {
  width: 24px; height: 24px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Keyboard hint ── */
.kbd-hint {
  position: fixed; bottom: 16px; right: 16px;
  font-size: .65rem; color: var(--text-dim);
  display: flex; gap: 12px; z-index: 10;
}
.kbd-hint kbd {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  font-family: monospace; font-size: .6rem; margin-right: 3px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .explorer-columns { grid-template-columns: 1fr; height: auto; }
  .col-center { border-left: none; border-right: none; border-bottom: 1px solid var(--border); }
  .col-flows { max-height: 50vh; }
  .mobile-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
  .mobile-tab {
    flex: 1; padding: 10px; text-align: center; font-size: .78rem;
    font-weight: 600; color: var(--text-muted); cursor: pointer;
    border: none; background: none; border-bottom: 2px solid transparent;
  }
  .mobile-tab.active { color: var(--text); border-bottom-color: var(--primary); }
  .flow-pipeline { flex-direction: column; gap: 4px; }
  .pipeline-arrow { transform: rotate(90deg); padding: 2px 0; }
  .center-balance { font-size: 1.6rem; }
  .flow-card-preview { display: none !important; }
  .kbd-hint { display: none; }
  .search-input { width: 140px; }
  .search-input:focus { width: 180px; }
}
@media (min-width: 769px) {
  .mobile-tabs { display: none; }
}

/* coin-ledger additions */
.stat-card.sc-treasury::before { background: var(--role-CT); }
.pipeline-branch { display: flex; flex-direction: column; gap: 8px; }
.intake-node { cursor: default; }
.intake-node:hover { transform: none; }
.or-status { font-size: .72rem; color: var(--text-dim); margin-top: 6px; }
.alloc-ref { font-size: .62rem; color: var(--text-dim); margin-left: 4px; }
