/* =============================================================================
   FUND FLOW — Full-screen force-directed graph with floating overlays
   ============================================================================= */

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

:root {
  --zinc-950: #09090b;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-200: #e4e4e7;
  --zinc-100: #f4f4f5;
  --zinc-50:  #fafafa;
  --red-400:  #f87171;
  --red-500:  #ef4444;
  --red-700:  #b91c1c;
  --violet-400: #a78bfa;
  --blue-400: #60a5fa;
  --green-400: #4ade80;
  --amber-500: #d4a017;
}

body {
  background: var(--zinc-950);
  color: var(--zinc-300);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Dot grid ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(circle, var(--zinc-700) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

/* ── Vignette ── */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(24,24,27,0.15) 0%, transparent 55%, rgba(0,0,0,0.25) 100%);
}

/* =============================================================================
   STATS STRIP — 36px ultra-thin
   ============================================================================= */

#stats-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.94);
  border-bottom: 1px solid var(--zinc-800);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

#stats-strip.collapsed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.strip-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--zinc-50);
  letter-spacing: 0.8px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px solid var(--zinc-800);
  text-transform: uppercase;
}

.strip-title .dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red-500);
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { opacity: 1; box-shadow: 0 0 4px rgba(239,68,68,0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 10px rgba(239,68,68,0.7); }
}

.strip-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px;
  border-right: 1px solid rgba(39,39,42,0.6);
  height: 100%;
}

.strip-label {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--zinc-300);
  font-weight: 500;
  line-height: 1;
}

.strip-value {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.strip-stolen .strip-value { color: var(--red-400); }
.strip-frozen .strip-value { color: #60a5fa; }
.strip-laundered .strip-value { color: var(--violet-400); }
.strip-wallets .strip-value { color: var(--blue-400); }
.strip-exchanges .strip-value { color: var(--amber-500); }

.strip-cell[data-highlight] {
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 4px;
  padding: 2px 10px;
  margin: 0 -2px;
}
.strip-cell[data-highlight]:hover {
  background: rgba(255,255,255,0.04);
}
.strip-cell[data-highlight].active-filter {
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.strip-spacer { flex: 1; }

.strip-nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--zinc-300);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--zinc-700);
  white-space: nowrap;
  transition: all 0.15s ease;
  margin-right: 4px;
}
.strip-nav-link:hover {
  color: var(--zinc-100);
  border-color: var(--zinc-500);
  background: rgba(39,39,42,0.3);
}

.strip-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border-radius: 3px;
  border: 1px solid var(--zinc-700);
  color: var(--zinc-300);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.strip-icon-link:hover {
  color: var(--zinc-100);
  border-color: var(--zinc-500);
  background: rgba(39,39,42,0.3);
}

.strip-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--red-400);
  background: rgba(185,28,28,0.08);
  border: 1px solid rgba(185,28,28,0.2);
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  user-select: none;
  margin-left: 12px;
  margin-right: 6px;
}


/* =============================================================================
   LEGEND — floating bottom-left, starts collapsed
   ============================================================================= */

#legend {
  position: fixed;
  bottom: 44px; left: 10px;
  z-index: 100;
  background: rgba(9,9,11,0.85);
  border: 1px solid rgba(39,39,42,0.5);
  border-radius: 6px;
  padding: 0;
  font-size: 11px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 200px;
  user-select: none;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

#legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(39,39,42,0.4);
  transition: background 0.15s ease;
}
#legend-header:hover { background: rgba(39,39,42,0.2); }

#legend-header h4 {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--zinc-300);
  font-weight: 600;
  margin: 0;
}

#legend-toggle {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-300);
  transition: transform 0.2s ease;
}

#legend-body {
  padding: 5px 8px 6px;
  max-height: 280px;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease;
  overflow: hidden;
}
#legend-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 8px;
}

.legend-section { margin-bottom: 4px; }
.legend-section:last-child { margin-bottom: 0; }

