/* algo.css — Algorand Intelligence, LIGHT theme.
   The page sets <body class="algo-light">; that class re-points the site-wide tokens (--bg, --text, --line …) so the
   shared nav / footer follow automatically. Fills use --green / --algo; TEXT in those hues uses the darker "-ink"
   variants so every label keeps WCAG AA contrast on white. */

body.algo-light {
  color-scheme: light;
  --bg: #f7f9fc; --bg2: #ffffff; --bg3: #f0f3f8; --surface: #ffffff; --surface2: #f0f3f8;
  --line: #e2e8f0; --line-strong: #cbd5e1; --border: var(--line); --border2: var(--line-strong);
  --text: #0b0f16; --text2: #475569; --text3: #5b6b82;
  --green: #00c46a; --green2: #00a85a; --green-ink: #007a44; --accent: #007a44;
  --green-dim: rgba(0,196,106,.12); --green-glow: rgba(0,196,106,.32);
  --algo: #2d2df1; --algo-dim: rgba(45,45,241,.08);
  --amber: #f59e0b; --amber-ink: #b45309; --amber-dim: rgba(245,158,11,.14);
  --red: #ef4444; --red-ink: #c81e1e; --red-dim: rgba(239,68,68,.12);
  --blue-dim: rgba(15,23,42,.05); --purple-dim: rgba(15,23,42,.05);
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Space Mono", monospace;
  --radius: 10px; --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
  --shadow-hover: 0 2px 6px rgba(15,23,42,.08), 0 16px 36px rgba(15,23,42,.08);
  background: var(--bg); color: var(--text);
}
html:has(body.algo-light) { background: #f7f9fc; }

/* shared chrome in light */
body.algo-light nav#navbar.scrolled { background: rgba(247,249,252,.86); border-bottom-color: var(--line); }
body.algo-light .nav-links a.nav-cta { background: var(--green); color: #04210f !important; }
body.algo-light .nav-links a.nav-cta:hover { background: #00d977; }
body.algo-light .nav-links a:hover { color: var(--green-ink); }
body.algo-light .nav-links a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--green); }
body.algo-light .mobile-menu { background: rgba(247,249,252,.98); }
body.algo-light .lang-switcher, body.algo-light .lang-btn { border-color: var(--line-strong); }
body.algo-light .lang-btn.active { background: var(--green); color: #04210f; }
body.algo-light .hamburger span { background: var(--text); }
body.algo-light .site-footer { background: #fff; border-top-color: var(--line); }
body.algo-light .sf-col a, body.algo-light .sf-brand p, body.algo-light .sf-bottom, body.algo-light .sf-bottom a { color: var(--text2); }
body.algo-light .sf-col a:hover { color: var(--green-ink); }
body.algo-light .skip-link { background: #fff; color: var(--text); }

.algo { position: relative; z-index: 1; }
.bg-net { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.algo .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.algo code { font-family: var(--mono); font-size: .88em; color: var(--text); background: var(--blue-dim); padding: 1px 6px; border-radius: 6px; }
.algo .fine { font-size: 12.5px; line-height: 1.7; color: var(--text3); max-width: 880px; margin-top: 16px; }
.algo .fine a, .algo .disclaimer a { color: var(--text2); text-decoration: underline; text-underline-offset: 3px; }
.algo .fine a:hover, .algo .disclaimer a:hover { color: var(--green-ink); }
.algo .muted { color: var(--text3); }
.algo .nb { white-space: nowrap; }
.algo-sec .lede { max-width: 760px; }
.algo-sec .h2 { max-width: 880px; }
.algo .sec { border-top: 1px solid var(--line); }
.algo .eyebrow { color: var(--green-ink); }
.algo .eyebrow::before { background: var(--green); }

/* ── cards: soft shadow, 16 px radius, gradient border on hover ── */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  transition: box-shadow .25s ease, transform .25s ease;
  animation: algo-in .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 1) * 70ms);
}
.card::before {
  content: ''; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(135deg, var(--green), var(--algo));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card:hover::before { opacity: 1; }
@keyframes algo-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kpi-grid > :nth-child(1) { --i: 1; } .kpi-grid > :nth-child(2) { --i: 2; } .kpi-grid > :nth-child(3) { --i: 3; }
.kpi-grid > :nth-child(4) { --i: 4; } .kpi-grid > :nth-child(5) { --i: 5; } .kpi-grid > :nth-child(6) { --i: 6; }
.viz-grid > :nth-child(1) { --i: 2; } .viz-grid > :nth-child(2) { --i: 3; }

/* ── hero ───────────────────────────────────────────────────── */
.crumb { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--text3); margin-bottom: 30px; flex-wrap: wrap; }
.crumb a { color: var(--text2); text-decoration: none; }
.crumb a:hover { color: var(--green-ink); }
.net-badge {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; background: #fff;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text2); box-shadow: var(--shadow);
}
.net-badge[data-state="online"] { color: var(--green-ink); border-color: rgba(0,196,106,.45); }
.net-badge[data-state="degraded"] { color: var(--amber-ink); border-color: rgba(245,158,11,.55); }
.net-badge[data-state="offline"] { color: var(--red-ink); border-color: rgba(239,68,68,.55); }
.net-badge[data-state="online"] .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); animation: algo-pulse 2.4s ease-in-out infinite; }
.net-badge[data-state="degraded"] .dot { background: var(--amber); }
.net-badge[data-state="offline"] .dot { background: var(--red); }
.net-note { font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--amber-ink); }

