/* SAFU dark theme: one palette, one set of radii and spacing for the whole page. */
:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-2: #0b1120;
  --card: #0f1626;
  --card-2: #151e31;
  --line: #1f2a40;
  --line-strong: #2c3a56;
  --text: #e9eef7;
  --muted: #a3afc4;
  --faint: #7d8aa3;
  --accent: #2de2b4;
  --accent-2: #38bdf8;
  --accent-glow: rgba(45, 226, 180, .28);
  --origin: #f7b84b;
  --hacker: #ff4f7b;
  --exchange: #8f74ff;
  --mixer: #e86bff;
  --recovered: #3ddc84;
  --borrowed: #d4ff3f;
  --unconfirmed: #ffa45c;
  --other: #8a96ad;
  --frozen: #38bdf8;
  --arrow: #3d4b68;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 520px at 85% -120px, rgba(56, 189, 248, .10), transparent 70%),
    radial-gradient(900px 480px at -10% 10%, rgba(45, 226, 180, .07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
a:hover, a:focus-visible { color: #7ff3d4; border-bottom-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
strong { color: #fff; font-weight: 650; }
h1, h2, h3 { letter-spacing: -.01em; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.top { border-bottom: 1px solid var(--line); background: rgba(7, 11, 20, .82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 14px; padding: 12px 20px; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: .14em; font-size: 1.1rem; display: inline-flex; align-items: center; gap: 8px; }
.logo-mark { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent-glow); }

/* Slim top bar */
.top .wrap.top-row { gap: 10px 26px; padding: 10px 20px; }
.top-stat { display: inline-flex; align-items: baseline; gap: 8px; font-size: .92rem; }
.top-k { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.top-v { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.top-v .term { color: transparent; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; border-bottom-color: rgba(45, 226, 180, .5); }
.top-v.small { font-size: .92rem; font-weight: 600; }
.chip { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 1px 8px; border-radius: 999px; border: 1px solid; }
.chip.live { color: var(--accent); border-color: rgba(45, 226, 180, .5); background: rgba(45, 226, 180, .1); }
.chip.saved { color: #ffd99a; border-color: rgba(247, 184, 75, .5); background: rgba(247, 184, 75, .12); }

.term { border-bottom: 1px dashed var(--accent); cursor: help; color: #fff; }
.tip {
  position: fixed; z-index: 30; max-width: min(300px, calc(100vw - 16px)); pointer-events: none;
  background: rgba(21, 30, 49, .97); color: var(--text); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55); padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .86rem; line-height: 1.45; display: grid; gap: 3px;
}
.tip[hidden] { display: none; }
.tip-title { font-size: .95rem; }
.tip-usd { color: #fff; font-weight: 700; }
.tip-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tip-kind { font-size: .7rem; padding: 1px 7px; border-radius: 999px; color: #0a0f1a; font-weight: 700; }
.tip-kind.origin { background: var(--origin); } .tip-kind.hacker { background: var(--hacker); } .tip-kind.exchange { background: var(--exchange); color: #fff; }
.tip-kind.mixer { background: var(--mixer); } .tip-kind.recovered { background: var(--recovered); } .tip-kind.borrowed { background: var(--borrowed); }
.tip-hint { color: var(--faint); font-size: .76rem; margin-top: 2px; }

.section-head { position: relative; max-width: 100%; margin-bottom: 10px; }
.section-head h1, .section-head h2 { margin: 0 0 6px; font-size: 1.45rem; line-height: 1.2; }
.hint { color: var(--muted); margin: 0 0 12px; font-size: .93rem; max-width: 80ch; }
.loading { color: var(--muted); list-style: none; }

/* Timeline: horizontal on wide screens, vertical on phones. */
.tl-section { padding: 26px 0 8px; }
.tl-nav { position: absolute; right: 0; top: 0; display: flex; gap: 6px; }
.tl-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font-size: 1.2rem; cursor: pointer; transition: border-color .15s, color .15s; }
.tl-nav button:hover { border-color: var(--accent); color: var(--accent); }
.tl-list {
  list-style: none; margin: 0; padding: 18px 2px 14px; display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-color: var(--line-strong) transparent;
}
.tl-item { position: relative; flex: 0 0 290px; scroll-snap-align: start; padding-top: 22px; display: flex; }
.tl-item::before { content: ""; position: absolute; top: 6px; left: 0; right: -14px; height: 2px; background: linear-gradient(90deg, rgba(45, 226, 180, .55), rgba(56, 189, 248, .35)); }
.tl-item:last-child::before { right: 50%; }
.tl-dot { position: absolute; top: 0; left: 16px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.tl-card {
  flex: 1; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  background: linear-gradient(170deg, var(--card-2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px 12px; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.tl-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tl-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px rgba(45, 226, 180, .14); }
.tl-item:has(.tl-card.on) .tl-dot { background: var(--accent); }
.tl-card.is-unconfirmed { border-style: dashed; }
.tl-card time { color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tl-card h3 { margin: 0; font-size: 1rem; line-height: 1.3; color: #fff; }
.tl-text { margin: 0; color: #c9d2e2; font-size: .88rem; line-height: 1.5; flex: 1; }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-usd { font-weight: 800; color: #fff; font-size: .95rem; }
.tl-wallets { color: var(--faint); font-size: .76rem; }
.tl-src { margin: 0; color: var(--faint); font-size: .76rem; }
.tl-src a { color: var(--muted); }
.tl-src a:hover { color: var(--accent); }

/* The blockchain visual */
.fv-section { padding: 18px 0 48px; }
.legend { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--c) 45%); box-shadow: 0 0 10px var(--c); }
.ring-icon { width: 13px; height: 13px; border-radius: 50%; border: 2px dashed #7fd6ff; }
.saved-icon { font-size: .7rem; font-weight: 700; color: #ffd99a; }
.fv-selection { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(45, 226, 180, .08); border: 1px solid rgba(45, 226, 180, .35); font-size: .88rem; }
.fv-selection[hidden] { display: none; }
.fv-selection button { background: transparent; color: var(--accent); border: 1px solid rgba(45, 226, 180, .5); border-radius: 999px; padding: 3px 12px; cursor: pointer; font: inherit; font-size: .82rem; }
.fv { position: relative; width: 100%; }
.fv-svg { display: block; overflow: visible; font-family: var(--font); -webkit-tap-highlight-color: transparent; }
.fv-band rect { fill: rgba(255, 255, 255, .018); stroke: rgba(255, 255, 255, .055); }
.fv-band-title { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.fv-band-usd { fill: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.fv-edge path { fill: none; stroke-linecap: round; transition: opacity .3s; }
.fv-edge-glow { opacity: .14; }
.fv-edge-line { opacity: .8; }
.fv-edge.unconfirmed .fv-edge-line { stroke-dasharray: .02 .015; }
.fv-particle { opacity: .95; }
.fv-pg { transition: opacity .3s; }
.fv-node { cursor: pointer; outline: none; transition: opacity .3s; }
.fv-orb { transform-box: fill-box; transform-origin: center; transition: transform .25s var(--ease); }
.fv-halo { opacity: .9; }
.fv-core { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.fv-frozen { fill: none; stroke: #7fd6ff; stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .9; }
.fv-hit { fill: transparent; }
.fv-node:hover .fv-orb, .fv-node.focus .fv-orb, .fv-node:focus-visible .fv-orb { transform: scale(1.12); }
.fv-node:focus-visible .fv-core { stroke: #fff; stroke-width: 2.5; }
.fv-text { transition: opacity .3s; }
.fv-label { fill: #fff; font-size: 12.5px; font-weight: 650; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.fv-sub { font-size: 11.5px; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.fv-usd { fill: var(--muted); font-weight: 600; }
.fv-saved { fill: #ffd99a; font-weight: 700; font-size: 10.5px; }
.fv-unc { fill: #ffc89a; font-weight: 700; font-size: 10.5px; }
.fv-via { fill: var(--borrowed); font-size: 10.5px; font-style: italic; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.fv-edge-label rect { fill: var(--bg-2); stroke: rgba(212, 255, 63, .45); }
.fv-edge-label text { fill: #ecffb0; font-size: 10.5px; font-weight: 700; }
.fv-edge-label { transition: opacity .3s; }
.fv-edge-label.unconfirmed rect { stroke: rgba(255, 164, 92, .7); stroke-dasharray: 4 3; }

/* Highlight: the chosen wallets and their lines stay bright, the rest dims. */
.fv-svg.dim .fv-node:not(.lit), .fv-svg.dim .fv-edge-label:not(.lit) { opacity: .16; }
.fv-svg.dim .fv-edge:not(.lit) path { opacity: .05; }
.fv-svg.dim .fv-pg:not(.lit) { opacity: .08; }
.fv-svg.dim .fv-edge.lit .fv-edge-line { opacity: 1; }
.fv-svg.dim .fv-edge.lit .fv-edge-glow { opacity: .35; }

/* Entrance: lines draw, wallets pop in step by step, then the particles start. */
.fv-anim .fv-orb { animation: fv-pop .7s var(--ease) both; animation-delay: var(--d); }
.fv-anim .fv-text { animation: fv-fade .6s ease both; animation-delay: var(--d); }
.fv-anim .fv-edge path { stroke-dasharray: 1; animation: fv-draw .9s var(--ease) both; animation-delay: var(--d); }
.fv-anim .fv-edge.unconfirmed .fv-edge-line { animation-name: fv-draw-dashed; }
.fv-anim .fv-particles, .fv-anim .fv-edge-labels, .fv-anim .fv-bands { animation: fv-fade 1s ease both; animation-delay: 1.1s; }
.fv-anim .fv-bands { animation-delay: 0s; animation-duration: .6s; }
@keyframes fv-pop { from { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } to { transform: scale(1); } }
@keyframes fv-fade { from { opacity: 0; } }
@keyframes fv-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fv-draw-dashed { from { opacity: 0; } }

.notice {
  background: rgba(247, 184, 75, .08); color: #ffd99a; border: 1px solid rgba(247, 184, 75, .35);
  border-left: 4px solid var(--origin);
  padding: 12px 16px; border-radius: var(--radius-sm); margin: 8px 0 20px;
}


.badge { font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--muted); border: 1px solid var(--line-strong); white-space: nowrap; }
.badge.frozen { background: rgba(56, 189, 248, .15); color: #9fdcff; border-color: rgba(56, 189, 248, .5); }
.badge.unconfirmed { background: rgba(255, 164, 92, .13); color: #ffc89a; border-color: rgba(255, 164, 92, .45); }
.badge.stale { background: rgba(247, 184, 75, .14); color: #ffd99a; border-color: rgba(247, 184, 75, .45); }

/* Detail panel */
.panel { position: fixed; inset: 0; z-index: 20; }
.panel-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, .7); backdrop-filter: blur(3px); }
.panel-body {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100%);
  background: var(--card); border-left: 1px solid var(--line-strong);
  padding: 22px; overflow-y: auto; box-shadow: -20px 0 50px rgba(0, 0, 0, .55);
  animation: panel-in .25s var(--ease);
}
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } }
.panel-close { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; font-size: 1.5rem; line-height: 1; background: var(--card-2); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.panel-close:hover { color: #fff; border-color: var(--accent); }
.panel h3 { margin: 0 44px 4px 0; font-size: 1.25rem; }
.panel p { color: #cfd7e6; }
.panel .kind { color: var(--muted); margin: 0 0 12px; font-size: .9rem; }
.addr { font-family: var(--mono); font-size: .82rem; word-break: break-all; background: var(--bg); color: #cfe9ff; border: 1px solid var(--line); padding: 7px 9px; border-radius: 8px; margin: 4px 0; }
.addr-list { max-height: 260px; overflow-y: auto; }
.addr-row { display: flex; gap: 8px; align-items: center; }
.addr-row .addr { flex: 1; }
.holdings { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .9rem; }
.holdings th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.holdings td, .holdings th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.holdings td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.explorer {
  display: inline-block; margin: 10px 0; padding: 9px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #04110d; font-weight: 700;
  border: 0; transition: box-shadow .18s, transform .18s var(--ease);
}
.explorer:hover, .explorer:focus-visible { color: #04110d; border: 0; transform: translateY(-1px); box-shadow: 0 6px 22px var(--accent-glow); }
.small-link { font-size: .8rem; white-space: nowrap; }

.mono { font-family: var(--mono); }
.panel-usd { font-size: 1.5rem; font-weight: 800; color: var(--k, #fff); margin: 0 0 10px; }

@media (max-width: 760px) {
  .wrap, .top .wrap.top-row { padding-left: 14px; padding-right: 14px; }
  .top .wrap.top-row { gap: 4px 16px; padding-top: 8px; padding-bottom: 8px; }
  .logo { width: 100%; font-size: 1rem; }
  .top-v { font-size: 1rem; }
  .section-head h1, .section-head h2 { font-size: 1.25rem; }
  .tl-nav { display: none; }
  .tl-list { flex-direction: column; overflow: visible; gap: 12px; padding: 4px 0 8px 26px; }
  .tl-item { flex: none; padding-top: 0; }
  .tl-item::before { top: 0; bottom: -12px; left: -19px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, rgba(45, 226, 180, .55), rgba(56, 189, 248, .35)); }
  .tl-item:last-child::before { bottom: 50%; }
  .tl-dot { top: 16px; left: -25px; }
  .tl-card:hover { transform: none; }
  .fv-wrap { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .fv-node:hover .fv-orb, .fv-node.focus .fv-orb, .tl-card:hover { transform: none; }
}
