:root {
  --bg: #0b0f14; --panel: #121820; --panel2: #18202a; --line: #243040;
  --text: #e6edf3; --muted: #8b9bb0; --accent: #3ddbd9; --accent-ink: #04201f;
  --warn: #ffb020; --warn-bg: rgba(255, 176, 32, .12); --danger: #f85149; --ok: #3fb950; --link: #6cb6ff;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 10px;
}
:root[data-theme="light"] {
  --bg: #f3f5f8; --panel: #ffffff; --panel2: #eef2f6; --line: #d6dde6;
  --text: #17212b; --muted: #5b6b7d; --accent: #0b8f8c; --accent-ink: #ffffff;
  --warn: #a35f00; --warn-bg: rgba(214, 137, 0, .13); --danger: #c62828; --ok: #1b7f37; --link: #0b63c5;
}
* { box-sizing: border-box; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { display: inline-block; width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* layout */
#app { display: grid; grid-template-columns: 210px minmax(0, 1fr) 210px; min-height: 100%; }
.side { grid-column: 1; grid-row: 1; align-self: start; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 20px; position: sticky; top: 0; z-index: 8; min-width: 0; height: 100dvh; overflow-y: auto; }
.side-right { grid-column: 3; border-right: 0; border-left: 1px solid var(--line); }
.side-group-title { display:flex; align-items:center; min-height:42px; padding:0 8px; color:var(--muted); font-size:13px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); padding: 0 6px; min-height:42px; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font-size: 16px; letter-spacing: .2px; }
.brand small { color: var(--muted); font-size: 11px; }
.logo { width: 30px; height: 30px; border-radius: 8px; flex: none; background:
  radial-gradient(circle at 50% 50%, var(--warn) 0 4px, transparent 5px),
  linear-gradient(var(--accent), var(--accent)) 50% 50% / 3px 20px no-repeat,
  linear-gradient(var(--accent), var(--accent)) 50% 50% / 20px 3px no-repeat, var(--bg);
  border: 1px solid var(--line); }
:is(#nav, #nav-resources) { display: flex; flex-direction:column; flex:none; gap:8px; min-width:0; width:100%; }
:is(#nav, #nav-resources) a { --nav-color: var(--accent); color: var(--muted); min-width: 0; min-height: 54px; padding: 10px; border-radius: 8px; display: flex; justify-content: flex-start; align-items: center; gap: 10px; font-weight: 500; text-align: left; white-space: normal; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
:is(#nav, #nav-resources) .nav-icon { width: 18px; height: 18px; color: var(--nav-color); }
:is(#nav, #nav-resources) a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
:is(#nav, #nav-resources) a.on { background: color-mix(in srgb, var(--nav-color) 12%, var(--panel2)); color: var(--text); box-shadow: inset 0 -2px 0 var(--nav-color); }
:is(#nav, #nav-resources) i { font-style: normal; font-size: 11px; font-variant-numeric: tabular-nums; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; }
:is(#nav, #nav-resources) i:empty { display: none; }
:is(#nav, #nav-resources) i.warn { color: var(--warn); border-color: var(--warn); }
.side-note { display: none; }
.main { grid-column:2; grid-row:1; min-width: 0; display: flex; flex-direction: column; }
.site-credit { padding: 10px 24px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; text-align: center; }
.developer-credit { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0 4px; padding: 18px 22px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--panel); }
.developer-credit > div { display: grid; gap: 4px; }
.developer-credit-label { color: var(--muted); font-size: 12px; }
.developer-credit strong { color: var(--text); font-size: 15px; }
.developer-credit > div > span:last-child { color: var(--muted); font-size: 13px; }
.developer-credit a { color: var(--accent); font-size: 13px; overflow-wrap: anywhere; }
.top { display: flex; gap: 12px; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
#search { display: flex; gap: 8px; flex: 1; min-width: 0; }
#search input { flex: 1; min-width: 0; }
/* The New case / theme / AP Police logo cluster shows on the Home page only. */
.top-actions { display: none; gap: 8px; flex: none; align-items: center; }
.org-logo { display: block; height: 40px; width: auto; margin-left: 4px; border-radius: 8px; background: #fff; flex: none; }
body.home-page .top { border-bottom: none; background: transparent; }
body.home-page #search { display: none; }
body.home-page .top-actions { display: flex; margin-left: auto; }
/* Every other page keeps just the light / dark button from that cluster
   (the tracer hides this bar and has the same button in its graph tools). */
body:not(.home-page) .top-actions { display: flex; }
body:not(.home-page) .top-actions > :not([data-act="theme"]) { display: none; }
#view { padding: 24px; max-width: 1360px; width: 100%; outline: none; }
#view:has(.tr-canvas) { max-width: none; }
body:has(#view .tr-canvas) .top { display: none; }
body.tracer-popout #app { grid-template-columns: minmax(0, 1fr); }
body.tracer-popout .side, body.tracer-popout #search { display: none; }
body.tracer-popout .top { justify-content: flex-end; }
body.tracer-popout #view { max-width: none; padding: 16px; }

/* controls */
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; width: 100%; }
.btn { font: inherit; font-weight: 600; font-size: 13px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.ic { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 5px; border-radius: 5px; }
.ic:hover { color: var(--text); background: var(--panel2); }

/* page furniture */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.panel > h2 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel > h2 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr)); gap: 16px; }
.grid2 > .panel { margin: 0; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile span { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.tile b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.tile small { color: var(--muted); }
.tile.warn { border-color: var(--warn); background: var(--warn-bg); }
.tile.warn b { color: var(--warn); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"], .toolbar input[type="text"] { flex: 1; min-width: 200px; }
.toolbar label.chk { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.tr-toolbar-filter-fields { display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: end; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.tr-toolbar-filter-fields > label { display: grid; flex: 1 1 120px; gap: 4px; min-width: 112px; max-width: 170px; color: var(--muted); font-size: 10px; }
.tr-toolbar-filter-fields input { width: 100%; min-width: 0; padding: 6px 7px; font-size: 12px; }
.tr-picker-wrap { position: relative; display: block; min-width: 0; }
.tr-picker-wrap input { padding-right: 34px; }
.tr-picker-wrap input::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; right: 0; width: 32px; height: 100%; cursor: pointer; }
.tr-picker-open { position: absolute; top: 50%; right: 3px; display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--accent); cursor: pointer; }
.tr-picker-open:hover, .tr-picker-open:focus-visible { background: var(--panel); outline: 1px solid var(--accent); }
.tr-picker-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-toolbar-filter-fields > button { align-self: end; }
.tr-toolbar-filter-fields > small { align-self: center; color: var(--muted); font-size: 10px; white-space: nowrap; }
#tr-filter-count:not(:empty) { color: var(--accent); }
.tr-add-addresses-collapse { margin: 0 0 12px; }
.tr-add-addresses-collapse > summary { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; white-space: nowrap; width: max-content; }
.tr-add-addresses-collapse > summary::-webkit-details-marker { display: none; }
.tr-add-addresses-collapse > summary::before { content: "+"; color: var(--accent); font-size: 17px; line-height: 1; }
.tr-add-addresses-collapse[open] > summary::before { content: "−"; }
.tr-add-addresses-collapse[open] > .tr-add-addresses { margin-top: 8px; }
.tr-add-addresses { align-items: center; }
.saved-chain-folder { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.saved-chain-folder > summary { cursor: pointer; font-weight: 700; }
.saved-chain-folder .tablewrap { margin-top: 10px; }
.tr-add-detected { flex: 0 0 100%; color: var(--muted); font-size: 12px; }
.tr-add-detected.warn { color: var(--warn, #f59e0b); }
.tr-add-addresses textarea { flex: 1; width: auto; min-width: min(320px, 100%); }
.spacer { flex: 1; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.panel .tablewrap { border: 0; border-radius: 0; margin: 0 -16px -16px; border-top: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--panel2); }
tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.rowact { white-space: nowrap; text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.s-open { color: var(--link); border-color: var(--link); }
.badge.s-under-investigation { color: var(--accent); border-color: var(--accent); }
.badge.s-awaiting-response { color: var(--warn); border-color: var(--warn); }
.badge.s-closed { color: var(--muted); }
.badge.p-critical { background: var(--danger); border-color: var(--danger); color: #fff; }
.badge.p-high { color: var(--danger); border-color: var(--danger); }
.badge.p-medium { color: var(--warn); border-color: var(--warn); }
.badge.role { color: var(--text); border-color: var(--c, var(--line)); box-shadow: inset 3px 0 0 var(--c, var(--line)); border-radius: 5px; }
.chain { display: inline-block; font: 600 10.5px var(--mono); padding: 1px 6px; border-radius: 5px; color: var(--c); border: 1px solid var(--c); white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; margin: 0 4px 2px 0; color: var(--muted); }
.addr { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.addr .mono { white-space: nowrap; }
.xl { font-size: 11px; font-weight: 600; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; white-space: nowrap; color: var(--link); }
.xl:hover { border-color: var(--link); text-decoration: none; }
.hit { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 5px; padding: 0 6px; white-space: nowrap; }
.hit:hover { text-decoration: none; filter: brightness(1.15); }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); background: var(--panel2); border-radius: 5px; padding: 0 6px; margin: 0 4px 3px 0; white-space: nowrap; }

/* case */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; }
.tabs a i.warn { color: var(--warn); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; margin: 0; }
.meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.case-tracer-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.case-tracer-panel h2 { margin: 0 0 4px; }
.case-tracer-panel p { margin: 0; }
.case-tracer-panel ul { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.case-tracer-panel .btn { flex: none; }
@media (max-width: 680px) { .case-tracer-panel { flex-direction: column; } }
.alert { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; }
.alert h2 { color: var(--warn); margin-bottom: 6px; }
.alert ul { margin: 0; padding-left: 18px; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; }
.empty.sm { padding: 22px 12px; }
.empty h2 { color: var(--text); margin-bottom: 6px; font-size: 18px; }
.empty .actions { justify-content: center; margin-top: 16px; }
.welcome-panel { padding: clamp(22px, 4vw, 42px); text-align: left; color: var(--text); background: radial-gradient(ellipse at 88% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 38%), var(--panel); }
.welcome-intro { max-width: 880px; margin: 0 auto; text-align: center; }
.welcome-eyebrow { display: inline-block; margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.welcome-intro h2 { margin-bottom: 10px; font-size: clamp(23px, 3vw, 32px); }
.welcome-intro p { margin: 0 auto; max-width: 820px; color: var(--muted); font-size: 15px; }
.welcome-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 920px; margin: 26px auto; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--panel2) 55%, transparent); }
.welcome-stats > div, .welcome-stats > a { display: grid; align-content: center; gap: 2px; padding: 14px 18px; text-align: center; }
.welcome-stats > a { color: inherit; text-decoration: none; transition: background .16s ease; }
.welcome-stats > a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.welcome-stats > div + div, .welcome-stats > a + div { border-left: 1px solid var(--line); }
.welcome-stats b { color: var(--accent); font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.welcome-stats span { color: var(--muted); font-size: 12px; }
.welcome-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 auto; max-width: 1080px; }
.welcome-features article { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--panel2) 65%, transparent); }
.welcome-feature-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); font-size: 19px; font-weight: 700; }
.welcome-features h3 { margin: 1px 0 5px; font-size: 14px; }
.welcome-features p { margin: 0; color: var(--muted); font-size: 12.5px; }
.welcome-caveat { max-width: 1080px; margin: 18px auto 0; color: var(--muted); font-size: 11.5px; }
.welcome-panel .actions { justify-content: center; margin-top: 20px; }
@media (max-width: 680px) { .welcome-panel { padding: 22px 16px; } .welcome-stats { margin: 20px auto; } .welcome-stats > div { padding: 12px 7px; } .welcome-stats span { font-size: 10px; } .welcome-features { grid-template-columns: 1fr; } }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 34px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 4px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bigaddr { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.exgroup { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.exgroup:last-child { border-bottom: 0; }
.exgroup > span:first-child { min-width: 128px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.legend i.ring { background: none; border: 2px dashed var(--warn); }

/* graph */
.graphbox { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.txdetail-grid { display:grid; grid-template-columns: 160px minmax(0,1fr); gap:10px 18px; overflow-wrap:anywhere; }
.txdetail-grid > span { color:var(--muted); }
.txflow-row { display:grid; grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr) minmax(100px,auto); align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.txflow-row b { color:var(--accent); font-size:22px; text-align:center; }
@media(max-width:700px){.txdetail-grid{grid-template-columns:1fr}.txflow-row{grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr)}.txflow-row strong{grid-column:1/-1}}
svg.graph { display: block; touch-action: none; cursor: grab; user-select: none; }
.gedge { stroke: var(--muted); stroke-width: 1.4; opacity: .7; }
.garrow { fill: var(--muted); }
.gelabel { fill: var(--muted); font: 10.5px var(--mono); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.glabel { fill: var(--text); font: 11px var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
.gdot { stroke: var(--bg); stroke-width: 2; }
.gring { fill: none; stroke: var(--warn); stroke-width: 2; stroke-dasharray: 4 3; }
.gnode { cursor: pointer; }
.gtools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.gtools button { font: 600 12px var(--sans); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer; }

/* modal + toast */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-start; justify-content: center; padding: 5dvh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(680px, 100%); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.modal header, .modal footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px; }
.modal header { border-bottom: 1px solid var(--line); }
.modal footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 16px 18px; }
.modal-body > p { margin: 0 0 12px; }
.modal-intro { color: var(--text); }
.tx-explorer-intro { display: grid; gap: 12px; }
.tx-explorer-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; background: color-mix(in srgb, var(--panel2) 62%, transparent); }
.tx-explorer-field { display: grid; grid-template-columns: minmax(130px, 29%) minmax(0, 1fr); align-items: center; gap: 14px; min-height: 47px; border-bottom: 1px solid var(--line); }
.tx-explorer-field:last-child { border-bottom: 0; }
.tx-explorer-field > span { color: var(--muted); }
.tx-network, .tx-explorer-hash, .tx-address-value { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tx-explorer-hash code, .tx-address-value code { overflow-wrap: anywhere; }
.tx-explorer-field .ic { flex: 0 0 auto; }
.tx-explorer-subtable { width: 100%; margin: 8px 0; }
.tx-explorer-subtable table { min-width: 620px; }
.tx-explorer-subtable td small { display: block; margin-top: 3px; }
.tx-contract-list { display: grid; gap: 5px; }
.tx-contract-link { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--link); text-decoration: none; }
.tx-contract-link:hover { text-decoration: underline; }
.tx-contract-link svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tx-contract-link code { overflow-wrap: anywhere; }
.tx-contract-link span { color: var(--accent); font-size: 12px; white-space: nowrap; }
.tx-status-pill { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 9px; font-weight: 600; }
.tx-status-pill.successful { color: #35d18a; background: #35d18a1c; }
.tx-status-pill.failed { color: #ff6b72; background: #ff6b721c; }
.tx-status-pill.pending { color: #f6bd55; background: #f6bd551c; }
.tx-time { color: var(--text); }
@media (max-width: 520px) {
  .tx-explorer-card { padding: 6px 10px; }
  .tx-explorer-field { grid-template-columns: 1fr; gap: 3px; padding: 8px 0; }
  .tx-explorer-hash, .tx-address-value { align-items: flex-start; }
}
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld small { color: var(--muted); font-size: 11.5px; }
.fld input, .fld select { width: 100%; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: #22c55e; }

.print-only { display: none; }

@media (max-width: 860px) {
  #app { grid-template-columns: 48px minmax(0, 1fr) 48px; }
  .side { gap:12px; padding:8px 4px; }
  :is(#nav, #nav-resources) { gap:5px; }
  :is(#nav, #nav-resources) a { min-height:42px; height:42px; padding:0; justify-content:center; font-size:0; }
  :is(#nav, #nav-resources) a.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .side-note { display: none; }
  .top { padding: 10px 16px; flex-wrap: wrap; position: static; }
  #view { padding: 16px; }
  .site-credit { padding: 10px 16px 14px; }
  .developer-credit { align-items: flex-start; flex-direction: column; }
  .fgrid { grid-template-columns: 1fr; }
}

@media print {
  :root, :root[data-theme="light"] { --bg: #fff; --panel: #fff; --panel2: #f3f3f3; --line: #bbb; --text: #000; --muted: #444; --link: #000; --accent: #000; --warn: #7a4a00; --warn-bg: #fff6e0; }
  .side, .top, .no-print, .ic, .gtools, #toasts { display: none !important; }
  #app { display: block; }
  #view { padding: 0; max-width: none; }
  .panel, .tablewrap { break-inside: auto; border-color: #bbb; }
  tr { break-inside: avoid; }
  .print-only { display: block; }
  .mono { font-size: 10.5px; }
  a.xl::after { content: ""; }
}

/* case form: repeatable rows, wide modal */
[hidden] { display: none !important; }
.modal.wide { width: min(860px, 100%); }
.fhead { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.rep { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.rep:empty { display: none; }
.rep-row { display: flex; gap: 6px; align-items: center; }
.rep-row input { flex: 1; min-width: 0; }
.rep-row select { width: auto; max-width: 42%; }
.rep-have { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; }
.fld .btn.sm { align-self: flex-start; }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 14px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.picklist label { display: flex; gap: 6px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.fld .picklist input, .fld .chk-inline input { width: auto; flex: none; }
.picklist small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
#reqtext { font: 13px/1.55 var(--mono); min-height: 420px; }
.reqact { margin: 12px 0 8px; }
.vnote { margin: 3px 0 0; font-size: 12px; max-width: 46ch; }
#printbox { display: none; }
.osh { margin: 22px 0 10px; font-size: 16px; }
.osint-menu { display: grid; gap: 10px; }
.osint-menu-main { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.osint-menu-main > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; list-style: none; background: var(--panel2); font-weight: 750; }
.osint-menu-main > summary::-webkit-details-marker, .osint-menu-sub > summary::-webkit-details-marker { display: none; }
.osint-menu-main > summary::before { content: "›"; display: inline-block; margin-right: 2px; color: var(--accent); font-size: 22px; line-height: .8; transition: transform .16s ease; }
.osint-menu-main[open] > summary::before { transform: rotate(90deg); }
.osint-menu-main > summary > span { flex: 1; }
.osint-menu-main > summary > small, .osint-menu-sub > summary > small { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.osint-menu-sublist { display: grid; gap: 7px; padding: 9px; }
.osint-menu-sub { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.osint-menu-sub > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; color: var(--text); font-weight: 650; }
.osint-menu-sub > summary::before { content: "+"; width: 15px; color: var(--accent); font-weight: 800; }
.osint-menu-sub[open] > summary::before { content: "−"; }
.osint-menu-sub > summary > span { flex: 1; }
.osint-menu-sub > .tablewrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.osint-menu-sub table { min-width: 620px; }
@media (max-width: 600px) {
  .osint-menu-main > summary { align-items: flex-start; padding: 12px; }
  .osint-menu-main > summary > small, .osint-menu-sub > summary > small { font-size: 11px; text-align: right; }
  .osint-menu-sublist { padding: 7px; }
}
.exlinks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.exlinks > span { white-space: nowrap; }
.nav-ic { color: var(--accent); font-weight: 700; margin-right: 2px; }
@media print {
  body.print-letter #app, body.print-letter #modal-root, body.print-letter #toasts { display: none !important; }
  body.print-letter #printbox { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font: 11.5pt/1.5 Georgia, 'Times New Roman', serif; color: #000; margin: 0; }
}
.fld input[type="file"] { padding: 6px; }
.chk-inline { display: inline-flex; gap: 5px; align-items: center; margin-left: 6px; }
.chk-inline input { width: auto; }
.idrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.idrow:last-child { border-bottom: 0; }
.panel > h2 .btn { font-weight: 600; }
.firview { display: block; width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
iframe.firview { height: 62dvh; }
img.firview { height: auto; max-height: 70dvh; object-fit: contain; }
.rep-row.hash-row { flex-wrap: wrap; }
.hstat { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }
.hstat:empty { display: none; }


/* Restored multi-hop tracer and historical data layouts */
.tr-canvas { height: clamp(520px, calc(100dvh - 260px), 900px); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; touch-action: none; cursor: grab; margin-bottom: 10px; }
.tr-svg { width: 100%; height: 100%; display: block; user-select: none; }
.tr-status { min-height: 20px; margin: 0 0 8px; color: var(--muted); }
.tr-status.err { color: var(--danger); }
.tr-node { cursor: pointer; }
.tr-node > rect { fill: var(--panel2); stroke: var(--line); stroke-width: 1.2; }
.tr-node.root > rect { stroke: var(--accent); stroke-width: 2; }
.tr-node.selected > rect { stroke: #10b981; stroke-width: 2.5; }
.tr-node.cluster > rect { stroke-dasharray: 5 3; }
.tr-node-address-card > rect { fill: #1a202c; stroke: #2e67b2; stroke-width: 1.6; }
.tr-node-address-card.root > rect { stroke: #4a85dc; stroke-width: 2; }
.tr-node-address-card.selected > rect { stroke: #8b5cf6; stroke-width: 2.5; }
.tr-node-address-card.attributed > rect { fill: color-mix(in srgb, var(--entity-color) 13%, #111827); stroke: var(--entity-color); stroke-width: 2.5; }
.tr-node-address-card.attributed.root > rect { stroke: var(--entity-color); stroke-width: 3; }
.tr-node-address-card.attributed.selected > rect { stroke: #fff; stroke-width: 3; }
.tr-node-address-card.previous-case > rect { stroke: #b39b62; stroke-width: 2.4; stroke-dasharray: 7 4; }
.tr-node-address-card.flash-prior > rect { animation: tr-prior-flash 1400ms ease-in-out infinite; }
.tr-link-badge { cursor:pointer; }
.tr-link-badge rect { fill:#3f3826;stroke:#b39b62;stroke-width:1.5; }
.tr-link-badge text { fill:#ece4cf;font:800 11px system-ui,sans-serif;pointer-events:none; }
.tr-link-badge.blinking,.tr-link-pulse { animation:tr-link-pulse 1400ms ease-in-out infinite; }
.tr-cross-links { position:absolute;z-index:78;left:66px;top:64px;width:min(430px,calc(100% - 132px));max-height:calc(100% - 90px);overflow:auto;padding:14px;border:2px solid #b39b62;border-radius:14px;background:var(--panel);box-shadow:0 8px 32px #000a; }
.tr-cross-links[hidden] { display:none; }
.tr-cross-links > header,.tr-cross-links > footer { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.tr-cross-links > header strong { color:#b39b62;font-size:17px;letter-spacing:.07em; }
.tr-cross-links p { margin:9px 0;font-size:12px;overflow-wrap:anywhere; }
.tr-cross-links > .mono { display:block;font-size:11px;overflow-wrap:anywhere; }
.tr-cross-case-list article { margin:12px 0;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel2); }
.tr-cross-case-list h3 { font-size:14px;margin:0 0 9px;color:var(--accent);overflow-wrap:anywhere; }
.tr-cross-case-list dl { display:grid;gap:6px;margin:0 0 10px; }
.tr-cross-case-list dl > div { display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;font-size:11px; }
.tr-cross-case-list dt { color:var(--muted); }.tr-cross-case-list dd { margin:0;overflow-wrap:anywhere; }
.tr-cross-case-list details { font-size:12px;margin:8px 0; }.tr-cross-case-list summary { cursor:pointer; }
.tr-cross-case-list small { display:block;color:var(--muted);margin:8px 0; }
.tr-link-wallets { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;font-size:12px; }.tr-link-wallets b { flex-basis:100%; }
@keyframes tr-link-pulse {0%,100%{opacity:1}50%{opacity:.45}}
@media(max-width:900px) {.tr-cross-links {top:108px;max-height:calc(100% - 128px)}}
@media(prefers-reduced-motion:reduce) {.tr-link-badge.blinking,.tr-link-pulse,.tr-node-address-card.flash-prior > rect {animation:none}}
.tr-prior-badge { fill: #c9b27a; font: 800 10px var(--sans); letter-spacing: .05em; }
@keyframes tr-prior-flash { 0%,100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 7px #b39b6288); } }
.tr-memory-case-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tr-memory-case-label select { min-width: 180px; max-width: 260px; }
.tr-drawing-tools { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-bottom: 1px solid var(--line); }
.tr-drawing-tools .btn.active { color: #071019; background: #22d3ee; border-color: #22d3ee; }
.tr-annotation-mode { cursor: crosshair; }
.tr-visualizer-coin { fill: #1d2c49; stroke: #356bb5; stroke-width: 1.3; }
.tr-visualizer-coin.attributed { fill: color-mix(in srgb, var(--entity-color) 24%, #111827); stroke: var(--entity-color); stroke-width: 2; }
.tr-entity-symbol-path { fill: none; stroke: var(--entity-color); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.tr-entity-symbol-text { fill: var(--entity-color); font: 800 16px var(--sans); letter-spacing: -.4px; }
.tr-visualizer-eth { fill: #a6b0cd; stroke: #66789d; stroke-width: .8; }
.tr-visualizer-symbol { fill: #cad4ec; font: 700 11px var(--mono); }
.tr-visualizer-coin-logo { pointer-events: none; }
.tr-visualizer-address { fill: #f3f5fb; font: 600 21px var(--mono); }
.tr-visualizer-entity { fill: #f3f5fb; font: 500 20px var(--mono); }
.tr-visualizer-entity.prominent { fill: var(--entity-color); font: 800 21px var(--sans); }
.tr-visualizer-address.secondary { fill: #c5d0e2; font: 500 15px var(--mono); }
.tr-entity-kicker { fill: var(--entity-color); font: 700 9px var(--sans); letter-spacing: 1.25px; }
.tr-visualizer-grip { fill: none; stroke: #79849b; stroke-width: 1.7; stroke-linecap: round; }
.tr-node.dimmed, .tr-edge.dimmed { opacity: .2; }
.tr-edge.route path { stroke: #10b981; stroke-width: 3; }
.tr-edge { cursor: default; }
.tr-edge .tr-edge-hit { cursor: pointer; }
/* A selected arrow keeps its thickness: it is only brightened (the other arrows fade). */
.tr-edge.hover-selected .tr-edge-visible { stroke: color-mix(in srgb, var(--edge-color) 70%, #fff) !important; filter: none; }
.tr-edge.hover-selected .tr-edge-flow { opacity: 1; }
.tr-edge.hover-selected rect { stroke: var(--accent); stroke-width: 2.5; }
.tr-edge.hover-selected .tr-edge-label rect, .tr-edge.hover-selected .tr-pill { stroke: var(--edge-color) !important; stroke-width: 2.5 !important; filter: drop-shadow(0 0 5px var(--edge-color)); }
.tr-canvas.tr-edge-hovering .tr-edge:not(.hover-selected) { opacity: .3; transition: opacity .12s; }
.tr-edge.hover-selected text { font-weight: 700; }
.tr-comment { font: 14px system-ui, sans-serif; fill: #10b981; }
.tr-addr { font: 22px var(--mono); fill: var(--text); }
.tr-label { font: 700 18px system-ui, sans-serif; fill: var(--accent); }
.tr-node-action { cursor: pointer; }
.tr-node-action rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; }
.tr-node-action text { font: 700 14px system-ui, sans-serif; fill: var(--accent); pointer-events: none; }
.tr-node-analyze rect { fill: #2c4a78; stroke: #4a72ad; }
.tr-node-analyze text { font: 600 12px system-ui, sans-serif; fill: #fff; }
.tr-node-action:hover rect, .tr-node-action.active rect { fill: var(--accent); stroke: var(--accent); }
.tr-node-action:hover text, .tr-node-action.active text { fill: #fff; }
.tr-node-action.danger text { fill: var(--danger); }
.tr-node-action.danger:hover rect { fill: var(--danger); stroke: var(--danger); }
.tr-node-action:focus-visible rect { stroke: #fff; stroke-width: 2; }
.tr-sym { font: 700 9px var(--mono); fill: #fff; }
.tr-hit { font: 600 11px system-ui, sans-serif; fill: var(--warn); }
.tr-ex { font-size: 15px; fill: var(--link); cursor: pointer; }
.tr-plus circle { fill: var(--panel); stroke: #3b82f6; stroke-width: 1.6; }
.tr-plus text { font: 700 16px system-ui, sans-serif; fill: #3b82f6; pointer-events: none; }
.tr-plus:hover circle { fill: #3b82f6; }
.tr-plus:hover text { fill: #fff; }
.tr-plus.busy circle { stroke-dasharray: 3 3; }
/* Spinning ring on the + button while transfers load and Arkham is checked. */
.tr-plus.busy .tr-spinner { fill: none; stroke: var(--accent, #22d3ee); stroke-width: 3; stroke-dasharray: 22 54; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: tr-spin .8s linear infinite; }
@keyframes tr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tr-plus.busy .tr-spinner { animation-duration: 2.4s; } }
.tr-verified-ok { font: 700 13px var(--mono, monospace); fill: #34d399; }
.tr-remove { cursor: pointer; }
.tr-remove circle { fill: var(--panel); stroke: var(--danger); stroke-width: 1.6; }
.tr-remove text { font: 700 17px system-ui, sans-serif; fill: var(--danger); pointer-events: none; }
.tr-remove:hover circle { fill: var(--danger); }
.tr-remove:hover text { fill: #fff; }
.tr-included circle { fill: #10b981; stroke: var(--panel); stroke-width: 2; }
.tr-included text { font: 700 10px system-ui, sans-serif; fill: #fff; pointer-events: none; }
.tr-graph-stage { position: relative; min-width: 0; }
.tr-connection-hint:not([hidden]) { position: absolute; z-index: 44; top: 82px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 150px)); padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--muted); font-size: 13px; text-align: center; pointer-events: none; }
.tr-transfer-summary:not([hidden]) { position: absolute; z-index: 47; top: 76px; right: 66px; width: min(400px, calc(100% - 132px)); max-height: min(320px, 48%); overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 10px 28px #0008; font-size: 12px; }
.tr-transfer-summary summary { padding: 8px 10px; color: var(--text); font-weight: 700; cursor: pointer; }
.tr-transfer-summary-rows { padding: 0 10px 8px; }
.tr-transfer-summary-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.tr-transfer-summary-row b { color: #5ee0c7; overflow-wrap: anywhere; }
.tr-transfer-summary-row a { white-space: nowrap; }
@media (max-width: 520px) { .tr-transfer-summary:not([hidden]) { top: 118px; } }
.tr-arrowhead { stroke-width: 1px; filter: drop-shadow(0 0 1px #000a); }
/* Moving white dashes show the direction money flows: sender → receiver. */
.tr-edge .tr-edge-flow { fill: none !important; stroke: #fff !important; stroke-width: 1.6px !important; stroke-dasharray: 3 15; stroke-linecap: round; opacity: .75; pointer-events: none; animation: tr-edge-flow .9s linear infinite; }
.tr-edge.dimmed .tr-edge-flow { animation: none; opacity: 0; }
@keyframes tr-edge-flow { from { stroke-dashoffset: 18; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .tr-edge .tr-edge-flow { animation: none; } }
.tr-tool-dock { position: absolute; z-index: 45; top: 12px; transform: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; max-width: min(46vw, calc(100vw - 24px)); max-height: 82dvh; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 96%, transparent); box-shadow: 0 8px 28px #0008; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tr-tool-dock-left { left: 12px; }
.tr-tool-dock-right { right: 12px; }
.tr-tool-dock[open] { width: min(230px, calc(100vw - 24px)); }
.tr-tool-dock > summary { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex: none; width: max-content; max-width: 100%; min-height: 36px; list-style: none; cursor: pointer; border-radius: 8px; background: var(--panel2); color: var(--accent); padding: 6px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tr-tool-dock-left > summary { --dock-color: #22d3ee; color: var(--dock-color); }
.tr-tool-dock-right > summary { --dock-color: #a78bfa; color: var(--dock-color); }
.tr-tool-dock > summary .ui-icon { width: 18px; height: 18px; }
.tr-tool-dock > summary::-webkit-details-marker { display: none; }
.tr-tool-dock[open] > summary { background: var(--dock-color, var(--accent)); color: #071019; box-shadow: 0 5px 16px color-mix(in srgb, var(--dock-color, var(--accent)) 22%, transparent); }
.tr-dock-controls { display: flex; flex-direction: column; align-items: stretch; gap: 6px; max-height: calc(82dvh - 56px); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
.tr-icon-btn { --tool-color: var(--accent); width: 100%; min-height: 34px; justify-content: flex-start; padding: 5px 8px !important; font-size: 12px !important; white-space: normal; text-align: left; border-color: color-mix(in srgb, var(--tool-color) 28%, var(--line)); }
.tr-icon-btn:hover:not(:disabled) { border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 12%, var(--panel2)); }
.tr-icon-btn .ui-icon { flex: 0 0 18px; width: 18px; height: 18px; color: var(--tool-color); }
.tr-icon-btn:disabled { opacity: .5; }
#tr-route { --tool-color: #fbbf24; }
#tr-optimize { --tool-color: #c084fc; }
#tr-aggregate { --tool-color: #22d3ee; }
#tr-undo, #tr-redo { --tool-color: #fb923c; }
#tr-lock { --tool-color: #34d399; }
#tr-unlock { --tool-color: #facc15; }
#tr-hide { --tool-color: #94a3b8; }
#tr-show-hidden { --tool-color: #60a5fa; }
#tr-comments { --tool-color: #f472b6; }
.tr-tool-dock { width: 48px; min-width: 48px; max-width: 48px; max-height: calc(100% - 24px); padding: 5px; gap: 6px; overflow: visible; }
.tr-dock-title { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; background: var(--panel2); color: var(--accent); }
.tr-tool-dock-left .tr-dock-title { color: #22d3ee; }
.tr-tool-dock-right .tr-dock-title { color: #a78bfa; }
.tr-dock-title .ui-icon { width: 20px; height: 20px; }
.tr-dock-controls { flex: 1 1 auto; min-height: 0; max-height: calc(100% - 42px); gap: 6px; overflow-y: auto; overflow-x: visible; scrollbar-width: none; }
.tr-dock-controls::-webkit-scrollbar { width: 0; height: 0; }
.tr-tool-dock .tr-icon-btn { display: grid; place-items: center; flex: 0 0 36px; width: 36px; min-height: 36px; height: 36px; padding: 0 !important; font-size: 0 !important; text-align: center; }
.tr-tool-dock .tr-icon-btn .ui-icon { width: 20px; height: 20px; flex: none; }
.tr-tool-dock .tr-icon-btn span { display: none; }
.tr-drawing-tools { position: absolute; z-index: 46; top: 8px; left: 66px; right: 66px; width: max-content; max-width: calc(100% - 132px); display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tr-drawing-tools .btn { gap: 5px; padding: 5px 7px; font-size: 12px; }
.tr-drawing-tools .ui-icon { width: 19px; height: 19px; }
.tr-drawing-tools input[type=color] { width: 32px; height: 32px; padding: 2px; }
.tr-drawing-tools select { width: 82px; padding: 4px; font-size: 12px; }
.tr-drawing-tools .active { color: var(--accent); border-color: var(--accent); background: var(--panel2); }
.tr-annotation-mode { cursor: crosshair; touch-action: none; }
.tr-annotation { cursor: move; pointer-events: bounding-box; }
.tr-annotation path { pointer-events: stroke; }
.tr-annotation-editor { position: absolute; z-index: 85; top: 66px; left: 66px; width: min(350px, calc(100% - 132px)); padding: 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--panel); display: grid; gap: 10px; }
.tr-annotation-editor[hidden] { display: none; }
.tr-annotation-editor textarea { width: 100%; }
.tr-address-note { cursor: pointer; }
@media(max-width:760px) { .tr-drawing-tools .btn span { display: none; } .tr-drawing-tools { gap: 2px; padding: 4px; } .tr-drawing-tools .btn { padding: 4px; } }
.tr-rail-menu { position: relative; }
.tr-tool-dock .tr-rail-menu > summary { display: grid; place-items: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 9px; }
.tr-tool-dock .tr-rail-menu > summary .ui-icon { width: 20px; height: 20px; }
.tr-tool-dock .tr-rail-menu > summary .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tr-tool-dock .tr-dock-controls > .tr-rail-menu > .tr-menu-pop { position: absolute; z-index: 70; top: 0; left: calc(100% + 8px); right: auto; width: max-content; min-width: 230px; max-width: min(340px, calc(100vw - 100px)); max-height: 72dvh; overflow: auto; margin: 0; padding: 12px; box-shadow: 0 14px 40px #000b; }
.tr-tool-dock-right .tr-dock-controls > .tr-rail-menu > .tr-menu-pop { left: auto; right: calc(100% + 8px); }
.tr-tool-dock .tr-layout-label { display: grid; gap: 7px; font-size: 12px; }
.tr-tool-dock .tr-layout-label > .ui-icon { display: none; }
.tr-tool-dock .tr-layout-label select { width: 100%; }
.tr-tool-dock .tr-find-wrap { display: grid; gap: 7px; font-size: 12px; }
.tr-tool-dock .tr-find-wrap > .ui-icon { display: none; }
.tr-tool-dock .tr-find-wrap input { width: 100%; min-width: 0; }
body:has(#view .tr-canvas) .tr-tool-dock { width: 48px; min-width: 48px; max-width: 48px; max-height: calc(100% - 24px); padding: 5px; }
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-title { width: 36px; min-width: 36px; height: 36px; min-height: 36px; font-size: 0; }
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-title .ui-icon { width: 20px; height: 20px; }
body:has(#view .tr-canvas) .tr-tool-dock:not([open]) { width: 48px; }
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls { max-height: calc(100% - 42px); }
@media (max-width: 760px) {
  .tr-tool-dock, body:has(#view .tr-canvas) .tr-tool-dock { width: 44px; min-width: 44px; max-width: 44px; padding: 4px; }
  .tr-dock-title, .tr-tool-dock .tr-icon-btn, .tr-tool-dock .tr-rail-menu > summary { width: 34px; min-width: 34px; height: 34px; min-height: 34px; flex-basis: 34px; }
  .tr-tool-dock .tr-dock-controls > .tr-rail-menu > .tr-menu-pop { max-width: min(300px, calc(100vw - 82px)); max-height: 62dvh; }
}
.tr-layout-label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; color: var(--muted); font-size: 12px; }
.tr-layout-label > .ui-icon { width: 18px; height: 18px; color: #60a5fa; }
.tr-layout-label select { width: 100%; min-width: 0; padding: 5px 6px; font-size: 12px; }
.tr-find-wrap { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 3px 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.tr-find-wrap > .ui-icon { width: 18px; height: 18px; color: #e879f9; }
.tr-find-wrap input { grid-column: 1 / -1; width: 100%; min-width: 0; padding: 6px 8px; font-size: 12px; }
.tr-menu { position: relative; }
.tr-menu > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; width: 100%; min-height: 34px; padding: 5px 8px; font-size: 12px; font-weight: 600; }
.tr-menu > summary > .ui-icon { flex: 0 0 18px; width: 18px; height: 18px; color: var(--accent); }
.tr-convert > summary > .ui-icon { color: #fbbf24; }
.tr-filter-menu > summary > .ui-icon { width: 18px; height: 18px; color: #fbbf24; }
.tr-menu > summary::-webkit-details-marker { display: none; }
.tr-menu[open] > summary { border-color: var(--accent); }
.tr-menu-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max-content; min-width: 210px; max-width: min(320px, calc(100vw - 40px)); max-height: 65dvh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 14px 40px #0008; }
.tr-tool-dock .tr-menu-pop { position: static; width: 100%; min-width: 0; max-width: none; max-height: none; overflow: visible; margin: 4px 0 6px; padding: 8px; box-shadow: none; }
.tr-menu-pop b { margin-top: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tr-menu-pop label { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.tr-menu-pop input { width: auto; min-width: 0; flex: none; }
.tr-menu-pop .btn { justify-content: flex-start; }
.tr-layout-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tr-layout-label select { width: auto; min-width: 100px; padding: 4px 8px; }
#tr-find { flex: 1 1 180px; min-width: 160px; }
.tr-comments-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: #0009; }
.tr-comments-box { width: min(640px, 100%); max-height: 75dvh; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 60px #0009; }
.tr-comments-box h2 { margin-top: 0; }
.tr-comments-box p { overflow-wrap: anywhere; padding: 9px; border-bottom: 1px solid var(--line); }
.tr-edge line { stroke: var(--edge-color, #2563eb); stroke-width: 3.8; vector-effect: non-scaling-stroke; }
.tr-edge path { fill: none; stroke: var(--edge-color, #2563eb); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tr-edge .tr-edge-hit { fill: none !important; stroke: transparent !important; stroke-width: 12px !important; pointer-events: stroke; vector-effect: non-scaling-stroke; }
.tr-edge.route path { stroke: #10b981; stroke-width: 3; }
#tr-arrow path { fill: #2563eb; }
.tr-edge rect { fill: var(--bg); stroke: var(--line); cursor: default; }
.tr-edge text { font: 18px var(--mono); fill: var(--text); pointer-events: none; }
#tr-in, #hs-in { flex: 2; min-width: 260px; }
.hsum { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0 0 14px; }
.hsum dt { font-size: 11.5px; color: var(--muted); }
.hsum dd { margin: 2px 0 0; font-weight: 600; }
.tr-address-panel[hidden] { display: none; }
.tr-address-panel { position: fixed; z-index: 50; top: 70px; right: 12px; bottom: 12px; width: min(1080px, calc(100vw - 290px)); overflow: auto; padding: 12px 15px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 60px #0009; }
.tr-address-panel--adjacent { z-index: 80; overscroll-behavior: contain; }
.tr-convert-pop { min-width: 260px; max-width: min(320px, calc(100vw - 24px)); }
.tr-convert-pop label { display: grid; gap: 5px; margin: 8px 0; white-space: normal; }
.tr-convert-pop output { display: block; min-height: 36px; margin: 8px 0; padding: 8px; border-radius: 7px; background: var(--panel2); overflow-wrap: anywhere; }
.tr-convert-pop small { display: block; max-width: 34ch; color: var(--muted); line-height: 1.4; }
.tx-full-hash { display: inline-block; max-width: min(520px, 48vw); overflow-wrap: anywhere; white-space: normal; }
.tx-hash-pop { display: grid; gap: 8px; margin: 0 0 10px; padding: 12px; border: 1px solid var(--accent); border-radius: 9px; background: var(--panel2); }
.tx-hash-pop > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tx-hash-pop > code { max-width: 100%; font-size: 13px; }
.tx-hash-pop > div { display: flex; gap: 7px; align-items: center; }
.tr-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.tr-detail-ident { display: flex; gap: 13px; align-items: flex-start; min-width: 0; }
.tr-detail-coin { flex: 0 0 42px; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; padding: 6px; border-radius: 50%; background: var(--coin); color: #111; font-size: 11px; font-weight: 800; }
.tr-detail-coin img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tr-detail-kicker { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.tr-detail-head h2 { margin: 0; font-size: 19px; }
.tr-detail-full { margin: 5px 0 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.tr-detail-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-address-info { margin: 6px 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tr-address-info h3 { margin: 0 0 5px; font-size: 12px; }
.tr-address-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 5px 12px; margin: 0; }
.tr-address-info-grid > div { min-width: 0; }
.tr-address-info-grid dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.tr-address-info-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.tr-info-ens { color: var(--muted); }
.tr-info-copy { margin-left: 6px; padding: 0 4px; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 16px; }
.tr-info-copy:hover { color: var(--accent); }
.tr-address-info > small { display: block; margin-top: 8px; font-size: 10px; }
.tr-arkham-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.tr-arkham-card > div { display: grid; gap: 3px; margin-right: auto; }
.tr-arkham-card small { color: var(--muted); font-size: 10px; }
.tr-arkham-card p { flex-basis: 100%; margin: 0; font-size: 12px; }
.tr-arkham-card ul { display: grid; flex-basis: 100%; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tr-arkham-card li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tr-arkham-card li > span { display: grid; gap: 2px; }
.tr-arkham-card a { font-size: 11px; }
.tr-attribution-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; padding: 11px 12px; border: 1px solid color-mix(in srgb, #37d7c0 26%, var(--line)); border-radius: 9px; background: color-mix(in srgb, #37d7c0 4%, var(--panel2)); }
.tr-attribution-card > div:first-child { display: grid; gap: 3px; margin-right: auto; }
.tr-attribution-card > div:first-child small, .tr-attribution-card li small { color: var(--muted); font-size: 10px; }
.tr-attribution-card p { flex-basis: 100%; margin: 0; font-size: 12px; }
.tr-attribution-card ul { display: grid; flex-basis: 100%; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tr-attribution-card li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; }
.tr-attribution-card li > span { display: grid; gap: 3px; min-width: 0; }
.tr-attribution-card li small { overflow-wrap: anywhere; }
.tr-attribution-card a { font-size: 11px; }
.tr-provider-card { border-color: var(--line); background: var(--panel2); }
.tr-provider-links { display: flex; flex-wrap: wrap; gap: 7px; }
.tr-provider-links a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.tr-provider-links a:hover { border-color: var(--accent); color: var(--accent); }
.tr-detail-label { display: flex; align-items: center; gap: 8px; padding: 12px 0; }
.tr-detail-label label { color: var(--muted); font-size: 12px; }
.tr-detail-label input { width: min(300px, 36vw); }
.tr-detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 6px; margin: 0 0 8px; }
.tr-detail-metrics > div { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.tr-detail-metrics small { display: block; color: var(--muted); font-size: 11px; }
.tr-detail-metrics b { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 14px; }
.tr-token-balances { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.tr-address-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0 0 8px; }
.tr-flow-card { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.tr-flow-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tr-flow-card header h3 { margin: 0; font-size: 14px; }
.tr-flow-card header small, .tr-flow-note { color: var(--muted); font-size: 10px; }
.tr-flow-card header > strong { color: var(--accent); font-size: 14px; white-space: nowrap; }
.tr-flow-card.in header > strong, .tr-flow-card.in li > span { color: #2fcf8b; }
.tr-flow-card.out header > strong, .tr-flow-card.out li > span { color: #ff7880; }
.tr-flow-card ul { display: grid; gap: 6px; max-height: 150px; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.tr-flow-card li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; }
.tr-flow-card li > span, .tr-flow-card li > b { overflow-wrap: anywhere; }
.tr-flow-card li > b { font-size: 11px; text-align: right; }
.tr-flow-card li > b small { color: var(--muted); font-size: 10px; font-weight: 400; }
.tr-flow-card > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.tr-flow-note { grid-column: 1 / -1; }
.tr-detail-tabs { display: flex; gap: 6px; align-items: center; margin: 8px 0 10px; border-bottom: 1px solid var(--line); }
.tr-detail-tabs button { padding: 9px 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tr-detail-tabs button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
.tr-detail-tabs input { width: min(320px, 38vw); margin: 0 0 7px auto; }
.tr-detail-direction-tabs { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.tr-detail-direction-tabs button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); color: var(--muted); cursor: pointer; }
.tr-detail-direction-tabs button.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tr-detail-filters { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 8px; align-items: end; margin: 8px 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.tr-detail-filters label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 10px; }
.tr-detail-filters input { width: 100%; min-width: 0; padding: 6px 7px; font-size: 12px; }
.tr-detail-filters small { grid-column: 2 / -1; align-self: center; color: var(--muted); font-size: 10px; }
.tr-detail-table { max-height: min(34dvh, 340px); overflow: auto; }
.tr-detail-table input[type="checkbox"] { width: 16px; min-width: 16px; margin: 2px; padding: 0; }
.tr-attribution-sources { display: block; margin-top: 3px; font-size: 10px; white-space: nowrap; }
.tr-counterparty-txs, .tr-tx-details { padding: 2px 4px; border: 0; background: transparent; color: var(--link); cursor: pointer; font: inherit; }
.tr-counterparty-txs:hover, .tr-tx-details:hover { color: var(--accent); text-decoration: underline; }
.tr-counterparty-txs { font-variant-numeric: tabular-nums; }
.tr-tx-details .mono { overflow-wrap: anywhere; }
.tr-detail-address { display: block; padding: 0; border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; text-align: left; }
.tr-detail-address:hover { text-decoration: underline; }
.tr-detail-address-label { color: var(--text); font-weight: 700; }
.tr-detail-table td small { display: block; max-width: 32ch; overflow-wrap: anywhere; font-size: 10px; }
.tr-dir { display: inline-block; font-size: 11px; font-weight: 800; }
.tr-dir.out { color: var(--danger); }
.tr-dir.in { color: var(--ok); }
.tr-detail-note { margin: 12px 0 0; font-size: 11px; }
.tr-arkham-dashboard { margin: 8px 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel2) 72%, var(--panel)); }
.tr-arkham-fold { margin: 7px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.tr-arkham-fold > summary, .tr-address-tools > summary, .tr-arkham-filter-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; list-style-position: inside; }
.tr-arkham-fold > summary small { color: var(--muted); font-size: 10px; font-weight: 400; }
.tr-arkham-fold[open] > summary, .tr-address-tools[open] > summary, .tr-arkham-filter-fold[open] > summary { border-bottom: 1px solid var(--line); }
.tr-arkham-fold > .tr-arkham-dashboard { margin: 0; border: 0; padding: 8px; background: transparent; }
.tr-arkham-compact-note { margin: 8px 0; color: var(--muted); font-size: 11px; }
.tr-arkham-filter-fold { margin: 8px; border: 1px solid var(--line); border-radius: 8px; }
.tr-address-tools { margin: 7px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.tr-address-tools > .tr-attribution-card, .tr-address-tools > .tr-arkham-card { margin: 6px; }
.tr-address-tools > .tr-detail-label { margin: 0 8px; padding: 7px 0; }
.tr-arkham-dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.tr-arkham-dashboard-head h3 { margin: 0; font-size: 17px; }
.tr-arkham-dashboard-head small, .tr-arkham-cost { color: var(--muted); font-size: 10px; }
.tr-arkham-cost { display: block; margin: 6px 0 12px; line-height: 1.5; }
.tr-arkham-address-value { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.tr-arkham-address-value b { font-size: 17px; }
.tr-arkham-address-value span { font-size: 11px; }
.tr-arkham-address-value small { color: var(--muted); font-size: 10px; }
.tr-arkham-dashboard .positive { color: #2fcf8b; }
.tr-arkham-dashboard .negative { color: #ff7880; }
.tr-arkham-overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tr-arkham-overview-grid > section, .tr-arkham-activity { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); overflow: hidden; }
.tr-arkham-tabs { display: flex; gap: 3px; align-items: center; min-height: 42px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tr-arkham-tabs button { flex: 0 0 auto; padding: 10px 12px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; cursor: pointer; font-size: 11px; }
.tr-arkham-tabs button.on { border-bottom-color: var(--accent); color: var(--text); font-weight: 700; }
.tr-arkham-tabs .spacer { flex: 1; }
.tr-arkham-page { padding: 0 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.tr-arkham-pane { min-height: 190px; padding: 10px; }
.tr-arkham-value-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 9px; }
.tr-arkham-value-cards > div { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel2); }
.tr-arkham-value-cards small { display: block; color: var(--muted); font-size: 9px; }
.tr-arkham-value-cards b { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 13px; }
.tr-arkham-table { max-height: 290px; overflow: auto; }
.tr-arkham-table table { min-width: 650px; font-size: 11px; }
.tr-arkham-table th, .tr-arkham-table td { padding: 7px 8px; }
.tr-arkham-table td small { display: block; font-size: 9px; }
.tr-arkham-chart { display: block; width: 100%; height: 150px; overflow: visible; }
.tr-arkham-chart .gridline { fill: none; stroke: var(--line); stroke-width: 1; }
.tr-arkham-chart polyline { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tr-arkham-chart .series-primary { stroke: #70a5ff; }
.tr-arkham-chart .series-secondary { stroke: #32c89b; }
.tr-arkham-chart-caption { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.tr-arkham-empty { display: grid; min-height: 145px; place-items: center; padding: 14px; color: var(--muted); text-align: center; font-size: 11px; }
.tr-arkham-token-controls, .tr-arkham-archive-controls { display: flex; flex-wrap: wrap; gap: 7px; align-items: end; margin-bottom: 8px; }
.tr-arkham-token-controls label, .tr-arkham-archive-controls label { display: grid; flex: 1 1 180px; gap: 4px; color: var(--muted); font-size: 10px; }
.tr-arkham-token-controls select, .tr-arkham-archive-controls input { min-width: 0; width: 100%; padding: 7px; }
.tr-arkham-token-controls small, .tr-arkham-archive-controls small { flex-basis: 100%; color: var(--muted); font-size: 9px; }
.tr-arkham-pnl-summary { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; font-size: 10px; }
.tr-arkham-pnl-summary small { flex-basis: 100%; color: var(--muted); }
.tr-arkham-activity { margin-top: 11px; }
.tr-arkham-filters { display: grid; grid-template-columns: repeat(5, minmax(95px, 1fr)); gap: 7px; align-items: end; padding: 9px; border-bottom: 1px solid var(--line); }
.tr-arkham-filters label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 9px; }
.tr-arkham-filters input, .tr-arkham-filters select { width: 100%; min-width: 0; padding: 6px; font-size: 10px; }
.tr-arkham-filters small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.tr-arkham-activity > .btn { margin: 9px; }
@media (max-width: 900px) {
  .tr-arkham-overview-grid { grid-template-columns: 1fr; }
  .tr-arkham-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tr-toolbar-filter-fields { flex: 1 0 100%; gap: 6px; padding: 7px; }
  .tr-toolbar-filter-fields > label { flex: 1 1 calc(50% - 8px); min-width: 105px; max-width: none; }
  .tr-toolbar-filter-fields > button { flex: 1 1 auto; }
  .tr-tool-dock { top: 8px; bottom: auto; transform: none; max-width: min(46vw, calc(100vw - 16px)); max-height: 64dvh; padding: 4px; }
  .tr-tool-dock[open] { width: min(220px, calc(100vw - 16px)); }
  .tr-tool-dock-left { left: 8px; }
  .tr-tool-dock-right { right: 8px; }
  .tr-dock-controls { max-height: calc(64dvh - 52px); }
  .tr-tool-dock .tr-menu-pop, .tr-tool-dock-right .tr-menu-pop { position: static; top: auto; right: auto; bottom: auto; left: auto; width: 100%; min-width: 0; max-width: none; max-height: none; }
}
@media (max-width: 760px) {
  .tr-address-panel { top: 10px; right: 10px; bottom: 10px; left: 10px; width: auto; padding: 15px 13px 12px; }
  .tr-address-panel--adjacent { right: auto; bottom: auto; max-width: calc(100vw - 16px); padding: 12px; }
  .tr-address-panel--adjacent .tr-detail-head { flex-direction: row; }
  .tr-address-panel--adjacent .tr-detail-ident { gap: 8px; }
  .tr-address-panel--adjacent .tr-detail-coin { flex-basis: 30px; width: 30px; height: 30px; font-size: 9px; }
  .tr-address-panel--adjacent .tr-detail-head h2 { font-size: 15px; }
  .tr-address-panel--adjacent .tr-detail-actions { justify-content: flex-end; }
  .tr-address-panel--adjacent .tr-detail-actions .btn { padding: 4px 6px; font-size: 10px; }
  .tr-address-panel--adjacent .tr-detail-label { padding: 6px 0; }
  .tr-address-info { margin: 7px 0 6px; padding: 7px 0 6px; }
  .tr-address-info h3 { margin-bottom: 6px; font-size: 13px; }
  .tr-address-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
  .tr-address-info-grid dt { font-size: 9px; }
  .tr-address-info-grid dd { font-size: 11px; }
  .tr-address-info > small { margin-top: 5px; font-size: 9px; }
  .tr-address-panel--adjacent .tr-detail-metrics { gap: 5px; margin-bottom: 8px; }
  .tr-address-panel--adjacent .tr-detail-metrics > div { padding: 6px 8px; }
  .tr-address-panel--adjacent .tr-detail-metrics b { font-size: 11px; }
  .tr-address-panel--adjacent .tr-detail-tabs button { padding: 6px; font-size: 11px; }
  .tr-address-panel--adjacent .tr-detail-table { max-height: none; }
  .tr-address-panel--adjacent .tr-detail-note { margin-top: 6px; }
  .tr-address-panel:not(.tr-address-panel--adjacent) .tr-detail-head { flex-direction: column; }
  .tr-detail-label { flex-wrap: wrap; }
  .tr-detail-label input { flex: 1; width: auto; }
  .tr-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-detail-tabs { flex-wrap: wrap; }
  .tr-detail-tabs input { order: 2; width: 100%; max-width: none; margin: 0 0 8px; }
  .tr-detail-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-detail-filters small { grid-column: 1 / -1; }
  .tr-arkham-dashboard { padding: 8px; }
  .tr-arkham-dashboard-head { align-items: flex-start; }
  .tr-arkham-dashboard-head h3 { font-size: 14px; }
  .tr-arkham-tabs button { padding: 8px 9px 7px; font-size: 10px; }
  .tr-arkham-pane { padding: 7px; }
  .tr-arkham-value-cards { grid-template-columns: 1fr; }
  .tr-arkham-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px; }
}

/* Full-height tracing workspace: compact navigation and a canvas-first layout. */
body:has(#view .tr-canvas) { overflow: hidden; }
body:has(#view .tr-canvas) #app { grid-template-columns: 58px minmax(0, 1fr) 58px; height: 100dvh; min-height: 0; }
body:has(#view .tr-canvas) .side { position: relative; top: auto; z-index: 12; width: 58px; height: 100dvh; min-height: 0; flex: none; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-right: 1px solid var(--line); }
body:has(#view .tr-canvas) .brand { padding: 0; }
body:has(#view .tr-canvas) .brand > span:not(.logo) { display: none; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) { display: flex; flex: 1 1 auto; align-content: flex-start; align-items: center; flex-direction: column; flex-wrap: nowrap; gap: 5px; width: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a { position: relative; width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 0; border: 1px solid transparent; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a[data-nav~="tracer"],
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a[data-nav~="contracts"] { order: initial; margin-left: 0; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) .nav-icon { width: 20px; height: 20px; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a:hover { background: color-mix(in srgb, var(--nav-color) 11%, var(--panel)); border-color: color-mix(in srgb, var(--nav-color) 28%, var(--line)); }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a.on { background: color-mix(in srgb, var(--nav-color) 16%, var(--panel)); border-color: color-mix(in srgb, var(--nav-color) 38%, var(--line)); box-shadow: inset 3px 0 0 var(--nav-color), 0 5px 18px color-mix(in srgb, var(--nav-color) 12%, transparent); }
body:has(#view .tr-canvas) .main { height: 100dvh; min-height: 0; overflow: hidden; }
body:has(#view .tr-canvas) .site-credit { display: none; }
body:has(#view .tr-canvas) #view { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 58px 40px 0 minmax(0, 1fr); gap: 0 10px; align-content: stretch; width: 100%; max-width: none; min-height: 0; padding: 0; overflow: hidden; }
body:has(#view .tr-canvas) #view > .page-head { display: none; }
body:has(#view .tr-canvas) #tr-form { grid-column: 1 / -1; grid-row: 1; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
body:has(#view .tr-canvas) #tr-chain { order: -2; flex: 0 0 152px; min-width: 0; height: 40px; }
body:has(#view .tr-canvas) #tr-in { order: -1; flex: 1 1 240px; min-width: 100px; height: 40px; }
body:has(#view .tr-canvas) #tr-days { flex: 0 0 178px; min-width: 0; height: 40px; }
body:has(#view .tr-canvas) #tr-form > .btn { min-height: 40px; }
body:has(#view.tr-has-graph .tr-canvas) #tr-collapse-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 34px; padding: 5px 10px; color: #9ce8e7; border-color: #286d70; background: #102124; }
body:has(#view.tr-has-graph .tr-canvas) #tr-collapse-toggle:hover { background: #153033; }
body:has(#view.tr-has-graph .tr-canvas) #tr-collapse-toggle .ui-icon { width: 15px; height: 15px; transition: transform .18s ease; }
body:has(#view.tr-has-graph .tr-canvas) #tr-collapse-toggle .tr-chevron-expanded { transform: rotate(180deg); }
body:has(#view.tr-controls-collapsed .tr-canvas) #view { grid-template-rows: 44px 40px 0 minmax(0, 1fr); }
/* While "Add addresses" is open, its row grows so the panel pushes the
   status line and canvas down instead of covering them. */
@media (min-width: 901px) {
  body:has(#view .tr-canvas) #view:has(.tr-add-addresses-collapse[open]) { grid-template-rows: 58px auto 0 minmax(0, 1fr); }
  body:has(#view.tr-controls-collapsed .tr-canvas) #view.tr-controls-collapsed:has(.tr-add-addresses-collapse[open]) { grid-template-rows: 44px auto 0 minmax(0, 1fr); }
  body:has(#view .tr-canvas) #view .tr-add-addresses-collapse[open] { align-self: start; padding-bottom: 6px; }
}
body:has(#view.tr-controls-collapsed .tr-canvas) #tr-form { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
body:has(#view.tr-controls-collapsed .tr-canvas) #tr-form > :not(#tr-collapse-toggle) { display: none !important; }
body:has(#view.tr-controls-collapsed .tr-canvas) #tr-collapse-toggle { width: min(100%, 760px); justify-content: flex-start; }
body:has(#view.tr-controls-collapsed .tr-canvas) #tr-collapse-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(#view.tr-controls-collapsed .tr-canvas) .tr-workspace-controls { display: none; }
body:has(#view.tr-controls-collapsed .tr-canvas) .tr-add-addresses-collapse { display: block; grid-column: 1 / -1; width: max-content; }
body:has(#view .tr-canvas) .tr-filter-menu { position: relative; flex: none; }
body:has(#view .tr-canvas) .tr-filter-menu > summary { list-style: none; }
body:has(#view .tr-canvas) .tr-filter-menu > summary::-webkit-details-marker { display: none; }
body:has(#view .tr-canvas) .tr-filter-menu[open] > .tr-toolbar-filter-fields { position: absolute; z-index: 55; top: calc(100% + 8px); right: 0; display: flex; flex: none; width: min(830px, calc(100vw - 100px)); box-shadow: 0 12px 32px #0009; }
body:has(#view .tr-canvas) .tr-add-addresses-collapse { grid-column: 1; grid-row: 2; align-self: center; position: relative; z-index: 56; min-width: 220px; margin: 0 0 0 12px; }
body:has(#view .tr-canvas) .tr-add-addresses-collapse > summary { min-height: 32px; padding: 4px 9px; }
body:has(#view .tr-canvas) .tr-add-addresses-collapse[open] > .tr-add-addresses { position: static; margin-top: 6px; width: min(560px, calc(100vw - 100px)); padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); box-shadow: 0 12px 32px #0009; }
body:has(#view .tr-canvas) .tr-workspace-controls { grid-column: 2; grid-row: 2; align-self: center; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; min-width: 0; margin: 0 12px 0 0; overflow-x: auto; scrollbar-width: thin; }
/* Reserve space on the left of the workspace controls so a wide row of
   checkboxes / buttons can never slide under the Add addresses button. */
body:has(#view .tr-canvas) .tr-workspace-controls::before { content: ""; flex: 0 0 200px; }
body:has(#view .tr-canvas) .tr-workspace-controls label.chk { font-size: 11px; white-space: nowrap; }
body:has(#view .tr-canvas) .tr-workspace-controls .spacer { display: none; }
body:has(#view .tr-canvas) .tr-workspace-controls .btn { min-height: 30px; padding: 4px 8px; font-size: 11px; }
body:has(#view .tr-canvas) #tr-status { grid-column: 1 / -1; grid-row: 3; min-height: 0; height: 22px; margin: 0; padding: 1px 12px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body:has(#view .tr-canvas) .tr-graph-stage { grid-column: 1 / -1; grid-row: 4; position: relative; min-height: 0; height: 100%; margin: 0; }
body:has(#view .tr-canvas) #tr-canvas { width: 100%; height: 100%; min-height: 0; margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
body:has(#view .tr-canvas) #view > p.muted { display: none; }
body:has(#view .tr-canvas) .tr-tool-dock { top: 12px; bottom: auto; transform: none; max-width: min(42vw, calc(100% - 24px)); max-height: 82%; padding: 5px; }
body:has(#view .tr-canvas) .tr-tool-dock-left { left: 10px; }
body:has(#view .tr-canvas) .tr-tool-dock-right { right: 10px; }
body:has(#view .tr-canvas) .tr-tool-dock:not([open]) { width: 46px; }
body:has(#view .tr-canvas) .tr-tool-dock > summary { width: 36px; min-width: 36px; height: 36px; min-height: 36px; justify-content: center; padding: 0; overflow: hidden; font-size: 0; }
body:has(#view .tr-canvas) .tr-tool-dock > summary .ui-icon { width: 20px; height: 20px; }
body:has(#view .tr-canvas) .tr-tool-dock[open] > summary { width: 100%; font-size: 12px; justify-content: flex-start; padding: 6px 9px; }
body:has(#view .tr-canvas) .tr-tool-dock[open] > summary > span { flex: 0 0 18px; text-align: center; }
body:has(#view .tr-canvas) .tr-dock-controls { max-height: calc(82dvh - 56px); }
body.tracer-popout #app { grid-template-columns: minmax(0, 1fr); }
body.tracer-popout .side { display: none; }
body.tracer-popout #view { padding: 0; }

@media (max-width: 900px) {
  body:has(#view .tr-canvas) #app { grid-template-columns: 48px minmax(0, 1fr) 48px; }
  body:has(#view .tr-canvas) .side { width: 48px; padding: 8px 4px; }
  body:has(#view .tr-canvas) :is(#nav, #nav-resources) a { width: 38px; height: 38px; }
  body:has(#view .tr-canvas) #view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 0 minmax(420px, 1fr); }
  body:has(#view .tr-canvas) #tr-form { flex-wrap: wrap; min-height: 58px; }
  body:has(#view .tr-canvas) #tr-chain { flex-basis: 128px; }
  body:has(#view .tr-canvas) #tr-in { flex-basis: 180px; }
  body:has(#view .tr-canvas) #tr-days { flex-basis: 150px; }
  body:has(#view .tr-canvas) .tr-add-addresses-collapse { grid-column: 1; grid-row: 2; margin-left: 9px; }
  body:has(#view .tr-canvas) .tr-workspace-controls { grid-column: 1; grid-row: 3; justify-content: flex-start; overflow-x: auto; margin: 0 8px; }
  body:has(#view .tr-canvas) #tr-status { grid-row: 4; align-self: start; }
  body:has(#view .tr-canvas) .tr-graph-stage { grid-row: 5; min-height: 420px; }
  body:has(#view .tr-canvas) .tr-tool-dock { top: 8px; bottom: auto; transform: none; max-height: 65%; }
  body:has(#view .tr-canvas) .tr-tool-dock[open] { width: min(220px, calc(100vw - 80px)); }
  body:has(#view .tr-canvas) .tr-filter-menu[open] > .tr-toolbar-filter-fields { right: 0; width: min(600px, calc(100vw - 72px)); }
}

@media (max-width: 520px) {
  .tr-address-flow { grid-template-columns: minmax(0, 1fr); }
  body:has(#view .tr-canvas) #view { grid-template-rows: auto auto auto 0 minmax(360px, 1fr); }
  body:has(#view .tr-canvas) #tr-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 34px 36px 34px 34px; gap: 5px; padding: 7px; }
  body:has(#view .tr-canvas) #tr-chain { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; height: 34px; flex: none; font-size: 11px; }
  body:has(#view .tr-canvas) #tr-days { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; height: 34px; flex: none; font-size: 11px; }
  body:has(#view .tr-canvas) #tr-in { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; height: 36px; flex: none; font-size: 11px; }
  body:has(#view .tr-canvas) #tr-form > button[type="submit"] { grid-column: 1; grid-row: 3; }
  body:has(#view .tr-canvas) #tr-form > #tr-add { grid-column: 2; grid-row: 3; }
  body:has(#view .tr-canvas) #tr-form > .btn { width: 100%; min-width: 0; min-height: 34px; padding: 4px 6px; font-size: 11px; }
  body:has(#view .tr-canvas) #tr-form > #tr-clear { display: none; }
  body:has(#view .tr-canvas) .tr-filter-menu { grid-column: 1; grid-row: 4; min-width: 0; }
  body:has(#view .tr-canvas) .tr-filter-menu > summary { width: 100%; min-height: 34px; justify-content: center; padding: 4px; font-size: 11px; }
  body:has(#view .tr-canvas) #tr-collapse-toggle { grid-column: 2; grid-row: 4; width: 100%; min-width: 0; min-height: 34px; justify-content: center; padding: 4px 6px; font-size: 10px; }
  body:has(#view .tr-canvas) .tr-workspace-controls label.chk { font-size: 10px; }
  body:has(#view .tr-canvas) .tr-workspace-controls #tr-popout { display: none; }
  body:has(#view .tr-canvas) .tr-tool-dock-left { left: 4px; }
  body:has(#view .tr-canvas) .tr-tool-dock-right { right: 4px; }
}

/* Keep tracer tool rails pinned to the graph edges; scroll long tool lists inside each rail. */
body:has(#view .tr-canvas) .tr-tool-dock {
  top: 8px; bottom: 8px; height: auto; max-height: none; overflow: hidden;
  gap: 5px; padding: 5px; border-radius: 11px;
}
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls {
  flex: 1 1 auto; min-height: 0; max-height: none; gap: 5px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin;
}
body:has(#view .tr-canvas) .tr-tool-dock .tr-icon-btn { flex-shrink: 0; }
body:has(#view .tr-canvas) .tr-tool-dock[open] { width: min(230px, calc(100vw - 64px)); }
body:has(#view .tr-canvas) .tr-tool-dock[open] > summary { width: 100%; min-width: 0; flex-basis: 36px; }
@media (max-width: 760px) {
  body:has(#view .tr-canvas) .tr-tool-dock { gap: 4px; padding: 4px; }
  body:has(#view .tr-canvas) .tr-tool-dock > summary,
  body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-title,
  body:has(#view .tr-canvas) .tr-tool-dock .tr-icon-btn,
  body:has(#view .tr-canvas) .tr-tool-dock .tr-rail-menu > summary {
    flex-basis: 36px; width: 36px; min-width: 36px; height: 36px; min-height: 36px;
  }
  body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls { gap: 4px; }
  body:has(#view .tr-canvas) .tr-tool-dock[open] { width: min(210px, calc(100vw - 64px)); }
}

.tr-node-lea rect { fill:#064e3b; stroke:#34d399; }
.tr-node-lea text { fill:#d1fae5; font-size:12px; }
.tr-node-lea { color:#d1fae5; }
.tr-lea-alerts { position:absolute; z-index:30; inset:0; pointer-events:none; overflow:hidden; }
.tr-lea-alerts[hidden] { display:none; }
.tr-lea-notice { position:absolute; pointer-events:auto; width:max-content; max-width:280px; animation:lea-appear .2s ease-out, lea-leave .3s ease-in 2.2s forwards; display:flex; align-items:center; gap:6px; padding:6px 6px 6px 10px; border:1px solid #34d399; border-radius:10px; background:var(--panel); box-shadow:0 4px 16px #0007; }
.tr-lea-notice[hidden] { display:none; }
.tr-lea-notice::before { content:''; position:absolute; top:50%; left:-7px; width:10px; height:10px; margin-top:-5px; background:var(--panel); border-left:1px solid #34d399; border-bottom:1px solid #34d399; transform:rotate(45deg); }
.tr-lea-notice[data-side="left"]::before { left:auto; right:-7px; transform:rotate(225deg); }
.tr-lea-notice > div { flex:1; min-width:0; }
.tr-lea-notice b,.tr-lea-notice small { display:block; white-space:nowrap; }
.tr-lea-tag rect { fill:#064e3b; stroke:#34d399; stroke-width:1.5; }
.tr-lea-tag text { fill:#d1fae5; font-size:13px; font-weight:700; }
.tr-lea-notice b { color:#6ee7b7; font-size:12px; }
.tr-lea-notice small { font-size:10px; color:var(--muted); }
.tr-lea-notice .btn { flex:none; padding:6px; font-size:11px; gap:4px; }
.tr-lea-notice .ui-icon { width:16px;height:16px; }
.lea-trace-prefill { border:1px solid #34d399; border-radius:10px; background:var(--panel2); padding:14px; margin-bottom:16px; overflow-wrap:anywhere; }
.lea-trace-prefill > b { color:var(--accent); }
.lea-trace-prefill p { margin:7px 0; }
@keyframes lea-leave { to{opacity:0} }
@keyframes lea-appear { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
@media(prefers-reduced-motion:reduce) { .tr-lea-notice {animation:none;} }
@media(max-width:600px) { .tr-lea-notice {max-width:200px;} }
.req-form-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
#lea-form fieldset { border:1px solid var(--line); border-radius:12px; padding:18px; margin:6px 0; min-width:0; }
#lea-form legend { color:var(--accent); padding:0 8px; font-weight:700; }
#lea-form, #lea-form .fgrid { grid-template-columns:minmax(0,1fr); }
#lea-form .fgrid { gap:14px; }
.lea-document-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.lea-document-grid h3 { font-size:14px; color:var(--accent); }
.lea-document-grid .chk { display:flex; gap:8px; align-items:flex-start; margin:9px 0; font-size:13px; color:var(--text); }
.lea-document-grid .chk input { flex:none; margin-top:3px; }
.lea-extra { padding:14px; border:1px solid var(--line); background:var(--panel2); border-radius:10px; margin:12px 0; }
.lea-generate { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:14px 0; }
#lea-status { font-size:13px; color:var(--muted); }
#lea-directory > summary { cursor:pointer; font-size:18px; font-weight:700; }
#lea-directory table td { max-width:340px; overflow-wrap:anywhere; }
@media(max-width:680px) { .lea-document-grid {grid-template-columns:1fr;} #lea-form fieldset {padding:12px;} }
/* Rail panels are siblings of the docks so rail scrolling cannot clip their controls. */
.tr-graph-stage > .tr-rail-panel { position: absolute; top: 8px; left: 66px; right: auto; z-index: 80; width: min(320px, calc(100% - 132px)); min-width: 0; max-width: none; max-height: calc(100% - 16px); overflow: auto; margin: 0; padding: 12px; box-shadow: 0 12px 32px #0009; }
.tr-graph-stage > .tr-rail-panel[hidden] { display: none !important; }
.tr-rail-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tr-rail-panel-heading .btn { width: 30px; min-height: 30px; padding: 2px; justify-content: center; }
.tr-tool-dock-left .tr-dock-title { cursor: pointer; }
/* Final rail override: keep the narrow mobile docks usable without a scrollbar drawn over icons. */
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls {
  overflow-y: auto; overflow-x: visible; scrollbar-width: none; -ms-overflow-style: none;
}
body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls::-webkit-scrollbar { width: 0; height: 0; display: none; }
@media (max-width: 760px) {
  body:has(#view .tr-canvas) .tr-tool-dock { top: 8px; max-height: calc(100% - 16px); }
  body:has(#view .tr-canvas) .tr-tool-dock .tr-dock-controls { max-height: calc(100% - 40px); }
  body:has(#view .tr-canvas) .tr-tool-dock .tr-icon-btn,
  body:has(#view .tr-canvas) .tr-tool-dock .tr-rail-menu > summary { flex-basis: 32px; width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
  body:has(#view .tr-canvas) .tr-tool-dock .tr-icon-btn .ui-icon,
  body:has(#view .tr-canvas) .tr-tool-dock .tr-rail-menu > summary .ui-icon { width: 18px; height: 18px; }
  body:has(#view .tr-canvas) .tr-tool-dock .tr-rail-menu > .tr-menu-pop,
  body:has(#view .tr-canvas) .tr-tool-dock-right .tr-rail-menu > .tr-menu-pop {
    position: fixed !important; top: 96px !important; bottom: auto !important; z-index: 120;
    max-height: 68dvh; overflow: auto; width: min(280px, calc(100vw - 116px));
  }
  body:has(#view .tr-canvas) .tr-tool-dock-left .tr-rail-menu > .tr-menu-pop { left: 56px !important; right: auto !important; }
  body:has(#view .tr-canvas) .tr-tool-dock-right .tr-rail-menu > .tr-menu-pop { right: 56px !important; left: auto !important; }
}
.tr-view-hint:not([hidden]) { position:absolute; z-index:45; bottom:8px; left:66px; right:66px; width:fit-content; max-width:calc(100% - 132px); display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--muted); font-size:13px; }
.contract-heading { display:flex; align-items:center; gap:10px; }
.contract-heading .ui-icon { width:32px; height:32px; color:#a78bfa; }
.contract-inputs { display:flex; flex-wrap:wrap; gap:12px; align-items:end; }
.contract-inputs label { display:flex; flex-direction:column; gap:6px; min-width:0; }
.contract-address-input { flex:1; min-width:230px!important; }
.contract-inputs input,.contract-inputs textarea,.contract-inputs select { width:100%; }
.contract-compare-input { flex-basis:100%; }
.contract-compare-input summary { cursor:pointer; padding:4px 0; color:var(--link); }
.contract-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; margin:16px 0; }
.contract-facts > div { min-width:0; padding:12px; border:1px solid var(--line); border-radius:9px; background:var(--panel2); }
.contract-facts small,.contract-facts strong { display:block; overflow-wrap:anywhere; }
.contract-facts small { color:var(--muted); margin-bottom:5px; }
.contract-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.contract-columns > section { min-width:0; }
.contract-columns details { margin:12px 0; }
.contract-columns summary { cursor:pointer; }
.contract-bytecode { max-height:260px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; padding:10px; background:var(--bg); }
.contract-hash { display:block; overflow-wrap:anywhere; padding:10px; color:var(--accent); }
.contract-party { max-width:300px; overflow-wrap:anywhere; }
.contract-overview .mono { overflow-wrap:anywhere; }
.tr-contract-tool { color:#c4b5fd!important; border-color:#7c3aed!important; }
.tr-node-contract { color:#c4b5fd; }
.tr-node-contract .ui-icon { fill:none; stroke:currentColor; stroke-width:1.7; pointer-events:none; }
@media(max-width:720px) { .contract-columns { grid-template-columns:1fr; } .contract-inputs > label { flex-basis:100%; } .contract-overview .panel-head { display:block; } }
body:has(#view #contract-form) .top-actions [data-act="newCase"] { display:none; }
.contract-badges { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.contract-overview h2 { margin:6px 0; font-size:27px; }
.contract-note { color:var(--muted); font-size:14px; line-height:1.6; }
.contract-key-values { display:grid; grid-template-columns:140px minmax(0,1fr); gap:8px 14px; margin:12px 0 0; }
.contract-key-values dt { color:var(--muted); }
.contract-key-values dd { margin:0; overflow-wrap:anywhere; }
.contract-match-count { font-size:36px; color:var(--accent); margin:8px 0; font-weight:700; }
.contract-match-count span { font-size:17px; font-weight:500; }
.contract-findings { padding-left:22px; line-height:1.8; }
.contract-amount { font-variant-numeric:tabular-nums; min-width:170px; overflow-wrap:anywhere; }
.contract-technical > summary { cursor:pointer; font-weight:600; color:var(--link); }
.contract-technical[open] > summary { margin-bottom:20px; }
.contract-technical .actions { margin:14px 0; }
#contract-results details:not(.panel) { margin:14px 0; }
#contract-results details summary { cursor:pointer; }
#contract-results td small { display:block; margin-top:5px; color:var(--muted); }
.contract-disclaimer { color:var(--muted); font-size:13px; }
.vasp-contact-table td { overflow-wrap:anywhere; min-width:150px; }
.vasp-contact-table td:first-child { min-width:150px; }
.vasp-contact-table td:nth-child(4) { min-width:220px; max-width:320px; }
.vasp-contact-table td:last-child { min-width:60px; }
.vasp-email { display:inline-flex; align-items:center; gap:3px; }
@media(max-width:600px) { .contract-key-values { grid-template-columns:1fr; gap:5px; } .contract-key-values dd { margin-bottom:10px; } .contract-facts { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Match both navigation rails and keep the center free for investigation content. */
body:has(#view .tr-canvas) .side-group-title { display:none; }
body:has(#view .tr-canvas) .side-right { border-right:0; border-left:1px solid var(--line); }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) a { flex:none; min-height:42px; }
body:has(#view .tr-canvas) :is(#nav, #nav-resources) i { display:none; }
@media (max-width:1180px) {
  #app { grid-template-columns:62px minmax(0,1fr) 62px; }
  .side { padding:12px 6px; gap:14px; align-items:center; }
  .brand { padding:0; }
  .brand > span:not(.logo), .side-group-title { display:none; }
  :is(#nav, #nav-resources) a { justify-content:center; min-height:46px; padding:8px; font-size:0; }
  :is(#nav, #nav-resources) .nav-icon { width:22px; height:22px; }
  :is(#nav, #nav-resources) i { display:none; }
}
@media (max-width:760px) {
  #app { grid-template-columns:48px minmax(0,1fr) 48px; }
  .side { padding:8px 4px; gap:12px; }
  :is(#nav, #nav-resources) { gap:5px; }
  :is(#nav, #nav-resources) a { height:42px; min-height:42px; padding:0; }
  :is(#nav, #nav-resources) .nav-icon { width:20px; height:20px; }
  #view { padding:12px; }
}
body.tracer-popout .main { grid-column:1; }

/* The synchronized graph window is a canvas view. Its parent window already
   carries the navigation and graph-tool rails. Override the tracer workspace
   grid too, so hiding the rails does not leave empty side columns. */
body.tracer-popout:has(#view .tr-canvas) #app { grid-template-columns: minmax(0, 1fr); }
body.tracer-popout:has(#view .tr-canvas) .side,
body.tracer-popout:has(#view .tr-canvas) .tr-tool-dock { display: none !important; }
body.tracer-popout:has(#view .tr-canvas) .main { grid-column: 1; }

/* Tracing uses the full viewport. Main navigation opens over the canvas only on request. */
.tr-nav-toggle, .tr-nav-backdrop { display:none; }
body:has(#view .tr-canvas) #app { grid-template-columns:minmax(0,1fr); }
body:has(#view .tr-canvas) .main { grid-column:1; }
body:has(#view .tr-canvas) .side { display:none; }
body:not(.tracer-popout):has(#view .tr-canvas) .tr-nav-toggle {
  position:fixed; z-index:122; bottom:12px; display:grid; place-items:center;
  width:38px; height:38px; padding:8px; border:1px solid var(--line); border-radius:10px;
  background:var(--panel); color:var(--accent); cursor:pointer; box-shadow:0 3px 12px #0005;
}
.tr-nav-toggle-left { left:10px; }
.tr-nav-toggle-right { right:10px; }
.tr-nav-toggle .ui-icon { width:21px; height:21px; }
.tr-nav-toggle[aria-expanded="true"] { border-color:var(--accent); background:var(--panel2); }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) .tr-nav-backdrop {
  display:block; position:fixed; inset:0; z-index:110; border:0; background:#0005;
}
body.tr-nav-left-open:has(#view .tr-canvas) .side-left,
body.tr-nav-right-open:has(#view .tr-canvas) .side-right {
  display:flex; position:fixed; top:0; bottom:0; z-index:120;
  width:min(240px,calc(100vw - 48px)); height:100dvh; padding:16px 12px 64px;
  align-items:stretch; gap:18px; box-shadow:0 0 24px #0007;
}
body.tr-nav-left-open:has(#view .tr-canvas) .side-left { left:0; }
body.tr-nav-right-open:has(#view .tr-canvas) .side-right { right:0; }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) .side .brand > span:not(.logo) { display:block; }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) .side-group-title { display:flex; }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) :is(#nav,#nav-resources) { flex:1 1 auto; align-items:stretch; overflow-y:auto; }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) :is(#nav,#nav-resources) a {
  width:100%; height:auto; min-height:48px; padding:10px; font-size:13px;
  justify-content:flex-start; text-align:left;
}
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) :is(#nav,#nav-resources) i { display:inline; }
body:is(.tr-nav-left-open,.tr-nav-right-open):has(#view .tr-canvas) :is(#nav,#nav-resources) i:empty { display:none; }

/* Only the three toolbar handles are visible until the investigator opens one. */
body:has(#view .tr-canvas) .tr-tool-dock { width:48px; min-width:48px; max-width:48px; }
body:has(#view .tr-canvas) .tr-tool-dock:not([open]) > .tr-dock-controls { display:none !important; }
body:has(#view .tr-canvas) .tr-tool-dock:not([open]) { bottom:auto; height:48px; min-height:0; max-height:48px; overflow:hidden; }
body:has(#view .tr-canvas) .tr-tool-dock > summary.tr-dock-title {
  display:grid; place-items:center; list-style:none; width:36px; min-width:36px;
  height:36px; min-height:36px; padding:0; font-size:0; cursor:pointer;
}
.tr-tool-dock > summary::-webkit-details-marker { display:none; }
body:has(#view .tr-canvas) .tr-drawing-collapse { display:block; width:max-content; padding:5px; }
.tr-drawing-collapse > summary { display:grid; place-items:center; width:34px; height:34px; cursor:pointer; list-style:none; border-radius:7px; color:var(--accent); }
.tr-drawing-collapse > summary::-webkit-details-marker { display:none; }
.tr-drawing-collapse:not([open]) > .tr-drawing-controls { display:none !important; }
.tr-drawing-collapse[open] > summary { margin-bottom:6px; background:var(--panel2); }
.tr-drawing-controls { display:flex; align-items:center; flex-wrap:wrap; gap:4px; }
@media(max-width:760px) {
  body:has(#view .tr-canvas) .tr-tool-dock { width:44px; min-width:44px; max-width:44px; }
  body:has(#view .tr-canvas) .tr-tool-dock:not([open]) { height:44px; max-height:44px; }
  body:has(#view .tr-canvas) .tr-tool-dock > summary.tr-dock-title { width:32px; min-width:32px; height:32px; min-height:32px; }
}

/* ---- Tracer bulk upload dialog ---- */
.tr-bulk { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 64px #000b; }
.tr-bulk::backdrop { background: #000a; }
.tr-bulk-inner { display: flex; flex-direction: column; gap: 10px; padding: 16px; max-height: calc(100dvh - 50px); }
.tr-bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-bulk-head h2 { margin: 0; font-size: 17px; }
.tr-bulk-input { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.tr-bulk-input textarea { flex: 1 1 420px; min-height: 84px; resize: vertical; }
.tr-bulk-actions { display: flex; flex-direction: column; gap: 8px; }
.tr-bulk-actions label.btn { cursor: pointer; text-align: center; }
.tr-bulk-summary { margin: 0; color: var(--muted); font-size: 13px; }
.tr-bulk-summary.done { color: #4ade80; font-weight: 700; background: color-mix(in srgb, #22c55e 12%, transparent); border: 1px solid color-mix(in srgb, #22c55e 45%, transparent); border-radius: 8px; padding: 8px 12px; }
.tr-bauto-pdf.ready { background: color-mix(in srgb, #2dd4bf 18%, var(--panel2)); animation: tr-bauto-ready 1.2s ease-in-out 4; }
@keyframes tr-bauto-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } 50% { box-shadow: 0 0 0 6px rgba(45, 212, 191, .35); } }
@media (prefers-reduced-motion: reduce) { .tr-bauto-pdf.ready { animation: none; } }
.tr-bulk-table-wrap { overflow: auto; min-height: 60px; max-height: 48dvh; border: 1px solid var(--line); border-radius: 8px; }
.tr-bulk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-bulk-table th { position: sticky; top: 0; background: var(--panel2, var(--panel)); text-align: left; font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tr-bulk-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tr-bulk-table td.mono { font-family: var(--mono, monospace); font-size: 12px; word-break: break-all; min-width: 300px; max-width: 420px; }
.tr-bulk-table .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tr-bulk-table td.raw { color: var(--muted); min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
.tr-bulk-table select { max-width: 170px; }
.tr-bulk-table .st { min-width: 130px; }
.tr-bulk-table .st small { display: block; color: var(--muted); font-size: 11px; }
.tr-bulk-table .ok { color: #34d399; font-weight: 600; }
.tr-bulk-table .warn { color: #f59e0b; font-weight: 600; }
.tr-bulk-table .bad { color: #f87171; font-weight: 600; }
.tr-bulk-table tr.invalid td, .tr-bulk-table tr.dup td { opacity: .75; }
.tr-bulk-foot { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .tr-bulk-table td.raw, .tr-bulk-table th:nth-child(2) { display: none; } }

/* ---- Fund-flow analysis (multi-model tracing) ---- */
.tr-ff { width: min(1180px, calc(100vw - 32px)); }
.tr-ff .tr-bulk-inner { overflow: auto; }
.tr-ff-intro, .tr-ff-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tr-ff-summary b { color: var(--text); }
.tr-ff-summary .warn, .tr-ff .warn { color: #f59e0b; }
.tr-ff-setup { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tr-ff-setup label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tr-ff-setup select { min-width: 200px; max-width: 360px; }
.tr-ff-seeds > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.tr-ff-seed-tools { display: flex; gap: 6px; margin: 6px 0; }
.tr-ff-seed-list { display: grid; gap: 4px; max-height: 180px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.tr-ff-seed-list label { display: grid; grid-template-columns: auto 150px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 12px; }
.tr-ff-seed-list small { color: var(--muted); }
.tr-ff-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.tr-ff-card { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2, var(--bg)); display: flex; flex-direction: column; gap: 3px; }
.tr-ff-card .big { font-size: 18px; font-weight: 700; color: #f87171; font-family: var(--mono, monospace); }
.tr-ff-card small { color: var(--muted); font-size: 11px; }
.tr-ff-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.tr-ff h3 { margin: 6px 0 0; font-size: 14px; }
.tr-ff-table td.num, .tr-ff-table th.num { text-align: right; font-family: var(--mono, monospace); white-space: nowrap; }
.tr-ff-table td small { display: block; color: var(--muted); font-size: 11px; }
.tr-ff-table td.differ { color: #f59e0b; font-weight: 700; }
.tr-ff-table .tag { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tr-ff-table .tag.fact { background: #1d4ed833; color: #93c5fd; }
.tr-ff-table .tag.agree { background: #05966933; color: #6ee7b7; }
.tr-ff-table .tag.differ { background: #d9770633; color: #fcd34d; }
.tr-ff-notes { font-size: 12px; color: var(--muted); }
.tr-ff-notes summary { cursor: pointer; font-weight: 600; }
/* Graph overlay */
.tr-edge.taint-off { opacity: .22; }
.tr-edge.taint-on .tr-edge-visible { stroke: #ef4444 !important; stroke-width: 3.4 !important; filter: drop-shadow(0 0 4px #ef444488); }
.tr-edge.taint-on rect { stroke: #ef4444; stroke-width: 2; }
.tr-taint-badge rect { fill: #450a0a; stroke: #ef4444; stroke-width: 1.5; }
.tr-taint-badge text { font: 700 13px var(--mono, monospace); fill: #fecaca; }
.tr-bulk-columns { display: flex; flex-direction: column; gap: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2, var(--bg)); font-size: 13px; }
.tr-bulk-columns .muted { color: var(--muted); font-size: 12px; }
.tr-bulk-col-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tr-bulk-col-list label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tr-bulk-col-list small { color: var(--muted); }
.tr-inferred-deposit { font: 700 12px var(--mono, monospace); fill: #fbbf24; }

.tr-bulk-table .tag.reused { display: inline-block; padding: 1px 7px; margin-left: 6px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #1e40af55; color: #93c5fd; }
/* Highlight the currently-applied Merge / Unmerge button so its state is obvious. */
.tr-icon-btn.active { background: var(--accent, #22d3ee); color: #0b1220; border-color: transparent; }
.tr-icon-btn.active .ui-icon { color: #0b1220; }

/* ---- Merged-transfer side panel ---- */
.tr-edge-panel { position: absolute; top: 60px; right: 12px; z-index: 80; width: min(620px, calc(100% - 24px)); max-height: calc(100% - 72px); overflow: auto; background: var(--panel, #0f1826); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px #000c; font-size: 13px; }
.tr-edge-panel[hidden] { display: none; }
.tr-ep-head { padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: inherit; z-index: 1; }
.tr-ep-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.tr-ep-close { background: var(--panel2, transparent); border: 1px solid var(--muted); border-radius: 50%; width: 30px; height: 30px; color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tr-ep-close:hover { color: #f87171; border-color: #f87171; }
.tr-ep-meta { display: grid; grid-template-columns: 70px 1fr; gap: 6px 14px; margin: 10px 0 0; }
.tr-ep-meta dt { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; align-self: center; }
.tr-ep-meta dd { margin: 0; word-break: break-all; font-family: var(--mono, monospace); font-size: 12px; color: var(--text); }
.tr-ep-meta dd b { font-family: inherit; }
.tr-ep-total { font-family: var(--mono, monospace); font-size: 18px; color: #5ee0c7; }
.tr-ep-meta dd small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; font-family: var(--mono, monospace); }
.tr-ep-table-title { padding: 10px 14px 4px; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }
.tr-ep-table-wrap { max-height: 46dvh; overflow: auto; }
.tr-ep-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tr-ep-table th { position: sticky; top: 0; background: var(--panel2, var(--panel)); color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tr-ep-table th.num { text-align: right; }
.tr-ep-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tr-ep-table td.num { text-align: right; font-family: var(--mono, monospace); }
.tr-ep-table .tr-ep-time { color: #7dd3fc; white-space: nowrap; }
.tr-ep-table .tr-ep-addr { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-ep-table .tr-ep-value { color: #f87171; font-weight: 600; }
.tr-ep-table .tr-ep-usd { color: var(--text); }
.tr-ep-table .tr-ep-link a { color: #7dd3fc; text-decoration: none; }
.tr-ep-full { margin-top: 10px; width: 100%; padding: 7px 10px; background: transparent; border: 1px solid var(--line); border-radius: 7px; color: #7dd3fc; font-size: 12px; cursor: pointer; }
.tr-ep-full:hover { background: var(--panel2, transparent); border-color: #7dd3fc; }

/* ---- NCRP complaint copy upload ---- */
.trace-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 4px; border-radius: 6px; border: 1px solid var(--line); color: var(--accent); vertical-align: middle; flex: none; }
.trace-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trace-ic:hover { background: var(--accent); color: var(--accent-ink); }
.ncrp-review .ncrp-sec, .ncrp-panel .ncrp-sec { margin: 14px 0 6px; font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.ncrp-dl { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.ncrp-dl dt { color: var(--muted); }
.ncrp-dl dd { margin: 0; word-break: break-word; }
.ncrp-dl dd .mono { word-break: break-all; }
.ncrp-table td { vertical-align: middle; font-size: 12px; }
.ncrp-table td.mono { word-break: break-all; max-width: 360px; }
.ncrp-ind { margin: 8px 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ncrp-all summary { cursor: pointer; margin-top: 12px; font-weight: 600; }
.ncrp-file { margin-bottom: 8px; }
@media (max-width: 680px) { .ncrp-dl { grid-template-columns: 1fr; } }

/* Address panel: one compact summary row, counterparties right below it */
.tr-detail-metrics { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tr-flow-tile span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-flow-tile.in b { color: #2fcf8b; }
.tr-flow-tile.out b { color: #ff7880; }
.tr-detail-folds { margin-top: 10px; }
.tr-detail-folds > details { margin: 5px 0; }

/* Address panel: tighter so header, summary, table and folds fit one screen */
.tr-address-panel { padding: 9px 12px 8px; }
.tr-detail-head { padding-bottom: 6px; }
.tr-detail-coin { flex-basis: 30px; width: 30px; height: 30px; padding: 4px; }
.tr-detail-kicker { margin-bottom: 1px; font-size: 9px; }
.tr-detail-head h2 { font-size: 15px; }
.tr-detail-full { margin: 2px 0 0; font-size: 11px; }
.tr-detail-head .btn { padding: 4px 9px; font-size: 12px; }
.tr-detail-metrics { gap: 5px; margin: 6px 0 4px; }
.tr-detail-metrics > div { padding: 4px 8px; }
.tr-detail-metrics small { font-size: 10px; }
.tr-detail-metrics b { margin-top: 1px; font-size: 13px; }
.tr-detail-metrics .tr-token-balances, .tr-flow-tile span { font-size: 9.5px; }
.tr-detail-tabs { margin: 4px 0 5px; }
.tr-detail-tabs button { padding: 5px 10px; }
.tr-detail-tabs input { margin-bottom: 4px; padding-top: 4px; padding-bottom: 4px; }
.tr-detail-direction-tabs { margin: 0 0 5px; }
.tr-detail-direction-tabs button { padding: 3px 9px; font-size: 12px; }
.tr-detail-table { max-height: min(48dvh, 480px); }
.tr-address-panel .tr-detail-table th { padding: 5px 8px; }
.tr-address-panel .tr-detail-table td { padding: 5px 8px; line-height: 1.3; }
.tr-detail-table td small { max-width: none; overflow-wrap: normal; white-space: nowrap; }
.tr-attribution-sources { margin-top: 1px; }
.tr-detail-note { margin: 5px 0 0; font-size: 10px; line-height: 1.35; }
.tr-detail-folds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; align-items: start; }
.tr-detail-folds > details { margin: 0; }
.tr-detail-folds > details[open] { grid-column: 1 / -1; }
.tr-detail-folds > details > summary { padding: 6px 10px; }
.tr-detail-folds > details > summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .tr-detail-folds { grid-template-columns: minmax(0, 1fr); } }

/* Counterparty column: full address with a copy icon */
.tr-cp-addr { display: inline-flex; align-items: center; gap: 6px; }
.tr-cp-addr .tr-detail-address { color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tr-cp-copy { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--panel2); color: var(--muted); cursor: pointer; }
.tr-cp-copy:hover { color: var(--accent); border-color: var(--accent); }

/* Decoded bridge / swap hops */
.tr-edge.decoded .tr-edge-visible { stroke-dasharray: 12 6; stroke-width: 3; }
.tr-output-mark .tr-output-ring { fill: none; stroke: #22c55e; stroke-width: 3; stroke-dasharray: 10 6; filter: drop-shadow(0 0 8px #22c55e99); }
.tr-output-mark .tr-output-tag { fill: #052e16; stroke: #22c55e; stroke-width: 1.5; }
.tr-output-mark text { fill: #bbf7d0; font: 700 12px system-ui, sans-serif; letter-spacing: .03em; }
.tr-output-mark .tr-output-next { fill: #4ade80; font-size: 13px; }
.tr-output-mark:not(.done) .tr-output-ring { animation: tr-output-pulse 1.6s ease-in-out 3; }
.tr-output-mark.done .tr-output-ring { stroke: #16a34a; stroke-dasharray: none; filter: none; opacity: .6; }
.tr-output-mark.done .tr-output-next { fill: #86efac; }
@keyframes tr-output-pulse { 50% { stroke-width: 5; filter: drop-shadow(0 0 14px #22c55e); } }
@media (prefers-reduced-motion: reduce) { .tr-output-mark .tr-output-ring { animation: none; } }
.tr-edge.decoded .tr-edge-label rect { fill: color-mix(in srgb, var(--edge-color) 22%, #0b1220); stroke: var(--edge-color); }
.tr-edge.decoded .tr-edge-label text { fill: #fff; font-weight: 700; }
.tx-decode { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid #22d3ee66; border-radius: 8px; background: color-mix(in srgb, #22d3ee 7%, var(--panel2)); }
.tx-decode-head b { color: #22d3ee; }
.tx-decode-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12px; }
.tx-decode-row > span { color: var(--muted); }
.tx-decode-row code { overflow-wrap: anywhere; }
.tx-decode-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; font-size: 12px; }

/* Transfer filters + zoom: one fixed line centred over the graph */
.tr-graph-bar { position: absolute; z-index: 44; top: 10px; left: 50%; transform: translateX(-50%); width: max-content; display: flex; flex-wrap: nowrap; align-items: end; gap: 6px; max-width: calc(100% - 130px); overflow-x: auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 6px 18px #0006; scrollbar-width: thin; }
.tr-graph-bar > label { display: grid; flex: 0 0 auto; gap: 2px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.tr-graph-bar input { min-width: 0; height: 28px; padding: 3px 6px; font-size: 12px; }
.tr-graph-bar input[type="date"] { width: 128px; }
.tr-graph-bar input[type="time"] { width: 92px; }
.tr-graph-bar input[type="number"] { width: 84px; }
.tr-graph-bar .tr-picker-wrap { display: flex; align-items: center; }
.tr-graph-bar .btn.sm { flex: 0 0 auto; height: 28px; padding: 3px 9px; white-space: nowrap; }
.tr-graph-bar > small { align-self: center; flex: 0 0 auto; color: var(--accent); font-size: 10px; white-space: nowrap; }
.tr-graph-bar-sep { align-self: stretch; flex: 0 0 1px; margin: 2px 2px; background: var(--line); }
.tr-detail-web { display: inline-block; margin: 2px 0 1px; color: var(--link); font-size: 12px; font-weight: 600; text-decoration: none; }
.tr-detail-web:hover { text-decoration: underline; }
.tr-detail-tabs .tr-detail-csv { flex: none; margin: 0 0 4px; }

/* Trace forward: pick all funds or one incoming fund */
.tr-fund-menu { position: absolute; z-index: 90; width: 250px; max-height: 360px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 14px 40px #0009; }
.tr-fund-menu header { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: var(--panel2); font-weight: 700; font-size: 14px; }
.tr-fund-menu header button { padding: 0 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.tr-fund-menu [data-fund] { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; }
.tr-fund-menu [data-fund]:hover, .tr-fund-menu [data-fund]:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.tr-fund-menu [data-fund] b { display: block; font-size: 13px; }
.tr-fund-menu [data-fund] small { display: block; color: var(--muted); font-size: 10.5px; }
.tr-fund-menu [data-fund] i { color: #4ade80; font-style: normal; font-size: 18px; font-weight: 700; }
.tr-fund-list { overflow-y: auto; }
.tr-fund-menu [data-fund] em { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--c); font-size: 9.5px; font-style: normal; font-weight: 700; vertical-align: 1px; }
.tr-fund-menu.backward [data-fund] i { color: #60a5fa; }
.tr-fund-wait { margin: 0; padding: 12px; color: var(--muted); font-size: 12px; }
.tr-fund-menu.tr-pick-menu { width: 340px; max-height: min(480px, calc(100% - 16px)); }
.tr-pick-tools { display: grid; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.tr-pick-tools label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.tr-pick-tools small { color: var(--muted); font-weight: 400; font-size: 11px; }
.tr-pick-tools input[type=search] { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 12px; }
.tr-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.tr-pick-row[hidden] { display: none; }
.tr-pick-row.off-trail { opacity: .62; }
.tr-pick-trail { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.tr-pick-trail .btn { margin-left: 6px; }
.tr-pick-row:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tr-pick-row:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tr-pick-row input, .tr-pick-tools input[type=checkbox] { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.tr-pick-row b { display: block; font-size: 13px; }
.tr-pick-row small { display: block; color: var(--muted); font-size: 10.5px; }
.tr-pick-row em { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--c, #8b9bb0) 25%, transparent); color: var(--c, #8b9bb0); font-size: 9.5px; font-style: normal; font-weight: 700; }
.tr-pick-row em.on-graph { --c: #fbbf24; }
.tr-pick-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel2); }
.tr-pick-foot .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Filter bar: one slim line with the label beside each box */
.tr-graph-bar { align-items: center; gap: 8px; padding: 4px 8px; }
.tr-graph-bar > label { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.tr-graph-bar input { height: 28px; }
.tr-graph-bar input[type="date"] { width: 122px; }
.tr-graph-bar input[type="time"] { width: 86px; }
.tr-graph-bar input[type="number"] { width: 74px; }
.tr-graph-bar-sep { align-self: center; height: 24px; }
/* Controls collapsed: the bar moves up beside "Add addresses to this graph" */
.tr-graph-bar.beside-add { right: 12px; transform: none; width: auto; max-width: none; justify-content: flex-end; border-color: transparent; background: transparent; box-shadow: none; }
.nav-ext { margin-left: 2px; font-size: 11px; opacity: .7; }
body:has(#view .tr-canvas) .nav-ext { display: none; }
.nav-two { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-sub { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.3; }
body:has(#view .tr-canvas):not(.tr-nav-left-open) .nav-two { display: none; }

/* AP Police logo at the foot of the left sidebar */
.side-org { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.side-org .org-logo { margin: 0; }
.side-org b { display: block; font-size: 12px; line-height: 1.25; }
.side-org small { display: block; color: var(--muted); font-size: 10px; }
body:has(#view .tr-canvas) .side-org { justify-content: center; padding: 8px 0 4px; }
body:has(#view .tr-canvas):not(.tr-nav-left-open) .side-org > span { display: none; }
body.tr-nav-left-open:has(#view .tr-canvas) .nav-two { font-size: 13px; }
body:has(#view .tr-canvas) .side-org .org-logo { height: 30px; }
@media (max-width: 900px) { .side-org > span { display: none; } }

/* Zoomed out: arrow labels fade so the flow reads as a clean map; hover an arrow to read its label */
.tr-canvas .tr-edge-label { transition: opacity .15s; }
.tr-canvas.tr-far .tr-edge-label text { font-weight: 700; }

/* Status messages: the line is kept for screen readers only; what it says
   flashes as a short note over the graph (beside the card it is about). */
body:has(#view .tr-canvas) #tr-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tr-flash { position: absolute; z-index: 60; max-width: 360px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--panel) 96%, transparent); color: var(--text); box-shadow: 0 10px 28px #0008; font-size: 12px; line-height: 1.4; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.tr-flash.show { opacity: 1; transform: none; }
.tr-flash.err { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.tr-flash.err::before { content: "⚠ "; color: var(--danger); }
.tr-flash.anchored::after { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; background: inherit; border: inherit; border-width: 0 0 1px 1px; transform: translateY(-50%) rotate(45deg); left: -6px; }
.tr-flash.anchored.left::after { left: auto; right: -6px; transform: translateY(-50%) rotate(225deg); }

/* Court Checker */
.court-tools { flex-wrap: wrap; gap: 8px; }
.court-tools input[type="search"] { flex: 1 1 260px; }
.court-item { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin: 0 0 8px; }
.court-when b { display: block; font-size: 13px; }
.court-when span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.court-title { color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.court-title:hover { color: var(--accent); text-decoration: underline; }
.court-meta { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.court-sum { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.court-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.court-chip { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); color: var(--muted); font-size: 10.5px; }
.court-chip.asset { border-color: color-mix(in srgb, #f59e0b 50%, var(--line)); color: #f59e0b; }
.court-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.court-more { display: flex; justify-content: center; margin: 12px 0; }
.court-sources { margin-top: 14px; }
@media (max-width: 760px) { .court-item { grid-template-columns: minmax(0, 1fr); } .court-actions { flex-wrap: wrap; } }

/* ----- Node Tracker ----- */
:root { --node-sea: #0a1020; --node-land: #1c2638; --node-border: #2c3a52; }
:root[data-theme="light"] { --node-sea: #e8eef6; --node-land: #ffffff; --node-border: #b9c4d3; }
.node-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.node-net { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.node-net i, .node-card h3 i, .node-tip i { width: 10px; height: 10px; border-radius: 50%; background: var(--net); display: inline-block; flex: none; }
.node-net b { font-weight: 600; color: var(--muted); }
.node-net.off { opacity: .45; }
.node-net.off i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--net); }
.node-legend-tools { display: inline-flex; gap: 4px; margin-left: auto; }
.node-map { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--node-sea); }
.node-map canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
.node-map canvas:active { cursor: grabbing; }
.node-tip { position: absolute; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap; z-index: 2; }
.node-tip div { display: flex; align-items: center; gap: 6px; }
.node-tip b { margin-left: auto; padding-left: 10px; }
.node-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.node-zoom button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 17px; line-height: 1; cursor: pointer; }
.node-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.node-card { border: 1px solid var(--line); border-top: 3px solid var(--net); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.node-card h3 { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin: 0 0 4px; }
.node-card-n { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.node-card-n span { font-size: 12px; font-weight: 400; color: var(--muted); }
.node-card ol { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.node-card li { position: relative; display: flex; justify-content: space-between; padding: 3px 4px; }
.node-card li span, .node-card li b { position: relative; z-index: 1; }
.node-card li em { position: absolute; left: 0; top: 2px; bottom: 2px; background: var(--net); opacity: .14; border-radius: 3px; }
.node-sources a { color: inherit; }
@media (max-width: 760px) { .node-legend-tools { margin-left: 0; } }

/* =====================================================================
   shadcn/ui design layer (adapted from shadcnblocks free blocks:
   Application Shell 1, Sidebar 1, Stats Card 1, Data Table 1).
   Zinc neutrals, 1px hairlines, soft shadows, ring focus, grouped sidebar.
   ===================================================================== */
/* Colours stay on the original TraceDesk teal / navy palette (top of this
   file); only layout, radius, shadow and focus tokens are added here. */
:root {
  --primary: var(--accent); --primary-ink: var(--accent-ink); --ring: color-mix(in srgb, var(--accent) 40%, transparent);
  --sidebar: var(--panel); --hover: var(--panel2);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .25); --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3), 0 1px 2px -1px rgba(0, 0, 0, .3);
  --r: 12px;
}
:root[data-theme="light"] {
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05); --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px -1px rgba(0, 0, 0, .06);
}
body { font-feature-settings: "cv11", "ss01"; letter-spacing: -0.006em; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }
h2 { font-weight: 600; letter-spacing: -0.015em; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 6px; }

/* shell: sidebar + header */
.side { background: var(--sidebar); }
.side-group-title { min-height: 30px; padding: 0 10px; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
:is(#nav, #nav-resources) a { color: var(--muted); border-radius: 8px; font-weight: 500; transition: background .15s ease, color .15s ease; }
:is(#nav, #nav-resources) a:hover { background: var(--hover); color: var(--text); }
:is(#nav, #nav-resources) a.on { background: var(--panel2); color: var(--text); box-shadow: inset 2px 0 0 var(--nav-color); }
:is(#nav, #nav-resources) i { background: var(--panel2); border-color: var(--line); border-radius: 6px; font-weight: 500; }
@media (min-width: 1181px) {
  :is(#nav, #nav-resources) { gap: 2px; }
  :is(#nav, #nav-resources) a { min-height: 38px; padding: 8px 10px; font-size: 13.5px; }
  :is(#nav, #nav-resources) .nav-icon { width: 17px; height: 17px; }
}
.top { background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px); }

/* page header */
.page-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head p { font-size: 13.5px; }

/* buttons (shadcn variants: default / outline / ghost / destructive) */
.btn { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; border-radius: 8px; background: var(--panel); border-color: var(--line); box-shadow: var(--shadow-xs); transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover { background: var(--hover); border-color: var(--line); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--primary) 88%, var(--bg)); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled, .btn[disabled] { opacity: .5; pointer-events: none; }

/* inputs */
input, select, textarea { background: transparent; border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow-xs); transition: border-color .15s ease, box-shadow .15s ease; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select { min-height: 34px; }
input:focus, select:focus, textarea:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--ring); }
select { background-color: var(--panel); }
select option { background: var(--panel); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* cards */
.panel, .tile, .court-item, .node-card, .tablewrap { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel { padding: 20px; }
.panel > h2 { font-size: 15px; }
.panel .tablewrap { box-shadow: none; margin: 0 -20px -20px; }

/* stats card (Stats Card 1) */
.tile { padding: 16px 18px; }
.tile span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.tile b { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; }

/* data table (Data Table 1) */
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; background: transparent; height: 40px; vertical-align: middle; }
th, td { padding: 9px 14px; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--panel2) 55%, transparent); }
tbody tr:last-child td { border-bottom: 0; }

/* badges & chips */
.badge { border-radius: 6px; font-weight: 500; padding: 1px 8px; }
.chip, .court-chip { border-radius: 6px; font-weight: 500; }
.node-net { border-radius: 8px; box-shadow: var(--shadow-xs); }
.node-net:hover { background: var(--hover); }

/* empty states */
.empty { border-radius: var(--r); }

/* ----- shadcnblocks: Sidebar 1 (groups) ----- */
.nav-group { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.nav-group:first-child { padding-top: 2px; }
@media (max-width: 1180px) { .nav-group { display: none; } }
body:has(#view .tr-canvas) .nav-group, body.tracer-popout .nav-group { display: none; }

/* ----- Application Shell 1: breadcrumbs ----- */
.crumbs { display: flex; align-items: center; gap: 6px; flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .ui-icon { width: 13px; height: 13px; opacity: .6; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
body.home-page .crumbs { display: none; }
@media (max-width: 860px) { .crumbs { display: none; } }

/* ----- Stats Card 1: metric card with icon ----- */
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-head .ui-icon { width: 16px; height: 16px; color: var(--muted); }
.tile.warn .tile-head .ui-icon { color: var(--warn); }
.tile small { display: block; margin-top: 2px; font-size: 12px; }

/* ----- Hero 115: centered hero with ring backdrop ----- */
.hero { position: relative; overflow: hidden; text-align: center; padding: 72px 20px 56px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--panel); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.hero > :not(.hero-rings) { position: relative; z-index: 1; }
.hero-rings { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.hero-rings i { position: absolute; border: 1px solid var(--line); border-radius: 50%; aspect-ratio: 1; opacity: .7; }
.hero-rings i:nth-child(1) { width: 340px; }
.hero-rings i:nth-child(2) { width: 560px; opacity: .45; }
.hero-rings i:nth-child(3) { width: 800px; opacity: .25; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 500; color: var(--muted); box-shadow: var(--shadow-xs); }
.hero-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.hero h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 700; letter-spacing: -0.04em; margin: 18px 0 4px; line-height: 1.05; }
.hero-org { margin: 0 0 14px; font-size: 15px; font-weight: 500; color: var(--muted); }
.hero-lead { max-width: 560px; margin: 0 auto; font-size: 16px; line-height: 1.6; color: var(--muted); }
.hero-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn .ui-icon { width: 15px; height: 15px; }

/* ----- stats strip ----- */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow-sm); margin-bottom: 28px; overflow: hidden; }
.stat-strip a { padding: 18px 20px; color: var(--text); border-left: 1px solid var(--line); transition: background .15s ease; }
.stat-strip a:first-child { border-left: 0; }
.stat-strip a:hover { background: var(--hover); text-decoration: none; }
.stat-strip b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.stat-strip span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-strip a:nth-child(3) { border-left: 0; } .stat-strip a:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ----- Feature 17: six-up icon grid with centered intro ----- */
.features { margin-bottom: 24px; }
.features-head { text-align: center; max-width: 620px; margin: 0 auto 22px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin-bottom: 10px; }
.features-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.03em; }
.features-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.feature-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); background: color-mix(in srgb, var(--panel2) 40%, var(--panel)); transform: translateY(-1px); }
.feature-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); margin-bottom: 4px; }
.feature-icon .ui-icon { width: 19px; height: 19px; color: var(--text); }
.feature-card h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; flex: 1; }
.feature-more { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.feature-card:hover .feature-more { color: var(--text); }
.feature-more .ui-icon { width: 13px; height: 13px; }
@media (max-width: 1100px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } .hero { padding: 48px 16px 40px; } }
.crumbs .ui-icon, .feature-more .ui-icon { transform: rotate(-90deg); }

/* ----- Court Checker: register status, sources directory ----- */
.court-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 12.5px; }
.court-chip.status { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.court-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.court-dir summary { cursor: pointer; list-style: none; }
.court-dir summary::-webkit-details-marker { display: none; }
.court-dir summary h2::before { content: "▸"; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s ease; }
.court-dir[open] summary h2::before { transform: rotate(90deg); }
.court-dir[open] summary { margin-bottom: 12px; }
.court-dir .tablewrap { margin: 0 0 10px; box-shadow: none; }

/* ----- Node Tracker: census panel ----- */
.node-census h3 { margin: 18px 0 8px; font-size: 14px; }
.node-census > p.muted { margin: 4px 0 12px; max-width: 900px; }
.node-census .tablewrap { box-shadow: none; }
.census-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.census-cats div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel2); }
.census-cats b { display: block; margin-bottom: 2px; }
.census-cats span { color: var(--muted); font-size: 13px; }
.census-bars { margin: 14px 0 4px; display: grid; gap: 8px; }
.census-bar { display: grid; grid-template-columns: 90px minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: 13px; }
.census-bar > div { position: relative; height: 18px; border-radius: 5px; background: var(--panel2); overflow: hidden; }
.census-bar i { position: absolute; left: 0; display: block; border-radius: 5px; }
.census-bar i.rep { top: 0; bottom: 0; background: color-mix(in srgb, var(--muted) 60%, transparent); }
.census-bar i.live { top: 5px; height: 8px; background: var(--net); }
.census-bar b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.census-bar em { font-style: normal; color: var(--muted); font-weight: 500; }
.census-bars .key { display: inline-block; width: 18px; height: 8px; border-radius: 3px; vertical-align: middle; }
.census-bars .key.rep { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.census-bars .key.live { background: var(--accent); }
.census-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.census-src { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.census-src li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.census-src li span { color: var(--muted); }
.census-sets { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.census-sets li { margin-bottom: 6px; }
.census-sets b { color: var(--text); }
.node-census .callout { margin-top: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 10px; background: var(--warn-bg); font-size: 13px; }
.census-conclusion { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
@media (max-width: 860px) { .census-cats, .census-cols { grid-template-columns: minmax(0, 1fr); } .census-bar { grid-template-columns: 70px minmax(0, 1fr) 110px; } }

/* ----- shadcn chart palette + tracer pie charts (Chart Pie Label) ----- */
:root { --chart-1: #3b82f6; --chart-2: #10b981; --chart-3: #f59e0b; --chart-4: #a855f7; --chart-5: #f43f5e; --chart-6: #14b8a6; }
:root[data-theme="light"] { --chart-1: #f54a00; --chart-2: #009689; --chart-3: #104e64; --chart-4: #ffb900; --chart-5: #fe9a00; --chart-6: #6366f1; }
.tr-pie-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.tr-pie-card { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: grid; grid-template-columns: minmax(140px, 180px) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; align-items: center; }
.tr-pie-card figcaption { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.tr-pie-card figcaption b { font-size: 13.5px; }
.tr-pie-card figcaption small { color: var(--muted); font-size: 12px; }
.tr-pie { width: 100%; height: auto; overflow: visible; }
.tr-pie .track { fill: none; stroke: color-mix(in srgb, var(--muted) 16%, transparent); }
.tr-pie circle:not(.track) { transition: opacity .15s ease; }
.tr-pie:hover circle:not(.track) { opacity: .5; }
.tr-pie circle:not(.track):hover { opacity: 1; }
.tr-pie text.big { font-size: 19px; font-weight: 700; fill: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tr-pie text.small { font-size: 11px; fill: var(--muted); }
.tr-pie-legend { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: grid; gap: 5px; min-width: 0; }
.tr-pie-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.tr-pie-legend em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 12px; }
.tr-pie-legend i { width: 10px; height: 10px; border-radius: 3px; }
.tr-pie-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.tr-pie-legend b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .tr-pie-card { grid-template-columns: minmax(0, 1fr); } }

/* ----- Background pattern (shadcnblocks "Background Pattern"): diagonal
   soft beams, centre glow and a fine grid texture behind the whole app ----- */
:root { --beam: rgba(251, 146, 60, .07); --glow: rgba(255, 255, 255, .035); --grid: rgba(255, 255, 255, .025);
  --so-1: #fb6a2c; --so-2: #14b8a6; --so-3: #3b8fb0; --so-4: #a1a1aa; }
:root[data-theme="light"] { --beam: rgba(226, 170, 120, .30); --glow: rgba(255, 255, 255, .75); --grid: rgba(0, 0, 0, .028);
  --so-1: #f54a00; --so-2: #009689; --so-3: #104e64; --so-4: #a1a1aa; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(-15deg, transparent 38%, var(--beam) 46%, var(--beam) 54%, transparent 62%),
    linear-gradient(-15deg, transparent 8%, var(--beam) 16%, transparent 26%),
    radial-gradient(60% 50% at 50% 35%, var(--glow), transparent 70%),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 5px); }
body:has(#view .tr-canvas)::before { display: none; }
.hero { background:
    linear-gradient(-15deg, transparent 30%, var(--beam) 42%, var(--beam) 56%, transparent 68%),
    radial-gradient(60% 70% at 50% 40%, var(--glow), transparent 70%),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 5px),
    color-mix(in srgb, var(--panel) 80%, transparent); }
:root[data-theme="light"] .hero { --beam: rgba(226, 170, 120, .42); }

/* ----- Dashboard stats overview ----- */
.so-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.so-card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-sm); padding: 26px 28px; display: flex; flex-direction: column; min-width: 0; }
.so-card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.so-card > header h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.so-card > header a, .so-panel header a { color: var(--text); font-weight: 500; font-size: 14px; }
.so-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 0; }
.c1 { --c: var(--so-1); } .c2 { --c: var(--so-2); } .c3 { --c: var(--so-3); } .c4 { --c: var(--so-4); }
.so-dot, .so-sq { background: var(--c); }
.so-legend { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 22px 0 8px; }
.so-legend span { color: var(--muted); font-size: 14px; }
.so-legend b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.so-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: end; margin-top: auto; padding-top: 22px; }
.so-headline b { font-size: 46px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.so-headline p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.35; }
.so-mini { background: var(--panel2); border-radius: 12px; padding: 12px 14px 8px; }
.so-mini-head { display: flex; align-items: center; gap: 6px; }
.so-mini-head b { font-size: 14px; }
.so-mini-head small { font-size: 11px; color: var(--muted); }
.so-mini-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--so-2); color: #fff; }
.so-mini-ic .ui-icon { width: 10px; height: 10px; }
.so-mini > small { display: block; font-size: 10px; margin: 2px 0 6px 24px; }
.so-mini-bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 110px; align-items: end; }
.so-mini-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.so-mini-col i { width: 5px; border-radius: 4px; background: var(--so-1); display: block; }
.so-mini-col i.zero { background: color-mix(in srgb, var(--muted) 30%, transparent); }
.so-mini-col i.now { background: var(--so-2); }
.so-mini-col span { font-size: 8.5px; color: var(--muted); margin-top: 4px; }
.so-mini-col em { position: absolute; top: -2px; font-style: normal; font-size: 8px; color: #fff; background: var(--so-1); border-radius: 4px; padding: 0 4px; }
.so-viz { padding: 0; overflow: hidden; }
.so-stage { position: relative; padding: 34px 28px 30px; min-height: 290px; border-bottom: 1px solid var(--line);
  background: radial-gradient(70% 80% at 40% 50%, color-mix(in srgb, var(--so-1) 6%, transparent), transparent 70%); }
.so-panel { width: 64%; background: var(--panel2); border-radius: 14px; padding: 18px 20px 16px; }
.so-panel header { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 500; }
.so-panel header a { color: var(--so-1); font-size: 12px; }
.so-value { display: block; font-size: 24px; font-weight: 500; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.so-pills { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding-right: 10%; }
.so-pill { flex: 1; max-width: 40px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.so-pill i { width: 100%; border-radius: 999px; background: var(--c); display: block; }
.so-pill span { font-size: 10px; color: var(--muted); }
.so-donut { position: absolute; right: 22px; bottom: 26px; width: 38%; max-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.so-donut header small { color: var(--so-1); font-size: 11px; font-weight: 500; }
.so-donut svg { display: block; width: 62%; margin: 4px auto; }
.so-donut circle { fill: none; stroke-width: 9; stroke-linecap: round; stroke: var(--c); }
.so-donut circle.track { stroke: color-mix(in srgb, var(--muted) 18%, transparent); }
.so-donut .t1 { font-size: 7px; fill: var(--muted); }
.so-donut .t2 { font-size: 12px; font-weight: 700; fill: var(--so-1); }
.so-donut ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10.5px; color: var(--muted); }
.so-donut li b { color: var(--text); font-weight: 600; }
.so-sq { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.so-caption { padding: 20px 28px 24px; }
.so-caption h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.so-caption p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 1100px) { .so-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .so-foot { grid-template-columns: minmax(0, 1fr); } .so-panel { width: 100%; } .so-donut { position: static; width: auto; max-width: none; margin-top: 12px; } }

/* ----- Home fits on one screen ----- */
body.home-page #view { padding-top: 8px; padding-bottom: 8px; }
body.home-page .site-credit { display: none; }
body.home-page .hero { padding: 26px 20px 22px; margin-bottom: 10px; }
body.home-page .hero-badge { padding: 3px 10px; font-size: 11.5px; }
body.home-page .hero h1 { font-size: clamp(30px, 3.6vw, 42px); margin: 10px 0 0; }
body.home-page .hero-org { margin: 2px 0 6px; font-size: 13.5px; }
body.home-page .hero-lead { font-size: 14px; line-height: 1.5; max-width: 620px; }
body.home-page .hero-cta { margin-top: 14px; }
body.home-page .hero-cta .btn.lg { height: 34px; font-size: 13.5px; }
body.home-page .stat-strip { margin-bottom: 12px; }
body.home-page .stat-strip a { padding: 10px 16px; display: flex; align-items: baseline; gap: 10px; }
body.home-page .stat-strip b { font-size: 22px; flex: none; }
body.home-page .stat-strip span { font-size: 12.5px; line-height: 1.3; }
body.home-page .features { margin-bottom: 10px; }
body.home-page .features-head { display: none; }
body.home-page .feature-grid { gap: 10px; }
body.home-page .feature-card { padding: 12px 14px; gap: 4px; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; align-items: start; }
body.home-page .feature-icon { width: 30px; height: 30px; border-radius: 8px; margin: 0; grid-row: span 2; }
body.home-page .feature-icon .ui-icon { width: 16px; height: 16px; }
body.home-page .feature-card h3 { font-size: 14px; align-self: center; }
body.home-page .feature-card p { font-size: 12.5px; line-height: 1.45; grid-column: 2; }
body.home-page .feature-more { display: none; }
body.home-page .developer-credit { margin: 0; padding: 10px 18px; }
body.home-page .developer-credit > div { gap: 1px; }
@media (max-height: 760px) {
  body.home-page .top { padding-top: 6px; padding-bottom: 6px; }
  body.home-page .hero { padding: 14px 18px 14px; margin-bottom: 8px; }
  body.home-page .hero h1 { font-size: 30px; margin-top: 6px; }
  body.home-page .hero-org { margin: 0 0 4px; font-size: 12.5px; }
  body.home-page .hero-lead { font-size: 13px; }
  body.home-page .hero-cta { margin-top: 10px; }
  body.home-page .stat-strip { margin-bottom: 8px; }
  body.home-page .stat-strip a { padding: 7px 14px; }
  body.home-page .stat-strip b { font-size: 19px; }
  body.home-page .feature-grid { gap: 8px; }
  body.home-page .feature-card { padding: 9px 12px; }
  body.home-page .feature-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  body.home-page .features { margin-bottom: 8px; }
  body.home-page .developer-credit { padding: 7px 16px; }
  body.home-page .developer-credit-label { display: none; }
}

/* ----- Exchange reply analyser ----- */
.xr-drop { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; margin-bottom: 18px; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease; }
.xr-drop:hover, .xr-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.xr-drop b { font-size: 15px; }
.xr-drop span { color: var(--muted); font-size: 13px; }
.xr-drop small { color: var(--ok); font-size: 12px; margin-top: 4px; }
.xr-file { margin-bottom: 26px; }
.xr-file-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.xr-file-head h2 { font-size: 15px; overflow-wrap: anywhere; }
.xr-account { border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 18px; margin-bottom: 14px; }
.xr-acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.xr-kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.xr-acc-head h2 { font-size: 20px; margin: 2px 0; }
.xr-acc-head small { overflow-wrap: anywhere; }
.xr-acc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.xr-counts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: var(--panel); }
.xr-counts div { padding: 10px 12px; border-left: 1px solid var(--line); }
.xr-counts div:first-child { border-left: 0; }
.xr-counts b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.xr-counts span { color: var(--muted); font-size: 12px; }
.xr-flags { border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.xr-flags b { color: var(--warn); }
.xr-flags ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.xr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.xr-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 16px; min-width: 0; }
.xr-card h3 { font-size: 14px; margin-bottom: 10px; }
.xr-card h3 small, .xr-card h4 small, .xr-sub small { font-weight: 400; color: var(--muted); font-size: 12px; }
.xr-card h4 { font-size: 12.5px; margin: 12px 0 6px; color: var(--muted); font-weight: 600; }
.xr-kv { display: grid; gap: 6px; margin: 0; }
.xr-kv div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.xr-kv dt { color: var(--muted); }
.xr-kv dd { margin: 0; overflow-wrap: anywhere; }
.xr-coins { display: flex; flex-wrap: wrap; gap: 8px; }
.xr-coins div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel2); }
.xr-coins b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.xr-coins span { color: var(--muted); font-size: 11.5px; }
.xr-meta { color: var(--muted); font-size: 12px; margin: 8px 0 0; overflow-wrap: anywhere; }
.xr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.xr-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; align-items: center; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.xr-list li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xr-list li small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.xr-sub { font-size: 14px; margin: 6px 0 8px; }
.xr-table { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.xr-table summary { cursor: pointer; padding: 10px 14px; font-size: 13px; }
.xr-table summary small { color: var(--muted); margin-left: 6px; }
.xr-table[open] summary { border-bottom: 1px solid var(--line); }
.xr-table .tablewrap { border: 0; border-radius: 0 0 10px 10px; max-height: 420px; overflow: auto; box-shadow: none; }
.xr-table td { font-size: 12.5px; }
.xr-val { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; padding: 0 6px; margin-right: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel2); font-size: 11.5px; }
@media (max-width: 760px) { .xr-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .xr-counts div:nth-child(4) { border-left: 0; } .xr-counts div:nth-child(n+4) { border-top: 1px solid var(--line); } .xr-kv div { grid-template-columns: 110px minmax(0, 1fr); } }

/* ----- Exchange reply: downloads + counterparty ranking ----- */
.xr-dl { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.xr-cp { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px; margin-bottom: 14px; }
.xr-cp-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.xr-cp-head h3 { font-size: 15px; }
.xr-cp-head h3 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.xr-cp-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.xr-cp-tools label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.xr-cp-tools select { min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.xr-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.xr-seg button { font: inherit; font-size: 12.5px; padding: 5px 11px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.xr-seg button + button { border-left: 1px solid var(--line); }
.xr-seg button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); font-weight: 600; }
.xr-cp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.xr-cp-kpis div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--panel2); }
.xr-cp-kpis b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.xr-cp-kpis span { font-size: 11.5px; color: var(--muted); }
.xr-share { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--panel2); margin-bottom: 12px; }
.xr-share i { display: block; height: 100%; }
.xr-share i + i { box-shadow: inset 1px 0 0 var(--panel); }
.xr-share i.rest { flex: 1; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.xr-rank { list-style: none; margin: 0; padding: 0; max-height: 620px; overflow: auto; display: grid; gap: 2px; }
.xr-rank li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 150px; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px; }
.xr-rank li:hover { background: var(--panel2); }
.xr-rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.xr-rank li:nth-child(-n+3) .xr-rk { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.xr-rk-main { min-width: 0; }
.xr-rk-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.xr-rk-top .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.xr-chip { flex: none; font-size: 10.5px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.xr-bar { height: 10px; border-radius: 5px; background: var(--panel2); margin: 5px 0 3px; overflow: hidden; }
.xr-bar i { display: block; height: 100%; border-radius: 5px; transition: width .25s ease; }
.xr-rk-main small { color: var(--muted); font-size: 11.5px; }
.xr-rk-val { text-align: right; }
.xr-rk-val b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.xr-rk-val span { font-size: 11.5px; color: var(--muted); }
@media (max-width: 760px) { .xr-cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xr-rank li { grid-template-columns: 28px minmax(0, 1fr); } .xr-rk-val { grid-column: 2; text-align: left; } }

/* ----- Exchange reply: attribution ----- */
.xr-opt { display: flex; align-items: center; gap: 8px; margin: -8px 0 16px; font-size: 13px; color: var(--muted); }
.xr-attr-status { display: block; margin-top: 2px; font-size: 12px; color: var(--accent); }
.xr-attr-status.running::before { content: "● "; animation: xrPulse 1s infinite; }
@keyframes xrPulse { 50% { opacity: .3; } }
.xr-ent { flex: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.xr-ent.none { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 400; }
.xr-ent.risk { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.xr-ents { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--panel2); font-size: 13px; }
.xr-ents small { color: var(--muted); }
.xr-ents ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.xr-ents li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 56px; gap: 10px; align-items: baseline; }
.xr-ents li span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xr-ents li.none span { font-weight: 400; color: var(--muted); }
.xr-ents li.risk span { color: var(--danger); }
.xr-ents li b { font-variant-numeric: tabular-nums; }
.xr-ents li em { font-style: normal; color: var(--muted); text-align: right; }
.xr-flag { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }

/* ----- Tracer: CoinJoin box and panel ----- */
.tr-node-coinjoin > rect { fill: color-mix(in srgb, #a855f7 16%, var(--panel)); stroke: #a855f7; stroke-width: 2.5; stroke-dasharray: 9 5; }
.tr-node-coinjoin.selected > rect { stroke-width: 4; }
.tr-cj-icon circle { fill: color-mix(in srgb, #a855f7 28%, var(--panel)); stroke: #c084fc; stroke-width: 2; }
.tr-cj-icon path { stroke: #f5f3ff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-cj-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; fill: #c084fc; }
.tr-cj-type { font-size: 21px; font-weight: 700; fill: var(--text); }
.tr-cj-line { font-size: 14px; fill: var(--text); }
.tr-cj-line.muted { fill: var(--muted); font-size: 13px; }
.tr-cj-coin { display: grid; place-items: center; font-size: 22px; color: #f5f3ff; background: #7c3aed !important; }
.tr-cj-h { font-size: 13.5px; margin: 14px 0 6px; }
.tr-cj-h small { font-weight: 400; color: var(--muted); font-size: 12px; }
.tr-cj-dens { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-cj-dens span { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, #a855f7 50%, var(--line)); background: color-mix(in srgb, #a855f7 12%, transparent); }
.tr-cj-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-cj-tables .tablewrap { max-height: 360px; overflow: auto; }
.tr-cj-tag { font-size: 10.5px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); white-space: nowrap; }
.tr-cj-tag.mixed { color: #c084fc; border-color: color-mix(in srgb, #a855f7 50%, transparent); }
.tr-cj-tag.change { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.tr-cj-tag.ingraph { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
@media (max-width: 900px) { .tr-cj-tables { grid-template-columns: minmax(0, 1fr); } }
.tr-cj-tables td:first-child .mono { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-size: 11.5px; }
.tr-cj-tables table { min-width: 0; }

/* ----- Transaction details: +N more inputs / outputs ----- */
.tx-more-count { display: inline-block; margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
details.tx-more { margin-top: 6px; }
details.tx-more > summary { cursor: pointer; display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent); padding: 2px 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); list-style: none; }
details.tx-more > summary::-webkit-details-marker { display: none; }
details.tx-more > summary::after { content: " ▾"; }
details.tx-more[open] > summary::after { content: " ▴"; }
details.tx-more ol { margin: 8px 0 0; padding-left: 26px; max-height: 260px; overflow: auto; font-size: 12px; }
details.tx-more li { padding: 2px 0; }
details.tx-more li code { font-size: 11.5px; overflow-wrap: anywhere; }
details.tx-more li b { margin-left: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ----- Transaction Explorer: compact one-screen layout ----- */
.tx-explorer-card.compact { padding: 4px 16px; }
.tx-explorer-card.compact .tx-explorer-field { min-height: 38px; padding: 5px 0; gap: 12px; grid-template-columns: 120px minmax(0, 1fr); }
.tx-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tx-cell { padding: 7px 10px 7px 0; min-width: 0; }
.tx-cell + .tx-cell { padding-left: 12px; border-left: 1px solid var(--line); }
.tx-cell:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
.tx-cell:nth-child(n + 4) { border-top: 1px solid var(--line); }
.tx-cell > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.tx-cell > div { font-size: 13.5px; overflow-wrap: anywhere; }
.tx-cell .tx-status-pill { padding: 2px 10px; font-size: 13px; }
.tx-party { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.tx-party .tx-address-value { min-width: 0; }
.tx-party .tx-address-value code { overflow-wrap: anywhere; }
.tx-party details.tx-more { margin-top: 0; }
.tx-party details.tx-more[open] { flex-basis: 100%; }
.tx-party details.tx-more ol { max-height: 200px; }
.tx-party .tx-more-count { margin-left: 0; }
@media (max-width: 760px) { .tx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tx-cell:nth-child(3n + 1) { border-left: 1px solid var(--line); padding-left: 12px; } .tx-cell:nth-child(2n + 1) { border-left: 0; padding-left: 0; } .tx-cell:nth-child(n + 3) { border-top: 1px solid var(--line); } }

/* ----- Tracer: select boxes and delete from the trace ----- */
.tr-select-bar { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); white-space: nowrap; }
.tr-select-bar[hidden] { display: none; }
.tr-select-bar b { font-size: 13.5px; }
.tr-select-bar small { color: var(--muted); font-size: 11.5px; }
.tr-marquee { position: absolute; z-index: 25; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; pointer-events: none; }
.tr-marquee[hidden] { display: none; }
.tr-lane-title { cursor: pointer; }
.tr-lane-title:hover { text-decoration: underline; }
body:has(#view .tr-canvas) .tr-select-bar small { display: none; }
@media (max-width: 760px) { .tr-select-bar small { display: none; } }

/* ----- AI Investigator ----- */
.ai-launch { font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; border: 1px solid #f472b6; color: #fff; background: linear-gradient(135deg, #db2777, #7c3aed); box-shadow: 0 4px 12px rgba(219, 39, 119, .3); cursor: pointer; }
.ai-launch:hover { filter: brightness(1.1); }
.ai-setup { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(2, 6, 12, .62); padding: 16px; }
.ai-setup-card { width: min(720px, 100%); max-height: 92dvh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); display: grid; gap: 12px; }
.ai-setup-card header { display: flex; justify-content: space-between; gap: 12px; }
.ai-setup-card h2 { font-size: 20px; margin: 2px 0 4px; }
.ai-kicker { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f472b6; }
.ai-field { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.ai-field input, .ai-field select { color: var(--text); }
.ai-field input { font-family: var(--mono); font-size: 13px; }
.ai-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
.ai-chk { align-items: flex-start !important; font-size: 13px; }
.ai-note { font-size: 12px; margin: 0; }
.ai-setup-card footer { display: flex; gap: 8px; align-items: center; }
.ai-setup-card .spacer, .ai-report-bar .spacer { flex: 1; }
.ai-progress { position: fixed; z-index: 190; left: 76px; bottom: 18px; width: min(420px, calc(100vw - 32px)); background: var(--panel); border: 1px solid #f472b6; border-radius: 14px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.ai-progress header { display: flex; align-items: center; gap: 8px; }
.ai-progress header button { margin-left: auto; }
.ai-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, #f472b6 30%, transparent); border-top-color: #f472b6; animation: aiSpin .8s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-now { margin: 8px 0 4px; font-size: 13px; font-weight: 600; }
.ai-steps { margin: 0; padding-left: 18px; font-size: 11.5px; color: var(--muted); max-height: 120px; overflow: hidden; }
.ai-chip { position: fixed; z-index: 190; left: 76px; bottom: 18px; font: inherit; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 999px; border: 1px solid #f472b6; color: #fff; background: linear-gradient(135deg, #db2777, #7c3aed); cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
.ai-report { position: fixed; inset: 0; z-index: 180; background: var(--bg); overflow: auto; }
.ai-report-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; background: color-mix(in srgb, var(--panel) 96%, transparent); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ai-doc { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; font-size: 13.5px; line-height: 1.55; }
.ai-doc h1 { font-size: 26px; margin: 4px 0; }
.ai-doc h2 { font-size: 16px; margin: 0 0 10px; }
.ai-doc h2 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.ai-doc h3 { font-size: 14.5px; margin: 16px 0 6px; color: var(--accent); }
.ai-doc code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.ai-doc table { width: 100%; border-collapse: collapse; }
.ai-doc th, .ai-doc td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 12.5px; }
.ai-doc th { color: var(--muted); font-weight: 600; background: var(--panel2); }
.ai-doc td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 14px 0 8px; background: var(--panel); }
.ai-kpis div { padding: 10px 14px; border-left: 1px solid var(--line); }
.ai-kpis div:first-child { border-left: 0; }
.ai-kpis b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.ai-kpis span { font-size: 12px; color: var(--muted); }
.ai-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 16px; margin-top: 14px; overflow-x: auto; }
.ai-narrative { border-color: color-mix(in srgb, #f472b6 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, #f472b6 7%, var(--panel)), var(--panel)); }
.ai-narrative ul { margin: 4px 0 8px; padding-left: 20px; }
.ai-narrative p { margin: 6px 0; }
details.ai-sec summary { cursor: pointer; list-style: none; }
details.ai-sec summary h2 { display: inline; }
.ai-log { font-size: 12px; color: var(--muted); }
.ai-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .ai-row { grid-template-columns: 1fr 1fr; } .ai-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ai-progress, .ai-chip { left: 16px; } }

/* ----- Home button on every pop-up and window ----- */
.home-btn { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.home-btn .ui-icon { width: 14px; height: 14px; color: var(--accent); }
#modal-root .modal > header .home-btn { margin-left: auto; margin-right: 6px; }
#modal-root .modal > header .home-btn + [data-act="closeModal"] { margin-left: 0; }
dialog .tr-bulk-head .home-btn { margin-left: auto; margin-right: 6px; }
.ai-setup-card > header .home-btn { margin-left: auto; align-self: flex-start; }
body.tracer-popout .top .home-btn { order: -1; }

/* ----- Risk score, open labels, Bitcoin clustering ----- */
.tr-risk-badge rect { fill: #7f1d1d; stroke: #f87171; stroke-width: 1.5; }
.tr-risk-badge.high rect { fill: #4a3f26; stroke: #b39b62; }
.tr-risk-badge text { font-size: 13px; font-weight: 800; fill: #fff; letter-spacing: .02em; }
.tr-risk-line { margin: 4px 0 2px; font-size: 12.5px; padding: 3px 9px; border-radius: 7px; display: inline-flex; gap: 8px; align-items: baseline; border: 1px solid var(--line); }
.tr-risk-line.severe { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: #fecaca; }
.tr-risk-line.high { background: color-mix(in srgb, var(--warn) 16%, transparent); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.tr-risk-line.medium { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.tr-risk-line.low { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tr-risk-line span { color: var(--muted); }
.tr-open-label { margin: 2px 0; font-size: 12px; color: var(--muted); }
.tr-cluster-fold { margin: 7px 0; border: 1px solid color-mix(in srgb, #f7931a 55%, var(--line)); border-radius: 9px; background: color-mix(in srgb, #f7931a 6%, var(--panel)); }
.tr-cluster-fold > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; }
.tr-cluster-fold > summary small { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }
.tr-cluster-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.tr-cluster-body .tablewrap { max-height: 260px; overflow: auto; }
.tr-cluster-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----- Watchlist ----- */
.wl-add input[name="addr"] { flex: 2; min-width: 260px; font-family: var(--mono); }
.wl-add input[name="label"] { flex: 1; min-width: 160px; }
.wl-list { display: grid; gap: 10px; }
.wl-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px 14px; }
.wl-item.alert { border-color: #fbbf24; box-shadow: 0 0 0 1px #fbbf24 inset; }
.wl-item header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wl-item code { font-size: 12px; overflow-wrap: anywhere; }
.wl-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.chain-pill { font-size: 11px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.wl-new { font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 999px; background: #fbbf24; color: #1f1300; }
.wl-now { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 8px 0 4px; font-size: 13px; }
.wl-now small { color: var(--muted); margin-left: auto; }
.wl-changes { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.wl-changes time { color: var(--muted); margin-right: 6px; }
.wl-quiet { font-size: 12px; margin: 2px 0 0; }

/* ---------- Dashboard: every entry is a link, tidy rows ---------- */
a.tile.link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.tile.link:hover, a.tile.link:focus-visible { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
a.tile.link small { color: var(--muted); }
a.tile.link:hover small { color: var(--accent); }
.dash-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.bar-row.link { color: inherit; text-decoration: none; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; }
a.bar-row.link:hover, a.bar-row.link:focus-visible { background: var(--panel2); }
a.bar-row.link:hover span { color: var(--accent); text-decoration: underline; }
.so-legend > a { color: inherit; text-decoration: none; border-radius: 8px; }
.so-legend > a:hover b, .so-legend > a:hover span { color: var(--accent); }
a.so-mini { display: block; color: inherit; text-decoration: none; }
a.so-mini:hover { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
a.so-pill { color: inherit; text-decoration: none; }
a.so-pill:hover i { filter: brightness(1.2); outline: 2px solid var(--accent); outline-offset: 1px; }
.so-donut li a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.so-donut li a:hover { color: var(--accent); }
.so-donut svg a:hover text { fill: var(--accent); }
.dash-recent { margin: 0 0 16px; }
.dash-row { margin-bottom: 16px; align-items: stretch; }
.dash-reqs a { color: inherit; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-reqs a:hover { color: var(--accent); }
.dash-breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-breakdown > .panel { margin: 0; min-width: 0; }
.dash-breakdown h2 { font-size: 15px; }
@media (max-width: 1280px) { .dash-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-breakdown { grid-template-columns: minmax(0, 1fr); } }
.dash-breakdown .bar-row { grid-template-columns: minmax(0, 50%) 1fr 30px; }
/* AI Investigator button only on the tracer launch screen (empty graph); the left menu link opens it anywhere */


/* ---------- Receipt reader (tracer) ---------- */
.tr-receipt-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tr-receipt-btn .ui-icon { width: 15px; height: 15px; }
.rc-dialog { width: min(920px, 96vw); }
.rc-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 18px; margin: 4px 0 14px; border: 2px dashed var(--line); border-radius: 12px; background: var(--panel2); cursor: pointer; transition: border-color .15s, background .15s; }
.rc-drop:hover, .rc-drop.over, .rc-drop:focus-visible { border-color: var(--accent); }
.rc-drop span { color: var(--muted); font-size: 13px; }
.rc-drop small { color: var(--muted); font-size: 11.5px; max-width: 560px; }
.rc-drop.small { padding: 12px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
.rc-drop.small small { display: none; }
.rc-results { display: grid; gap: 12px; max-height: 58dvh; overflow: auto; }
.rc-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rc-card:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.rc-card img { width: 150px; max-height: 260px; object-fit: contain; object-position: top; border-radius: 8px; background: #fff; }
.rc-card header { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; }
.rc-card.busy .rc-status { color: var(--muted); }
.rc-card.bad p { margin: 0; color: var(--muted); }
.rc-card dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; }
.rc-card dt { color: var(--muted); }
.rc-card dd { margin: 0; overflow-wrap: anywhere; }
.rc-card dd small { color: var(--muted); }
.rc-ok { color: #22c55e; font-weight: 600; }
.rc-warn { color: var(--warn); font-weight: 600; }
.rc-bad { color: #f87171; font-weight: 600; }
.rc-note { margin: 8px 0 0; font-size: 12px; color: var(--warn); }
.rc-text { margin-top: 8px; font-size: 12px; }
.rc-text pre { white-space: pre-wrap; max-height: 180px; overflow: auto; background: var(--panel2); padding: 8px; border-radius: 6px; font-size: 11.5px; }
@media (max-width: 640px) { .rc-card { grid-template-columns: minmax(0, 1fr); } .rc-card img { width: 100%; max-height: 200px; } }
.rc-note.ok { color: #22c55e; }
.rc-note.bad { color: #f87171; }
.page-head > .page-home { margin-left: auto; align-self: flex-start; }
.page-head > .actions > .page-home { order: -1; }
#tr-form > .tr-home { padding-left: 10px; padding-right: 10px; }
#tr-form > .tr-home .ui-icon { width: 16px; height: 16px; }
.rc-pick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; font-weight: 600; }
.rc-pick input { width: 100%; padding: 7px 10px; }
.rc-pick-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* =====================================================================
   macOS (Safari / Chrome) and Android phone tuning
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
:root { --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Roboto Mono", "Droid Sans Mono", monospace; }
.top { -webkit-backdrop-filter: saturate(1.4) blur(8px); }
/* nothing may push the page wider than the screen */
#view, .main { min-width: 0; }
#view :is(select, input, textarea) { max-width: 100%; }
.addr { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.addr .mono { overflow-wrap: anywhere; }
img, svg, video, canvas { max-width: 100%; }
#view svg.tr-svg, #view .tr-canvas svg { max-width: none; }

/* touch screens: comfortable finger targets (not inside the tracer graph bar) */
@media (pointer: coarse) {
  #view .btn, .top .btn, .modal .btn, dialog .btn { min-height: 40px; }
  #view .btn.sm { min-height: 36px; }
  #view .tr-graph-bar .btn, #view .tr-graph-bar input { min-height: 0; }
  #view :is(select, input[type="text"], input[type="search"], input[type="number"], input[type="date"], input:not([type])) { min-height: 40px; }
  .tabs a { padding: 11px 14px; }
  :is(#nav, #nav-resources) a { min-height: 44px; }
}

/* phones (Android and narrow windows): full-width content, menus slide out */
@media (max-width: 640px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .main { grid-column: 1; }
  .side { display: none; }
  body:not(.tracer-popout) .tr-nav-toggle {
    position: fixed; z-index: 122; bottom: calc(12px + env(safe-area-inset-bottom)); display: grid; place-items: center;
    width: 44px; height: 44px; padding: 9px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); color: var(--accent); cursor: pointer; box-shadow: 0 3px 12px #0005;
  }
  body:is(.tr-nav-left-open, .tr-nav-right-open) .tr-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 110; border: 0; background: #0006; }
  body.tr-nav-left-open .side-left, body.tr-nav-right-open .side-right {
    display: flex; position: fixed; top: 0; bottom: 0; z-index: 120;
    width: min(260px, calc(100vw - 48px)); height: 100dvh; padding: 16px 12px 72px; overflow-y: auto;
    align-items: stretch; gap: 16px; box-shadow: 0 0 24px #0007;
  }
  body.tr-nav-left-open .side-left { left: 0; }
  body.tr-nav-right-open .side-right { right: 0; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) .side .brand > span:not(.logo) { display: block; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) .side-group-title { display: flex; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) { flex: 1 1 auto; align-items: stretch; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) a {
    width: 100%; height: auto; min-height: 46px; padding: 10px 12px; font-size: 14px; justify-content: flex-start; text-align: left;
  }
  body:is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) i { display: inline; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) i:empty { display: none; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) .nav-two { font-size: 13px; }
  body:is(.tr-nav-left-open, .tr-nav-right-open) .side-org > span { display: block; }
  #view { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .top { padding: 8px 12px; gap: 8px; }
  .top #search { flex: 1 1 100%; order: 3; }
  .top #search input { min-width: 0; font-size: 16px; }
  .crumbs { font-size: 12px; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { flex-wrap: wrap; }
  .panel { padding: 14px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > * { min-width: 0; }
  .toolbar > input[type="search"], .toolbar > select { flex: 1 1 100%; }
  .grid2, .so-grid, .dash-breakdown { grid-template-columns: minmax(0, 1fr); }
  .tiles, .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* any table that is not already in a scroll box scrolls sideways on its own */
  #view table:not(.tablewrap table):not(.tr-bulk-table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tablewrap { -webkit-overflow-scrolling: touch; }
  /* inputs at 16px stop mobile browsers zooming in on focus */
  #view :is(input, select, textarea), .modal :is(input, select, textarea), dialog :is(input, select, textarea) { font-size: 16px; }
  .modal, dialog { max-width: calc(100vw - 16px); }
  #toasts { left: 12px; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); max-width: none; }
  .developer-credit { padding: 14px; }
}

/* Tracer filter bar: start-aligned beside "Add addresses" so an overflow is
   measured (a right-aligned row overflowed to the left, hiding "From"), and
   an Apply button that lights up when changed filters are waiting. */
.tr-graph-bar.beside-add { justify-content: flex-start; }
.tr-graph-bar .tr-filter-apply { opacity: .55; }
.tr-graph-bar .tr-filter-apply.pending { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); animation: tr-apply-pulse 1.6s ease-in-out infinite; }
@keyframes tr-apply-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); } }
@media (prefers-reduced-motion: reduce) { .tr-graph-bar .tr-filter-apply.pending { animation: none; } }
/* When the filter bar has its own row, keep it clear of the tool buttons at
   the left (view tools, drawing) and the dock at the right. */
.tr-graph-bar:not(.beside-add) { left: 116px; right: 64px; transform: none; width: auto; max-width: none; justify-content: flex-start; }

/* =====================================================================
   Sidebars only on the Home screen. Every other page uses the full width;
   the two menu buttons (bottom-left / bottom-right) slide the menus out.
   ===================================================================== */
body:not(.home-page) #app { grid-template-columns: minmax(0, 1fr); }
body:not(.home-page) .main { grid-column: 1; }
body:not(.home-page) .side { display: none; }
body:not(.home-page):not(.tracer-popout) .tr-nav-toggle {
  position: fixed; z-index: 122; bottom: calc(12px + env(safe-area-inset-bottom)); display: grid; place-items: center;
  width: 42px; height: 42px; padding: 9px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--accent); cursor: pointer; box-shadow: 0 3px 12px #0005;
}
body:not(.home-page) .tr-nav-toggle-left { left: 12px; }
body:not(.home-page) .tr-nav-toggle-right { right: 12px; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) .tr-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 110; border: 0; background: #0006; }
body:not(.home-page).tr-nav-left-open .side-left,
body:not(.home-page).tr-nav-right-open .side-right {
  display: flex; position: fixed; top: 0; bottom: 0; z-index: 120;
  width: min(250px, calc(100vw - 48px)); height: 100dvh; padding: 16px 12px 72px; overflow-y: auto;
  align-items: stretch; gap: 16px; box-shadow: 0 0 24px #0007;
}
body:not(.home-page).tr-nav-left-open .side-left { left: 0; }
body:not(.home-page).tr-nav-right-open .side-right { right: 0; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) .side .brand > span:not(.logo) { display: block; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) .side-group-title { display: flex; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) { flex: 1 1 auto; align-items: stretch; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) a {
  width: 100%; height: auto; min-height: 44px; padding: 9px 12px; font-size: 14px; justify-content: flex-start; text-align: left;
}
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) i { display: inline; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) :is(#nav, #nav-resources) i:empty { display: none; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) .nav-two { display: flex; font-size: 13px; }
body:not(.home-page):is(.tr-nav-left-open, .tr-nav-right-open) .side-org > span { display: block; }
/* room so the menu buttons never cover the last lines of a page */
body:not(.home-page):not(:has(#view .tr-canvas)) #view { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* Touch screens: a finger on the node map or a link graph still scrolls the
   page up and down (sideways drags keep panning the picture). */
@media (pointer: coarse) {
  svg.graph, .node-map canvas { touch-action: pan-y pinch-zoom; }
}
/* The filter row never scrolls sideways (scrolled fields looked cut off next
   to the tool buttons): fields that do not fit wrap onto a second line. */
.tr-graph-bar:not(.beside-add) { flex-wrap: wrap; overflow: visible; row-gap: 6px; align-items: center; }
.tr-graph-bar:not(.beside-add) .tr-graph-bar-sep { display: none; }
/* Filters button: phones only. On phones the bar shows Filters + zoom; the
   fields open as a full-width panel under the tool buttons. */
.tr-filter-toggle { display: none; }
@media (max-width: 640px) {
  .tr-graph-bar:not(.beside-add) { left: 116px; right: 64px; flex-wrap: nowrap; padding: 4px 6px; }
  .tr-graph-bar .tr-filter-toggle { display: inline-flex; }
  .tr-graph-bar:not(.tr-filters-open) > :is(label, #tr-filter-apply, #tr-filter-clear, #tr-filter-count) { display: none; }
  .tr-graph-bar.tr-filters-open { left: 8px; right: 8px; top: 56px !important; flex-wrap: wrap; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; z-index: 60; }
  .tr-graph-bar.tr-filters-open > label { display: grid; gap: 3px; font-size: 11px; }
  .tr-graph-bar.tr-filters-open > label input { width: 100%; }
  .tr-graph-bar.tr-filters-open .tr-picker-wrap { width: 100%; }
  .tr-graph-bar.tr-filters-open > .tr-filter-toggle { grid-column: 1 / -1; justify-self: start; }
  .tr-graph-bar.tr-filters-open > [data-z] { display: none; }
}

/* =====================================================================
   Home sidebars: equal menus on both sides, each collapsible to an icon
   rail; the centre widens to fill the page.
   ===================================================================== */
.side-left { position: sticky; }
.side-collapse { display: none; }
@media (min-width: 861px) {
  .side-collapse { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--muted); cursor: pointer; }
  .side-collapse:hover { color: var(--text); border-color: var(--accent); }
  .side-collapse .ui-icon { width: 16px; height: 16px; }
  .side-left > .side-collapse { position: absolute; top: 22px; right: 8px; }
  .side-left .brand { padding-right: 40px; }
  .side-head-right { display: flex; align-items: center; gap: 6px; }
  .side-head-right .side-group-title { flex: 1 1 auto; }
  body.home-page.side-left-collapsed #app { grid-template-columns: 64px minmax(0, 1fr) 210px; }
  body.home-page.side-right-collapsed #app { grid-template-columns: 210px minmax(0, 1fr) 64px; }
  body.home-page.side-left-collapsed.side-right-collapsed #app { grid-template-columns: 64px minmax(0, 1fr) 64px; }
  /* collapsed rail: icons only, names on hover (each link has a title) */
  body.home-page.side-left-collapsed .side-left, body.home-page.side-right-collapsed .side-right { padding: 14px 8px; align-items: center; }
  body.home-page.side-left-collapsed .side-left .brand { padding: 0; justify-content: center; }
  body.home-page.side-left-collapsed .side-left .brand > span:not(.logo),
  body.home-page.side-left-collapsed .side-left .nav-group,
  body.home-page.side-left-collapsed .side-left .side-org > span,
  body.home-page.side-right-collapsed .side-right .side-group-title,
  body.home-page.side-right-collapsed .side-right .nav-group { display: none; }
  body.home-page.side-left-collapsed .side-left > .side-collapse { position: static; margin: 0 auto; }
  body.home-page.side-right-collapsed .side-head-right { justify-content: center; }
  body.home-page.side-left-collapsed .side-left #nav a, body.home-page.side-right-collapsed .side-right #nav-resources a {
    width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0 auto; justify-content: center; font-size: 0; gap: 0; }
  body.home-page.side-left-collapsed .side-left #nav a .nav-icon, body.home-page.side-right-collapsed .side-right #nav-resources a .nav-icon { width: 20px; height: 20px; }
  body.home-page.side-left-collapsed .side-left #nav a i, body.home-page.side-right-collapsed .side-right #nav-resources a i,
  body.home-page.side-right-collapsed .side-right #nav-resources .nav-two { display: none; }
  body.home-page.side-left-collapsed .side-left .side-org { justify-content: center; }
}
/* Home coverage figures: clearly clickable */
.stat-strip a { position: relative; cursor: pointer; }
.stat-strip a::after { content: "→"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); opacity: .45; transition: opacity .15s, transform .15s, color .15s; }
.stat-strip a:hover::after, .stat-strip a:focus-visible::after { opacity: 1; color: var(--accent); transform: translate(3px, -50%); }
.stat-strip a:hover span { color: var(--text); }
/* Links found dead by the daily link check */
a.link-dead { opacity: .5; text-decoration: line-through; cursor: not-allowed; }
a.link-dead::after { content: " offline"; font-size: .78em; font-weight: 600; text-decoration: none; display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--panel2); color: var(--muted); }

/* Tracer filter bar, desktop: one compact line with a solid background */
@media (min-width: 641px) {
  .tr-graph-bar, .tr-graph-bar:not(.beside-add) { flex-wrap: nowrap !important; gap: 5px; padding: 3px 6px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 14px #0005; }
  .tr-graph-bar.beside-add { background: var(--panel); border-color: var(--line); }
  .tr-graph-bar > label { gap: 3px; font-size: 10.5px; white-space: nowrap; }
  .tr-graph-bar input { height: 26px !important; min-height: 0 !important; padding: 2px 5px; font-size: 11.5px; }
  .tr-graph-bar input[type="date"] { width: 112px; }
  .tr-graph-bar input[type="time"] { width: 74px; }
  .tr-graph-bar input[type="number"] { width: 60px; }
  .tr-graph-bar .tr-picker-wrap button { width: 22px; height: 22px; padding: 0; }
  .tr-graph-bar .btn.sm { height: 26px; min-height: 0; padding: 2px 9px; font-size: 11.5px; }
  .tr-graph-bar .tr-zoom-btn { min-width: 28px; padding: 2px 7px; justify-content: center; font-size: 14px; }
  .tr-graph-bar .tr-zoom-btn[data-z="fit"] { font-size: 11.5px; }
  .tr-graph-bar > small { font-size: 10px; }
  .tr-graph-bar .tr-graph-bar-sep { display: block; height: 18px; }
}
@media (min-width: 641px) and (max-width: 1199px) {
  .tr-graph-bar { gap: 4px; padding: 3px 5px; }
  .tr-graph-bar input[type="date"] { width: 102px; padding: 2px 3px; }
  .tr-graph-bar input[type="time"] { width: 64px; padding: 2px 3px; }
  .tr-graph-bar input[type="number"] { width: 48px; }
  .tr-graph-bar > #tr-filter-count, .tr-graph-bar .tr-graph-bar-sep { display: none; }
  .tr-graph-bar .btn.sm { padding: 2px 7px; }
}

/* Tracer case library and case brief */
.tr-case-library { display: grid; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tr-case-library > b { font-size: 12px; color: var(--muted); font-weight: 600; }
.tr-library-case { display: grid !important; justify-items: start; gap: 1px; height: auto !important; padding: 6px 10px !important; text-align: left; white-space: normal; }
.tr-library-case span { font-weight: 700; }
.tr-library-case small { color: var(--muted); font-weight: 500; font-size: 11px; }
.tr-case-brief { position: absolute; z-index: 46; right: 70px; bottom: 60px; width: min(440px, calc(100% - 140px)); max-height: min(62%, 560px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px #0007; overflow: hidden; }
.tr-case-brief > header { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tr-case-brief > header > div { flex: 1 1 auto; min-width: 0; }
.tr-case-brief > header small { display: block; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.tr-case-brief > header b { display: block; font-size: 14px; }
.tr-case-brief-body { overflow-y: auto; padding: 4px 14px 12px; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tr-case-brief-body h4 { margin: 12px 0 4px; font-size: 12.5px; color: var(--accent); }
.tr-case-brief-body p { margin: 0 0 7px; }
.tr-case-brief.min .tr-case-brief-body { display: none; }
@media (max-width: 640px) { .tr-case-brief { left: 8px; right: 8px; width: auto; bottom: 64px; max-height: 50%; } }

/* Fan bundles: label pills with a token badge */
.tr-edge-label .tr-pill { fill: var(--panel); stroke: color-mix(in srgb, var(--edge-color, var(--line)) 55%, var(--line)); stroke-width: 1.2; }
.tr-edge-label .tr-pill-badge { stroke: #0006; stroke-width: 1; }
.tr-edge-label .tr-pill-badge-t { font: 700 11px system-ui, sans-serif !important; fill: #fff !important; pointer-events: none; }
.tr-bundle-label .tr-edge-label { pointer-events: auto; cursor: pointer; }
/* MetaSleuth-style lanes: label sits on the flat run, no box */
.tr-lane-label .tr-lane-hit { fill: transparent; stroke: none; }
.tr-lane-label:hover .tr-lane-hit { fill: color-mix(in srgb, var(--edge-color) 12%, transparent); }
.tr-lane-label .tr-lane-n { font: 600 15px system-ui, -apple-system, "Segoe UI", sans-serif !important; }
.tr-lane-label .tr-lane-t { font: 500 15px system-ui, -apple-system, "Segoe UI", sans-serif !important; fill: var(--text) !important; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.tr-bundle-label ~ .tr-arrowhead-mid { display: none; }
/* lanes animate too (see directional flow below) */
.tr-edge.tr-lane .tr-edge-visible { stroke-width: 2.6; }
.tr-edge.tr-lane:hover .tr-edge-visible { stroke-width: 3.6; }
.tr-plus.busy { cursor: pointer; } .tr-plus.busy:hover circle:not(.tr-spinner) { stroke: var(--danger); }

/* =====================================================================
   Tracer: mixed MetaSleuth / Global Ledger look, original colours kept
   ===================================================================== */
/* flat solid cards (MetaSleuth); entity colour kept as a thin outline and a soft tint */
.tr-node-address-card > rect { fill: #1b2029; stroke: #303a49; stroke-width: 1.3; stroke-dasharray: none; }
.tr-node-address-card.root > rect { stroke: #4a85dc; stroke-width: 1.8; }
.tr-node-address-card.attributed > rect { fill: color-mix(in srgb, var(--entity-color) 9%, #171c24); stroke: color-mix(in srgb, var(--entity-color) 70%, #303a49); stroke-width: 1.6; }
.tr-node-address-card.attributed.root > rect { stroke: var(--entity-color); stroke-width: 2.2; }
.tr-node-address-card.selected > rect, .tr-node-address-card.attributed.selected > rect { stroke: #fff; stroke-width: 2.4; }
.tr-node-address-card:hover > rect { filter: drop-shadow(0 4px 14px #0008); }
/* Global Ledger style ring around the icon: type or risk at a glance */
.tr-type-ring { fill: none; stroke-width: 4; stroke: #4b5563; }
.tr-type-ring.plain { stroke: #3f4a5a; stroke-width: 3; }
.tr-type-ring.entity { stroke: var(--entity-color, #64748b); }
.tr-type-ring.exchange { stroke: #f0b90b; }
.tr-type-ring.service { stroke: #22d3ee; }
.tr-type-ring.medium { stroke: #b39b62; stroke-dasharray: 6 4; }
.tr-type-ring.high { stroke: #f97316; }
.tr-type-ring.severe { stroke: #ef4444; stroke-width: 5; filter: drop-shadow(0 0 6px #ef444488); }
/* lanes for single links: same calm text, no index */
.tr-edge.tr-lane .tr-edge-visible { stroke-opacity: .95; }

/* =====================================================================
   Directional flow on every link: bright dots in the line's own colour
   travel from the sender to the receiver (the path runs sender → receiver).
   ===================================================================== */
.tr-edge .tr-edge-flow {
  stroke: color-mix(in srgb, var(--edge-color, #7dd3fc) 40%, #ffffff) !important;
  stroke-width: 3.4px !important; stroke-linecap: round; stroke-dasharray: 0.1 26;
  opacity: .95; animation: tr-edge-flow-dir 1.15s linear infinite;
}
@keyframes tr-edge-flow-dir { from { stroke-dashoffset: 26.1; } to { stroke-dashoffset: 0; } }
/* a second, slower and softer stream gives the flow some depth on lanes */
.tr-edge.tr-lane .tr-edge-flow { stroke-dasharray: 0.1 30; animation-duration: 1.35s; }
/* busier links (merged transfers, bundles) move a little faster */
.tr-edge.route .tr-edge-flow, .tr-edge.taint-on .tr-edge-flow { animation-duration: .8s; stroke-width: 4px !important; }
.tr-edge.decoded .tr-edge-flow { stroke-dasharray: 0.1 22; }
.tr-edge:hover .tr-edge-flow { stroke-width: 4.4px !important; }
.tr-edge.dimmed .tr-edge-flow, .tr-edge.taint-off .tr-edge-flow { animation: none; opacity: 0; }
/* zoomed far out: fewer, larger pulses keep it readable and light */
.tr-canvas.tr-far .tr-edge .tr-edge-flow { stroke-dasharray: 0.1 60; stroke-width: 6px !important; animation-duration: 2s; }
@media (prefers-reduced-motion: reduce) { .tr-edge .tr-edge-flow { animation: none !important; opacity: 0; } }
/* balance line on address cards */
.tr-card-balance { font: 600 15px system-ui, -apple-system, "Segoe UI", sans-serif; fill: #a9c7ee; }
.tr-card-balance .tr-card-balance-k { fill: #8b97a8; font-weight: 500; }
.tr-card-balance.loading { fill: #6b7686; font-weight: 500; font-style: italic; }
/* No corner menu buttons on the tracer page (Home is in its input bar) */
body:has(#view .tr-canvas) .tr-nav-toggle, body:has(#view .tr-canvas) .tr-nav-backdrop { display: none !important; }
/* Drawing tools docked below the left tool dock, as an icon column */
.tr-drawing-tools.tr-drawing-docked { right: auto; bottom: auto; width: 48px; max-width: none; padding: 5px; flex-direction: column; align-items: center; }
.tr-drawing-docked > summary { margin: 0 auto; }
.tr-drawing-docked .tr-drawing-controls { flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 5px; }
.tr-drawing-docked .tr-drawing-controls .btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
.tr-drawing-docked .tr-drawing-controls .btn span { display: none; }
.tr-drawing-docked .tr-drawing-controls input[type=color] { width: 34px; height: 30px; }
.tr-drawing-docked .tr-drawing-controls select { width: 40px; padding: 2px; font-size: 11px; }
.rc-explorer { font-size: 12px; font-weight: 600; margin-left: 6px; } .rc-explorer.ok { color: #22c55e; }

/* + button tells whether there is more to follow:
   green arrow = further transactions, red struck + = nothing further */
.tr-plus.more circle { stroke: #22c55e; stroke-width: 2.2; fill: rgba(34,197,94,.12); }
.tr-plus .tr-plus-arrow { fill: none; stroke: #22c55e; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.tr-plus.more:hover circle { fill: #22c55e; }
.tr-plus.more:hover .tr-plus-arrow { stroke: #fff; }
.tr-plus.none circle { stroke: #ef4444; stroke-width: 2; fill: rgba(239,68,68,.1); }
.tr-plus.none text { fill: #ef4444; }
.tr-plus .tr-plus-strike { stroke: #ef4444; stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.tr-plus.none:hover circle { fill: #ef4444; }
.tr-plus.none:hover text { fill: #fff; }
.tr-plus.none:hover .tr-plus-strike { stroke: #fff; }

/* Transfer between two cards in the same column: loops outside the column */
.tr-edge.tr-edge-side .tr-edge-visible { stroke-width: 3; }

/* Calmer flow animation on arrows: about three times slower and a little fainter */
.tr-edge .tr-edge-flow { animation-duration: 3.4s; opacity: .6; }
.tr-edge.tr-lane .tr-edge-flow { animation-duration: 4s; }
.tr-edge.route .tr-edge-flow, .tr-edge.taint-on .tr-edge-flow { animation-duration: 2.4s; }
.tr-canvas.tr-far .tr-edge .tr-edge-flow { animation-duration: 6s; }

/* Graph message: blinks in, then fades away */
.tr-flash { transition: opacity .45s, transform .2s; }
.tr-flash.blink { animation: tr-flash-blink .9s ease-out 1; }
@keyframes tr-flash-blink { 0%, 50% { opacity: 1; } 25% { opacity: .25; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tr-flash.blink { animation: none; } }

/* Money sent back to a wallet already further left: dashed loop underneath the cards */
.tr-edge.tr-edge-back .tr-edge-visible { stroke-dasharray: 9 6; stroke-width: 2.6; }

/* Last wallet clicked or expanded: amber outline + badge, so you know where to continue */
.tr-last-badge { display: none; pointer-events: none; }
.tr-node.last-touched .tr-last-badge { display: inline; }
.tr-last-badge rect { fill: #3b82f6; }
.tr-last-badge text { fill: #ffffff; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.tr-node.last-touched > rect:first-of-type { stroke: #60a5fa !important; stroke-width: 3px !important; filter: drop-shadow(0 0 8px #60a5fa66); }
.tr-node.last-pulse > rect:first-of-type { animation: tr-last-pulse .8s ease-in-out 2; }
@keyframes tr-last-pulse { 50% { filter: drop-shadow(0 0 16px #60a5fa); } }
.tr-goto-last { color: #60a5fa; border-color: color-mix(in srgb, #60a5fa 50%, var(--line)); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tr-node.last-pulse > rect:first-of-type { animation: none; } }

/* Saved-data warning (cases unreadable, or restorable from the automatic backup) */
.store-notice { position: sticky; top: 0; z-index: 200; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 16px; background: var(--warn-bg, rgba(255, 179, 0, .14)); border-bottom: 1px solid var(--warn, #ffb300); color: var(--text); font-size: 14px; }

/* Soft Google-style tones for highlighted routes */
.tr-edge.route path { stroke: #81C995; }

/* Each wallet card carries its network's soft colour: tinted border and a faint wash */
.tr-node-address-card > rect { stroke: color-mix(in srgb, var(--chain-color, #303a49) 55%, #1b2029); fill: color-mix(in srgb, var(--chain-color, #1b2029) 7%, #1b2029); stroke-width: 1.6; }
.tr-node-address-card.attributed > rect { stroke: var(--entity-color, var(--chain-color)); }

/* Web3 Exploits: shield with a broken chain link, in the top bar on every page */
.top-exploits { display: inline-flex; align-items: center; gap: 6px; color: #f28b82; border-color: color-mix(in srgb, #f28b82 45%, var(--line)); text-decoration: none; white-space: nowrap; }
.top-exploits .ui-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-exploits:hover { background: color-mix(in srgb, #f28b82 14%, transparent); color: #f6aea9; text-decoration: none; }
.top-exploits .nav-ext { font-size: 11px; opacity: .8; }
@media (max-width: 720px) { .top-exploits span:not(.nav-ext) { display: none; } }
/* Top-bar actions, Web3 Exploits link included, show on the Home page only. */

/* "No transfer link …" hint: blinks in, then fades away like other messages */
.tr-connection-hint:not([hidden]) { opacity: 0; transition: opacity .45s; pointer-events: none; }
.tr-connection-hint.show { opacity: 1; }
.tr-connection-hint.blink { animation: tr-flash-blink .9s ease-out 1; }

/* Tracer graph: calm deep-blue board with a faint dot grid. The soft network
   colours (cards, arrows, group boxes) stay readable on it. */
#view .tr-canvas {
  background-color: #0f1c2e;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(174, 203, 250, .10) 1px, transparent 1.4px),
    radial-gradient(120% 90% at 50% 0%, #17304d 0%, #12233a 45%, #0d1726 100%);
  background-size: 26px 26px, 100% 100%;
  border-color: #1f3350;
}
:root[data-theme="light"] #view .tr-canvas {
  background-color: #eef4fb;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(66, 133, 244, .14) 1px, transparent 1.4px),
    radial-gradient(120% 90% at 50% 0%, #f7fbff 0%, #eef4fb 55%, #e3ecf8 100%);
  border-color: #cfdcef;
}
/* Cards on the blue board: a slightly blue base under the network tint. */
.tr-node-address-card > rect { fill: color-mix(in srgb, var(--chain-color, #17273d) 7%, #17273d); }

/* Exchange deposit addresses dialog */
.tr-cexdep .tr-cexdep-tools { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.tr-cexdep .tr-cexdep-tools .spacer { flex: 1; }
.tr-cexdep td small { display: block; color: var(--muted); font-size: 11px; }
.tr-cexdep .tag.ok { color: #81C995; background: rgba(129, 201, 149, .14); border-radius: 999px; padding: 2px 8px; }
.tr-cexdep-unconfirmed { margin-top: 12px; color: var(--muted); }
.tr-cexdep-unconfirmed li { margin: 4px 0; }
.tr-cexdep .tr-cexdep-links { font-family: var(--sans, inherit); }
.tr-cexdep .tr-cexdep-links a { color: var(--link, #8AB4F8); }

/* Flow from the start of the trace to the exchange deposit addresses */
.tr-cexdep-flow { margin: 4px 0 14px; border: 1px solid #1f3350; border-radius: 12px; background: radial-gradient(120% 90% at 50% 0%, #17304d 0%, #12233a 45%, #0d1726 100%); }
.tr-cexflow-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 14px 0; }
.tr-cexflow-head small { color: var(--muted); }
.tr-cexflow-modes { display: inline-flex; gap: 6px; margin-left: auto; }
.tr-cexflow-trail { border-top: 1px solid #1f3350; margin-top: 10px; }
.tr-cexflow-trail h4 { margin: 10px 14px 0; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tr-cexflow-trail h4 small { color: var(--muted); font-weight: 400; }
.tr-cexflow-scroll { overflow: auto; max-height: 75vh; padding: 6px 8px 10px; }
.tr-cexflow { display: block; margin: 0 auto; width: 100%; height: auto; }
.tr-cexflow-node rect { fill: color-mix(in srgb, var(--c) 8%, #17273d); stroke: color-mix(in srgb, var(--c) 55%, #17273d); stroke-width: 1.5; }
.tr-cexflow-node.dep rect { fill: color-mix(in srgb, #FDD663 14%, #17273d); stroke: #FDD663; stroke-width: 2.4; }
.tr-cexflow-node.start rect { stroke: #81C995; stroke-width: 2.2; }
.tr-cexflow-node .t1 { fill: #e8eaed; font-size: 13px; font-weight: 700; }
.tr-cexflow-node.dep .t1 { fill: #FDD663; }
.tr-cexflow-node .t2 { fill: #9aa0a6; font-size: 11.5px; font-family: ui-monospace, monospace; }
.tr-cexflow-amt { fill: #cfd8e3; font-size: 11px; paint-order: stroke; stroke: #12233a; stroke-width: 4px; }

/* Payments out made before the traced funds arrived: dashed and faded */
.tr-edge.tr-edge-pre .tr-edge-visible { stroke-dasharray: 6 6; opacity: .5; }
.tr-edge.tr-edge-pre .tr-edge-flow { opacity: 0; animation: none; }
.tr-edge.tr-edge-pre .tr-edge-label { opacity: .7; }

/* Read receipt: paste the receipt text */
.rc-paste { display: grid; gap: 6px; margin: 10px 0 4px; }
.rc-paste small { color: var(--muted); font-weight: 400; }
.rc-paste textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12.5px; }
.rc-paste button { justify-self: end; }

/* ----- Home page: blue boxes with blue-matched lettering -----
   Hero, stat strip, feature cards and developer credit swap the theme tokens
   for a blue set, so their text, borders, icons and buttons follow along. */
:root {
  --home-bg: #0c2148; --home-bg2: #12305f; --home-line: #24508f; --home-hover: #163a72;
  --home-text: #e3edff; --home-muted: #a4c2f2; --home-accent: #5aa9ff; --home-accent-ink: #03142e;
  --home-beam: rgba(90, 169, 255, .10); --home-glow: rgba(140, 190, 255, .08);
}
:root[data-theme="light"] {
  --home-bg: #e4eeff; --home-bg2: #d3e3ff; --home-line: #a9c6f3; --home-hover: #d6e5ff;
  --home-text: #0b2a5e; --home-muted: #335c9c; --home-accent: #1a5fd0; --home-accent-ink: #ffffff;
  --home-beam: rgba(26, 95, 208, .08); --home-glow: rgba(255, 255, 255, .55);
}
:root body.home-page :is(.hero, .stat-strip, .feature-card, .developer-credit) {
  --panel: var(--home-bg); --panel2: var(--home-bg2); --line: var(--home-line); --hover: var(--home-hover);
  --text: var(--home-text); --muted: var(--home-muted); --accent: var(--home-accent); --accent-ink: var(--home-accent-ink);
  --link: var(--home-accent); --primary: var(--home-accent); --primary-ink: var(--home-accent-ink); --beam: var(--home-beam); --glow: var(--home-glow);
  background-color: var(--home-bg); border-color: var(--home-line); color: var(--home-text);
}
:root body.home-page .feature-card:hover { background: var(--home-hover); border-color: var(--home-accent); }
:root body.home-page :is(.feature-icon .ui-icon, .stat-strip b) { color: var(--home-accent); }

/* Home fills the whole window: the banner and the feature cards take up any
   spare height, so there is no empty band under the credit card. On screens
   where the content is already taller than the window nothing changes. */
body.home-page .main { min-height: 100dvh; }
body.home-page #view { flex: 1 0 auto; display: flex; flex-direction: column; }
body.home-page #view > .hero { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
body.home-page #view > .features { flex: 2 1 auto; display: flex; flex-direction: column; }
body.home-page #view > .features > .feature-grid { flex: 1 1 auto; grid-auto-rows: 1fr; }
body.home-page .feature-card { align-content: center; }
/* chain group boxes: drag the top band (or the grip) to move the whole group */
.tr-lane-grip, .tr-lane-grip-icon { cursor: grab; }
.tr-lane-grip:hover { fill-opacity: .08; }
.tr-svg:active .tr-lane-grip, .tr-svg:active .tr-lane-grip-icon { cursor: grabbing; }
.tr-lane-grip-icon { opacity: .7; user-select: none; }
.tr-lane-grip-icon:hover { opacity: 1; }

/* ---------- Follow the funds (FIFO) ---------- */
.tr-fifo-btn.running { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tr-edge.fifo-path .tr-edge-visible { stroke: var(--accent); stroke-width: 3.4; }
.tr-edge.fifo-path .tr-edge-label rect { stroke: var(--accent); }
.tr-fifo-dlg { width: min(980px, 96vw); }
.tr-fifo-pick { display: grid; gap: 8px; margin: 10px 0 14px; max-height: 40vh; overflow: auto; }
.tr-fifo-opt { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); cursor: pointer; }
.tr-fifo-opt:has(input:checked) { border-color: var(--accent); }
.tr-fifo-opt small { color: var(--muted); margin-left: 6px; }
.tr-fifo-amt { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.tr-fifo-amt input { width: 200px; }
.tr-fifo-sum { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.tr-fifo-chip { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); min-width: 150px; }
.tr-fifo-chip b { font-size: 18px; }
.tr-fifo-chip span, .tr-fifo-chip small { color: var(--muted); font-size: 12px; }
.tr-fifo-chip.k-service, .tr-fifo-chip.k-entity { border-color: #3d4d00; }
.tr-fifo-chip.k-held { border-color: #3a2a12; }
.tr-fifo-k.k-service, .tr-fifo-k.k-entity { color: var(--accent); background: rgba(212, 255, 0, .1); }
.tr-fifo-k.k-bridge { color: #8f86ff; background: rgba(91, 76, 255, .16); }
.tr-fifo-k.k-held { color: var(--orange, #ff9f1c); background: rgba(255, 159, 28, .13); }
.tr-fifo-k.k-mixer, .tr-fifo-k.k-coinjoin, .tr-fifo-k.k-error { color: #ff5a5a; background: rgba(255, 59, 59, .13); }
.tr-fifo-table .sub { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- search box "Go to" suggestions ---------- */
#search { position: relative; }
.q-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px #0007; padding: 6px; max-height: 70vh; overflow: auto; }
.q-sug-head { font: 600 11px var(--mono, monospace); letter-spacing: .12em; color: var(--muted); padding: 6px 10px; text-transform: uppercase; }
.q-sug { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.q-sug > span { display: flex; flex-direction: column; min-width: 0; }
.q-sug b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.q-sug small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sug.on, .q-sug:hover { background: var(--panel2); }

/* ---------- address profile page ---------- */
.ap-nets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-nets .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ap-verdict { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); margin-bottom: 12px; }
.ap-verdict p { margin: 4px 0 0; color: var(--muted); }
.ap-kind { flex: none; font: 700 12px system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: #64748b33; color: var(--text); }
.ap-verdict.ok .ap-kind { background: #16a34a33; color: #4ade80; }
.ap-verdict.ok { border-color: #16a34a88; }
.ap-verdict.bad .ap-kind { background: #dc262633; color: #f87171; }
.ap-verdict.bad { border-color: #dc262688; }
.ap-verdict.info .ap-kind { background: #2563eb33; color: #93c5fd; }
.ap-entity { font-size: 18px; }
.ap-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.ap-facts dt { color: var(--muted); }
.ap-facts dd { margin: 0; overflow-wrap: anywhere; }
.ap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ap-cols h3 { margin: 0 0 8px; font-size: 14px; }
@media (max-width: 900px) { .ap-cols { grid-template-columns: 1fr; } }
.ap-chart { width: 100%; height: auto; display: block; }
.ap-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.ap-chart .area { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: none; }
.ap-chart-cap { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.ap-recent-sum { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 10px; }
.ap-recent-sum b { font-size: 11px; padding: 2px 7px; border-radius: 6px; margin-right: 6px; }
.ap-recent-sum b.in, .ap-dir.in { background: #16a34a33; color: #4ade80; }
.ap-recent-sum b.out, .ap-dir.out { background: #dc262633; color: #f87171; }
.ap-recent-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.ap-recent-tabs .chip { cursor: pointer; }
.ap-recent-tabs .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ap-dir { font: 700 11px system-ui, sans-serif; padding: 2px 7px; border-radius: 6px; }
.ap-dir.self { background: #64748b33; }
.ap-lab { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font: 600 11px system-ui, sans-serif; background: #64748b33; color: var(--text); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ap-lab.ok { background: #16a34a33; color: #4ade80; }
.ap-lab.bad { background: #dc262633; color: #f87171; }
.ap-lab.info { background: #2563eb33; color: #93c5fd; }
.contract-caps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.contract-caps li small { display: block; color: var(--muted); font-family: var(--mono, monospace); font-size: 11px; }
.contract-caps .cap-high .badge { background: #dc262633; color: #f87171; }
.contract-caps .cap-medium .badge { background: #d9770633; color: #fbbf24; }
.contract-caps .cap-info .badge { background: #2563eb33; color: #93c5fd; }
.contract-drain { border: 1px solid #dc262688; background: #dc262614; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.contract-drain h3 { margin: 0 0 6px; color: #f87171; font-size: 14px; }

/* ---------- smart contract marking ---------- */
.tr-contract-tag rect { fill: #7c3aed; stroke: #c4b5fd; stroke-width: 1.5; }
.tr-contract-tag text { fill: #fff; font: 800 12px system-ui, sans-serif; letter-spacing: .04em; }
.tr-contract-pop { position: fixed; right: 24px; top: 84px; z-index: 80; width: min(420px, calc(100vw - 32px)); display: flex; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 2px solid #7c3aed; box-shadow: 0 18px 48px #0009; animation: tr-cpop .25s ease-out; }
.tr-contract-pop-body b { font-size: 16px; }
.tr-contract-pop-body p { margin: 6px 0; }
.tr-contract-pop-body .mono { font-size: 11px; overflow-wrap: anywhere; }
.tr-contract-pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tr-contract-pop-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #7c3aed; color: #fff; display: grid; place-items: center; font: 800 15px ui-monospace, monospace; }
.tr-contract-pop-x { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
@keyframes tr-cpop { from { transform: translateY(-10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tr-contract-pop { animation: none; } }
.tr-contract-banner { display: flex; gap: 12px; align-items: center; margin: 10px 0; padding: 12px 14px; border-radius: 10px; border: 1.5px solid #7c3aed; background: #7c3aed1f; }
.tr-contract-banner p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.tr-contract-banner .btn { flex: none; margin-left: auto; }
.ap-contract { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid #7c3aed; background: #7c3aed1f; }
.ap-contract p { margin: 3px 0 0; color: var(--muted); }
.ap-contract .btn { flex: none; margin-left: auto; }
.q-sug-contract b { color: #a78bfa; }

/* ---------- case report: visual first section ---------- */
.rep-cover, .rep-verdict, .rep-tiles, .rep-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rep-cover { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; padding: 22px 26px; border-radius: 12px; background: #0f1a30; color: #fff; margin-bottom: 14px; }
.rep-cover small { color: #a9b8cc; font-weight: 700; letter-spacing: .08em; font-size: 11px; }
.rep-cover h1 { margin: 6px 0 4px; font-size: 26px; color: #fff; }
.rep-sub { color: #7fe3e3; font-weight: 700; }
.rep-chips span { display: inline-block; margin: 8px 6px 0 0; padding: 3px 10px; border-radius: 999px; background: #0e7c86; color: #fff; font-size: 11px; font-weight: 700; }
.rep-ref { color: #a9b8cc; text-align: right; font: 11px/1.7 ui-monospace, monospace; }
.rep-verdict { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border: 1.5px solid; border-radius: 10px; margin-bottom: 12px; }
.rep-verdict .pill { flex: none; padding: 6px 13px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .04em; }
.rep-verdict p { margin: 2px 0 0; }
.rep-verdict.green { border-color: #16a34a; background: #16a34a14; } .rep-verdict.green .pill { background: #16a34a; }
.rep-verdict.amber { border-color: #d97706; background: #d9770614; } .rep-verdict.amber .pill { background: #d97706; }
.rep-verdict.blue { border-color: #2563eb; background: #2563eb14; } .rep-verdict.blue .pill { background: #2563eb; }
.rep-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.rep-tiles div { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--panel2); }
.rep-tiles small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rep-tiles b { display: block; font-size: 16px; margin: 3px 0 1px; overflow-wrap: anywhere; }
.rep-tiles i { font-style: normal; color: var(--muted); font-size: 11px; }
.rep-tiles .hl { border-color: #dc2626; background: #dc262614; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.rep-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.rep-card h3 { margin: 0 0 8px; font-size: 13px; }
.rep-card svg { display: block; width: 100%; height: auto; }
.rep-wide { grid-column: 1 / -1; }
.rep-card .vbar { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; margin: 5px 0; font-size: 12px; }
.rep-card .vtrack { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.rep-card .vtrack span { display: block; height: 100%; border-radius: 6px; }
.rep-card .vval { text-align: right; font-weight: 700; }
@media (max-width: 800px) { .rep-tiles { grid-template-columns: repeat(2, 1fr); } .rep-grid { grid-template-columns: 1fr; } .rep-cover { flex-direction: column; align-items: flex-start; } .rep-ref { text-align: left; } }
@media print { .rep-tiles { grid-template-columns: repeat(6, 1fr); } .rep-tiles div, .rep-card { background: #fff; } .rep-grid { break-inside: avoid; } }
/* A close button that cannot be missed */
.tr-detail-actions { flex-wrap: wrap; }
.tr-detail-actions .tr-detail-close { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 800; padding-inline: 14px; box-shadow: 0 0 0 3px #dc262633; }
.tr-detail-actions .tr-detail-close:hover, .tr-detail-actions .tr-detail-close:focus-visible { background: #b91c1c; border-color: #fca5a5; color: #fff; }
#tr-collapse-toggle { display: none !important; }
.tr-lea-notice.unlisted { border-color: #d97706; }
.tr-lea-notice.unlisted small { color: #fbbf24; }
/* Contract cards: purple outline; the badge sits on the card's own top border. */
.tr-node-contract > rect:first-of-type, .tr-node-contract .tr-card-bg { stroke: #8b5cf6 !important; stroke-width: 3 !important; }
.tr-contract-tag rect { stroke: #ede9fe; stroke-width: 2; }
/* ---------- read post / link dialog ---------- */
.lr-dialog { width: min(760px, calc(100vw - 32px)); max-height: 86vh; padding: 18px 20px; }
/* link reader, mail / chat reader and confirmations: the app's panel colours (they showed the browser's white) */
.tr-dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 24px 64px #000b; }
.tr-dialog::backdrop { background: #000a; }
.tr-dialog .muted, .tr-dialog small { color: var(--muted); }
.tr-dialog :is(input, textarea, select) { background: var(--bg); color: var(--text); border-color: var(--line); }
.lr-body { display: grid; gap: 10px; }
.lr-head { display: flex; justify-content: space-between; align-items: center; }
.lr-head h2 { margin: 0; }
.lr-field { display: grid; gap: 4px; font-weight: 600; }
.lr-field input, .lr-field textarea { width: 100%; }
.lr-list { display: grid; gap: 6px; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.lr-row { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: start; padding: 6px; border-radius: 6px; background: var(--panel2); }
.lr-row small { display: block; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.lr-kind { font: 800 10.5px system-ui, sans-serif; padding: 3px 7px; border-radius: 6px; background: #2563eb33; color: #93c5fd; }
.lr-kind.tx { background: #7c3aed33; color: #c4b5fd; }
.lr-foot { justify-content: flex-end; }
/* Arrow colour key by token */
.tr-token-legend { position: absolute; left: 70px; bottom: 14px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: min(640px, 60%); padding: 7px 12px; border-radius: 10px; background: #0f172acc; border: 1px solid var(--line); font: 600 12px system-ui, sans-serif; color: var(--text); pointer-events: none; }
.tr-token-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tr-token-legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }

/* Arrow labels take their token's colour (same as the arrow): tinted box, coloured border and text. */
.tr-edge:not(.decoded):not(.route) .tr-edge-label rect:not(.tr-lane-hit) { fill: color-mix(in srgb, var(--edge-color) 18%, #0b1220) !important; stroke: var(--edge-color) !important; stroke-width: 1.6 !important; }
.tr-edge:not(.decoded):not(.route) .tr-edge-label text:not(.tr-pill-badge-t) { fill: color-mix(in srgb, var(--edge-color) 45%, #ffffff) !important; }
.tr-lane-label .tr-lane-hit { fill: color-mix(in srgb, var(--edge-color) 16%, #0b1220) !important; stroke: var(--edge-color) !important; stroke-width: 1.4 !important; }
.tr-lane-label .tr-lane-t { fill: color-mix(in srgb, var(--edge-color) 45%, #ffffff) !important; }
.tr-lane-label:hover .tr-lane-hit { fill: color-mix(in srgb, var(--edge-color) 30%, #0b1220) !important; }
:root[data-theme="light"] .tr-edge:not(.decoded):not(.route) .tr-edge-label rect:not(.tr-lane-hit), :root[data-theme="light"] .tr-lane-label .tr-lane-hit { fill: color-mix(in srgb, var(--edge-color) 14%, #ffffff) !important; }
:root[data-theme="light"] .tr-edge:not(.decoded):not(.route) .tr-edge-label text:not(.tr-pill-badge-t), :root[data-theme="light"] .tr-lane-label .tr-lane-t { fill: color-mix(in srgb, var(--edge-color) 70%, #000000) !important; stroke: #ffffff; }
.lr-img { display: inline !important; color: #fbbf24 !important; font-weight: 700; }

.tr-fund-menu .tr-fund-wait small { display: block; margin-top: 6px; opacity: .8; }
.tr-fund-actions { margin-top: 10px; display: flex; gap: 8px; }

/* Receipt reader: every slip read, in one table, each ticked for tracing */
.rc-summary { border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); padding: 10px 12px; margin: 0 0 14px; }
.rc-summary header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rc-summary header span { color: var(--muted); font-size: 12.5px; }
.rc-summary table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rc-summary th, .rc-summary td { text-align: left; padding: 5px 7px; border-top: 1px solid var(--line); white-space: nowrap; }
.rc-summary tr.busy td { color: var(--muted); }
.rc-summary tr.bad td { color: #f87171; }
.rc-summary td { vertical-align: middle; }
.rc-thumb { display: block; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; overflow: hidden; width: 132px; height: 84px; }
.rc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rc-thumb:hover, .rc-thumb:focus-visible { border-color: var(--accent); outline: none; }
.rc-thumb.none { display: grid; place-items: center; background: var(--panel); color: var(--muted); font-size: 11px; cursor: default; }
.rc-zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #000c; cursor: zoom-out; padding: 20px; }
.rc-zoom figure { margin: 0; max-width: min(900px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 8px; }
.rc-zoom img { max-width: 100%; max-height: 84vh; object-fit: contain; background: #fff; border-radius: 8px; }
.rc-zoom figcaption { color: #ddd; font-size: 13px; text-align: center; }

/* One Read menu: slip / file, link / post, mail / chat */
.tr-read-menu { position: relative; display: inline-block; }
.tr-read-menu > summary { list-style: none; cursor: pointer; }
.tr-read-menu > summary::-webkit-details-marker { display: none; }
.tr-read-caret { margin-left: 2px; font-size: 11px; opacity: .8; }
.tr-read-list { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 260px; display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 30px #0008; }
.tr-read-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.tr-read-list button:hover, .tr-read-list button:focus-visible { background: var(--panel2); outline: none; }
.tr-read-list small { color: var(--muted); font-size: 11.5px; }

/* Mail / chat reader */
.ml-dialog { width: min(1100px, 96vw); max-height: 92vh; }
.ml-inner { display: flex; flex-direction: column; gap: 10px; }
.ml-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ml-src { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }
.ml-src h3 { margin: 0; font-size: 14px; }
.ml-src textarea { width: 100%; resize: vertical; }
.ml-opt { font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.ml-opt-row { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.ml-drop { padding: 14px 10px; margin: 0; }
.ml-help { font-size: 12px; color: var(--muted); }
.ml-help ul { margin: 6px 0 0; padding-left: 18px; }
.ml-summary { font-size: 13px; }
.ml-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ml-chip { border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ml-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ml-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.ml-row { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.ml-row.open { border-color: var(--accent); }
.ml-head { display: grid; grid-template-columns: auto 120px minmax(120px, 200px) 1fr; gap: 8px; align-items: center; padding: 7px 10px; cursor: pointer; font-size: 12.5px; }
.ml-head > input { margin: 0; }
.ml-head:not(:has(> input)) { grid-template-columns: 120px minmax(120px, 200px) 1fr; }
.ml-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.ml-who, .ml-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-subj { font-weight: 600; }
.ml-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.ml-cat, .ml-ex, .ml-amt, .ml-n { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); }
.ml-cat.exchange { background: #0ea5e933; border-color: #0ea5e9; }
.ml-cat.account { background: #a855f733; border-color: #a855f7; }
.ml-cat.transfer { background: #22c55e33; border-color: #22c55e; }
.ml-cat.slip { background: #f59e0b33; border-color: #f59e0b; }
.ml-cat.scam { background: #ef444433; border-color: #ef4444; }
.ml-ex { text-transform: capitalize; }
.ml-body { padding: 6px 12px 12px; font-size: 12.5px; }
.ml-body pre { white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; background: var(--panel); padding: 8px; border-radius: 8px; font-size: 12px; }
.ml-meta { margin: 0 0 6px; }
.ml-items { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-items span { border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 11.5px; }
@media (max-width: 640px) { .ml-head { grid-template-columns: auto 1fr; } .ml-when, .ml-who { grid-column: auto; } }

/* Transaction Explorer: Bitcoin inputs and outputs one by one */
.utxo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; width: 100%; }
.utxo-side h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.utxo-count { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; text-align: center; margin-left: 4px; }
.utxo-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.utxo-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.utxo-table th { text-align: left; font-size: 10.5px; color: var(--muted); text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.utxo-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.utxo-table td code { font-size: 11px; word-break: break-all; }
.utxo-table .num { text-align: right; white-space: nowrap; }
.utxo-spent { color: #60a5fa; font-weight: 600; }
.utxo-unspent { color: #22c55e; font-weight: 600; }
.tx-explorer-field:has(.utxo-grid) { display: block; }
.tx-explorer-field:has(.utxo-grid) > span { display: none; }

/* Clear graph confirmation */
.tr-confirm { max-width: 420px; padding: 20px 22px; border-radius: 14px; }
.tr-confirm h2 { margin: 0 0 8px; font-size: 18px; }
.tr-confirm p { margin: 0 0 8px; }
.tr-confirm .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Hop ruler across the top of the graph (like a page ruler in Word) and hop guide lines */
.tr-ruler { position: absolute; top: 0; left: 0; right: 0; height: 34px; z-index: 4; pointer-events: none; background-color: color-mix(in srgb, var(--panel) 92%, transparent); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px #0004;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--muted) 70%, transparent) 1px, transparent 1px), linear-gradient(to right, color-mix(in srgb, var(--muted) 35%, transparent) 1px, transparent 1px); background-repeat: repeat-x, repeat-x; }
.tr-ruler-hop { position: absolute; top: 3px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 5px; white-space: nowrap; padding: 2px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--accent); font-size: 11.5px; }
.tr-ruler-hop b { color: var(--accent); }
.tr-ruler-hop small { color: var(--muted); font-size: 10.5px; }
.tr-ruler-hop.start { border-color: #f59e0b; }
.tr-ruler-hop.start b { color: #f59e0b; }
.tr-hop-guide { position: absolute; top: 34px; bottom: 0; width: 0; border-left: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); pointer-events: none; z-index: 1; }

.tr-canvas { position: relative; }
.rc-live { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }

/* Clean graph view: small round icons, name and short address below, plain transfer lines */
.tr-svg-clean .tr-clean-hit { fill: transparent; stroke: none; cursor: pointer; }
.tr-svg-clean .tr-clean-icon { fill: color-mix(in srgb, var(--node-color, #64748b) 22%, #0f172a); stroke: var(--node-color, #64748b); stroke-width: 2; }
.tr-svg-clean .tr-clean-ring { fill: none; stroke: transparent; stroke-width: 3; }
.tr-svg-clean .tr-node-clean.selected .tr-clean-ring, .tr-svg-clean .tr-node-clean.last-touched .tr-clean-ring { stroke: var(--accent); }
.tr-svg-clean .tr-node-clean.kind-H .tr-clean-icon { stroke: #ef4444; }
.tr-svg-clean .tr-clean-glyph { fill: #f8fafc; font: 700 18px Inter, Arial, sans-serif; pointer-events: none; }
.tr-svg-clean .tr-clean-glyph.small { font-size: 11px; }
.tr-svg-clean .tr-clean-name { fill: var(--text); font: 700 13px Inter, Arial, sans-serif; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.tr-svg-clean .tr-clean-addr { fill: var(--muted); font: 500 11px ui-monospace, Menlo, Consolas, monospace; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.tr-svg-clean .tr-clean-link { fill: #fbbf24; font: 700 10px Inter, Arial, sans-serif; cursor: pointer; }
.tr-svg-clean .tr-clean-badge circle { fill: #f59e0b; stroke: var(--bg); stroke-width: 2; }
.tr-svg-clean .tr-clean-badge.k-H circle { fill: #ef4444; }
.tr-svg-clean .tr-clean-badge.k-E circle { fill: #16a34a; }
.tr-svg-clean .tr-clean-badge text { fill: #fff; font: 800 10px Inter, Arial, sans-serif; pointer-events: none; }
.tr-svg-clean .tr-clean-start rect { fill: #4f6bed; }
.tr-svg-clean .tr-clean-start text { fill: #fff; font: 700 11px Inter, Arial, sans-serif; }
.tr-svg-clean .tr-clean-label text { font: 500 11.5px Inter, Arial, sans-serif; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; cursor: pointer; }
.tr-svg-clean .tr-clean-amt { font-weight: 700; }
.tr-svg-clean .tr-clean-meta { fill: var(--muted); }
.tr-svg-clean .tr-clean-label:hover text { text-decoration: underline; }
.tr-svg-clean .tr-edge-clean .tr-edge-visible { opacity: .85; }
.tr-svg-clean .tr-edge-clean:hover .tr-edge-visible, .tr-svg-clean .tr-edge-clean.route .tr-edge-visible { opacity: 1; }
/* Clean view: small round dots flowing along each curve into the arrowhead */
.tr-svg-clean .tr-edge-dots { fill: none; stroke: #ffffff; stroke-width: 3.4px; stroke-linecap: round; stroke-dasharray: 0 15; opacity: .9; pointer-events: none; animation: tr-clean-dots 1s linear infinite; }
.tr-svg-clean .tr-edge.dimmed .tr-edge-dots { animation: none; opacity: 0; }
@keyframes tr-clean-dots { to { stroke-dashoffset: -15; } }
@media (prefers-reduced-motion: reduce) { .tr-svg-clean .tr-edge-dots { animation: none; } }
.tr-svg-clean .tr-clean-head { stroke: #0b1220; stroke-width: 1px; filter: drop-shadow(0 0 1px #000a); }

/* Clean view amount labels: larger, clear of the arrows */
.tr-svg-clean .tr-clean-label text { font: 500 11px Inter, Arial, sans-serif; paint-order: stroke; stroke: #0b1424; stroke-width: 5px; stroke-linejoin: round; }
.tr-svg-clean .tr-clean-label .tr-clean-amt { font-size: 13.5px; font-weight: 800; }
.tr-svg-clean .tr-clean-label .tr-clean-meta { font-size: 10.5px; fill: #94a3b8; }
.tr-svg-clean .tr-clean-label.hover-selected .tr-clean-amt { font-size: 15px; }

/* Graph: the normal arrow pointer everywhere (no hand), except while drawing */
.tr-canvas:not(.tr-annotation-mode), .tr-canvas:not(.tr-annotation-mode) * { cursor: default !important; }

/* Selected arrow: its amount stays readable above the glow */
.tr-svg-clean .tr-clean-label.hover-selected text { stroke: #050b16; stroke-width: 8px; }
.tr-svg-clean .tr-clean-label.hover-selected .tr-clean-amt { font-size: 16px; }
.tr-svg-clean .tr-clean-label.hover-selected .tr-clean-meta { fill: #e2e8f0; font-size: 11.5px; }

/* Zoomed out: amount labels larger, in the middle of each arrow */
.tr-svg-clean .tr-clean-label.far text { stroke-width: 9px; }
.tr-svg-clean .tr-clean-label.far .tr-clean-amt { font-size: 29px; }
.tr-svg-clean .tr-clean-label.far.hover-selected .tr-clean-amt { font-size: 33px; }

/* Clean view: small white arrows moving along each curve (in place of dots) */
.tr-svg-clean .tr-chev { fill: none; stroke: #ffffff; stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px #000c); pointer-events: none; }
.tr-svg-clean .tr-edge.dimmed .tr-edge-chevrons { display: none; }
.tr-canvas.tr-far .tr-svg-clean .tr-chev { stroke-width: 3.5px; }
@media (prefers-reduced-motion: reduce) { .tr-svg-clean .tr-edge-chevrons { display: none; } }

/* Hop lines: grab one (or its label on the ruler) to move the whole hop */
.tr-hop-hit { stroke: transparent; stroke-width: 16px; pointer-events: stroke; }
.tr-hop-hit.hop-hover { stroke: color-mix(in srgb, var(--accent) 22%, transparent); }
.tr-hop-guide.hop-hover { border-left: 2px solid var(--accent); }
.tr-ruler .tr-ruler-hop { pointer-events: auto; }
.tr-ruler-hop.hop-hover { background: color-mix(in srgb, var(--accent) 25%, var(--panel2)); }
.tr-canvas.tr-hop-dragging .tr-hop-guide { border-left-color: var(--accent); }

/* Every graph view: small white arrows move along each line (the old moving dots are gone) */
.tr-svg .tr-edge-flow { display: none !important; }
.tr-svg .tr-chev { fill: none; stroke: #ffffff; stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px #000c); pointer-events: none; }
.tr-svg .tr-edge.dimmed .tr-edge-chevrons, .tr-svg .tr-edge.taint-off .tr-edge-chevrons, .tr-svg .tr-edge.tr-edge-pre .tr-edge-chevrons { display: none; }
.tr-canvas.tr-far .tr-svg .tr-chev { stroke-width: 3.5px; }
@media (prefers-reduced-motion: reduce) { .tr-svg .tr-edge-chevrons { display: none; } }

/* Hop ruler (tick strip with "Hop n · wallets" labels) removed; the hop lines stay and can still be dragged */
.tr-canvas .tr-ruler { display: none !important; }

/* Tracer bar: Trace sits right after the address box (where Home was); Home sits where Trace was, before Clear */
@media (min-width: 521px) {
  body:has(#view .tr-canvas) #tr-form > button[type="submit"] { order: -1; }
  body:has(#view .tr-canvas) #tr-form > .tr-home { order: 1; }
  body:has(#view .tr-canvas) #tr-form > #tr-clear { order: 2; }
}

/* Explain box: the graph in a few lines and where to continue */
.tr-explain-btn { border-color: color-mix(in srgb, #c084fc 60%, var(--line)); color: #d8b4fe; }
.tr-explain-btn.active { background: color-mix(in srgb, #c084fc 22%, var(--panel2)); }
.tr-explain:not([hidden]) { position: absolute; z-index: 80; top: 64px; right: 66px; width: min(380px, calc(100% - 140px)); max-height: calc(100% - 90px); display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, #c084fc 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--panel) 97%, transparent); box-shadow: 0 12px 34px #000a; font-size: 12.5px; line-height: 1.45; cursor: auto; }
.tr-explain, .tr-explain * { cursor: auto !important; }
.tr-explain button { cursor: pointer !important; }
.tr-explain header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); color: #d8b4fe; font-size: 13.5px; }
.tr-explain-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.tr-explain-body, .tr-explain-ai { padding: 8px 12px; overflow: auto; }
.tr-explain-ai { border-top: 1px solid var(--line); max-height: 45%; }
.tr-explain ul, .tr-explain ol { margin: 4px 0; padding-left: 18px; }
.tr-explain li { margin: 5px 0; }
.tr-explain h4 { margin: 10px 0 4px; font-size: 12.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.tr-explain .k { display: inline-block; padding: 0 6px; margin-right: 3px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.tr-explain .k.swap { color: #FF8BCB; border-color: #FF8BCB66; }
.tr-explain .k.bridge { color: #78D9EC; border-color: #78D9EC66; }
.tr-explain .k.cex { color: #fbbf24; border-color: #fbbf2466; }
.tr-explain-acts { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tr-explain-acts .btn { min-height: 24px; padding: 2px 8px; font-size: 11px; }
.tr-explain footer { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.tr-explain footer small { color: var(--muted); font-size: 11px; }
.tr-explain .err { color: #fca5a5; }
@media (max-width: 700px) { .tr-explain:not([hidden]) { left: 8px; right: 8px; width: auto; top: 56px; } }

/* Explain button: always visible at the top right of the graph, next to the right-hand tools */
.tr-explain-fab { position: absolute; z-index: 79; top: 64px; right: 66px; min-height: 34px; padding: 6px 14px; border-radius: 999px; font-weight: 700; background: linear-gradient(135deg, #7c3aed, #c026d3); border: 1px solid #e9d5ff66; color: #fff !important; box-shadow: 0 6px 18px #7c3aed55; cursor: pointer !important; }
.tr-explain-fab:hover { filter: brightness(1.12); }
.tr-explain-fab.active { display: none; }

/* Merge / Unmerge: the one in effect is highlighted */
#tr-merge-all.active, #tr-unmerge-all.active { background: color-mix(in srgb, var(--accent) 26%, var(--panel2)); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Hop bands on the graph: START, HOP 1, HOP 2 … */
.tr-hop-band { fill: color-mix(in srgb, var(--accent) 3%, transparent); stroke: none; pointer-events: none; }
.tr-hop-band.alt { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.tr-hop-divider { stroke: color-mix(in srgb, var(--accent) 30%, transparent); stroke-width: 1.5px; stroke-dasharray: 10 8; pointer-events: none; }
.tr-hop-band-name { fill: color-mix(in srgb, var(--accent) 75%, var(--text)); font-weight: 800; letter-spacing: .12em; pointer-events: none; font-family: inherit; }
.tr-hop-band-name.start { fill: #f59e0b; }
.tr-hop-band-count { fill: var(--muted); font-weight: 600; pointer-events: none; font-family: inherit; }
[data-theme="light"] .tr-hop-band.alt { fill: color-mix(in srgb, var(--accent) 9%, transparent); }

/* Bulk upload: auto-trace to exchanges (runs off screen, results in the Exchange deposits report) */
.tr-bauto { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 10px 0 4px; padding: 12px 14px; border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--line)); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, #f59e0b 10%, var(--panel2)), color-mix(in srgb, #7c3aed 8%, var(--panel2))); }
.tr-bauto > .tr-bauto-icon { width: 34px; height: 34px; align-self: center; }
.tr-bauto-icon { fill: none; stroke: #f59e0b; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-bauto-icon circle { fill: #f59e0b; stroke: none; }
.tr-bauto-text { flex: 1 1 260px; display: grid; gap: 2px; }
.tr-bauto-text b { color: #fbbf24; font-size: 14px; }
.tr-bauto-text small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.tr-bauto label { display: grid; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tr-bauto select { min-height: 34px; text-transform: none; font-weight: 500; letter-spacing: 0; }
.tr-bauto-go { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; font-weight: 700; color: #1a1205 !important; background: linear-gradient(135deg, #fbbf24, #f59e0b); border-color: #f59e0b; }
.tr-bauto-go .tr-bauto-icon { width: 20px; height: 20px; stroke: #1a1205; }
.tr-bauto-go .tr-bauto-icon circle { fill: #1a1205; }
.tr-bauto-go.running { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff !important; border-color: #dc2626; }
.tr-bauto-go.running .tr-bauto-icon { stroke: #fff; } .tr-bauto-go.running .tr-bauto-icon circle { fill: #fff; }
.tr-bauto-go:disabled { opacity: .55; }
.tr-bauto-pdf { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 700; border-color: #2dd4bf; color: #5eead4; }
.tr-bauto-pdf:not(:disabled):hover { background: color-mix(in srgb, #2dd4bf 16%, var(--panel2)); }
.tr-bauto-dl { display: inline-flex; align-items: stretch; }
.tr-bauto-dl select { min-width: 210px; min-height: 36px; border-radius: 8px 0 0 8px; border-right: 0; font-weight: 700; }
.tr-bauto-dl .tr-bauto-pdf { border-radius: 0 8px 8px 0; }

/* Bulk auto-trace running in the background: a small bar at the bottom of the screen */
.tr-bulk-min { margin-left: auto; margin-right: 6px; }
.tr-bulk-chip { position: fixed; z-index: 2000; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(760px, calc(100vw - 32px)); padding: 9px 12px 9px 14px; border: 1px solid #f59e0b; border-radius: 999px; background: color-mix(in srgb, var(--panel) 96%, #f59e0b); box-shadow: 0 10px 30px #000a; font-size: 13px; }
.tr-bulk-chip[hidden] { display: none; }
.tr-bulk-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tr-bulk-chip-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #f59e0b; animation: tr-bulk-pulse 1.2s ease-in-out infinite; }
.tr-bulk-chip.done { border-color: #22c55e; }
.tr-bulk-chip.done .tr-bulk-chip-dot { background: #22c55e; animation: none; }
@keyframes tr-bulk-pulse { 50% { opacity: .3; } }
.rc-note.rc-fixed { color: #4ade80; border-color: color-mix(in srgb, #22c55e 45%, transparent); background: color-mix(in srgb, #22c55e 10%, transparent); }
/* Arrows can be dragged to a new position (double-click a moved arrow to reset it). */
.tr-edge[data-via] .tr-edge-label, .tr-edge[data-via] .tr-lane-label { cursor: grab; }
.tr-edge[data-via] .tr-edge-label:active, .tr-edge[data-via] .tr-lane-label:active { cursor: grabbing; }
.tr-edge[data-moved] .tr-edge-visible { stroke-dasharray: none; }
.tr-edge-clean[data-via], .tr-clean-label[data-via] { cursor: grab; }
.tr-edge-clean[data-via]:active, .tr-clean-label[data-via]:active { cursor: grabbing; }
.tr-cexdep-check { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: #4ade80; background: color-mix(in srgb, #22c55e 10%, transparent); border: 1px solid color-mix(in srgb, #22c55e 40%, transparent); }
.tr-cexdep-check.gap { color: #fbbf24; background: color-mix(in srgb, #f59e0b 12%, transparent); border-color: color-mix(in srgb, #f59e0b 45%, transparent); }
.tr-fund-menu .tr-fund-hint { margin: 6px 14px 2px; font-size: 12px; color: var(--muted); }
.tr-bulk-table td.st small.fixed { color: #4ade80; }
.td-update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9999; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--panel, #111827); border: 1px solid #2dd4bf; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13px; max-width: calc(100vw - 32px); }

/* Change loops as elliptical rings; unspent wallets ringed */
.tr-ring .tr-ring-text { font: 600 13px var(--font-mono, ui-monospace, monospace); paint-order: stroke; stroke: var(--bg, #0b0f14); stroke-width: 4px; }
.tr-ring .tr-ring-text.sub { font-size: 10.5px; font-weight: 500; fill: var(--muted, #8b9bb0); }
.tr-ring .tr-ring-dot { filter: drop-shadow(0 0 6px currentColor); }
.tr-ring:hover .tr-edge-visible { stroke-width: 3.2; }
.tr-unspent-dash { animation: tr-unspent-spin 14s linear infinite; }
@keyframes tr-unspent-spin { to { stroke-dashoffset: -360; } }
.tr-unspent-text { font: 700 11px var(--font-mono, ui-monospace, monospace); fill: #81C995; letter-spacing: .06em; paint-order: stroke; stroke: var(--bg, #0b0f14); stroke-width: 4px; }
@media (prefers-reduced-motion: reduce) { .tr-unspent-dash { animation: none; } }
.tr-ring .tr-ring-text.main { font: 500 11.5px var(--font-sans, Montserrat, system-ui, sans-serif); fill: var(--text, #e8eef6); }
.tr-ring .tr-ring-text.sub { font-size: 9.5px; }
.tr-bulk-table small.tr-inr { color: var(--accent, #3ddbd9); font-weight: 600; }

/* AI Investigator report: values in USD and INR, exchange deposit cards, wallet roles */
.ai-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.ai-pill { display: inline-block; padding: 3px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 11.5px; font-weight: 600; }
.ai-pill.warn { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #fbbf24; }
.ai-pill.ok { background: color-mix(in srgb, #22c55e 16%, transparent); color: #4ade80; }
.ai-pill.ghost { background: var(--panel2); color: var(--muted); }
.ai-input { margin: 6px 0 0; color: var(--muted); }
.ai-kpis div.m b { font-size: 19px; }
.ai-kpis em { display: block; font-style: normal; color: #4ade80; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-usd { display: block; }
.ai-inr { display: block; color: #4ade80; font-weight: 700; }
.ai-cex { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ai-cex article { border: 1px solid color-mix(in srgb, #22c55e 40%, var(--line)); border-left: 4px solid #22c55e; border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, color-mix(in srgb, #22c55e 8%, var(--panel)), var(--panel)); }
.ai-cex header { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ai-cex header b { font-size: 16px; margin-right: 4px; }
.ai-cex-fig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 6px; }
.ai-cex-fig > div { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.ai-cex-fig small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.ai-cex-fig b { display: block; font-variant-numeric: tabular-nums; }
.ai-cex .muted { font-size: 12px; margin: 4px 0; }
.ai-next { margin: 6px 0 0; font-weight: 600; color: #4ade80; font-size: 12.5px; }
.ai-role { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.ai-role.input { background: color-mix(in srgb, #60a5fa 18%, transparent); color: #93c5fd; }
.ai-role.cex { background: color-mix(in srgb, #22c55e 18%, transparent); color: #4ade80; }
.ai-role.hold { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #fbbf24; }
.ai-role.mix { background: color-mix(in srgb, #f43f5e 18%, transparent); color: #fb7185; }
.ai-wallets td { vertical-align: middle; }
@media (max-width: 760px) { .ai-cex { grid-template-columns: 1fr; } .ai-cex-fig { grid-template-columns: 1fr; } }
.tr-pick-earlier { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; background: color-mix(in srgb, #f59e0b 12%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--line)); }
.ai-setup textarea[name=q] { width: 100%; min-height: 64px; resize: vertical; font-family: var(--mono); font-size: 13px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: inherit; }
.ai-count { color: var(--accent); font-weight: 600; }
.ai-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 10px; }
.ai-progress .ai-batch { margin: 0 0 4px; font-weight: 700; color: var(--accent); font-size: 12.5px; }
.ai-bulk-item { border-top: 3px double color-mix(in srgb, var(--accent) 60%, var(--line)); margin-top: 30px; padding-top: 8px; }
.ai-bulk-no { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: .04em; font-size: 12px; text-transform: uppercase; }
.rc-ai { align-items: flex-start; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, #f472b6 40%, var(--line)); background: color-mix(in srgb, #f472b6 7%, transparent); }
.rc-ai small { display: block; color: var(--muted); margin-top: 2px; }
.rc-ai-note:empty { display: none; }
.rc-ai-note { color: #fbbf24 !important; }
.tr-fund-row { display: flex; align-items: stretch; gap: 4px; }
.tr-fund-row > input[type=checkbox] { flex: none; align-self: center; width: 16px; height: 16px; margin: 0 2px 0 8px; accent-color: var(--accent); cursor: pointer; }
.tr-fund-row > button { flex: 1; min-width: 0; }
.tr-fund-all { display: flex; align-items: center; gap: 8px; padding: 2px 12px 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.tr-fund-all input { accent-color: var(--accent); }
.tr-fund-menu .tr-pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); }

/* Pick list: order selector and the exchange-check note */
.tr-pick-tools select[data-pick-sort] { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: inherit; font-size: 12px; }
.tr-pick-cexnote { display: block; width: 100%; color: #4ade80; font-size: 11.5px; }
/* Exchange deposit card: its balance flashes above it on hover */
.tr-bal-flash { position: absolute; z-index: 40; transform: translate(-50%, -100%); pointer-events: none; padding: 7px 14px; border-radius: 12px; text-align: center; white-space: nowrap;
  background: #0d2a1b; border: 1px solid #22c55e; box-shadow: 0 0 22px rgba(34, 197, 94, .5); animation: tr-bal-blink 3.7s ease forwards; }
.tr-bal-flash small { display: block; color: #86efac; font-size: 10.5px; letter-spacing: .03em; }
.tr-bal-flash b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
@keyframes tr-bal-blink { 0% { opacity: 0; } 8% { opacity: 1; } 15% { opacity: .2; } 22% { opacity: 1; } 29% { opacity: .2; } 36% { opacity: 1; } 78% { opacity: 1; transform: translate(-50%, -100%); } 100% { opacity: 0; transform: translate(-50%, -125%); } }
@media (prefers-reduced-motion: reduce) { .tr-bal-flash { animation: tr-bal-fade 3.7s ease forwards; } @keyframes tr-bal-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } } }

/* Close button on every notification (js/dismiss.js) */
.td-has-dismiss { position: relative; padding-right: 30px !important; }
.td-dismiss { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; opacity: .55; font: 600 12px/22px system-ui, sans-serif; text-align: center; cursor: pointer; }
.td-dismiss:hover, .td-dismiss:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); outline: none; }
.td-closed { display: none !important; }
@media print { .td-dismiss { display: none !important; } }

/* Read transaction receipt: inputs side by side, options in one row, the slip list takes the rest of the window */
.tr-bulk.rc-dialog { width: min(1200px, calc(100vw - 32px)); height: calc(100dvh - 48px); }
.rc-dialog .tr-bulk-inner { height: 100%; box-sizing: border-box; }
.rc-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.rc-inputs .rc-drop { margin: 0; padding: 16px 14px; justify-content: center; gap: 4px; }
.rc-inputs .rc-drop b { font-size: 14px; }
.rc-inputs .rc-drop span { font-size: 12.5px; }
.rc-inputs .rc-drop small { font-size: 11.5px; }
.rc-inputs .rc-paste { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rc-inputs .rc-paste textarea { flex: 1 1 auto; min-height: 78px; resize: vertical; }
.rc-inputs .rc-paste button { align-self: flex-end; }
.rc-options { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px; align-items: stretch; }
.rc-options .rc-live { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); font-size: 12.5px; line-height: 1.4; }
.rc-options .rc-ai { margin: 0; border-color: color-mix(in srgb, #f472b6 40%, var(--line)); background: color-mix(in srgb, #f472b6 7%, transparent); }
.rc-options .rc-ai small { font-size: 11px; }
.rc-dialog .rc-results { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.rc-dialog .rc-summary { margin: 0; }
/* once slips are read: one-line inputs */
.rc-has-results .rc-inputs .rc-drop { padding: 8px 12px; }
.rc-has-results .rc-inputs .rc-drop span, .rc-has-results .rc-inputs .rc-drop small, .rc-has-results .rc-paste label small { display: none; }
.rc-has-results .rc-inputs .rc-paste { flex-direction: row; align-items: center; }
.rc-has-results .rc-inputs .rc-paste label { display: none; }
.rc-has-results .rc-inputs .rc-paste textarea { min-height: 38px; height: 38px; }
.rc-has-results .rc-options .rc-ai small { display: none; }
.rc-has-results .rc-options .rc-ai small.rc-ai-note:not(:empty) { display: block; }
@media (max-width: 760px) { .rc-inputs, .rc-options { grid-template-columns: 1fr; } .tr-bulk.rc-dialog { height: calc(100dvh - 24px); width: calc(100vw - 16px); } }
.rc-summary tr.rc-dup td { opacity: .55; }
.rc-dup-tag { display: inline-block; margin-top: 2px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-family: system-ui, sans-serif; color: #fbbf24; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.rc-summary .rc-thumb.none { width: 44px; height: 30px; }
.tr-bauto.flash { animation: tr-bauto-flash 1.6s ease; }
@keyframes tr-bauto-flash { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 3px #fbbf24, 0 0 24px rgba(251, 191, 36, .45); } }
.tr-pick-tools select[data-pick-sort] { max-width: 100%; }
/* Balance flash next to a hovered address in a list */
.tr-addr-hover { color: var(--accent); border-bottom: 1px dotted currentColor; cursor: help; font-family: var(--mono, ui-monospace, monospace); }
.tr-bal-flash.floating { position: fixed; z-index: 1000; }
.tr-bal-flash.loading { animation: none; opacity: .9; }
.tr-pick-fee { margin: 0; padding: 7px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: color-mix(in srgb, #94a3b8 8%, transparent); }
.tr-pick-fee .btn { margin-left: 6px; }
.tr-pick-row.fee { opacity: .7; }

/* Collapsed sidebars (1180 px wide or less): icons only, no text spilling out; the logo centred with the
   collapse button under it (it used to cover the logo). Nothing else of the design changes. */
@media (max-width: 1180px) {
  :is(#nav, #nav-resources) .nav-two, :is(#nav, #nav-resources) .nav-ext, :is(#nav, #nav-resources) small { display: none !important; }
  .side-org > span { display: none; }
  .side-left .brand { width: 30px; padding: 0 !important; margin: 0 auto; justify-content: center; gap: 0; }
  .side-left .side-collapse { position: static; margin: -6px auto 0; }
}

/* Link reader: AI intelligence read */
.lr-ai { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, #8b5cf6 40%, var(--line)); background: color-mix(in srgb, #8b5cf6 7%, transparent); font-size: 13px; }
.lr-ai small { display: block; color: var(--muted); margin-top: 2px; }
.lr-intel { border: 1px solid color-mix(in srgb, #8b5cf6 40%, var(--line)); border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, #8b5cf6 6%, var(--panel)); display: grid; gap: 8px; }
.lr-intel header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lr-intel header b { color: #c4b5fd; }
.lr-intel header small, .lr-intel-wait { color: var(--muted); font-size: 12px; }
.lr-intel h3 { margin: 2px 0 0; font-size: 15px; }
.lr-intel p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.lr-intel-err { color: #fbbf24; }
.lr-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin: 0; }
.lr-facts dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.lr-facts dd { margin: 0; font-size: 13px; font-weight: 600; }
.lr-steps summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.lr-steps ol, .lr-steps ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.lr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.lr-chips code { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); }
.lr-role { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.lr-step { color: #c4b5fd; }
.tr-cexdep .tr-exsum { display: inline-flex; align-items: center; gap: 6px; border-color: color-mix(in srgb, var(--accent, #2dd4bf) 55%, transparent); }
.tr-cexdep .tr-exsum .tr-exsum-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lr-intel .lr-webres { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.lr-intel .lr-webres small { color: var(--muted); margin-left: 6px; }
.lr-intel .lr-webres p { margin: 6px 0; }
.lr-intel .lr-sources { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.lr-intel .lr-sources li { margin: 2px 0; }
.lr-intel .lr-sources small { margin-left: 4px; }
.lr-row .lr-web { color: #38bdf8; }
.lr-row .lr-web a { color: inherit; }
/* Pick list: only the transfer list scrolls; the tools, notes and the "Add selected" footer always stay in view. */
.tr-fund-menu.tr-pick-menu > * { flex: none; }
.tr-fund-menu.tr-pick-menu > .tr-fund-list { flex: 1 1 auto; min-height: 72px; overflow-y: auto; }
.tr-fund-menu.tr-pick-menu > .tr-pick-foot { position: relative; z-index: 1; }

/* Security alert (home page): red panel that flashes when it appears, then keeps a slow red pulse. */
.sec-alert { margin: 0 0 22px; border: 2px solid #ef4444; border-radius: 14px; background: rgba(239, 68, 68, .10); padding: 16px 18px; color: var(--text, #e6edf3); animation: sec-flash .55s ease-in-out 0s 8, sec-pulse 2.4s ease-in-out 4.4s infinite; }
.sec-alert header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.sec-alert header > div { flex: 1; }
.sec-alert h2 { margin: 0 0 4px; font-size: 18px; color: #fca5a5; }
.sec-alert p { margin: 0; font-size: 13px; color: var(--muted, #9aa4b2); }
.sec-alert-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: #ef4444; color: #fff; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: sec-ring 1.6s ease-out infinite; }
.sec-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sec-table th { text-align: left; font-weight: 600; color: #fca5a5; border-bottom: 1px solid rgba(239, 68, 68, .45); padding: 6px 8px; }
.sec-table td { padding: 7px 8px; border-bottom: 1px solid rgba(239, 68, 68, .18); vertical-align: top; }
.sec-table tr.sev-high td:nth-child(2) b { color: #fff; background: #dc2626; border-radius: 6px; padding: 1px 7px; }
.sec-table tr.sev-medium td:nth-child(2) b { color: #1f1300; background: #f59e0b; border-radius: 6px; padding: 1px 7px; }
.sec-table code { font-size: 12px; }
.toast.sec-toast { display: block; background: #b91c1c; color: #fff; border: 1px solid #ef4444; font-weight: 600; text-decoration: none; animation: sec-flash .55s ease-in-out 0s 8; }
@keyframes sec-flash { 0%, 100% { background-color: rgba(239, 68, 68, .10); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } 50% { background-color: rgba(239, 68, 68, .45); box-shadow: 0 0 26px 4px rgba(239, 68, 68, .55); } }
@keyframes sec-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } 50% { box-shadow: 0 0 18px 2px rgba(239, 68, 68, .35); } }
@keyframes sec-ring { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); } 100% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); } }
@media (prefers-reduced-motion: reduce) { .sec-alert, .sec-alert-icon, .toast.sec-toast { animation: none; } }
[data-theme="light"] .sec-alert { color: #1f2328; } [data-theme="light"] .sec-alert h2, [data-theme="light"] .sec-table th { color: #b91c1c; }
/* Security alerts page */
.sec-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.sec-stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.sec-stat b { display: block; font-size: 22px; }
.sec-stat span { color: var(--muted); font-size: 12px; }
.sec-stat.high b { color: #f87171; } .sec-stat.medium b { color: #fbbf24; } .sec-stat.low b { color: #94a3b8; }
.sec-tools { flex-wrap: wrap; gap: 8px; }
.sec-page-table th { color: var(--muted); border-bottom-color: var(--line); }
.sec-page-table td { border-bottom-color: var(--line); }
.sec-page-table .sec-lvl { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, #94a3b8 25%, transparent); }
.sec-page-table tr.sev-high .sec-lvl { background: #dc2626; color: #fff; }
.sec-page-table tr.sev-medium .sec-lvl { background: #d97706; color: #fff; }
.sec-page-table tr.acked { opacity: .72; }
.sec-page-table .sec-open { color: #f87171; }
.side nav .sec-badge:not(:empty) { background: #dc2626; color: #fff; }
.side nav a[hidden] { display: none !important; }
.tr-pick-legend { margin: 0; padding: 6px 12px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.tr-pick-foot .btn.primary.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.tr-pick-row em.before-funds { --c: #94a3b8; }
.tr-ask { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.tr-ask h4 { margin: 0 0 8px; }
.tr-ask-thread { display: grid; gap: 8px; margin-bottom: 8px; }
.tr-ask-q { justify-self: end; max-width: 92%; padding: 6px 10px; border-radius: 10px 10px 2px 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tr-ask-q b { display: block; font-size: 11px; color: var(--muted); }
.tr-ask-q p { margin: 2px 0 0; }
.tr-ask-a { padding: 6px 10px; border-left: 3px solid #a855f7; background: color-mix(in srgb, #a855f7 8%, transparent); border-radius: 2px 10px 10px 2px; }
.tr-ask-a p, .tr-ask-a li { margin: 3px 0; }
.tr-ask-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tr-ask-ideas .btn { font-size: 11.5px; padding: 3px 8px; }
.tr-ask-form { display: flex; gap: 6px; align-items: flex-end; }
.tr-ask-form textarea { flex: 1; resize: vertical; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.tr-ask small { display: block; margin-top: 4px; font-size: 11px; }
.tr-pick-status { flex: 1; font-size: 11.5px; color: var(--muted); }
.tr-pick-earlier { margin: 0; padding: 6px 12px; font-size: 12px; }
.tr-fund-menu.tr-pick-menu { max-height: min(640px, calc(100% - 16px)); }
/* Forward + of a decoded swap / bridge or a mixer: red, no trace */
.tr-plus.stop circle { stroke: #ef4444; stroke-width: 2.2; fill: rgba(239,68,68,.14); }
.tr-plus.stop .tr-plus-x { stroke: #ef4444; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.tr-plus.stop .tr-notrace rect { fill: #dc2626; }
.tr-plus.stop .tr-notrace text { fill: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; }
.tr-plus.stop { cursor: not-allowed; }
/* Department style (AP Police slides): every page title sits on a blue banner in bold white condensed letters,
   with the AP Police badge at the top right. Same in the dark and light themes. */
:root { --dept-blue: #00358f; --dept-blue-2: #002c78; }
#view .page-head:not(.plain) { position: relative; align-items: center; background: linear-gradient(135deg, var(--dept-blue) 0%, var(--dept-blue-2) 100%); color: #fff; border: 0; border-radius: 14px; padding: 26px 116px 24px 30px; margin-bottom: 22px; box-shadow: 0 10px 26px rgba(0, 35, 100, .28); }
#view .page-head:not(.plain)::after { content: ''; position: absolute; top: 16px; right: 22px; width: 64px; height: 64px; border-radius: 50%; background: #fff url(img/appolice-logo.jpg) center / 86% no-repeat; box-shadow: 0 2px 10px rgba(0, 0, 0, .28); }
#view .page-head:not(.plain) h1 { margin: 0; color: #fff; font-family: "Bahnschrift Condensed", Bahnschrift, "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif; font-stretch: condensed; font-weight: 700; font-size: clamp(30px, 3.6vw, 50px); line-height: 1.04; letter-spacing: -.005em; }
#view .page-head:not(.plain) p, #view .page-head:not(.plain) .crumb, #view .page-head:not(.plain) .muted, #view .page-head:not(.plain) small { color: rgba(255, 255, 255, .86); }
#view .page-head:not(.plain) p { max-width: 900px; margin-top: 8px; font-size: 14px; line-height: 1.5; }
#view .page-head:not(.plain) a:not(.btn) { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
#view .page-head:not(.plain) .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); color: #fff; }
#view .page-head:not(.plain) .btn:hover { background: rgba(255, 255, 255, .24); }
#view .page-head:not(.plain) .btn.primary { background: #fff; border-color: #fff; color: var(--dept-blue); }
#view .page-head:not(.plain) .btn.primary:hover { background: #e8eefc; }
#view .page-head:not(.plain) .btn[disabled] { opacity: .5; }
#view .page-head:not(.plain) svg.ui-icon { color: currentColor; }
@media (max-width: 700px) {
  #view .page-head:not(.plain) { padding: 20px 80px 18px 18px; border-radius: 12px; }
  #view .page-head:not(.plain)::after { width: 48px; height: 48px; top: 12px; right: 14px; }
}
.tr-visualizer-coin.coin-filled { fill: color-mix(in srgb, var(--coin) 26%, #111827); stroke: var(--coin); stroke-width: 2; }

/* ===== AP Police blue: every page blue with white letters (the dark theme) ===== */
:root:not([data-theme="light"]) {
  --bg: #00358f; --panel: #002b76; --panel2: #0a43a3; --line: #2f62b8;
  --text: #ffffff; --muted: #c8d6f2; --accent: #ffffff; --accent-ink: #00358f;
  --warn: #ffc94d; --warn-bg: rgba(255, 201, 77, .16); --danger: #ff7b72; --ok: #5fe08c; --link: #ffe08a;
  --hover: #0c48ad; --ring: rgba(255, 255, 255, .45);
  --beam: rgba(255, 255, 255, .035); --glow: rgba(255, 255, 255, .05); --grid: rgba(255, 255, 255, .03);
  --node-sea: #002566; --node-land: #003b9c; --node-border: #3a6cc0;
}
:root:not([data-theme="light"]) body { background: #00358f; }
/* the page title banner sits on blue now: a deeper blue so it still stands out */
:root:not([data-theme="light"]) #view .page-head:not(.plain) { background: linear-gradient(135deg, #002a74 0%, #001f58 100%); box-shadow: 0 10px 26px rgba(0, 10, 40, .35); border: 1px solid rgba(255, 255, 255, .14); }
/* the tracer graph: a deep blue sheet so arrows and cards read clearly */
:root:not([data-theme="light"]) .tr-canvas { background: #002463; }
:root:not([data-theme="light"]) .btn.primary { background: #fff; border-color: #fff; color: #00358f; }
:root:not([data-theme="light"]) .btn.primary:hover { background: #e6eeff; border-color: #e6eeff; }
:root:not([data-theme="light"]) :is(input, select, textarea) { background: #002563; color: #fff; border-color: #3a6cc0; }
:root:not([data-theme="light"]) :is(input, textarea)::placeholder { color: #9fb6e0; }
/* Sign-in page in AP Police blue */
body .au-page { background: #00358f; color: #fff; }
body .au-brand { background: linear-gradient(135deg, #00358f 0%, #002c78 100%); }
body .au-brand:after { background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px); }
body .au-brand h1 { font-family: "Bahnschrift Condensed", "Bahnschrift", "Arial Narrow", system-ui, sans-serif; font-weight: 700; font-size: clamp(30px, 3.6vw, 48px); letter-spacing: .005em; }
body .au-brand h1 em { color: #fff; }
body .au-mark small, body .au-org small { color: #c8d6f2; }
body .au-feats li { color: #e4ecfb; }
body .au-feats li:before { background: #fff; box-shadow: none; }
body .au-org { border-top-color: rgba(255, 255, 255, .2); }
body .au-side { background: #002463; }
body .au-box p.sub, body .au-box .au-note { color: #c8d6f2; }
body .au-box label { color: #e4ecfb; }
body .au-box input, body .au-box select { background: #001d52; border-color: #3a6cc0; color: #fff; }
body .au-box input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }
body .au-box .btn.primary { background: #fff; color: #00358f; }
body .au-box .au-note { border-top-color: rgba(255, 255, 255, .18); }
:root:not([data-theme="light"]) #view .tr-canvas { background-color: #002463;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .10) 1px, transparent 1.4px), radial-gradient(120% 90% at 50% 0%, #003a9a 0%, #002b78 45%, #001f5a 100%); }

/* Watchlist: WhatsApp alerts */
.wl-wa { margin: 0 0 14px; padding: 12px 16px; }
.wl-wa summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.wl-wa p { margin: 10px 0; font-size: 13px; }
.wl-wa .toolbar { margin: 0; }
.wl-wa input[name="phone"] { flex: 1; min-width: 220px; }
.wl-wa input[name="apikey"] { flex: 1; min-width: 180px; }
.wl-wa-on { color: var(--ok); font-weight: 600; }
.wl-steps { margin: 10px 0; padding-left: 20px; font-size: 13px; }
.wl-steps li { margin: 3px 0; }
.wl-tg input[name="token"] { flex: 1; min-width: 280px; font-family: var(--mono); }

/* ---------- Court Checker tabs + Crypto Court Library ---------- */
.court-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.court-tab { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); text-decoration: none; min-width: 240px; }
.court-tab .ui-icon { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--panel2); color: var(--accent); }
.court-tab b { display: block; font-size: 15px; }
.court-tab small { color: var(--muted); font-size: 12px; }
.court-tab:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.court-tab.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.court-tab.on .ui-icon { background: var(--accent); color: var(--accent-ink); }
.cl-search h2 small { font-weight: 400; color: var(--muted); font-size: 13px; }
.cl-q { display: flex; gap: 8px; margin: 10px 0 8px; }
.cl-q input { flex: 1; min-width: 0; font-size: 15px; padding: 11px 16px; }
.cl-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cl-examples .chip { font: inherit; font-size: 12px; padding: 4px 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; border-radius: 999px; }
.cl-examples .chip:hover { color: var(--text); border-color: var(--accent); }
.cl-answer { margin: 14px 0; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.cl-answer h3 small, .cl-an-block h3 small, .cl-an-block h4 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.cl-answer ul { padding-left: 20px; } .cl-answer li { margin: 4px 0; }
.cl-cite { font-weight: 600; white-space: nowrap; }
.cl-hit { padding: 10px 0; border-top: 1px solid var(--line); }
.cl-hit-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.cl-hit-head small { color: var(--muted); }
.cl-hit-head .btn { margin-left: auto; }
.cl-hit p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.cl-hit mark, .cl-answer mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.cl-addr-hit { margin: 10px 0; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); }
.cl-addr-hit.yes { border-color: #ff5a5a; background: rgba(255, 59, 59, .08); }
.cl-addr-hit div { margin-top: 4px; font-size: 13px; } .cl-addr-hit small { color: var(--muted); }
.cl-tiles { margin-top: 16px; }
.cl-indexes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.cl-indexes small { color: var(--muted); margin-left: 4px; }
.cl-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.cl-cat { font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.cl-cat b { margin-left: 4px; color: var(--muted); }
.cl-cat.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cl-cat.on b { color: var(--accent-ink); }
.cl-group > summary { list-style: none; cursor: pointer; }
.cl-group > summary::-webkit-details-marker { display: none; }
.cl-group h2 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.cl-status { margin: 4px 0 0; font-size: 13px; }
.cl-doc { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.cl-doc-id b { display: block; font-size: 15px; font-family: var(--mono); }
.cl-type { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #1d1d1d; color: var(--muted); }
.cl-type.t-final { color: var(--accent); background: rgba(212, 255, 0, .1); }
.cl-type.t-freeze { color: #8f86ff; background: rgba(91, 76, 255, .16); }
.cl-type.t-warrant { color: var(--orange, #ff9f1c); background: rgba(255, 159, 28, .13); }
.cl-type.t-order { color: #e4e4e4; background: #232323; }
.cl-type.t-allegation { color: #ff8a8a; background: rgba(255, 59, 59, .1); }
.cl-doc-title { font-weight: 600; font-size: 15px; }
.cl-doc-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cl-doc-crypto { margin: 6px 0 0; font-size: 13px; }
.cl-doc-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.cl-doc-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 160px; }
.cl-src { font-size: 12px; text-align: center; }
.cl-dialog { width: min(1040px, 96vw); }
.cl-an-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cl-an-block { margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); }
.cl-an-block.ai { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cl-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; margin: 8px 0; }
.cl-kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.cl-kv dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.cl-passages { padding-left: 20px; font-size: 13px; } .cl-passages li { margin: 6px 0; }
.cl-addrs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow: auto; }
.cl-addrs span { font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.cl-addrs small { color: var(--muted); }
@media (max-width: 860px) { .cl-doc { grid-template-columns: minmax(0, 1fr); } .cl-doc-actions { flex-direction: row; flex-wrap: wrap; } .cl-q { flex-wrap: wrap; } }
.cl-zipbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.cl-zipbar small { opacity: .75; margin-left: 6px; font-weight: 500; }
.cl-zipbar .muted { font-size: 13px; }
.cl-group > summary { position: relative; }
.cl-zip-group { position: absolute; top: 0; right: 0; }

/* ---------- Court Checker · Draft filings ---------- */
.dr-layout { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.dr-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.dr-side h2 { font-size: 15px; margin: 4px 0 10px; }
.dr-side h2:not(:first-child) { margin-top: 18px; }
.dr-tgroup { margin-bottom: 8px; }
.dr-tgroup > small, .dr-aj > small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 4px; }
.dr-t { display: block; width: 100%; text-align: left; font: inherit; padding: 9px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); color: var(--text); cursor: pointer; }
.dr-t b { display: block; font-size: 13px; } .dr-t span { color: var(--muted); font-size: 11.5px; }
.dr-t:hover { border-color: var(--accent); }
.dr-t.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.dr-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.dr-f { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.dr-f.wide { grid-column: 1 / -1; }
.dr-f input, .dr-f textarea, .dr-f select { font: inherit; font-size: 13px; color: var(--text); padding: 7px 10px; }
.dr-f textarea { font-family: var(--mono); font-size: 12px; resize: vertical; }
.dr-a { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.dr-a input { margin-top: 3px; }
.dr-a i { color: var(--muted); }
.dr-a small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.dr-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.dr-bar small { color: var(--muted); margin-left: 6px; }
.dr-spacer { flex: 1; }
.dr-doc { background: #fff; color: #111; font-family: 'Times New Roman', Georgia, serif; font-size: 15px; line-height: 1.6; padding: 44px 54px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); min-height: 600px; outline: none; }
.dr-doc:focus { box-shadow: 0 0 0 3px var(--ring), 0 8px 30px rgba(0, 0, 0, .35); }
.dr-doc a { color: #0b4fae; }
.dr-doc h3 { font-size: 15px; text-decoration: underline; margin: 18px 0 6px; }
.dr-caption { text-align: center; margin-bottom: 18px; }
.dr-court { font-weight: 700; }
.dr-title { font-weight: 700; text-decoration: underline; margin-top: 12px; }
.dr-doc .dr-table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.dr-doc .dr-table th, .dr-doc .dr-table td { border: 1px solid #555; padding: 4px 6px; text-align: left; vertical-align: top; color: #111; }
.dr-doc .dr-table th { background: #f1f1f1; }
.dr-doc .mono { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
.dr-blank { background: #fff3a0; color: #5a4300; border-radius: 3px; padding: 0 3px; }
.dr-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 34px; }
.dr-right { text-align: right; }
.dr-note { font-size: 12px; color: #666; border-top: 1px solid #ccc; margin-top: 26px; padding-top: 8px; }
.dr-doc ol.dr-paras > li { margin-bottom: 10px; }
.dr-libref { font-size: 13px; }
.dr-ai-box { margin: 0 0 12px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 14px; background: var(--panel2); }
.dr-ai-box small { color: var(--muted); }
.dr-ai-actions { display: flex; gap: 8px; margin: 8px 0; }
@media (max-width: 1100px) { .dr-layout { grid-template-columns: minmax(0, 1fr); } .dr-side { position: static; max-height: none; } .dr-doc { padding: 24px 20px; } }