.legend-section-title {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--zinc-300);
  margin-bottom: 1px;
  font-weight: 600;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 0;
  color: var(--zinc-300);
  font-family: 'Geist', sans-serif;
  font-size: 12px;
}

.legend-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.legend-line {
  width: 12px; height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
  opacity: 0.8;
}

.legend-badge {
  display: inline-block;
  padding: 0px 3px;
  border-radius: 2px;
  font-family: 'Geist Mono', monospace;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* =============================================================================
   CHAIN FILTER PILLS — floating bottom-left
   ============================================================================= */

#chain-filters {
  position: fixed;
  bottom: 10px; left: 10px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  max-width: min(calc(100vw - 20px), 720px);
}

.chain-pill {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--zinc-700);
  background: transparent;
  color: var(--zinc-300);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chain-pill:hover {
  border-color: var(--zinc-300);
  color: var(--zinc-300);
}

.chain-pill.active {
  background: var(--zinc-800);
  border-color: var(--zinc-300);
  color: var(--zinc-200);
}

.chain-pill[data-chain="ETH"].active { background: rgba(91,147,212,0.2); border-color: rgba(91,147,212,0.5); color: #8bb8e8; }
.chain-pill[data-chain="BSC"].active { background: rgba(212,160,23,0.2); border-color: rgba(212,160,23,0.5); color: #e8c84a; }
.chain-pill[data-chain="TRON"].active { background: rgba(212,99,122,0.2); border-color: rgba(212,99,122,0.5); color: #e88a9e; }
.chain-pill[data-chain="CROSS"].active { background: rgba(61,158,78,0.2); border-color: rgba(61,158,78,0.5); color: #6ed47e; }

.filter-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: rgba(82,82,91,0.65);
}

.edge-threshold-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(63,63,70,0.85);
  background: rgba(9,9,11,0.86);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.edge-threshold-prefix {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--zinc-400);
  white-space: nowrap;
}

#edge-threshold-input {
  width: 68px;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--zinc-100);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#edge-threshold-input::placeholder {
  color: var(--zinc-500);
}

#edge-threshold-input::-webkit-outer-spin-button,
#edge-threshold-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.edge-threshold-pill {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--zinc-700);
  background: rgba(9,9,11,0.82);
  color: var(--zinc-400);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.edge-threshold-pill:hover {
  border-color: var(--zinc-500);
  color: var(--zinc-200);
}

.edge-threshold-pill.active {
  background: rgba(220,74,74,0.12);
  border-color: rgba(220,74,74,0.4);
  color: #fca5a5;
}

@media (max-width: 780px) {
  #chain-filters {
    max-width: min(calc(100vw - 20px), 460px);
  }

  .edge-threshold-control {
    order: 2;
  }
}

/* =============================================================================
   CONTROLS — floating bottom-right, icon buttons
   ============================================================================= */

#controls {
  position: fixed;
  bottom: 10px; right: 10px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#controls button {
  background: rgba(9,9,11,0.85);
  border: 1px solid var(--zinc-800);
  color: var(--zinc-300);
  width: 38px; height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#controls button:hover {
  background: var(--zinc-900);
  border-color: var(--zinc-700);
  color: var(--zinc-50);
}

#controls button:active {
  transform: scale(0.97);
}

.kbd {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--zinc-300);
  background: rgba(39,39,42,0.4);
  padding: 0px 3px;
  border-radius: 2px;
  border: 1px solid rgba(63,63,70,0.4);
  line-height: 1.3;
}

/* =============================================================================
   TOOLTIP — frosted glass with colored left border
   ============================================================================= */

#tooltip {
  position: fixed;
  z-index: 200;
  background: rgba(24,24,27,0.92);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--zinc-500);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  max-width: 340px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 12px 40px rgba(0,0,0,0.5),
    0 2px 8px rgba(0,0,0,0.3);
}

