/* Ariadne pre-check — round-2 "Network" direction (investigative graph explorer).
   Consumes the --exp-* tokens from shared.css. Layout: full-viewport app shell,
   left verdict/entity panel, graph canvas center-stage. */

html, body { height: 100%; }
body.net { overflow: hidden; }

.net-app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- top bar ---------- */
.net-top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: var(--exp-bg-surface);
  border-bottom: 1px solid var(--exp-line);
  z-index: 30;
}
.net-top .wordmark { font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.net-top .wordmark .thread { color: var(--exp-accent-text); }
.net-top .sub { color: var(--exp-muted); font-size: 12.5px; white-space: nowrap; }
.net-top .spacer { flex: 1; }

.net-cases { display: flex; gap: 6px; }
.net-case {
  font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--exp-line-strong);
  background: var(--exp-bg-elevated); color: var(--exp-text);
  white-space: nowrap;
}
.net-case.active {
  background: var(--exp-accent-subtle);
  border-color: var(--exp-accent);
  color: var(--exp-accent-text);
  font-weight: 600;
}

.net-counts { font-family: var(--exp-mono); font-size: 11.5px; color: var(--exp-muted); white-space: nowrap; }

.net-legend { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--exp-muted); }
.net-legend .seg { display: flex; align-items: center; gap: 5px; }
.net-legend .line { display: inline-block; width: 22px; border-radius: 2px; background: var(--exp-line-strong); }
.net-legend .line.strong { height: 3px; }
.net-legend .line.moderate { height: 2px; opacity: 0.8; }
.net-legend .line.weak { height: 1px; opacity: 0.6; }

/* ---------- body: panel + canvas ---------- */
.net-body { display: flex; flex: 1; min-height: 0; }

.net-panel {
  width: 330px; min-width: 330px;
  overflow-y: auto;
  background: var(--exp-bg-surface);
  border-right: 1px solid var(--exp-line);
  z-index: 20;
}
.net-panel .pad { padding: 16px; }

.net-tierband { border-left: 4px solid var(--s-solid); padding: 12px 14px; background: var(--s-tint); }
.net-tierband .chip {
  display: inline-block; font-family: var(--exp-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--s-on, var(--exp-on-solid)); background: var(--s-solid);
  padding: 2px 8px; border-radius: 4px;
}
.net-tierband h2 { margin: 8px 0 2px; font-size: 17px; line-height: 1.25; }
.net-tierband .score { font-family: var(--exp-mono); font-size: 12px; color: var(--s-text); }

.net-addr {
  font-family: var(--exp-mono); font-size: 11.5px; color: var(--exp-muted);
  word-break: break-all; margin: 10px 0 0;
}

.net-stats { display: flex; border-top: 1px solid var(--exp-line-subtle); border-bottom: 1px solid var(--exp-line-subtle); margin: 14px 0; }
.net-stats .cell { flex: 1; padding: 10px 4px; text-align: center; }
.net-stats .cell + .cell { border-left: 1px solid var(--exp-line-subtle); }
.net-stats .n { font-family: var(--exp-mono); font-size: 16px; font-weight: 700; }
.net-stats .l { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--exp-muted); }

.net-h { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--exp-muted); margin: 16px 0 8px; }

.net-reason { border: 1px solid var(--exp-line-subtle); border-radius: var(--exp-radius); padding: 10px 12px; margin-bottom: 8px; background: var(--exp-bg-elevated); }
.net-reason .rt { font-family: var(--exp-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--s-text); }
.net-reason .rs { font-size: 13px; margin: 4px 0; }
.net-reason .src { font-size: 11px; color: var(--exp-muted); }
.net-reason .refs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.net-ref {
  font-family: var(--exp-mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--exp-bg-base); border: 1px solid var(--exp-line);
  color: var(--exp-muted);
}

.net-btn {
  display: block; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 9px 12px; border-radius: var(--exp-radius);
  border: 1px solid var(--exp-accent);
  background: var(--exp-accent-subtle); color: var(--exp-accent-text);
  margin: 12px 0 0;
}
.net-btn.on { background: var(--exp-accent); color: var(--exp-on-solid); }
.net-btn[disabled] { opacity: 0.45; cursor: default; }
.net-btn.ghost { background: none; border-color: var(--exp-line-strong); color: var(--exp-muted); font-weight: 400; }