/* ── dots ───────────────────────────────────────────────────── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex: none; vertical-align: middle; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.dot.pend { background: transparent; border: 1.5px solid var(--text3); }
.dot.live { animation: algo-pulse 2.4s ease-in-out infinite; }
@keyframes algo-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ── KPI cards ──────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 22px 22px 20px; min-width: 0; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.kpi-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); }
.kpi-val {
  font-family: var(--mono); font-weight: 700; font-size: clamp(25px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -.02em;
  color: var(--text); font-variant-numeric: tabular-nums; min-height: 1.15em; overflow-wrap: anywhere; transform-origin: left center;
}
.kpi--accent .kpi-val { color: var(--green-ink); }
.kpi-val.pulse { animation: algo-flash .9s ease-out; }
@keyframes algo-flash { 0% { transform: scale(1.045); text-shadow: 0 0 22px var(--green-glow); } 100% { transform: none; text-shadow: none; } }
.kpi-sub { font-size: 12.5px; color: var(--text2); margin-top: 10px; line-height: 1.5; min-height: 1.5em; }
.spark-host { position: relative; height: 48px; margin: 14px 0 0; }
.spark { width: 100%; height: 100%; display: block; overflow: visible; }
.spark-dot { position: absolute; right: -3px; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); animation: algo-pulse 2s ease-in-out infinite; display: none; }

/* skeletons: reserve the final footprint, no layout shift */
.skel { position: relative; color: transparent !important; }
.skel::after { content: ''; position: absolute; left: 0; top: 12%; height: 76%; width: min(9ch, 70%); background: linear-gradient(90deg, var(--bg3) 25%, #e6ebf3 50%, var(--bg3) 75%); background-size: 200% 100%; animation: algo-shimmer 1.4s linear infinite; border-radius: 6px; }
@keyframes algo-shimmer { to { background-position: -200% 0; } }
.chart-host { position: relative; min-width: 320px; }
.chart-host.is-loading::after, .donut-row.is-loading::after {
  content: ''; position: absolute; inset: 10px 0 30px 46px; border-radius: 12px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, var(--bg3) 25%, #e6ebf3 50%, var(--bg3) 75%); background-size: 200% 100%; animation: algo-shimmer 1.4s linear infinite;
}

/* ── viz cards ──────────────────────────────────────────────── */
.viz-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.viz-card { padding: 24px 24px 20px; min-width: 0; margin-top: 16px; }
.viz-grid > .viz-card { margin-top: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.viz-head h3 { line-height: 1.3; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--text); }
.viz-sub { font-size: 13px; color: var(--text2); line-height: 1.6; margin: 6px 0 14px; max-width: 760px; }
.viz-meta { font-family: var(--mono); font-size: 11px; color: var(--text3); display: inline-block; margin-left: 4px; }
.live-tag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--green-ink); background: var(--green-dim); padding: 5px 10px; border-radius: 999px; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* chart internals (SVG classes from charts.js / sankey.js) */
.chart { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-family: var(--mono); font-size: 10.5px; fill: var(--text3); }
.chart .bv { font-family: var(--mono); font-size: 10px; fill: var(--text2); }
.chart .line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .live-dot { fill: var(--green); }
.chart .live-ring { fill: var(--green-dim); animation: algo-ring 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes algo-ring { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.chart .cross { stroke: var(--text3); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .hover-dot { fill: #fff; stroke: var(--algo); stroke-width: 2; }
.chart .ref { stroke: var(--text3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart.bars .bar { outline: none; cursor: default; }
.chart.bars .bar rect { transition: opacity .15s, filter .15s; }
.chart.bars .bar:hover rect, .chart.bars .bar:focus rect { filter: brightness(1.08) saturate(1.1); opacity: .92; }
.chart.bars .bar:focus-visible rect { stroke: var(--text); stroke-width: 2; }

.donut-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; min-height: 330px; align-content: start; }
.donut-row.is-loading::after { inset: 0; border-radius: 16px; }
.donut { width: 200px; height: 200px; display: block; }
.donut .seg { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.donut .seg.dim { opacity: .22; }
.donut .c-top { font-family: var(--mono); font-weight: 700; font-size: 24px; fill: var(--text); }
.donut .c-sub { font-family: var(--mono); font-size: 10px; fill: var(--text3); letter-spacing: .06em; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; width: 100%; }
.donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 52px; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; color: var(--text2); cursor: default; outline: none; transition: background .15s; }
.donut-legend li.on, .donut-legend li:hover, .donut-legend li:focus-visible { background: var(--bg3); color: var(--text); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .cnt { font-family: var(--mono); font-size: 12px; color: var(--text3); }
.donut-legend .pct { font-family: var(--mono); font-weight: 700; font-size: 12px; text-align: right; color: var(--text); }
.donut-legend .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tooltip */
.tt { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; min-width: 170px; max-width: 280px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.16); font-size: 12px; color: var(--text2); }
.tt[hidden] { display: none; }
.tt-h { font-family: ui-monospace, "JetBrains Mono", monospace; font-weight: 700; font-size: 12.5px; color: #0b0f16; margin-bottom: 6px; }
.tt-row { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.tt-row b { font-family: ui-monospace, "JetBrains Mono", monospace; font-weight: 600; color: #0b0f16; text-align: right; }
.tt-addr { font-family: ui-monospace, "JetBrains Mono", monospace; font-size: 10px; color: #5b6b82; word-break: break-all; margin-bottom: 6px; }
.tt-foot { margin-top: 7px; padding-top: 7px; border-top: 1px solid #e2e8f0; font-size: 11px; color: #2d2df1; }

/* flow diagram */
.flow-host { min-width: 720px; }
.flow-stage { position: relative; width: 100%; }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.flow-svg .edge { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; }
.flow-svg .node rect { fill: #fff; stroke: var(--line-strong); stroke-width: 1; filter: drop-shadow(0 4px 10px rgba(15,23,42,.06)); }
.flow-svg .n-s rect { stroke: rgba(0,196,106,.55); }
.flow-svg .n-p rect, .flow-svg .n-l rect { stroke: rgba(45,45,241,.35); }
.flow-svg .n-title { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; fill: var(--text3); }
.flow-svg .n-l1 { font-family: var(--mono); font-size: 14px; font-weight: 700; fill: var(--text); }
.flow-svg .n-l2 { font-family: var(--mono); font-size: 11px; fill: var(--text2); }
.flow-svg .edge-cap { font-family: var(--mono); font-size: 10.5px; fill: var(--text3); }

/* sankey */
.sankey .sk-link path { stroke: var(--algo); stroke-opacity: .26; transition: stroke-opacity .15s; cursor: pointer; }
.sankey .sk-link.exchange path { stroke: var(--green); stroke-opacity: .38; }
.sankey .sk-link.flagged path { stroke: var(--red); stroke-opacity: .42; }
.sankey .sk-link.on path { stroke-opacity: .85; }
.sankey .sk-link.dim path { stroke-opacity: .07; }
.sankey .sk-link:focus { outline: none; }
.sankey .sk-link:focus-visible path { stroke-opacity: .95; }
.sankey .sk-label { font-family: var(--mono); font-size: 11px; fill: var(--text2); }
.sankey .sk-hot { cursor: pointer; }
.empty-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text3); font-size: 13px; margin: 0; }

/* ── post-quantum detail ────────────────────────────────────── */
.pq-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.pq-box { padding: 26px 26px 22px; min-width: 0; }
.pq-box h3 { line-height: 1.3; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--text); margin-bottom: 16px; }
.facts > div { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { font-size: 13px; color: var(--text2); line-height: 1.5; }
.facts dd { font-family: var(--mono); font-size: 13px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.facts dd .muted { font-family: var(--body); font-size: 12px; text-align: right; display: block; }
.spark-wrap { margin: 18px 0 0; }
.spark-wrap svg { width: 100%; height: 48px; border-bottom: 1px solid var(--line); }
.spark-wrap figcaption { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: 0 0 20px; position: relative; }
.tl::before { content: ''; position: absolute; left: 96px; top: 7px; bottom: -7px; width: 1px; background: var(--line-strong); }
.tl:last-child::before { display: none; }
.tl::after { content: ''; position: absolute; left: 92px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--text3); }
.tl.done::after { background: var(--green); border-color: var(--green); }
.tl-when { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--text3); padding-top: 2px; }
.tl > div { padding-left: 22px; font-size: 13px; line-height: 1.6; color: var(--text2); }
.tl > div strong { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.tl.done .tl-when { color: var(--green-ink); }
.qday { margin-top: 16px; max-width: none; padding: 26px 28px; border-left: 0; background: var(--surface); }
.qday h3 { font-family: var(--display); font-weight: 800; font-size: 18px; margin-bottom: 10px; color: var(--text); }
.qday p { font-size: 14.5px; line-height: 1.75; color: var(--text2); max-width: 900px; }

/* ── whale feed ─────────────────────────────────────────────── */
.wh-controls { display: grid; grid-template-columns: auto minmax(160px, 320px) 1fr; gap: 20px; align-items: center; margin-top: 36px; }
.wh-label { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--text); min-width: 230px; }
#wh-range { width: 100%; accent-color: var(--algo); height: 28px; }
.wh-legend, .uptime-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.kd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kd.exchange { background: var(--green); }
.kd.flagged { background: var(--red); }
.kd.foundation { background: var(--algo); }
.kd.unknown { background: transparent; border: 1.5px solid var(--text3); }
.wh-meta { font-family: var(--mono); font-size: 11px; color: var(--text3); margin: 18px 0 4px; min-height: 1.4em; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; padding: 6px 22px 10px; }
.wh-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.wh-table th { text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); padding: 14px 14px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wh-table td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line); color: var(--text2); vertical-align: middle; transition: background .15s; }
.wh-table tbody tr:hover td { background: var(--bg3); }
.wh-table tbody tr:last-child td { border-bottom: 0; }
.wh-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wh-table th.num { text-align: right; }
.wh-table .time { font-family: var(--mono); font-size: 12px; color: var(--text3); white-space: nowrap; }
.wh-table .amt { color: var(--text); font-weight: 700; font-size: 14px; }
.wh-table .unit { color: var(--text3); font-size: 11px; }
.wh-table .usd { display: block; font-size: 11px; color: var(--text3); }
.wh-table .flow { white-space: nowrap; }
.wh-table .arr { color: var(--text3); margin: 0 10px; }
.wh-table .addr { font-family: var(--mono); font-size: 12px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.wh-table .addr:hover { color: var(--algo); }
.wh-table .type { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.wh-table .tx a { font-family: var(--mono); font-size: 12px; color: var(--text2); text-decoration: underline; text-underline-offset: 3px; }
.wh-table .tx a:hover { color: var(--algo); }
.wh-table .empty { text-align: center; padding: 36px 0; color: var(--text3); font-size: 13px; }
.skel-row td { padding: 14px 0; }
.skel-bar { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--bg3) 25%, #e6ebf3 50%, var(--bg3) 75%); background-size: 200% 100%; animation: algo-shimmer 1.4s linear infinite; }

/* ── state proof monitor ────────────────────────────────────── */
.sp-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 34px; padding: 16px 22px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--text3); border-radius: 14px; box-shadow: var(--shadow); }
.sp-status strong { font-family: var(--mono); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); }
.sp-status-note { font-size: 13px; color: var(--text2); }
.sp-status[data-state="healthy"] { border-left-color: var(--green); }
.sp-status[data-state="healthy"] .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); animation: algo-pulse 2.4s ease-in-out infinite; }
.sp-status[data-state="healthy"] strong { color: var(--green-ink); }
.sp-status[data-state="delayed"] { border-left-color: var(--amber); }
.sp-status[data-state="delayed"] .dot { background: var(--amber); }
.sp-status[data-state="delayed"] strong { color: var(--amber-ink); }
.sp-status[data-state="gap"] { border-left-color: var(--red); }
.sp-status[data-state="gap"] .dot { background: var(--red); }
.sp-status[data-state="gap"] strong { color: var(--red-ink); }
.sp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.spm { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: box-shadow .25s; }
.spm:hover { box-shadow: var(--shadow-hover); }
.spm-k { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); }
.spm-v { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sp-chart-wrap { margin-top: 16px; padding: 22px 24px 20px; }
.sp-chart-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; }
.uptime { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.uptime .dot { width: 12px; height: 12px; }
.uptime-legend { justify-content: flex-start; margin-top: 12px; }
.uptime-legend .dot { width: 8px; height: 8px; box-shadow: none; }
.sp-details { margin-top: 20px; }
.sp-details summary { cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); padding: 10px 0; }
.sp-details summary:hover, .sp-details summary:focus-visible { color: var(--green-ink); }
.chip { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.chip.ok { color: var(--green-ink); background: var(--green-dim); }
.chip.late { color: var(--amber-ink); background: var(--amber-dim); }
.chip.gap { color: var(--red-ink); background: var(--red-dim); }
.src-table td:nth-child(2) { white-space: nowrap; }
.src-table { min-width: 700px; }
.disclaimer { font-size: 13px; color: var(--text3); margin-top: 22px; line-height: 1.7; }

/* ── responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pq-detail, .viz-grid { grid-template-columns: minmax(0, 1fr); }
  .viz-grid > .viz-card { margin-top: 0; }
  .wh-controls { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wh-legend { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .facts dd, .facts dd .muted { text-align: left; }
  .donut-legend { width: 100%; }
}
@media (max-width: 480px) {
  .kpi-grid, .kpi-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .kpi, .viz-card, .pq-box { padding-left: 18px; padding-right: 18px; }
  .tl { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .tl::before { left: 70px; } .tl::after { left: 66px; }
  .table-wrap { padding: 4px 14px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .algo *, .algo *::before, .algo *::after, .card { animation: none !important; transition: none !important; }
  .bg-net { display: none; }
}

/* ── Traceed panel (hero, right) ───────────────────────────── */
.algo-hero-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.algo-hero-copy { min-width: 0; }
.algo-hero .algo-hero-copy h1 { font-size: clamp(34px, 4.3vw, 60px); }
.tr { padding: 22px 22px 20px; min-width: 0; align-self: start; }
.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tr-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--algo); }
.tr-badge { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber-dim); padding: 4px 10px; border-radius: 999px; }
.tr-title { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2vw, 25px); line-height: 1.2; letter-spacing: -.02em; color: var(--text); margin: 0 0 8px; }
.tr-sub { font-size: 13px; line-height: 1.6; color: var(--text2); margin: 0 0 16px; }
.tr-form { display: grid; gap: 8px; }
.tr-input { width: 100%; font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.tr-input::placeholder { color: var(--text3); letter-spacing: 0; }
.tr-input:focus { outline: none; border-color: var(--algo); box-shadow: 0 0 0 3px var(--algo-dim); }
.tr-input.valid { border-color: rgba(0,196,106,.7); }
.tr-input.invalid { border-color: rgba(239,68,68,.6); }
.tr-hint { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--text3); min-height: 1.3em; }
.tr-input.valid ~ .tr-hint { color: var(--green-ink); }
.tr-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-go, .tr-alt, .tr-btn { font: inherit; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; border-radius: 999px; padding: 10px 16px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, opacity .15s; }
.tr-go { background: var(--green); color: #04210f; border: 1px solid var(--green); }
.tr-go:hover:not(:disabled) { background: #00d977; box-shadow: 0 6px 18px var(--green-glow); transform: translateY(-1px); }
.tr-alt, .tr-btn { background: #fff; color: var(--text); border: 1px solid var(--line-strong); }
.tr-alt:hover:not(:disabled), .tr-btn:hover { border-color: var(--algo); color: var(--algo); }
.tr-go:disabled, .tr-alt:disabled { opacity: .5; cursor: not-allowed; }
.tr-go:focus-visible, .tr-alt:focus-visible, .tr-btn:focus-visible, .tr-addr:focus-visible { outline: 2px solid var(--algo); outline-offset: 2px; }

.tr-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.tr-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; color: var(--text3); position: relative; line-height: 1.3; }
.tr-steps li::before { content: ''; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--line-strong); transition: background .3s; }
.tr-steps li:first-child::before { display: none; }
.tr-steps i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1.5px solid var(--line-strong); font-size: 10px; font-weight: 700; position: relative; z-index: 1; transition: background .3s, border-color .3s, color .3s; }
.tr-steps li.done i { background: var(--green); border-color: var(--green); color: #04210f; }
.tr-steps li.done::before, .tr-steps li.on::before { background: var(--green); }
.tr-steps li.on i { border-color: var(--algo); color: var(--algo); box-shadow: 0 0 0 4px var(--algo-dim); animation: algo-pulse 1.6s ease-in-out infinite; }
.tr-steps li.on, .tr-steps li.done { color: var(--text2); }
.tr-steps li.err i { background: var(--red); border-color: var(--red); color: #fff; }
.tr-steps li.err { color: var(--red-ink); }

.tr-wire { margin-top: 14px; max-height: 128px; overflow: auto; font-family: var(--mono); font-size: 10.5px; line-height: 1.55; color: var(--text2); background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 0; }
.tr-wire:empty { display: none; }
.tr-wl { padding: 5px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; animation: algo-in .35s ease both; }
.tr-wl:last-child { border-bottom: 0; }
.tr-out:empty { display: none; }
.tr-out { margin-top: 16px; }
.tr-err { margin: 0; font-size: 13px; line-height: 1.6; color: var(--red-ink); background: var(--red-dim); border-radius: 10px; padding: 12px 14px; }

.tr-res { animation: algo-in .5s cubic-bezier(.2,.7,.2,1) both; }
.tr-top { display: flex; align-items: center; gap: 18px; }
.tr-gauge { width: 104px; height: 104px; flex: none; transform: rotate(-90deg); }
.tr-gauge .trk { fill: none; stroke: var(--line); stroke-width: 9; }
.tr-gauge .val { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1); stroke: var(--green); }
.tr-gauge.medium .val { stroke: var(--amber); } .tr-gauge.high .val { stroke: var(--red); }
.tr-gauge text { transform: rotate(90deg); transform-origin: 60px 60px; fill: var(--text); }
.tr-gauge .g-n { font-family: var(--mono); font-weight: 700; font-size: 30px; }
.tr-gauge .g-s { font-family: var(--mono); font-size: 10px; fill: var(--text3); }
.tr-lv { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-lvl { font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .12em; padding: 5px 12px; border-radius: 999px; align-self: flex-start; }
.tr-lvl.low { color: var(--green-ink); background: var(--green-dim); } .tr-lvl.medium { color: var(--amber-ink); background: var(--amber-dim); } .tr-lvl.high { color: var(--red-ink); background: var(--red-dim); }
.tr-addr { font-family: var(--mono); font-size: 12px; color: var(--text2); text-decoration: underline; text-underline-offset: 3px; }
.tr-addr:hover { color: var(--algo); }
.tr-sigs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.tr-sig { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, transform .2s; }
.tr-sig:hover { transform: translateX(2px); border-color: var(--line-strong); }
.tr-sig-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.tr-sig.on .tr-sig-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.tr-sig.na .tr-sig-dot { background: transparent; border: 1.5px solid var(--text3); box-shadow: none; }
.tr-sig.on { border-color: rgba(239,68,68,.35); }
.tr-sig-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tr-sig-h b { font-size: 13px; color: var(--text); }
.tr-sig-h em { font-style: normal; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: var(--green-ink); white-space: nowrap; }
.tr-sig.on .tr-sig-h em { color: var(--red-ink); } .tr-sig.na .tr-sig-h em { color: var(--text3); }
.tr-sig p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--text2); }
.tr-note { margin: 10px 0 0; font-size: 12px; color: var(--text3); }
.tr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.tr-stats > div { background: var(--bg3); border-radius: 10px; padding: 8px 10px; }
.tr-stats dt { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
.tr-stats dd { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--text); margin-top: 2px; }
.tr-prov { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.tr-prov summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); padding: 6px 0; }
.tr-prov dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.tr-prov dt { color: var(--text2); } .tr-prov dd { font-family: var(--mono); color: var(--text); text-align: right; }
.tr-prov dd a { color: var(--algo); text-decoration: underline; text-underline-offset: 3px; }
.tr-hash { grid-template-columns: minmax(0, 1fr) !important; }
.tr-hash dd { text-align: left !important; } .tr-hash code { display: block; font-size: 10.5px; line-height: 1.5; overflow-wrap: anywhere; background: var(--bg3); padding: 7px 9px; border-radius: 8px; }
.tr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tr-btn { padding: 7px 12px; font-size: 10.5px; }
.tr-disc { margin: 10px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text3); }

@media (max-width: 1000px) {
  .algo-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .algo-hero .algo-hero-copy h1 { font-size: clamp(34px, 7vw, 54px); }
}
@media (max-width: 480px) {
  .tr { padding: 18px 16px 16px; }
  .tr-steps li { font-size: 8.5px; }
  .tr-top { gap: 12px; } .tr-gauge { width: 88px; height: 88px; }
}