#tooltip.visible { opacity: 1; }

.tt-name {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--zinc-50);
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(39,39,42,0.5);
}

.tt-row {
  display: flex;
  gap: 5px;
  margin: 2px 0;
  line-height: 1.4;
}

.tt-label {
  font-family: 'Geist', sans-serif;
  color: var(--zinc-300);
  min-width: 44px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
}

.tt-value {
  color: var(--zinc-300);
  word-break: break-all;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================================================
   SEARCH OVERLAY
   ============================================================================= */

#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(9,9,11,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  transition: opacity 0.15s ease;
}

#search-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#search-box {
  width: 420px;
  max-width: 90vw;
  background: rgba(24,24,27,0.95);
  border: 1px solid var(--zinc-700);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

#search-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--zinc-800);
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--zinc-200);
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  caret-color: var(--blue-400);
}

#search-input::placeholder {
  color: var(--zinc-300);
}

.kbd-hint {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-300);
  background: rgba(39,39,42,0.4);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(63,63,70,0.4);
}

#search-results {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--zinc-700) transparent;
}

#search-results::-webkit-scrollbar { width: 4px; }
#search-results::-webkit-scrollbar-track { background: transparent; }
#search-results::-webkit-scrollbar-thumb { background: var(--zinc-700); border-radius: 2px; }

.search-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.search-result:hover,
.search-result.active {
  background: rgba(39,39,42,0.4);
}

.search-result-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-result-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-200);
}

.search-result-address {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--zinc-300);
  margin-left: auto;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-chain {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* =============================================================================
   DETAIL CARD — floating right side
   ============================================================================= */

#detail-card {
  position: fixed;
  z-index: 150;
  width: 310px;
  max-height: calc(100vh - 80px);
  background: rgba(18,18,20,0.95);
  border: 1px solid var(--zinc-800);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--zinc-700) transparent;
  transition: opacity 0.15s ease, transform 0.15s ease;
  right: 12px;
  top: 50px;
}

#detail-card::-webkit-scrollbar { width: 4px; }
#detail-card::-webkit-scrollbar-track { background: transparent; }
#detail-card::-webkit-scrollbar-thumb { background: var(--zinc-700); border-radius: 2px; }

#detail-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
}

#detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--zinc-800);
}

#detail-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#detail-label {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--zinc-50);
}

#detail-chain-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
}

#detail-status-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
}

#detail-close {
  background: none;
  border: none;
  color: var(--zinc-300);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
#detail-close:hover { color: var(--zinc-200); }

#detail-body {
  padding: 8px 12px 12px;
}

#detail-address-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 6px;
  background: rgba(39,39,42,0.25);
  border-radius: 4px;
}

#detail-address {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--zinc-300);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#detail-copy {
  background: none;
  border: none;
  color: var(--zinc-300);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
#detail-copy:hover {
  color: var(--zinc-200);
  background: rgba(39,39,42,0.4);
}

.detail-field {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-300);
  margin-bottom: 8px;
}

#detail-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-link-btn {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--zinc-700);
  background: rgba(39,39,42,0.3);
  color: var(--zinc-300);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-block;
}

.detail-link-btn:hover {
  background: rgba(39,39,42,0.6);
  border-color: var(--zinc-300);
  color: var(--zinc-100);
}

.detail-flow-section {
  margin-bottom: 6px;
}

.detail-flow-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--zinc-300);
  margin-bottom: 2px;
}

.detail-flow-item {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--zinc-300);
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.15s;
  border-bottom: 1px solid rgba(39,39,42,0.3);
}

.detail-flow-item:hover {
  color: var(--zinc-200);
}

.detail-age {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--zinc-300);
  padding: 2px 0 4px;
}

.detail-flow-arrow-in { color: var(--green-400); }
.detail-flow-arrow-out { color: var(--red-400); }
.detail-flow-time {
  display: block;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: var(--zinc-500);
  margin-left: 14px;
  margin-top: 1px;
}