.net-meta { font-size: 11px; color: var(--exp-muted); margin-top: 14px; line-height: 1.6; }
.net-meta b { color: var(--exp-text); font-weight: 600; }

.net-nodecard .kind {
  display: inline-block; font-family: var(--exp-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
  background: var(--exp-bg-elevated); border: 1px solid var(--exp-line-strong);
}
.net-nodecard .kind.ofac { background: var(--exp-sev-critical-subtle); border-color: var(--exp-sev-critical-tintBorder); color: var(--exp-sev-critical-text); }

/* ---------- canvas ---------- */
.net-canvas { flex: 1; position: relative; background: var(--exp-bg-base); min-width: 0; }
.net-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.net-canvas svg.panning { cursor: grabbing; }

.net-hint {
  position: absolute; left: 14px; bottom: 12px; z-index: 10;
  font-size: 11.5px; color: var(--exp-muted);
  background: var(--exp-bg-surface); border: 1px solid var(--exp-line-subtle);
  border-radius: var(--exp-radius); padding: 5px 10px;
  pointer-events: none;
}
.net-pending {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--exp-muted); font-style: italic;
}

/* graph elements */
.g-edge { stroke: var(--exp-line-strong); fill: none; }
.g-edge.thread {
  stroke: var(--exp-accent);
  stroke-dasharray: 7 5;
  animation: net-dash 1.2s linear infinite;
}
@keyframes net-dash { to { stroke-dashoffset: -24; } }

.g-node circle { stroke-width: 1.5px; }
.g-node.k-queried circle.body   { fill: var(--exp-accent-subtle); stroke: var(--exp-accent); }
.g-node.k-sanctioned circle.body{ fill: var(--exp-sev-critical-subtle); stroke: var(--exp-sev-critical-solid); }
.g-node.k-labeled circle.body   { fill: var(--exp-sev-medium-subtle); stroke: var(--exp-sev-medium-solid); }
.g-node.k-contract circle.body  { fill: var(--exp-sev-low-subtle); stroke: var(--exp-sev-low-solid); }
.g-node.k-wallet circle.body    { fill: var(--exp-bg-elevated); stroke: var(--exp-line-strong); }
.g-node.selected circle.body { stroke-width: 3px; }
.g-node.thread circle.body { stroke: var(--exp-accent); stroke-width: 3px; }
.g-node { cursor: pointer; }
.g-node text {
  font-family: var(--exp-mono); font-size: 9.5px;
  fill: var(--exp-muted); text-anchor: middle; pointer-events: none;
}
.g-node.k-queried text, .g-node.k-sanctioned text { fill: var(--exp-text); font-weight: 700; }

.net-nodelegend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; font-size: 11.5px; color: var(--exp-muted); }
.net-nodelegend .seg { display: flex; align-items: center; gap: 5px; }
.net-nodelegend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1.5px solid; }
.net-nodelegend .dot.queried    { background: var(--exp-accent-subtle); border-color: var(--exp-accent); }
.net-nodelegend .dot.sanctioned { background: var(--exp-sev-critical-subtle); border-color: var(--exp-sev-critical-solid); }
.net-nodelegend .dot.labeled    { background: var(--exp-sev-medium-subtle); border-color: var(--exp-sev-medium-solid); }
.net-nodelegend .dot.contract   { background: var(--exp-sev-low-subtle); border-color: var(--exp-sev-low-solid); }
.net-nodelegend .dot.wallet     { background: var(--exp-bg-elevated); border-color: var(--exp-line-strong); }

/* ---------- round 3: open-world live exploration ---------- */

