/* Trail Forensics explorer: design tokens and layout.
   Palette: paper, panel, ink, quiet, rule, trail (green), warn (frozen): the main site's neutral near-black with one blue accent, dark only.
   Type: Atkinson Hyperlegible Next 400/700 for text; IBM Plex Mono with slashed zero for addresses, hashes and amounts.
   Layout: full width; identity header, balance strip, three bordered panels (summary | flow graph | selected), tabbed tables.
   900-1199 px: selected panel under the graph. Under 900 px: stacked. */

@font-face { font-family: "Atkinson Next"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Next"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Next"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Next"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

/* Dark only, like the main site: one night-teal palette for every visitor. */
:root {
  --paper: #0b0c10; --panel: #111318; --ink: #f3f4f6; --quiet: #9aa1ad; --rule: #1f232b; --wash: #171a21;
  --trail: #3563e9; --trail-ink: #7ea4ff; --trail-soft: #121c38; --warn: #f08a63; --warn-soft: #2a1a16;
  --exchange: #b29ae0; --service: #d6b24a; --unknown: #9aabb7; --reported: #f0956a; --sanctioned: #ff7b86; --shade: rgba(0, 0, 0, .6); --edge: #606878; --path: #7ea4ff; --dot: #1a1d24;
  --on-trail: #ffffff;
  --sans: "Atkinson Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --bar: 64px; --gutter: 24px; --gap: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--trail-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--trail-ink); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--trail); color: var(--on-trail); padding: 8px 12px; z-index: 5; }
.skip:focus { top: 8px; }
.muted { color: var(--quiet); }
.num { text-align: right; white-space: nowrap; }
.t { white-space: nowrap; }
.addr, .hash, .address { font-family: var(--mono); font-variant-numeric: slashed-zero; font-feature-settings: "zero"; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; min-width: 0; }

/* Text pages sit in one centred column; the data pages use the full width */
.text-page main { max-width: calc(760px + 2 * var(--gutter)); margin-inline: auto; }
.text-page .prose, .text-page .form-card { max-width: none; }
.text-page .account-grid { grid-template-columns: minmax(0, 1fr); }

/* Header bar */
.bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 24px; height: var(--bar);
  padding: 0 var(--gutter); background: rgba(11, 12, 16, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand img { display: block; }
.brand-sub { font-weight: 400; color: var(--quiet); }
.bar-search { flex: 1; display: flex; gap: 8px; min-width: 0; max-width: 880px; }
.bar-search input, .search-row input { flex: 1; min-width: 0; font: 400 15px/1 var(--mono); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 0 14px; height: 42px; }
.bar-search input::placeholder, .search-row input::placeholder { color: var(--quiet); }
.bar-search button, .search-row button { border: 0; background: var(--trail); color: var(--on-trail); font-weight: 700;
  padding: 0 20px; border-radius: 6px; height: 42px; white-space: nowrap; }
.bar-search button:hover, .search-row button:hover { background: var(--trail-ink); }
/* Wide: brand | centred search | account, the two sides equal so the search sits in the middle */
@media (min-width: 900px) {
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 880px) minmax(0, 1fr); }
  .bar .brand { justify-self: start; }
  .bar .account-link { justify-self: end; grid-column: 3; }
}
.account-link { margin-left: auto; display: inline-flex; align-items: center; height: 38px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 6px;
  font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.account-link:hover { border-color: var(--quiet); }
.account-email { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* Home: headline, lookup card and the freeze pulse */
.lookup { padding: 56px var(--gutter) 40px; display: grid; gap: 32px; }
@media (min-width: 1200px) { .lookup { grid-template-columns: minmax(0, 1fr) 460px; gap: 48px; align-items: end; } }
.lookup h1 { font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -.012em; max-width: 20ch; }
.lead { color: var(--quiet); font-size: 18px; margin-top: 14px; max-width: 66ch; }
.search-card { margin-top: 28px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 20px; }
.search-card label { display: block; font-weight: 700; margin-bottom: 10px; }
.search-row { display: flex; gap: 10px; }
.search-row input { height: 56px; font-size: 18px; }
.search-row button { height: 56px; padding: 0 28px; font-size: 17px; }
.hint { color: var(--quiet); font-size: 14px; margin-top: 12px; }
.pulse { margin: 0; padding: 18px 20px; }
.pulse figcaption { font-weight: 700; margin-bottom: 10px; }
.pulse-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 56px; gap: 12px; align-items: end; padding: 3px 0; font-size: 14px; }
.pulse-chain { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-bars { width: 100%; height: 28px; display: block; }
.pulse-bars rect { fill: var(--warn); }
.pulse-bars rect.nil { fill: var(--rule); }
.pulse-bars rect:hover { fill: var(--ink); }
.pulse-axis { display: flex; justify-content: space-between; margin: 6px 68px 0 104px; font-size: 12px; color: var(--quiet); }
.block { padding: 8px var(--gutter) 48px; }
.block-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.012em; }
.block-head p { color: var(--quiet); font-size: 14px; }
.table-card { padding: 4px 8px; }
.table-card .block-head { padding: 14px 12px 4px; margin: 0; }
.batch summary { cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 700; }
.batch ul { list-style: none; margin: 8px 0 0; padding: 0; }
.batch li { display: flex; gap: 24px; flex-wrap: wrap; }
.batch li + li { margin-top: 4px; }
.batch-tx { color: var(--quiet); }

/* Entity, search and message pages */
.entity-head { padding: 40px var(--gutter) 16px; }
.entity-head h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.012em; }
.chip-cat { display: inline-block; margin-top: 10px; padding: 2px 10px; border-radius: 999px; background: var(--trail-soft); color: var(--trail-ink); font-size: 14px; font-weight: 700; }
.entity-head .lead { margin-top: 10px; }
.message { padding-bottom: 64px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chips a { text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; font-size: 14px; }
.chips a:hover { border-color: var(--quiet); }
.chips a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.count { color: var(--quiet); margin-left: 4px; }
.chips a[aria-current="page"] .count { color: inherit; opacity: .75; }

/* Tables: the freeze pages' table style */
.scroll { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { text-align: left; font-weight: 700; color: var(--quiet); padding: 10px 12px; border-bottom: 2px solid var(--rule);
  white-space: nowrap; background: var(--panel); }
.data th.num { text-align: right; }
.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; white-space: nowrap; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: var(--wash); }
.data tr.zero td { color: var(--quiet); }  /* zero-value transfers: often address poisoning; muted, not hidden */
.data td.addr, .data td.hash { font-size: 13px; }
.data td.label-cell { min-width: 28ch; white-space: normal; }  /* the one column that wraps; the table scrolls in its box */
.data .empty, p.empty { color: var(--quiet); padding: 24px 12px; }
.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.data th button:focus-visible { outline: 3px solid var(--trail-ink); outline-offset: 2px; }
.data th button::after { content: ""; width: 0; height: 0; border: 4px solid transparent; opacity: .35;
  border-top-color: currentColor; margin-top: 4px; }
.data th[aria-sort="ascending"] button::after { border-top-color: transparent; border-bottom-color: currentColor; margin: 0 0 4px; opacity: 1; }
.data th[aria-sort="descending"] button::after { opacity: 1; }
.data th[aria-sort] { color: var(--ink); }
.peer-name { display: block; font-family: var(--sans); color: var(--quiet); font-size: 13px; }
.dir { font-weight: 700; }
.dir-in { color: var(--trail-ink); }
.dir-out { color: var(--quiet); }
.pager { display: flex; gap: 16px; align-items: center; padding: 12px; font-size: 14px; color: var(--quiet); }
.pager button { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 12px; font-size: 14px; color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }
.table-note { padding: 8px 12px; font-size: 14px; }

/* The record marker and warn tags */
.marker { width: 18px; height: 16px; flex: none; }
.marker-body { fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.marker-eyes { fill: var(--panel); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; margin-right: 8px; }
.tag-warn, .tag-frozen, .tag-sanctioned { color: var(--warn); }

/* Address page: identity header and balance strip */
.identity { padding: 20px var(--gutter) 16px; background: var(--panel); border-bottom: 1px solid var(--rule); }
.id-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.chains { display: flex; gap: 4px; font-size: 14px; }
.chains a, .chains span { text-decoration: none; color: var(--ink); padding: 2px 10px; border-radius: 6px; border: 1px solid var(--rule); }
.chains [aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
.id-name { margin-top: 12px; font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -.012em; }
.id-address { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.address { font-size: 18px; line-height: 1.45; font-weight: 400; word-break: break-all; }
.address-lead { font-size: 24px; margin-top: 8px; }
.copy { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 10px; font-size: 13px; color: var(--quiet); }
.copy:hover { color: var(--ink); border-color: var(--quiet); }
.facts-row { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--wash); color: var(--quiet); font-size: 14px; }
.fact-warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.strip { padding: 12px var(--gutter); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.balances { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.balances div { display: flex; flex-direction: column; }
.balances dt { color: var(--quiet); font-size: 13px; }
.balances dd { font-size: 20px; font-weight: 700; text-align: left; }
.more { font-size: 14px; color: var(--quiet); margin-left: auto; }
.strip-note { font-size: 15px; color: var(--quiet); }
.notice { color: var(--ink); margin-right: 8px; }

/* Workspace: three bordered panels and the tables */
.workspace { display: grid; gap: var(--gap); padding: var(--gap) var(--gutter) 0; grid-template-columns: 320px minmax(0, 1fr) 340px;
  grid-template-areas: "summary graph detail" "tables tables tables"; }
.summary { grid-area: summary; padding: 18px 20px 24px; }
.graph-col { grid-area: graph; display: flex; flex-direction: column; overflow: hidden; }
.detail { grid-area: detail; padding: 18px 20px 24px; }
.tables { grid-area: tables; min-width: 0; margin: 0 calc(-1 * var(--gutter)); }

.facts + .facts { margin-top: 24px; }
.summary { display: flex; flex-direction: column; }
.trace-offer { margin-top: auto; padding: 18px; border: 1px solid var(--trail); border-radius: 8px; background: var(--trail-soft); }
#signals { margin-bottom: 24px; }
.trace-offer h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.trace-offer p { font-size: 14px; color: var(--ink); }
.trace-offer p + p { margin-top: 14px; }
.trace-offer .btn { height: 40px; }
.trace-offer .trace-price { font-size: 13px; color: var(--quiet); margin-top: 10px; }
.facts h2, .detail h2, .graph-head h2, .panel-h { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.facts p + p { margin-top: 6px; }
.label-card + .label-card { margin-top: 12px; }
.label-name { font-weight: 700; font-size: 17px; }
.meta { color: var(--quiet); font-size: 14px; }
.signal { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.signal .marker { margin-top: 2px; }
.external { font-size: 14px; }
.freeze-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.freeze-list li { display: flex; gap: 10px; align-items: flex-start; }
.freeze-list li + li { margin-top: 8px; }
.freeze-list strong { color: var(--warn); }
.freeze-list .since { display: block; color: var(--quiet); }

/* Flow graph plate: the map's dot grid */
.graph-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 20px 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); }
.graph-head h2 { margin: 0; }
.graph-head p { font-size: 14px; }
.plate { position: relative; flex: none; min-height: 520px; height: calc(100vh - var(--bar) - 64px);
  background-color: var(--paper); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 19px 19px; }
.plate > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plate-empty { position: absolute; left: var(--gutter); right: var(--gutter); top: 45%; text-align: center; color: var(--quiet); }
.col-label { fill: var(--quiet); font-size: 13px; font-weight: 700; }
.edge { fill: none; stroke: var(--edge); stroke-opacity: .75; stroke-linecap: round; }
.edge.hot { stroke: var(--path); stroke-opacity: 1; }
.arrow { fill: var(--edge); }
.arrow-hot { fill: var(--path); }
.node { cursor: pointer; outline: none; }
.ring { fill: var(--panel); stroke: var(--role); stroke-width: 3; }
.halo { fill: none; stroke: var(--role); stroke-width: 1.2; stroke-dasharray: 3 3; }
.icon { fill: none; stroke: var(--role); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node .focus { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; opacity: 0; }
.node:hover .ring { fill: var(--wash); }
.node.sel .focus, .node:focus-visible .focus { opacity: 1; }
.node:focus-visible .focus { stroke-width: 3; }
.n-exchange { --role: var(--exchange); }
.n-service { --role: var(--service); }
.n-unknown { --role: var(--unknown); }
.n-reported { --role: var(--reported); }
.n-sanctioned { --role: var(--sanctioned); }
.n-self { --role: var(--trail); }
.n-self .ring { fill: var(--trail); stroke: var(--trail); }
.n-self .icon { stroke: var(--on-trail); }
.cap { fill: var(--ink); font-size: 13px; font-weight: 700; }
.cap.mono { font-family: var(--mono); font-weight: 400; }
.sub { fill: var(--quiet); font-size: 12px; font-family: var(--mono); }
.st { fill: var(--warn); font-family: var(--sans); font-weight: 700; }
.cap, .sub, .st { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--quiet); margin: 0;
  padding: 10px 20px 12px; list-style: none; border-top: 1px solid var(--rule); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 18px; height: 18px; overflow: visible; }

/* Selected panel */
.detail .role { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.detail .role svg { width: 22px; height: 22px; overflow: visible; }
.detail .address { font-size: 15px; }
.detail dl { margin-top: 16px; display: grid; }
.detail dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.detail dt { color: var(--quiet); white-space: nowrap; }
.detail dd { text-align: right; }
.detail .open { display: inline-block; margin-top: 16px; font-weight: 700; }
.detail .label-card { margin-top: 16px; }
.detail .frozen-by { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: var(--warn-soft); }
.detail .frozen-by .marker { margin-top: 2px; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 0 var(--gutter); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tabs [role="tab"] { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 12px 11px; font-weight: 700;
  color: var(--quiet); white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--trail); }
.tabs [role="tab"]:hover { color: var(--ink); }
.panel { padding: 12px var(--gutter) 40px; }
.panel > .scroll, .panel > section > .scroll { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 4px 8px; }
.js .panel-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.panel-h { margin-top: 16px; }

/* Locked panel: live data needs an account (or the month's free addresses are used up) */
.workspace.is-locked { grid-template-columns: 320px minmax(0, 1fr); grid-template-areas: "summary graph" "tables tables"; grid-template-rows: auto; }
.locked { grid-area: graph; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: 40px;
  min-height: 320px; background-color: var(--paper); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 19px 19px; }
.locked h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.012em; max-width: 24ch; }
.locked p { max-width: 60ch; color: var(--quiet); font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.locked p.actions { margin-top: 4px; }
.btn { display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border: 1px solid var(--trail); border-radius: 6px;
  background: var(--trail); color: var(--on-trail); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--trail-ink); border-color: var(--trail-ink); }
.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { background: var(--wash); border-color: var(--quiet); }
.btn-warn { background: var(--warn); border-color: var(--warn); color: var(--paper); }
.btn-warn:hover { background: var(--warn); border-color: var(--ink); }
.done { color: var(--trail-ink); font-weight: 700; }
.locked p.done { color: var(--trail-ink); }

/* Sign-in and account pages */
.form-card { padding: 20px; max-width: 720px; }
.btn-provider { display: flex; align-items: center; justify-content: center; gap: 12px; height: 48px; border-radius: 6px;
  background: #fff; color: #1f1f1f; font-weight: 700; text-decoration: none; border: 1px solid #dadce0; }
.btn-provider:hover { background: #f1f3f4; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--quiet); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.form-card label { display: block; font-weight: 700; margin-bottom: 10px; }
.form-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.account-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.account-grid .prose { max-width: none; }
.prose .actions { margin-top: 8px; }
.used { list-style: none; padding: 0; }
.prose ul.used { padding-left: 0; }
.used .addr { font-size: 14px; word-break: break-all; }

/* Wide: the instrument fills the window and the tab bar stays in sight; long side panels scroll inside */
@media (min-width: 1200px) {
  .workspace { grid-template-rows: max(480px, calc(100vh - var(--bar) - 352px)) auto; }
  /* Scroll shadows: a shade at an edge only while there is more to scroll (covers move with the content) */
  .summary, .detail { overflow-y: auto;
    background: linear-gradient(var(--panel) 30%, transparent) center top, linear-gradient(transparent, var(--panel) 70%) center bottom,
      radial-gradient(farthest-side at 50% 0, var(--shade), transparent) center top,
      radial-gradient(farthest-side at 50% 100%, var(--shade), transparent) center bottom, var(--panel);
    background-repeat: no-repeat; background-size: 100% 40px, 100% 40px, 100% 16px, 100% 16px;
    background-attachment: local, local, scroll, scroll; }
  .plate { flex: 1; height: auto; min-height: 0; }
}
/* Medium: selected drops under the graph */
@media (max-width: 1199px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "summary graph" "summary detail" "tables tables"; }
  .plate { height: 540px; }
}
/* Narrow: everything stacks; the flow runs vertically */
@media (max-width: 899px) {
  :root { --gutter: 16px; --gap: 10px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "graph" "detail" "tables"; }
  .plate { min-height: 0; height: auto; }
  .plate > svg { position: relative; height: auto; }
  .bar { gap: 12px; height: auto; min-height: var(--bar); flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; position: static; }
  .bar-search { order: 3; flex-basis: 100%; max-width: none; }
  .lookup { padding: 32px var(--gutter) 24px; }
  .lookup h1 { font-size: 32px; }
  .search-row { flex-direction: column; }
  .search-row input { flex: none; height: 52px; font-size: 16px; }
  .id-name { font-size: 26px; }
  .address-lead { font-size: 19px; }
  .entity-head h1 { font-size: 26px; }
  .balances { gap: 8px 24px; }
  .more { margin-left: 0; }
  .workspace.is-locked { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "graph" "tables"; }
  .locked { padding: 28px var(--gutter); min-height: 0; }
  .locked h2 { font-size: 24px; }
  .account-email { max-width: 16ch; }
}


/* Footer */
/* Footer as on trailforensics.com: company line left, links right, always at the bottom of the window */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: 48px;
  padding: 28px var(--gutter) 40px; border-top: 1px solid var(--rule); color: var(--quiet); font-size: 14px; }
.foot a { color: var(--quiet); }
.foot a:hover { color: var(--ink); }
.prose { padding: 20px 24px; max-width: 72ch; }
.prose h2 { font-size: 18px; margin: 18px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { margin: 8px 0; }

/* Trace result: the answer, the summary, the flow by steps, a card per origin, notes, the full-report offer.
   Kind colours: exchange violet, service gold, frozen warm, sanctioned red, not followed grey, wallets blue. */
.trace-page main { max-width: 1440px; margin-inline: auto; padding: 0 var(--gutter); display: grid; gap: 24px; }
.k-exchange { --k: var(--exchange); } .k-service { --k: var(--service); } .k-frozen { --k: var(--warn); }
.k-sanctioned, .k-reported { --k: var(--sanctioned); } .k-unattributed { --k: var(--unknown); } .k-other { --k: var(--edge); }
.k-wallet { --k: var(--trail-ink); } .k-root { --k: var(--warn); }
.trace-id { padding-top: 24px; display: grid; gap: 10px; }
.trace-crumb { font-size: 14px; color: var(--quiet); }
.trace-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.trace-wallet .address { font-size: 16px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.trace-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.trace-answer { font-size: clamp(30px, 4.4vw, 56px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; max-width: 22ch; text-wrap: balance; }
.trace-answer span { display: block; }
.trace-answer .lead-part { color: var(--service); }
.trace-sub { margin-top: 12px; color: var(--quiet); font-size: 17px; }
.trace-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.trace-actions .muted { font-size: 14px; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.trace-summary { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); }
.trace-total { padding: 20px 22px; display: grid; gap: 6px; align-content: start; }
.trace-total > .muted { font-size: 14px; }
.trace-big { font-size: 30px; }
.split { display: block; width: 100%; height: 10px; border-radius: 5px; margin-top: 12px; }
.split rect { fill: var(--k); }
.split-key { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--quiet); }
.split-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--k); margin-right: 6px; vertical-align: -1px; }
.split-key .mono { color: var(--ink); }
.trace-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; overflow: hidden; }
.trace-tiles div { padding: 16px 20px; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); margin: 0 0 0 -1px; }
.trace-tiles div:nth-child(-n+2) { border-top: 0; }
.trace-tiles dt { font-size: 13px; color: var(--quiet); }
.trace-tiles dd { font-size: 24px; font-weight: 700; line-height: 1.3; }
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border-top: 1px solid var(--rule); }
.flow-scroll { overflow-x: auto; padding: 8px 12px 12px; min-width: 0; }
.flow { display: block; max-width: 100%; min-width: 820px; height: auto; }
.flow-head { font-size: 12px; fill: var(--quiet); }
.flow .band { fill: none; stroke: var(--k); stroke-opacity: .5; stroke-linecap: round; transition: stroke-opacity .15s; }
.flow .band:hover, .flow .band.on { stroke-opacity: .95; }
.flow.is-picked .band:not(.on) { stroke-opacity: .12; }
.flow .node { cursor: pointer; outline: none; }
.flow .node circle { fill: var(--k); stroke: var(--paper); stroke-width: 2; }
.flow .node:focus-visible circle, .flow .node.on circle { stroke: var(--ink); stroke-width: 3; }
.flow .node text { font-size: 13px; fill: var(--ink); }
.flow .node .sub { font: 12px var(--mono); fill: var(--quiet); }
.flow .node .addr-label { font: 12px var(--mono); }
.flow-detail { border-left: 1px solid var(--rule); padding: 16px 20px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.flow-detail h3 { font-size: 13px; font-weight: 400; }
.flow-name { font-size: 20px; font-weight: 700; }
.flow-detail .addr { font-size: 13px; overflow-wrap: anywhere; color: var(--trail-ink); }
.flow-detail dl { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.flow-detail dl div { display: flex; justify-content: space-between; gap: 12px; }
.flow-detail dt { color: var(--quiet); }
.flow-detail dd { margin: 0; }
.flow-detail > .muted { font-size: 14px; }
.trace-origins h2, .trace-notes h2, .trace-cta h2 { font-size: 22px; }
.trace-origins > .muted { margin-top: 4px; }
.origin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: 16px; }
.origin { padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.origin.is-big { grid-column: 1 / -1; }
.origin-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.origin-top h3 { font-size: 20px; }
.origin-top small, .origin-amt small { display: block; font-size: 13px; font-weight: 400; color: var(--quiet); }
.origin-amt { text-align: right; font-size: 20px; }
.origin-trail { display: flex; align-items: center; }
.origin-trail .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid var(--quiet); background: var(--paper); }
.origin-trail .start { border: 0; background: var(--k); }
.origin-trail .end { border-color: var(--warn); background: var(--warn); }
.origin-trail .line { flex: 1; height: 3px; min-width: 10px; background: var(--k); }
.origin-steps { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.origin-means { border-top: 1px solid var(--rule); padding-top: 12px; }
.origin-means .muted { display: block; font-size: 13px; margin-bottom: 2px; }
.origin details { font-size: 14px; }
.origin summary { cursor: pointer; color: var(--trail-ink); }
.origin-routes { margin: 8px 0 0; padding-left: 20px; color: var(--quiet); line-height: 1.9; }
.origin-routes .addr { font-size: 13px; }
.trace-notes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; border-top: 1px solid var(--rule); padding-top: 24px; }
.trace-list { display: grid; margin: 12px 0 0; }
.trace-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.trace-list dt { color: var(--ink); }
.trace-list dd { margin: 0; color: var(--quiet); text-align: right; }
.trace-estimate { margin-top: 14px; font-size: 14px; max-width: 70ch; }
.trace-cta { padding: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  border-color: var(--trail); background: var(--trail-soft); }
.trace-cta > div { max-width: 70ch; display: grid; gap: 6px; }
.trace-run { display: flex; gap: 8px; }
.trace-run select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 0 10px; }
.trace-wait h1 { font-size: 28px; }
.trace-wait .address { font-size: 15px; overflow-wrap: anywhere; }
.trace-progress { margin: 16px 0 8px; font-size: 18px; }
@media (max-width: 1099px) {
  .trace-summary, .trace-notes { grid-template-columns: minmax(0, 1fr); }
  .flow-wrap { grid-template-columns: minmax(0, 1fr); }
  .flow-detail { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 699px) {
  .origin-grid { grid-template-columns: minmax(0, 1fr); }
  .trace-tiles dd { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .flow .band { transition: none; } }

/* Trace: frozen wallet panel, where the money went, next steps */
.trace-frozen { padding: 20px 22px; border-color: var(--warn); background: var(--warn-soft); display: grid; gap: 8px; }
.trace-frozen h2 { font-size: 20px; color: var(--warn); display: flex; gap: 8px; align-items: center; }
.trace-onward h2, .trace-next h2 { font-size: 22px; }
.trace-onward > .muted { margin-top: 4px; max-width: 80ch; }
.trace-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.trace-table th { text-align: left; color: var(--quiet); font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.trace-table td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.trace-table .addr { font-size: 13px; }
.trace-next { padding: 20px 22px; display: grid; gap: 10px; }
.trace-next ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
@media (max-width: 699px) { .trace-table { display: block; overflow-x: auto; } }

/* Trace pictures: tabs, route lines, circle, outgoing */
.graph-tabs { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.graph-tabs button { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; }
.graph-tabs button[aria-pressed="true"] { border-color: var(--trail); color: var(--trail-ink); }
.graph-panel { padding: 8px 12px 12px; }
.flow .lab { font-size: 13px; fill: var(--ink); }
.flow .lab.warn { fill: var(--warn); font-weight: 700; }
.flow line.band, .flow-radial .band, .flow-out .band { fill: none; stroke: var(--k); stroke-opacity: .5; stroke-linecap: round; stroke-linejoin: round; }
.flow .dot-origin { fill: var(--k); stroke: var(--paper); stroke-width: 2; }
.flow .dot-wallet { fill: var(--trail-ink); stroke: var(--paper); stroke-width: 2; }
.flow .dot-root { fill: var(--warn); stroke: var(--paper); stroke-width: 2; }
.flow .ring { fill: none; stroke: var(--rule); stroke-dasharray: 3 5; }
.graph-out { margin-top: 12px; padding: 8px 12px; }
/* Phones: a wide picture scrolls inside its own box and never widens the page (grid items default to min-width: auto) */
.trace-page main > *, .graph-panel, .graph-out, .flow-wrap > * { min-width: 0; }
.trace-page main { grid-template-columns: minmax(0, 1fr); }
.trace-short { padding: 18px 22px; display: grid; gap: 8px; }
.trace-short h2 { font-size: 20px; }
.trace-short ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 17px; }
/* Release request form */
.release-page main { max-width: calc(860px + 2 * var(--gutter)); }
.release-form { display: grid; gap: 16px; }
.release-form label { display: block; margin: 12px 0 4px; font-weight: 700; font-size: 14px; }
.release-form input:not([type=checkbox]):not([type=file]), .release-form textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; }
.release-form input[type=file] { margin-top: 6px; color: var(--quiet); }
.release-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.release-q { border-top: 1px solid var(--rule); padding-top: 4px; margin-top: 12px; }
.release-q label { font-weight: 400; }
.sign-text { background: var(--wash); border-radius: 6px; padding: 10px 12px; }
.release-received { border-top: 1px solid var(--rule); padding-top: 10px; }

/* Staff: paid orders */
.order-list { display: grid; gap: 12px; }
.order { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 16px 20px; }
.order-main { flex: 1 1 340px; min-width: 0; }
.order-main p { margin: 0 0 4px; }
.order-main .addr { font-size: 14px; word-break: break-all; }
.order-actions .btn { height: 40px; padding: 0 18px; }
.order-actions form { margin: 0; }
.order-held { border-color: var(--trail); }

/* Paid trace on the address page */
.trace-buy { display: grid; gap: 10px; }
.trace-buy .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.trace-buy .check input { margin-top: 3px; }
.trace-buy select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; }
.trace-buy .btn { justify-self: start; }