.detail-tx-link {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 3px 6px;
  border-radius: 3px;
  color: var(--blue-400);
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.detail-tx-link:hover {
  opacity: 1;
  background: rgba(96, 165, 250, 0.15);
}

.detail-thorchain-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  margin: 3px 0;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 4px;
  color: var(--zinc-300);
  font-size: 12px;
  font-family: 'Geist Mono', monospace;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.detail-thorchain-link:hover {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.3);
}
.detail-thorchain-link svg { flex-shrink: 0; opacity: 0.5; }

.detail-note {
  margin-top: 8px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--zinc-300);
  border-top: 1px solid var(--zinc-800);
}

/* =============================================================================
   SVG GRAPH
   ============================================================================= */

svg { display: block; }

.link {
  fill: none;
  stroke-opacity: 0.35;
  transition: stroke-opacity 0.15s ease;
}

.link-label-bg {
  fill: var(--zinc-950);
  stroke: rgba(39,39,42,0.3);
  stroke-width: 0.5;
  rx: 3; ry: 3;
  pointer-events: none;
  opacity: 0.92;
}

.link-label {
  font-family: 'Geist Mono', monospace;
  font-size: 7.5px;
  fill: var(--zinc-500);
  pointer-events: none;
  font-weight: 500;
  text-anchor: middle;
}

.node-group { cursor: grab; }
.node-group:active { cursor: grabbing; }

.node-circle {
  stroke-width: 1.5;
  transition: filter 0.15s ease;
}

.node-group:hover .node-circle {
  filter: brightness(1.4) drop-shadow(0 0 8px currentColor);
  stroke-width: 2;
}

.node-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  fill: var(--zinc-300);
  text-anchor: middle;
  pointer-events: none;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--zinc-950);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.node-sublabel {
  font-family: 'Geist Mono', monospace;
  font-size: 6.5px;
  fill: var(--zinc-500);
  text-anchor: middle;
  pointer-events: none;
  font-weight: 400;
  paint-order: stroke;
  stroke: var(--zinc-950);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

.chain-badge-text {
  font-family: 'Geist Mono', monospace;
  font-size: 6px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: 0.5px;
}

.status-badge-text {
  font-family: 'Geist Mono', monospace;
  font-size: 5.5px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ── Flow dots ── */
.flow-dot {
  fill: currentColor;
  opacity: 0;
  pointer-events: none;
}

/* =============================================================================
   MINIMAP — bottom-right corner above controls
   ============================================================================= */

#minimap-container {
  position: fixed;
  bottom: 60px;
  right: 14px;
  z-index: 100;
  width: 160px;
  height: 120px;
  background: rgba(9,9,11,0.85);
  border: 1px solid var(--zinc-800);
  border-radius: 6px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#minimap { width: 100%; height: 100%; }

/* =============================================================================
   WATERMARK
   ============================================================================= */

#watermark {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: rgba(39,39,42,0.35);
  letter-spacing: 2px;
  z-index: 50;
  user-select: none;
  text-transform: uppercase;
  font-weight: 400;
}

/* =============================================================================
   LIVE BALANCE CHECKER
   ============================================================================= */

#live-alert-banner {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(127, 29, 29, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 600px;
  backdrop-filter: blur(12px);
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--zinc-100);
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: alertSlideIn 0.3s ease-out;
}
@keyframes alertSlideIn {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.live-alert-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.live-alert-content { flex: 1; }
.live-alert-content strong { color: #fca5a5; font-size: 12px; }
.live-alert-close {
  background: none;
  border: none;
  color: var(--zinc-300);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.live-alert-close:hover { color: var(--zinc-300); }

#live-status {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.live-status-checking {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--blue-400);
}
.live-status-ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .flow-dot { display: none; }
  .strip-title .dot { animation: none; opacity: 1; }
}