/* "you are here" — pulsing halo + tag on the queried node */
.g-node.k-queried .halo {
  fill: none; stroke: var(--exp-accent); stroke-width: 2px;
  animation: net-halo 2s ease-out infinite;
  pointer-events: none;
}
@keyframes net-halo {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0;   transform: scale(2.1); }
}
.g-node.k-queried .youtag {
  font-family: var(--exp-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; fill: var(--exp-accent-text); text-anchor: middle;
}

/* frontier (unexplored) vs loaded nodes */
.g-node.frontier circle.body { stroke-dasharray: 4 3; }
.g-node.frontier .plus {
  font-family: var(--exp-mono); font-size: 10px; font-weight: 700;
  fill: var(--exp-muted); text-anchor: middle; pointer-events: none;
}
.g-node.loading circle.body { stroke-dasharray: 4 3; }
.g-node .spin {
  fill: none; stroke: var(--exp-accent); stroke-width: 2px;
  stroke-dasharray: 12 50;
  animation: net-spin 0.9s linear infinite;
  pointer-events: none;
}
@keyframes net-spin { to { transform: rotate(360deg); } }

/* canvas controls (zoom / fit / home) */
.net-ctrl {
  position: absolute; right: 14px; bottom: 14px; z-index: 10;
  display: flex; flex-direction: column; gap: 6px;
}
.net-ctrl button {
  width: 34px; height: 34px; font-size: 15px; line-height: 1; cursor: pointer;
  border-radius: var(--exp-radius);
  border: 1px solid var(--exp-line-strong);
  background: var(--exp-bg-surface); color: var(--exp-text);
}
.net-ctrl button:hover { border-color: var(--exp-accent); color: var(--exp-accent-text); }

/* auto-reveal toggle + world budget in top bar */
.net-toggle {
  font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--exp-line-strong);
  background: var(--exp-bg-elevated); color: var(--exp-muted);
  white-space: nowrap;
}
.net-toggle.on {
  background: var(--exp-accent-subtle); border-color: var(--exp-accent);
  color: var(--exp-accent-text); font-weight: 600;
}

/* hover tooltip */
.net-tip {
  position: absolute; z-index: 40; pointer-events: none;
  max-width: 280px;
  background: var(--exp-bg-surface); border: 1px solid var(--exp-line-strong);
  border-radius: var(--exp-radius); padding: 8px 10px;
  font-size: 11.5px; color: var(--exp-text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.net-tip .mono { font-family: var(--exp-mono); font-size: 10.5px; color: var(--exp-muted); word-break: break-all; }
.net-tip .hint { color: var(--exp-accent-text); margin-top: 4px; }
.net-tip .ofacline { color: var(--exp-sev-critical-text); font-weight: 600; }

/* toasts */
.net-toasts {
  position: absolute; right: 60px; bottom: 14px; z-index: 30;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.net-toast {
  background: var(--exp-bg-surface); border: 1px solid var(--exp-line-strong);
  border-left: 3px solid var(--exp-accent);
  border-radius: var(--exp-radius); padding: 7px 12px;
  font-size: 12px; color: var(--exp-text);
  animation: net-toast-in 0.18s ease-out;
}
.net-toast.warn { border-left-color: var(--exp-sev-medium-solid); }
.net-toast.alert { border-left-color: var(--exp-sev-critical-solid); color: var(--exp-sev-critical-text); font-weight: 600; }
@keyframes net-toast-in { from { opacity: 0; transform: translateY(6px); } }

.net-panel a { color: var(--exp-accent-text); }

/* ---------- round 4: threads, branches, anchors, spacing ---------- */
.g-edge { stroke-linecap: round; }
.g-edge.t1 { stroke: var(--exp-thread-1); }
.g-edge.t2 { stroke: var(--exp-thread-2); }
.g-edge.t3 { stroke: var(--exp-thread-3); }
.g-edge.t4 { stroke: var(--exp-thread-4); }
.g-edge.t5 { stroke: var(--exp-thread-5); }
.g-edge.t6 { stroke: var(--exp-thread-6); }
/* selection trace: the thread from a selected node back to the origin */
.g-edge.trace { stroke: var(--exp-accent); }
/* verified evidence path keeps its dashed march (defined earlier, re-stated to win over tints) */
.g-edge.thread { stroke: var(--exp-accent); }

/* anchors — known addresses (labeled / sanctioned / named): heavier ring */
.g-node.anchor circle.body { stroke-width: 2.6px; }

.net-spacing {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--exp-muted); white-space: nowrap;
}
.net-spacing input[type="range"] { width: 90px; accent-color: var(--exp-accent); }
