:root {
  color-scheme: dark;
  --bg: #091619;
  --panel: #102326;
  --panel-soft: #153034;
  --text: #f1f6f3;
  --muted: #9ab4ad;
  --accent: #68d6bd;
  --amber: #e6b86b;
  --danger: #f47772;
  --ok: #68d6bd;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "DM Sans", sans-serif; background: radial-gradient(circle at 8% 0%, rgba(104,214,189,.13), transparent 28%), radial-gradient(circle at 95% 18%, rgba(230,184,107,.09), transparent 25%), linear-gradient(140deg, #071416, #0b2022 55%, #0a171c); color: var(--text); min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"); }
.app-shell { width: min(1080px, 100%); margin: 0 auto; padding: 18px; position: relative; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 28px; border-radius: 24px; background: linear-gradient(115deg, rgba(20,56,58,.95), rgba(15,35,38,.92) 55%, rgba(39,49,42,.92)); border: 1px solid rgba(154,180,173,.15); box-shadow: 0 20px 70px rgba(0,0,0,.25); animation: hero-in .55s ease-out both; }
.eyebrow { color: var(--accent); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; }
h1, h2, h3 { font-family: "Syne", sans-serif; margin: 0; }
h1 { font-size: clamp(26px, 5vw, 44px); letter-spacing: -.05em; }
h2 { margin-bottom: 14px; }
.settings-card, .panel, .card { background: var(--panel); border: 1px solid rgba(154,180,173,.16); border-radius: 20px; }
.settings-card { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; margin: 16px 0; padding: 14px; align-items: end; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input { width: 100%; border: 1px solid rgba(148,163,184,.22); background: #0f172a; color: var(--text); border-radius: 12px; padding: 12px; outline: none; }
button { border: 0; border-radius: 14px; padding: 12px 14px; cursor: pointer; color: #04111f; background: var(--accent); font-weight: 700; }
button.secondary { background: rgba(255,255,255,.12); color: var(--text); }
.tabs { display: flex; overflow-x: auto; gap: 8px; margin: 16px 0; padding-bottom: 4px; }
.tab { background: var(--panel-soft); color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--accent); color: #04111f; }
.panel { display: none; padding: 18px; margin-bottom: 18px; }
.panel.active { display: block; animation: panel-in .28s ease-out both; }
.grid { display: grid; gap: 12px; }
.cards { grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.card { padding: 16px; }
.card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card strong { font-size: 28px; }
.list { display: grid; gap: 10px; }
.list-item { background: var(--panel-soft); border-radius: 16px; padding: 12px; border: 1px solid rgba(148,163,184,.12); overflow-wrap: anywhere; }
.empty, .muted { color: var(--muted); }
.status { padding: 12px; border-radius: 14px; margin-bottom: 14px; background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.25); }
.status.error { color: var(--danger); background: rgba(251,113,133,.10); border-color: rgba(251,113,133,.25); }
.hidden { display: none; }
#cy { width: 100%; height: 520px; background: #071416; border-radius: 18px; border: 1px solid rgba(154,180,173,.16); margin-top: 14px; }
code { color: var(--accent); }
@media (max-width: 720px) { .settings-card, .cards { grid-template-columns: 1fr; } .hero { align-items: flex-start; flex-direction: column; } }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.form-grid + .list, .form-grid + .list-item { margin-top: 12px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.graph-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.graph-stats, .graph-actions, .legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; gap: 4px; align-items: center; padding: 8px 10px; border-radius: 999px; background: rgba(56,189,248,.10); border: 1px solid rgba(56,189,248,.22); color: var(--muted); font-size: 12px; }
.chip b { color: var(--text); }
.legend { margin: 12px 0 4px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: rgba(255,255,255,.05); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.root { background: #34d399; box-shadow: 0 0 14px rgba(52,211,153,.8); }
.dot.address, .dot.low { background: #68d6bd; }
.dot.med { background: #e6b86b; }
.dot.high { background: #f47772; }
.dot.tx { background: #f59e0b; border-radius: 2px; transform: rotate(45deg); }
.line { width: 18px; height: 2px; display: inline-block; background: linear-gradient(90deg, #38bdf8, #f59e0b); }
#cy { background: radial-gradient(circle at 20% 20%, rgba(104,214,189,.12), transparent 32%), radial-gradient(circle at 80% 10%, rgba(230,184,107,.10), transparent 30%), #071416; min-height: 620px; }
@media (max-width: 720px) { .graph-topline { align-items: stretch; } .graph-actions button { flex: 1; } }
.job-status { padding: 3px 8px; border-radius: 999px; font-size: 12px; background: rgba(148,163,184,.16); color: var(--muted); }
.job-status.running { background: rgba(56,189,248,.16); color: var(--accent); }
.job-status.done,
.job-status.completed { background: rgba(52,211,153,.16); color: var(--ok); }
.job-status.failed { background: rgba(251,113,133,.16); color: var(--danger); }
.error-text { color: var(--danger); }
button.danger { background: rgba(251,113,133,.14); color: #fecdd3; border: 1px solid rgba(251,113,133,.28); }
button.small { padding: 8px 10px; border-radius: 10px; margin-top: 8px; font-size: 12px; }


/* ---- AML report view (WP #89) ---- */
:root{ --rv-low:#37b24d; --rv-med:#e0982f; --rv-high:#f0666b;
  --rv-low-s:rgba(55,178,77,.14); --rv-med-s:rgba(224,152,47,.16); --rv-high-s:rgba(240,102,107,.16); }
#reportView{ display:none; margin-top:14px; }
.rv{ background:var(--panel); border:1px solid rgba(148,163,184,.16); border-radius:20px; overflow:hidden; }
.rv-head{ display:flex; justify-content:space-between; gap:16px; padding:18px 18px 16px;
  border-bottom:1px solid rgba(148,163,184,.14);
  background:radial-gradient(120% 140% at 100% 0%, rgba(56,189,248,.10), transparent 55%); }
.rv-kind{ font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.rv-addr{ font-family:ui-monospace,Menlo,Consolas,monospace; font-size:15px; font-weight:600; word-break:break-all; margin:6px 0 8px; }
.rv-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.rv-chip{ font-size:11px; font-weight:600; padding:3px 9px; border-radius:999px; background:var(--panel-soft); color:var(--muted); border:1px solid rgba(148,163,184,.18); }
.rv-badge{ flex:0 0 auto; width:130px; border-radius:14px; padding:12px; text-align:center; border:1px solid var(--rv-high); background:var(--rv-high-s); }
.rv-badge.med{ border-color:var(--rv-med); background:var(--rv-med-s); } .rv-badge.low{ border-color:var(--rv-low); background:var(--rv-low-s); }
.rv-badge .lab{ font-size:10px; letter-spacing:.10em; text-transform:uppercase; font-weight:800; }
.rv-badge .score{ font-size:38px; font-weight:800; line-height:1; margin:3px 0; }
.rv-badge .score small{ font-size:15px; color:var(--muted); }
.rv-badge .tier{ font-size:11px; font-weight:800; }
.rv-badge .scale{ margin-top:9px; height:6px; border-radius:999px; overflow:hidden; display:flex; }
.rv-badge .scale i{ display:block; height:100%; }
.rv-sec{ padding:16px 18px; border-bottom:1px solid rgba(148,163,184,.10); }
.rv-h{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:12px; }
.rv-h b{ font-size:13px; } .rv-h span{ font-size:11px; color:var(--muted); }
.rv-note{ margin:10px 0 0; font-size:12px; line-height:1.45; color:var(--muted); padding:10px 12px; border-radius:12px; background:rgba(154,180,173,.08); border:1px solid rgba(154,180,173,.16); }
.rv-note-soft{ color:#d4b56a; border-color:rgba(212,181,106,.28); background:rgba(212,181,106,.08); }
.rv-tiles{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.rv-tile{ background:var(--panel-soft); border:1px solid rgba(148,163,184,.12); border-radius:14px; padding:12px; }
.rv-tile .k{ font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.rv-tile .v{ font-size:20px; font-weight:800; margin-top:5px; } .rv-tile .v.flag{ color:var(--rv-high); }
.rv-compo{ height:30px; border-radius:8px; overflow:hidden; display:flex; border:1px solid rgba(148,163,184,.14); }
.rv-compo i{ display:flex; align-items:center; justify-content:center; color:#08111f; font-size:11px; font-weight:800; }
.rv-legend{ display:flex; flex-wrap:wrap; gap:14px; margin-top:12px; font-size:12px; color:var(--muted); }
.rv-legend div{ display:flex; align-items:center; gap:7px; } .rv-legend .sw{ width:10px; height:10px; border-radius:3px; }
.rv-bar{ display:grid; grid-template-columns:112px 1fr 52px; align-items:center; gap:10px; margin-bottom:9px; }
.rv-bar .nm{ font-size:12px; color:var(--muted); }
.rv-track{ height:12px; background:var(--panel-soft); border-radius:5px; overflow:hidden; } .rv-track i{ display:block; height:100%; border-radius:5px; }
.rv-bar .pc{ text-align:right; font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; }
.rv-row{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid rgba(148,163,184,.10); }
.rv-row:last-child{ border-bottom:0; } .rv-row .en{ font-weight:700; color:var(--accent); flex:1; word-break:break-word; }
.rv-rc{ font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.rv-rc.high{ color:var(--rv-high); background:var(--rv-high-s); } .rv-rc.med{ color:var(--rv-med); background:var(--rv-med-s); } .rv-rc.low{ color:var(--rv-low); background:var(--rv-low-s); }
.rv-row .am{ font-size:12px; font-variant-numeric:tabular-nums; }
.rv-find{ display:flex; gap:12px; background:var(--panel-soft); border:1px solid rgba(148,163,184,.12); border-radius:14px; overflow:hidden; margin-bottom:10px; }
.rv-find .rail{ width:4px; flex:0 0 auto; } .rv-find .bd{ padding:11px 13px; }
.rv-find .tp{ display:flex; gap:10px; align-items:center; margin-bottom:4px; } .rv-find .tp b{ font-size:13px; } .rv-find .tp .am{ margin-left:auto; font-weight:800; font-size:13px; }
.rv-find p{ margin:2px 0 0; font-size:12px; color:var(--muted); }
.rv-sankey{ display:block; margin-top:4px; color:var(--muted); overflow:visible; }
.rv-togs{ display:flex; flex-wrap:wrap; gap:10px; margin:0 0 12px; justify-content:space-between; }
.rv-tog-group{ display:inline-flex; gap:4px; padding:3px; border-radius:10px; background:var(--panel-soft); border:1px solid rgba(148,163,184,.14); }
.rv-tog{
  border:0; background:transparent; color:var(--muted); font-size:11px; font-weight:700;
  padding:6px 10px; border-radius:8px; cursor:pointer;
}
.rv-tog.active{ background:rgba(104,214,189,.18); color:var(--text); }
.rv-tile .v{ font-size:15px; line-height:1.25; word-break:break-word; }
.rv-narr{ border-left:3px solid var(--rv-low); padding:8px 0 8px 12px; margin-bottom:10px; }
.rv-narr.high{ border-left-color:var(--rv-high); }
.rv-narr.med{ border-left-color:var(--rv-med); }
.rv-narr p{ margin:0; font-size:12px; line-height:1.45; color:var(--text); }
.rv-narr .note{ margin-top:4px; color:var(--muted); font-size:11px; }
.rv-txid{
  display:inline-block; margin-top:6px; padding:4px 8px; border-radius:8px;
  border:1px solid rgba(148,163,184,.18); background:var(--panel-soft);
  color:var(--accent); font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:10px; word-break:break-all; cursor:pointer; text-align:left;
}
.rv-txid.copied{ outline:1px solid var(--accent); }
.rv-foot{ display:flex; gap:14px; align-items:center; padding:16px 18px; }
.rv-foot .qr{ width:78px; height:78px; background:#fff; border-radius:10px; padding:6px; flex:0 0 auto; }
.rv-foot .qr svg{ width:100%; height:100%; display:block; }
.rv-foot .meta{ font-size:11px; color:var(--muted); } .rv-foot .meta a{ color:var(--accent); font-weight:700; word-break:break-all; }

/* Product polish */
.header-actions, .language-switcher { display:flex; gap:8px; align-items:center; }
.language-switcher button { padding:7px 8px; border-radius:9px; font-size:11px; }
.language-switcher button.active { background:var(--accent); color:#071416; }
.telegram-gate { min-height: min(62vh, 560px); margin-top:16px; padding:48px 30px; display:grid; place-items:center; text-align:center; border:1px solid rgba(104,214,189,.3); border-radius:24px; background:radial-gradient(circle at 50% 0%, rgba(104,214,189,.16), transparent 48%), rgba(8,25,27,.94); }
.telegram-gate > div { max-width:440px; }
.telegram-gate h2 { font-size:clamp(30px,7vw,52px); letter-spacing:-.06em; }
.telegram-gate p:last-child { color:var(--muted); line-height:1.6; }
.unauthorized .tabs, .unauthorized .panel { display:none !important; }
.unauthorized #status { display:none; }
.digest-card { margin:4px 0 28px; padding:18px 0 20px; border-top:1px solid rgba(154,180,173,.2); border-bottom:1px solid rgba(154,180,173,.2); }
.digest-card.empty { display:none; }
.digest-heading { display:grid; gap:5px; max-width:720px; }
.digest-heading strong { font-family:"Syne",sans-serif; font-size:clamp(18px,3vw,25px); }
.digest-metrics { display:flex; gap:18px; flex-wrap:wrap; margin-top:15px; color:var(--muted); }
.digest-metrics span { padding-right:18px; border-right:1px solid rgba(154,180,173,.2); }
.digest-metrics b { color:var(--text); font-size:18px; margin-right:4px; }
.digest-moves { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:15px; }
.digest-moves div { border-left:2px solid var(--amber); padding:4px 9px; display:grid; gap:2px; min-width:0; }
.digest-moves b, .digest-moves span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.digest-moves span { color:var(--muted); font-size:12px; }
.investigator-layout { display:grid; grid-template-columns:minmax(260px,1fr) minmax(280px,1.2fr); gap:16px; margin-top:14px; }
.chat-pane { display:flex; flex-direction:column; min-height:420px; border:1px solid rgba(154,180,173,.22); border-radius:18px; overflow:hidden; background:rgba(8,25,27,.55); }
.chat-messages { flex:1; overflow:auto; padding:14px; display:grid; gap:10px; align-content:start; }
.chat-bubble { max-width:92%; padding:10px 12px; border-radius:14px; line-height:1.45; font-size:14px; }
.chat-bubble.user { justify-self:end; background:rgba(104,214,189,.18); border:1px solid rgba(104,214,189,.28); }
.chat-bubble.assistant { justify-self:start; background:rgba(255,255,255,.04); border:1px solid rgba(154,180,173,.18); }
.chat-compose { display:flex; gap:8px; padding:10px; border-top:1px solid rgba(154,180,173,.18); }
.chat-compose input { flex:1; }
.story-pane { border:1px solid rgba(154,180,173,.22); border-radius:18px; overflow:hidden; background:linear-gradient(180deg, rgba(20,40,38,.9), rgba(10,22,24,.95)); }
#flowCanvas { width:100%; height:auto; display:block; background:radial-gradient(circle at 20% 0%, rgba(104,214,189,.12), transparent 45%), #0d1a1b; }
.flow-cy {
  width:100%; height:440px; border-radius:16px; border:1px solid rgba(154,180,173,.16);
  background:
    radial-gradient(circle at 18% 0%, rgba(104,214,189,.18), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(126,182,255,.12), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(230,184,107,.08), transparent 45%),
    #0d1a1b;
  position:relative; overflow:hidden;
  animation: flowAmbient 12s ease-in-out infinite alternate;
}
@keyframes flowAmbient {
  from { filter: saturate(1); }
  to { filter: saturate(1.15); }
}
.flow-cy::after {
  content:""; position:absolute; inset:-20%; pointer-events:none; opacity:.35;
  background: conic-gradient(from 120deg at 50% 40%, transparent 0 60%, rgba(104,214,189,.07) 72%, transparent 88%);
  animation: flowSweep 18s linear infinite;
}
@keyframes flowSweep { to { transform: rotate(360deg); } }
.flow-caption { padding:12px 14px; min-height:3.2em; border-top:1px solid rgba(154,180,173,.16); }
.story-pane { position:relative; }
.flow-tooltip {
  position:absolute; z-index:6; max-width:240px; padding:8px 10px; border-radius:10px;
  background:rgba(6,16,18,.94); border:1px solid rgba(154,180,173,.3); color:#e8f2ef;
  font-size:.78rem; line-height:1.35; pointer-events:none; box-shadow:0 10px 28px rgba(0,0,0,.35);
}
.flow-tooltip.hidden { display:none; }
.flow-node-panel {
  position:absolute; right:12px; top:12px; z-index:5; width:min(300px, calc(100% - 24px));
  padding:12px 14px; border-radius:14px; border:1px solid rgba(154,180,173,.28);
  background:rgba(8,20,22,.96); box-shadow:0 12px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}
.flow-node-panel.hidden { display:none; }
.flow-node-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.flow-panel-addr { display:block; font-size:.72rem; word-break:break-all; color:#9ad0c2; margin-bottom:8px; }
.flow-panel-meta { font-size:.82rem; margin-bottom:10px; line-height:1.4; }
.flow-panel-actions { display:grid; gap:8px; }
.flow-panel-actions label { display:grid; gap:4px; font-size:.78rem; color:#9ad0c2; }
.flow-panel-actions input, .flow-panel-actions select {
  width:100%; border-radius:10px; border:1px solid rgba(154,180,173,.22);
  background:#0d1a1b; color:#e8f2ef; padding:8px 10px;
}
button.ghost { min-width:auto; padding:2px 10px; font-size:1.1rem; line-height:1; }
.flow-controls {
  display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center;
  padding:10px 12px; border-top:1px solid rgba(154,180,173,.14);
  background:rgba(6,14,16,.55);
}
.flow-dust, .flow-timeline, .flow-speed { display:flex; align-items:center; gap:8px; font-size:.82rem; color:#9ad0c2; }
.flow-dust input[type="number"] {
  width:88px; border-radius:8px; border:1px solid rgba(154,180,173,.22);
  background:#0d1a1b; color:#e8f2ef; padding:4px 6px;
}
.flow-speed select {
  border-radius:8px; border:1px solid rgba(154,180,173,.22);
  background:#0d1a1b; color:#e8f2ef; padding:4px 8px;
}
.flow-timeline input[type="range"] { width:min(220px, 40vw); }
.flow-legend {
  display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center;
  padding:8px 12px; border-top:1px solid rgba(154,180,173,.12);
  font-size:.74rem; color:#9ad0c2;
}
.flow-legend span { display:inline-flex; align-items:center; gap:6px; }
.flow-legend .lg {
  width:12px; height:12px; border-radius:3px; border:2px solid transparent; display:inline-block;
}
.flow-legend .lg.seed { background:#0f6b4c; border-color:#c8ffe8; box-shadow:0 0 8px rgba(158,240,210,.45); }
.flow-legend .lg.pivot { background:#35507a; border-color:#b7d4ff; transform:rotate(45deg); width:10px; height:10px; }
.flow-legend .lg.transit { background:#243044; border-color:#8aa4c8; border-style:dashed; }
.flow-legend .lg.partial { background:#6a4210; border-color:#ffd24a; border-style:dashed; }
.flow-legend .lg.sink { background:#6a4210; border-color:#ffd24a; }
.flow-legend .lg.pure { background:#0d4a52; border-color:#3de0d0; }
.flow-legend .lg.mixer { background:#5a2810; border-color:#ff7a40; }
.flow-legend .lg.exchange { background:#152a4a; border-color:#7eb6ff; }
.flow-legend .lg.warn {
  width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent;
  border-bottom:11px solid #ffd400; border-radius:0; background:transparent;
}
.flow-legend .lg.sink { background:#6a4210; border-color:#ffd24a; box-shadow:0 0 8px rgba(255,210,74,.4); }
.flow-legend .lg.dest { background:#2a1848; border-color:#c9a0ff; }
.flow-legend .lg.partial { background:#3a2a10; border-color:#e0a040; border-style:dashed; }
.flow-legend .lg.sink { background:#6a4210; border-color:#ffd24a; box-shadow:0 0 8px rgba(255,210,74,.4); }
.flow-legend .lg.pure { background:#0d4a52; border-color:#3de0d0; box-shadow:0 0 12px rgba(61,224,208,.55); }
.flow-legend .lg.path { width:18px; height:0; border:none; border-top:3px solid #ff7eb6; border-radius:0; }
.flow-legend .lg.edge { width:18px; height:0; border:none; border-top:3px solid #68d6bd; border-radius:0; }
.flow-toast {
  position:absolute; left:50%; bottom:18px; transform:translateX(-50%);
  z-index:8; padding:8px 14px; border-radius:999px; font-size:.8rem;
  background:rgba(15,107,76,.95); color:#e8fff6; border:1px solid rgba(158,240,210,.4);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.flow-toast.on { opacity:1; }
.flow-panel-events { margin:8px 0; font-size:.75rem; color:#9ad0c2; max-height:140px; overflow:auto; line-height:1.35; }
.flow-panel-events div { padding:2px 0; border-bottom:1px solid rgba(154,180,173,.08); }
.flow-visible-stats { padding:0 12px 8px; font-size:.78rem; }
#flowAddMore.hidden { display:none !important; }
#flowPause.hidden, #flowStop.hidden { display:none !important; }
.flow-cy-wow.playing::before {
  content:"▶ story"; position:absolute; left:12px; top:12px; z-index:4;
  padding:4px 8px; border-radius:999px; font-size:.72rem; letter-spacing:.04em;
  background:rgba(15,107,76,.85); color:#9ef0d2; border:1px solid rgba(158,240,210,.35);
  animation: storyBadge 1.2s ease-in-out infinite alternate;
}
@keyframes storyBadge { from { opacity:.7 } to { opacity:1 } }
.flow-cy node-pulse-hint { display:none; }
#flowMeta { padding:0 14px 14px; font-size:12px; }
.flow-edge { fill:none; stroke:#68d6bd; stroke-width:2.4; stroke-linecap:round; stroke-dasharray:480; stroke-dashoffset:480; transition:stroke-dashoffset .85s ease; }
.flow-edge.on { stroke-dashoffset:0; }
.flow-node rect { fill:#122526; stroke:#9ab4ad; stroke-width:1.2; }
.flow-node.root rect { fill:rgba(104,214,189,.18); stroke:#68d6bd; }
.flow-node.flagged rect { fill:rgba(232,168,92,.16); stroke:var(--amber); }
.flow-node text, .flow-edge-label { fill:#e8f2ef; font-size:12px; font-family:"DM Sans",sans-serif; }
.flow-edge-label { opacity:0; transition:opacity .35s ease .3s; }
.flow-edge-label.on { opacity:1; }
@media (max-width:900px) {
  .investigator-layout { grid-template-columns:1fr; }
}
.analysis-hero { margin-top:12px; padding:20px; border:1px solid rgba(104,214,189,.3); border-radius:18px; background:linear-gradient(130deg, rgba(24,62,60,.82), rgba(18,37,39,.9)); animation:score-in .42s cubic-bezier(.2,.9,.3,1) both; }
.analysis-hero-top { display:flex; justify-content:space-between; align-items:start; gap:16px; }
.analysis-hero h3 { margin-top:3px; overflow-wrap:anywhere; }
.risk-score { min-width:108px; padding:9px 12px; text-align:right; border-left:2px solid var(--amber); }
.risk-score span, .risk-score small { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.risk-score b { font-family:"Syne",sans-serif; font-size:38px; line-height:1; color:var(--amber); }
.primary-reason { font-size:16px; margin:15px 0 12px; }
.hero-actions, .case-downloads { display:flex; gap:9px; flex-wrap:wrap; align-items:center; }
.analysis-details { border-top:1px solid rgba(154,180,173,.16); margin-top:15px; padding-top:13px; }
.form-grid label.full-width { grid-column:1 / -1; }
.form-grid textarea { width:100%; min-height:88px; resize:vertical; font:inherit; }
.mini-table { width:100%; border-collapse:collapse; font-size:12px; }
.mini-table th, .mini-table td { text-align:left; padding:6px 8px; border-bottom:1px solid rgba(154,180,173,.16); vertical-align:top; }
.mini-table code { font-size:11px; word-break:break-all; }
.case-downloads { margin:0 0 14px; color:var(--muted); }
.case-downloads a { color:var(--accent); font-weight:700; }
@keyframes hero-in { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
@keyframes panel-in { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
@keyframes score-in { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:scale(1); } }
@media (max-width:720px) {
  .hero { padding:21px; }
  .header-actions { width:100%; justify-content:space-between; }
  .digest-moves { grid-template-columns:1fr; }
  .analysis-hero-top { align-items:stretch; flex-direction:column; }
  .risk-score { border-left:0; border-top:2px solid var(--amber); text-align:left; }
  .rv-head { flex-direction:column; } .rv-badge { width:100%; }
}
