: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; }
/* Kill OS/WebKit blue spinner arrows that clash with the mint dark UI */
input, select, textarea, button { accent-color: var(--accent); color-scheme: dark; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7dcfb8 50%),
    linear-gradient(135deg, #7dcfb8 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px !important;
}
button {
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 6px 16px rgba(0,0,0,.18);
  border: 1px solid rgba(154,180,173,.22);
}
button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(1px) scale(.98); filter: brightness(.96); box-shadow: 0 1px 0 rgba(0,0,0,.25) inset; }
button:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }
button.copied { border-color: rgba(104,214,189,.7) !important; color: #9ef0d2 !important; }
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(1440px, 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-color: #0f172a; color: var(--text); border-radius: 12px; padding: 12px; outline: none; }
select { width: 100%; border: 1px solid rgba(148,163,184,.22); background-color: #0f172a; color: var(--text); border-radius: 12px; padding: 12px; outline: none; }
button { border-radius: 14px; padding: 12px 14px; cursor: pointer; color: #04111f; background: var(--accent); font-weight: 700; border-color: rgba(104,214,189,.35); }
button.secondary { background: rgba(255,255,255,.10); color: var(--text); border-color: rgba(154,180,173,.28); }
button.secondary:hover:not(:disabled) { background: rgba(104,214,189,.14); border-color: rgba(104,214,189,.45); }
.tabs {
  display:flex; overflow-x:auto; gap:8px; margin:16px 0; padding:6px;
  position:sticky; top:0; z-index:30; border-radius:16px;
  background:rgba(7,20,22,.88); border:1px solid rgba(154,180,173,.12);
  backdrop-filter:blur(14px); box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.tab-group {
  display:flex; flex:0 0 auto; gap:5px; align-items:flex-end; padding:18px 5px 5px;
  position:relative; border-radius:12px; background:rgba(255,255,255,.025);
  border:1px solid rgba(154,180,173,.10);
}
.tab-group + .tab-group { margin-left:2px; }
.tab-group-title {
  position:absolute; top:4px; left:9px; color:#718d86; font-size:8px;
  line-height:1; text-transform:uppercase; letter-spacing:.12em; font-weight:700;
}
.tab-group-system:has(.tab:not(.hidden)) { display:flex; }
.tab-group-system:not(:has(.tab:not(.hidden))) { display:none; }
.tab { background: var(--panel-soft); color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--accent); color: #04111f; box-shadow: 0 0 0 1px rgba(104,214,189,.35); }
.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: 0; }
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; }
.monitoring-plan {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px;
  margin:0 0 14px; padding:14px; border-radius:16px;
  border:1px solid rgba(104,214,189,.26);
  background:linear-gradient(135deg,rgba(104,214,189,.10),rgba(8,25,27,.72));
}
.monitoring-plan > div { display:grid; gap:4px; min-width:0; }
.monitoring-plan span { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.monitoring-plan strong { font-family:"Syne",sans-serif; overflow-wrap:anywhere; }
.monitoring-plan p { grid-column:1/-1; margin:2px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.monitoring-plan.empty { border-style:dashed; opacity:.82; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .monitoring-plan { grid-template-columns:1fr 1fr; } .monitoring-plan > div:last-of-type { grid-column:1/-1; } }
.aml-block {
  margin: 0 0 14px; padding: 12px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(154,180,173,.12);
}
.aml-block-title {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #7dcfb8; margin: 0 0 8px;
}
.aml-block .gx-toolbar { margin-bottom: 8px; }
.aml-block .gx-toolbar:last-child { margin-bottom: 0; }
.aml-block textarea {
  width: 100%; min-height: 72px; border-radius: 10px; border: 1px solid rgba(154,180,173,.22);
  background-color: #0b191a; color: var(--text); padding: 8px 10px; resize: vertical;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.hero-actions button { min-height: 40px; }
.analysis-hero {
  margin-top: 12px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(12,28,30,.96), rgba(7,20,22,.98));
  border: 1px solid rgba(154,180,173,.16);
}
.brief-body { margin-top: 10px; line-height: 1.45; font-size: 13px; color: #e7f4ef; overflow-wrap: anywhere; }
.brief-body h4 { margin: 12px 0 6px; font-size: 14px; color: #9ef0d2; font-family: "Syne", sans-serif; }
.brief-body .brief-li { margin: 4px 0; }
.language-switcher button.active {
  background: rgba(104,214,189,.22) !important; color: #9ef0d2 !important;
  border-color: rgba(104,214,189,.55) !important;
}
.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; }
.graph-controls { margin-bottom: 8px; }
.graph-panel { position: relative; }
.gx-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; flex-wrap:wrap; margin-bottom:14px; }
.gx-lead { margin:4px 0 0; color:var(--muted); font-size:13px; max-width:42ch; }
.gx-stats { justify-content:flex-end; }
.gx-subject {
  margin:0 0 14px;
  padding:16px 18px;
  border-radius:18px;
  border:1px solid rgba(104,214,189,.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(104,214,189,.18), transparent 42%),
    linear-gradient(135deg, rgba(12,36,34,.95), rgba(7,20,22,.98));
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
.gx-subject.empty { opacity:.72; border-style:dashed; }
.gx-subject-kicker {
  font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:#7dcfb8; margin-bottom:8px;
}
.gx-subject-main { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; flex-wrap:wrap; }
.gx-subject-title { font-size:1.25rem; font-weight:700; letter-spacing:-.02em; margin-bottom:6px; }
.gx-subject-addr {
  display:inline-block; max-width:100%; color:#9ad0c2; font-size:12px;
  overflow-wrap:anywhere; word-break:break-all; cursor:pointer;
}
.gx-subject-addr:hover { color:#c6fff0; text-decoration:underline; }
.gx-badges { display:flex; flex-wrap:wrap; gap:6px; }
.gx-badge {
  padding:5px 9px; border-radius:999px; font-size:11px; font-weight:600;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); color:#d7ebe4;
}
.gx-badge.band-high { background:rgba(244,119,114,.16); border-color:rgba(244,119,114,.4); color:#ffd0cd; }
.gx-badge.band-med { background:rgba(230,184,107,.16); border-color:rgba(230,184,107,.4); color:#fae1b5; }
.gx-badge.band-low { background:rgba(104,214,189,.14); border-color:rgba(104,214,189,.35); color:#b8f0e0; }
.gx-badge.cat-exchange { background:rgba(94,176,255,.14); border-color:rgba(94,176,255,.4); color:#bfdbfe; }
.gx-toolbar {
  display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin:0 0 8px;
  padding:12px; border-radius:16px; background:rgba(255,255,255,.03); border:1px solid rgba(154,180,173,.12);
}
.gx-toolbar.gx-actions { align-items:center; padding:10px 12px; }
.action-cluster {
  display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:18px 7px 7px;
  position:relative; border-radius:12px; border:1px solid rgba(154,180,173,.13);
  background:rgba(7,20,22,.48);
}
.action-cluster > span:first-child {
  position:absolute; top:5px; left:9px; color:#718d86; font-size:8px;
  line-height:1; text-transform:uppercase; letter-spacing:.11em; font-weight:700;
}
.action-cluster button { min-height:34px !important; padding:7px 10px; font-size:11px; }
.action-cluster label { min-width:auto !important; }
.gx-toolbar label { display:grid; gap:4px; font-size:11px; color:var(--muted); min-width:72px; }
.gx-toolbar label.gx-addr { flex:1 1 220px; min-width:min(100%, 220px); }
.gx-toolbar input, .gx-toolbar select,
.gx-advanced input, .gx-advanced select {
  min-height:38px; border-radius:10px; border:1px solid rgba(154,180,173,.22);
  background-color:#0b191a; color:var(--text); padding:8px 10px;
}
.gx-toolbar button { min-height:38px; margin:0; }
.gx-filters-btn[aria-expanded="true"] {
  border-color: rgba(104,214,189,.55) !important;
  color: #9ef0d2 !important;
}
.gx-wow {
  border-color: rgba(255,126,182,.45) !important;
  color: #ffd0e8 !important;
  background: rgba(255,126,182,.08) !important;
}
.gx-toolbar.gx-findbar { align-items: end; padding: 8px 12px; }
.gx-recent {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 8px; padding: 0 2px;
}
.gx-recent.hidden { display: none !important; }
.gx-recent-label {
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.gx-recent-chip {
  padding: 5px 9px; border-radius: 999px; font-size: 11px; cursor: pointer;
  border: 1px solid rgba(154,180,173,.25); background: rgba(255,255,255,.04); color: #cfe7df;
}
.gx-recent-chip:hover { border-color: rgba(104,214,189,.5); color: #9ef0d2; }
.gx-primary[disabled], #buildGraph[disabled] {
  opacity: .72; cursor: wait; filter: saturate(.7);
}
.gx-building {
  position: relative;
  overflow: hidden;
}
.gx-building::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  animation: gx-shimmer 1.2s linear infinite;
}
@keyframes gx-shimmer {
  from { transform: translateX(-60%); }
  to { transform: translateX(60%); }
}
#cy.gx-ready-flash {
  box-shadow: 0 0 0 2px rgba(104,214,189,.55), 0 0 40px rgba(104,214,189,.25);
  transition: box-shadow .4s ease;
}
.gx-find { flex: 1 1 220px; min-width: min(100%, 200px); }
.gx-top-flows {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(94,176,255,.06); border: 1px solid rgba(94,176,255,.22);
}
.gx-top-flows.hidden { display: none !important; }
.gx-top-flows-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #8eb8d8; margin-right: 4px;
}
.gx-flow-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
  font-size: 12px; border: 1px solid rgba(94,176,255,.35);
  background: rgba(7,20,22,.85); color: #d7ebe4;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.gx-flow-chip:hover, .gx-flow-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(104,214,189,.55);
  background: rgba(104,214,189,.12);
  outline: none;
}
.gx-flow-chip .dir { color: #7dcfb8; font-weight: 700; font-size: 11px; }
.gx-flow-chip .amt { color: #9ad0c2; font-variant-numeric: tabular-nums; }
.gx-flow-chip.band-high { border-color: rgba(244,119,114,.45); }
.gx-flow-chip.band-med { border-color: rgba(230,184,107,.4); }
button.gx-active {
  border-color: rgba(104,214,189,.65) !important;
  color: #9ef0d2 !important;
  box-shadow: 0 0 0 1px rgba(104,214,189,.25);
}
.gx-primary {
  background: linear-gradient(135deg, #1f8f74, #68d6bd) !important;
  color:#041312 !important; border:none !important; font-weight:700;
  box-shadow: 0 10px 24px rgba(104,214,189,.25);
}
.gx-advanced {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px;
  margin:0 0 12px; padding:12px; border-radius:14px; background:rgba(0,0,0,.18);
  border:1px solid rgba(104,214,189,.18);
}
.gx-advanced.hidden { display:none !important; }
.gx-advanced label { display:grid; gap:4px; font-size:11px; color:var(--muted); }
.gx-advanced-hint { grid-column:1 / -1; margin:0 0 4px; font-size:12px; color:var(--muted); }
.gx-path-story {
  display:flex; flex-wrap:wrap; gap:8px; align-items:center;
  margin:0 0 10px; padding:12px 14px; border-radius:14px;
  background:rgba(255,126,182,.08); border:1px solid rgba(255,126,182,.28);
}
.gx-path-story.hidden { display:none !important; }
.gx-path-step {
  display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px;
  background:rgba(7,20,22,.85); border:1px solid rgba(255,126,182,.35); font-size:12px;
}
.gx-path-step b { color:#ffd0e8; }
.gx-path-arrow { color:#ff7eb6; opacity:.8; }
.gx-meta { margin:0 0 8px; font-size:12px; }
.gx-long-hint {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; font-size: 12px;
  background: rgba(230,184,107,.10); border: 1px solid rgba(230,184,107,.35); color: #fae1b5;
}
.gx-long-hint.hidden { display: none !important; }
.gx-exposure {
  display: grid; gap: 8px; margin: 0 0 10px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(12,36,34,.95), rgba(7,20,22,.98));
  border: 1px solid rgba(104,214,189,.22);
}
.gx-exposure.hidden { display: none !important; }
.gx-exposure-head {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #7dcfb8;
}
.gx-exposure-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; }
.gx-exposure-row span { color: var(--muted); }
.gx-exposure-row b { text-align: right; font-variant-numeric: tabular-nums; }
.gx-bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden;
}
.gx-bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #68d6bd, #5eb0ff);
  width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.gx-bar.risk > i { background: linear-gradient(90deg, #f59e0b, #f47772); }
.gx-bar.unk > i { background: linear-gradient(90deg, #66837d, #9ab4ad); }
.gx-brief {
  margin: 0 0 10px; padding: 12px 14px; border-radius: 14px;
  background: rgba(124,106,245,.10); border: 1px solid rgba(124,106,245,.35);
  white-space: pre-wrap; font-size: 13px; line-height: 1.45; color: #e8e4ff;
}
.gx-brief.hidden { display: none !important; }
.gx-brief-title { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #c4b5fd; margin-bottom: 8px; }
.gx-png-preview {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(0,0,0,.72); padding: 18px;
}
.gx-png-preview.hidden { display: none !important; }
.gx-png-preview-inner {
  width: min(920px, 100%); max-height: 90vh; overflow: auto; padding: 14px;
  border-radius: 16px; background: #0c2422; border: 1px solid rgba(104,214,189,.3);
}
.gx-png-preview img { width: 100%; border-radius: 12px; margin: 10px 0; background: #071416; }
.gx-png-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gx-legend { margin-top:0; }
.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 10px; 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); }
.dot.cat-sanctioned { background: #f47772; }
.dot.cat-mixer { background: #ff7a40; }
.dot.cat-darknet { background: #c084fc; }
.dot.cat-hack { background: #ff3b30; }
.dot.cat-scam { background: #fb7185; }
.dot.cat-exchange { background: #5eb0ff; box-shadow: 0 0 10px rgba(94,176,255,.45); }
.dot.cat-cluster { background: #7c6af5; border-radius: 3px; }
.dot.cat-gambling { background: #e6b86b; }
.line { width: 18px; height: 2px; display: inline-block; background: linear-gradient(90deg, #38bdf8, #f59e0b); }
.graph-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: stretch;
  margin-top: 8px;
}
.graph-canvas-wrap {
  position: relative;   /* anchor for the minimap overlay, scoped to the graph */
  min-width: 0;
}
#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%),
    radial-gradient(circle at 70% 80%, rgba(244,119,114,.08), transparent 28%),
    #071416;
  min-height: 620px;
  height: min(72vh, 720px);
}
.graph-inspector {
  border-radius: 18px;
  border: 1px solid rgba(154,180,173,.16);
  background: linear-gradient(180deg, rgba(12,28,30,.96), rgba(7,20,22,.98));
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
}
.graph-inspector-title {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.graph-inspector-body { display: grid; gap: 8px; }
.gi-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
  align-items: start;
}
.gi-row span { color: var(--muted); }
.gi-row b {
  font-weight: 600;
  color: #e7f4ef;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.graph-inspector-actions { display: grid; gap: 8px; margin-top: auto; }
button.flash-ok { background: #0f6b4c !important; border-color: #5fe0b0 !important; color: #eafff6 !important; }
button.flash-err { background: #6b1f1a !important; border-color: #ff8a80 !important; color: #ffe1de !important; }

.flow-exposure {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(154,180,173,.18); background: rgba(13,26,27,.45);
}
.flow-exposure.hidden { display: none; }
.flow-exposure .fx-ring { width: 96px; height: 96px; flex: 0 0 auto; }
.flow-exposure .fx-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; min-width: 150px; flex: 1; }
.flow-exposure .fx-head { flex-basis: 100%; font-size: .8rem; margin-bottom: 2px; }
.flow-exposure .fx-item { display: inline-flex; align-items: center; gap: 5px; }
.flow-exposure .fx-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.flow-exposure .fx-var {
  flex-basis: 100%; margin-top: 4px; padding: 6px 9px; border-radius: 8px;
  background: rgba(107,31,26,.4); border: 1px solid rgba(255,138,128,.4);
  color: #ffe1de; font-size: .78rem; line-height: 1.4;
}
.flow-exposure .fx-cross {
  flex-basis: 100%; margin-top: 4px; padding: 6px 9px; border-radius: 8px;
  background: rgba(14,86,102,.35); border: 1px solid rgba(34,211,238,.4);
  color: #d6f6fb; font-size: .78rem; line-height: 1.4;
}

.graph-minimap {
  position: absolute; left: 12px; bottom: 12px; width: 160px; height: 110px; z-index: 4;
  border: 1px solid rgba(154,180,173,.28); border-radius: 10px; overflow: hidden;
  background: rgba(8,20,22,.82); cursor: crosshair;
}
.graph-minimap svg { display: block; width: 100%; height: 100%; }
.graph-minimap.hidden { display: none; }

.graph-path-ab { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(154,180,173,.16); }
.graph-path-ab input {
  width: 100%; padding: 6px 8px; font-size: .78rem; border-radius: 8px;
  border: 1px solid rgba(154,180,173,.3); background: rgba(13,26,27,.6); color: inherit;
}
.graph-path-ab input::placeholder { color: rgba(154,180,173,.7); }
@media (max-width: 900px) {
  .graph-workspace { grid-template-columns: 1fr; }
  .graph-inspector { min-height: 0; }
}
@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; }
.aml-demo-shell{ padding:10px; }
.aml-demo-frame{
  display:block;
  width:100%;
  min-height:1100px;
  margin-top:12px;
  border:0;
  border-radius:20px;
  background:#071416;
}
.rv{ background:var(--panel); border:1px solid rgba(148,163,184,.16); border-radius:20px; overflow:hidden; }
.rv-passport{ display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; }
.rv-pass-row{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.rv-pass-row .k{ font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.rv-pass-row .v{ font-size:12px; font-weight:650; word-break:break-word; font-variant-numeric:tabular-nums; }
.rv-share{ margin:12px 0 0; display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:12px; }
.rv-share a{ color:var(--accent); font-weight:700; word-break:break-all; }
.rv-copy-share{ padding:6px 10px; border-radius:10px; font-size:11px; background:rgba(255,255,255,.10); color:var(--text); }
.rv-drivers-head,.rv-driver{
  display:grid; grid-template-columns:1.3fr 1.2fr .7fr .55fr; gap:8px; align-items:center;
  font-size:11px;
}
.rv-drivers-head{ color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.rv-driver{ padding:8px 0; border-bottom:1px solid rgba(148,163,184,.10); }
.rv-driver:last-child{ border-bottom:0; }
.rv-driver .subj{ font-weight:700; word-break:break-word; }
.rv-driver .cat{ color:var(--muted); word-break:break-word; }
.rv-driver .path{ font-weight:700; }
.rv-driver .path.ind{ color:var(--rv-high); }
.rv-driver .pct{ text-align:right; font-weight:800; font-variant-numeric:tabular-nums; }
.rv-driver .pct.high{ color:var(--rv-high); } .rv-driver .pct.med{ color:var(--rv-med); }
@media (max-width:720px){
  .rv-passport{ grid-template-columns:1fr; }
  .rv-drivers-head,.rv-driver{ grid-template-columns:1fr 1fr; }
  .rv-drivers-head span:nth-child(n+3), .rv-driver .path{ display:none; }
}
.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-conn-svg{ margin-top:2px; overflow:visible; padding:0 2px; }
.rv-sankey{ display:block; margin-top:2px; color:var(--muted); overflow:visible; min-height:160px; max-width:100%; }
.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); }
/* Must beat .telegram-gate { display:grid } — equal specificity, later rule wins otherwise. */
.telegram-gate.hidden { display:none !important; }
.telegram-gate > div { max-width:440px; }
.telegram-gate h2 { font-size:clamp(30px,7vw,52px); letter-spacing:-.06em; }
.telegram-gate p { color:var(--muted); line-height:1.6; }
.telegram-gate #telegramGateRetry { margin-top:18px; }
body.connecting .telegram-gate { border-color:rgba(104,214,189,.45); }
body.connecting .telegram-gate h2 { font-size:clamp(22px,5vw,34px); }
body.keyboard-relaunch .hero,
body.keyboard-relaunch .tabs,
body.keyboard-relaunch .panel { display:none !important; }
.unauthorized .tabs, .unauthorized .panel { display:none !important; }
.unauthorized #status { display:none; }
body.connecting.unauthorized #status { display:none !important; }
.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:flex; flex-direction:column; gap:14px; margin-top:14px;
}
/* Chat always above graph controls + canvas */
.chat-pane {
  display:flex; flex-direction:column; width:100%; order:0;
  height:min(46vh, 420px); max-height:min(46vh, 420px); min-height:280px;
  border:1px solid rgba(154,180,173,.22); border-radius:18px; overflow:hidden;
  background:rgba(8,25,27,.55);
}
.story-pane { order:1; }
.chat-messages {
  flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; 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;
  white-space:pre-wrap; overflow-wrap:anywhere;
}
.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); flex:0 0 auto; }
.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));
}
.flow-toolbar {
  margin:0; padding:10px 12px; border-radius:0; border:none;
  border-bottom:1px solid rgba(154,180,173,.14);
  background:rgba(6,14,16,.55);
}
.flow-batch-lab { font-size:.78rem; min-width:8ch; }
.flow-year-bar {
  display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px;
  border-bottom:1px solid rgba(154,180,173,.12);
  background:rgba(6,14,16,.35);
}
.flow-year-bar:empty { display:none; }
.flow-year-bar button {
  min-height:32px; padding:6px 10px; font-size:12px;
  background:rgba(255,255,255,.06); color:var(--text);
}
.flow-year-bar button.on {
  background:rgba(104,214,189,.18); color:#9ef0d2;
  box-shadow:0 0 0 1px rgba(104,214,189,.45);
}
.flow-legend .lg.batch {
  width:18px; height:0; border:none; border-top:3px solid #2ec4a0; border-radius:0;
}
#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:min(78vh, 820px); min-height:520px; border-radius:0; border:none;
  border-top:1px solid rgba(154,180,173,.12); border-bottom:1px solid rgba(154,180,173,.12);
  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);
  max-width:100%; overflow:hidden; box-sizing:border-box;
}
.flow-dust, .flow-timeline, .flow-speed {
  display:flex; align-items:center; gap:8px; font-size:.82rem; color:#9ad0c2;
  flex-wrap:wrap; max-width:100%; min-width:0;
}
.flow-dust input[type="number"] {
  width:88px; max-width:38vw; 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) {
  .chat-pane { height:min(42vh, 380px); max-height:min(42vh, 380px); min-height:260px; order:0; }
  .story-pane { order:1; }
  .flow-cy { height:min(70vh, 640px); min-height:420px; }
}
.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%; }
  .app-shell { padding:10px; }
  .tabs { margin:10px 0 14px; border-radius:13px; }
  .tab-group { padding-top:17px; }
  .tab { padding:9px 11px; font-size:12px; }
  .gx-toolbar.gx-actions { display:grid; grid-template-columns:1fr; align-items:stretch; }
  .action-cluster { width:100%; }
}

.dash-section-head {
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin:16px 0 10px;
}
.dash-section-head h2 { margin:0; }
.ledger-scroll, .cases-scroll {
  max-height: min(70vh, 720px); overflow-y:auto; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; padding-right:2px;
}
.ledger-filters { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 12px; }
.ledger-filter.on {
  background:rgba(104,214,189,.18) !important; color:#9ef0d2 !important;
  border-color:rgba(104,214,189,.5) !important;
}
.ledger-pos { color:#9ef0d2 !important; }
.ledger-neg { color:#f47772 !important; }
.ledger-item {
  display:grid; grid-template-columns:auto 1fr auto; gap:8px 12px; align-items:start;
}
.ledger-item .ledger-amt { font-family:"Syne",sans-serif; font-size:18px; font-weight:700; }
.ledger-item .ledger-amt.pos { color:#9ef0d2; }
.ledger-item .ledger-amt.neg { color:#f47772; }
.case-card { display:grid; gap:8px; }
.case-card .case-links { display:flex; flex-wrap:wrap; gap:8px; }
.case-detail {
  margin-top:14px; padding:14px; border-radius:16px;
  border:1px solid rgba(104,214,189,.22);
  background:rgba(8,25,27,.55);
}
.case-detail.hidden { display:none; }
.reports-scroll {
  max-height: min(70vh, 720px); overflow-y:auto; overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch; padding-right:2px; display:grid; gap:12px;
}
.reports-scroll h3 { margin:8px 0 0; font-size:15px; color:#9ad0c2; }
.ai-pro-result {
  margin:0; padding:14px 16px; border-radius:16px;
  border:1px solid rgba(104,214,189,.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(104,214,189,.14), transparent 45%),
    rgba(8,25,27,.72);
}
.ai-pro-result.hidden { display:none; }
.ai-pro-result h3 { margin:0 0 8px; font-family:"Syne",sans-serif; }
.ai-pro-hypo {
  margin:10px 0; padding:12px; border-radius:12px;
  background:rgba(255,255,255,.03); border:1px solid rgba(154,180,173,.14);
}
.ai-pro-hypo .conf {
  display:inline-block; margin-left:8px; font-size:12px; color:#e6b86b;
}
.ai-pro-hypo ul { margin:8px 0 0; padding-left:18px; color:#cfe7df; }
.ai-pro-locked { opacity:.7; }

/* Monitoring ring — matches the cytoscape node.is-monitored violet, and is
   deliberately outside the risk palette so it reads as "watched", not "risky". */
.legend .dot.monitored,
.flow-legend .lg.monitored {
  background: transparent;
  border: 3px solid #c084fc;
  box-shadow: 0 0 0 2px rgba(192, 132, 252, .18);
}

/* Legal footer — always-visible disclaimer + link to full terms/privacy. */
.app-footer {
  margin-top: 28px;
  padding: 16px 4px 8px;
  border-top: 1px solid var(--border, #23262f);
  text-align: center;
}
.app-footer p {
  margin: 0 0 6px;
  font-size: .74rem;
  line-height: 1.45;
  color: var(--muted, #8b90a0);
}
.app-footer a {
  font-size: .78rem;
  color: var(--accent, #a892ff);
  text-decoration: none;
}
.app-footer a:hover { text-decoration: underline; }
