.connections-view-switch{display:inline-flex;align-items:stretch;margin:0 0 14px;border:1px solid var(--line-strong);border-radius:var(--r-sm);overflow:hidden}
.connections-view-option{min-width:92px;border:0;border-radius:0}
.connections-view-option+.connections-view-option{border-left:1px solid var(--line-strong)}
.connections-view-option[aria-pressed="true"]{background:var(--accent-weak);color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--accent)}

.screen.system-graph-screen{max-width:1480px}
.system-graph-focus-open{overflow:hidden}
.system-graph-shell{display:grid;gap:12px;min-width:0;color:var(--ink)}
.system-graph-shell.is-expanded{position:fixed;z-index:90;inset:12px;overflow:auto;padding:12px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--app-background,var(--surface));box-shadow:var(--shadow-lg)}
.system-graph-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px}
.system-graph-title h2{margin:3px 0 4px;font:500 24px/1.15 var(--font-display)}
.system-graph-saved{display:flex;align-items:end;gap:8px;flex:none}
.system-graph-saved .field-label{display:grid;gap:5px}
.system-graph-saved-status{max-width:240px;color:var(--rejected);font-size:10px;line-height:1.35}
.system-graph-toolbar{display:grid;grid-template-columns:minmax(150px,.7fr) minmax(240px,2fr) minmax(150px,.8fr) auto;align-items:end;gap:10px;padding:12px}
.system-graph-toolbar .field-label{display:grid;gap:5px;color:var(--ink-2);font-size:11px}
.system-graph-select,.system-graph-search{width:100%;min-height:36px;padding:7px 10px;border:1px solid var(--control-border,var(--line-strong));border-radius:var(--r-sm);background:var(--surface);color:var(--ink);box-shadow:var(--control-shadow)}
.system-graph-search::-webkit-search-cancel-button{cursor:pointer}
.system-graph-zoom{display:flex;gap:5px}
.system-graph-zoom .icon-button{width:36px;min-width:36px;padding:0;justify-content:center}
.system-graph-filters{display:flex;align-items:center;gap:7px;padding:10px 12px;overflow-x:auto}
.system-graph-focus-field{display:grid;gap:4px;min-width:132px;margin-left:4px;color:var(--ink-2);font-size:10px}
.system-graph-focus-field .system-graph-select{min-height:32px;padding-block:5px}
.system-graph-hidden-count{min-width:190px;margin-left:auto;color:var(--ink-3);font-size:10px;line-height:1.35}
.system-graph-hidden-count.is-active{color:var(--accent-ink)}
.system-graph-focus-summary{color:var(--accent-ink)!important}
.system-graph-filters>.field-label{margin-right:3px}
.system-graph-type-filter{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:112px;padding:7px 9px;border:1px solid var(--line-strong);border-radius:4px;background:var(--surface);color:var(--ink-2);text-align:left;font-size:11.5px;white-space:nowrap}
.system-graph-type-filter:hover,.system-graph-type-filter:focus-visible{border-color:var(--accent);color:var(--accent-ink)}
.system-graph-type-filter[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-weak);color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--accent)}
.system-graph-type-count{min-width:20px;padding:1px 5px;border-radius:10px;background:var(--surface-2);color:var(--ink-2);font:10px/1.5 var(--font-mono);text-align:center}
.system-graph-status{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:48px;padding:9px 12px;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:var(--r-sm);background:var(--surface);font-size:11.5px}
.system-graph-status.is-partial{border-left-color:var(--warn);background:color-mix(in srgb,var(--surface) 94%,var(--warn) 6%)}
.system-graph-status.is-scope-boundary{border-left-color:var(--ink-3);background:var(--surface-2)}
.system-graph-status.is-error{border-left-color:var(--rejected);background:var(--rejected-bg)}
.system-graph-status-copy{display:grid;gap:1px;min-width:0}
.system-graph-status-copy span{color:var(--ink-2)}
.system-graph-status.is-loading{justify-content:flex-start;color:var(--ink-2)}
.system-graph-spinner{width:14px;height:14px;border:2px solid var(--accent-weak-2);border-top-color:var(--accent);border-radius:50%;animation:system-graph-spin .8s linear infinite}
@keyframes system-graph-spin{to{transform:rotate(360deg)}}
.system-graph-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,380px);gap:12px;min-height:clamp(680px,72vh,900px)}
.system-graph-canvas-panel{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;overflow:hidden}
.system-graph-canvas-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border-bottom:1px solid var(--line)}
.system-graph-canvas-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}
.system-graph-canvas-actions .panel-note{margin-left:0;white-space:normal;text-align:right}
.system-graph-expand-button{flex:none}
.system-graph-stage{position:relative;min-height:clamp(680px,72vh,900px);overflow:hidden;overscroll-behavior:contain;touch-action:none;background:radial-gradient(circle at center,color-mix(in srgb,var(--accent) 4%,transparent),transparent 54%),linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);background-size:auto,32px 32px,32px 32px;background-position:center}
[data-theme="dark"] .system-graph-stage{background-color:#151b19}
.system-graph-svg{display:block;width:100%;height:100%;min-height:clamp(680px,72vh,900px);touch-action:none;cursor:grab}
.system-graph-svg:active,.system-graph-svg.is-panning{cursor:grabbing}
.system-graph-shell.is-expanded .system-graph-workspace,.system-graph-shell.is-expanded .system-graph-stage,.system-graph-shell.is-expanded .system-graph-svg{min-height:max(640px,calc(100dvh - 330px))}
.system-graph-edge{cursor:pointer;color:var(--ink-3)}
.system-graph-edge line{stroke:currentColor;stroke-width:1.35;opacity:.72}
.system-graph-edge:hover line,.system-graph-edge:focus-visible line,.system-graph-edge.is-path line{stroke:var(--accent);stroke-width:3;opacity:1}
.system-graph-edge.is-reference line{stroke-dasharray:7 5;stroke-width:1.7}
.system-graph-edge.is-membership line{stroke-dasharray:2 6;stroke-width:1.5;opacity:.68}
.system-graph-edge.is-evidence-support line,.system-graph-edge.is-finding-support line{stroke-dasharray:3 5;stroke-width:1.2;opacity:.62}
.system-graph-edge.is-reference .system-graph-edge-label{font-style:italic}
.system-graph-edge-label{opacity:0;paint-order:stroke;stroke:var(--surface);stroke-width:5px;stroke-linejoin:round;fill:var(--ink-2);font:10px var(--font-ui);pointer-events:none;transition:opacity .12s ease}
.system-graph-edge:hover .system-graph-edge-label,.system-graph-edge:focus .system-graph-edge-label,.system-graph-edge.is-selected .system-graph-edge-label,.system-graph-edge.is-path .system-graph-edge-label{opacity:1}
.system-graph-arrow{fill:var(--ink-3)}
.system-graph-node{cursor:pointer;color:var(--accent);outline:none}
.system-graph-node-shape{fill:var(--surface);stroke:currentColor;stroke-width:2.2;filter:drop-shadow(0 3px 5px color-mix(in srgb,var(--ink) 14%,transparent));transition:fill .15s,stroke-width .15s}
.system-graph-node:hover .system-graph-node-shape,.system-graph-node:focus-visible .system-graph-node-shape,.system-graph-node[aria-pressed="true"] .system-graph-node-shape,.system-graph-node.is-path .system-graph-node-shape{fill:var(--accent-weak);stroke-width:4}
.system-graph-node.category-case{color:var(--accent-ink)}
.system-graph-node.category-organization{color:#50718a}
.system-graph-node.category-vehicle{color:#8a6414}
.system-graph-node.category-location{color:#7a5a83}
.system-graph-node.category-account{color:#8a4f52}
.system-graph-node.category-device{color:#4f7373}
.system-graph-node.category-evidence{color:#6c7252}
.system-graph-node.category-finding{color:#76545f}
.system-graph-node.category-encounter{color:#426f72}
.system-graph-node.category-contradiction{color:#9a493f}
.system-graph-node.category-other{color:var(--ink-2)}
[data-theme="dark"] .system-graph-node.category-organization{color:#8eb6d1}
[data-theme="dark"] .system-graph-node.category-vehicle{color:#d6a945}
[data-theme="dark"] .system-graph-node.category-location{color:#c3a1cf}
[data-theme="dark"] .system-graph-node.category-account{color:#d99b9d}
[data-theme="dark"] .system-graph-node.category-device{color:#8ab9b5}
[data-theme="dark"] .system-graph-node.category-evidence{color:#bbc48d}
[data-theme="dark"] .system-graph-node.category-finding{color:#d7a0b1}
.system-graph-node-label{paint-order:stroke;stroke:var(--surface);stroke-width:5px;fill:var(--ink);font:650 11.5px var(--font-ui);pointer-events:none}
.system-graph-node-type{paint-order:stroke;stroke:var(--surface);stroke-width:4px;fill:var(--ink-3);font:9px var(--font-mono);text-transform:uppercase;pointer-events:none}
.system-graph-empty{display:grid;justify-items:center;gap:10px;padding:28px;text-align:center;color:var(--ink)}
.system-graph-empty h3{max-width:520px;font:500 22px/1.25 var(--font-display)}
.system-graph-empty p{color:var(--ink-2)}
.system-graph-empty-mark{display:grid;place-items:center;width:54px;height:54px;border:1px solid var(--accent);border-radius:50%;color:var(--accent);font:28px var(--font-display)}
.system-graph-inspector{padding:16px;overflow:auto}
.system-graph-inspector>h3{margin:4px 0 6px;font:500 22px/1.2 var(--font-display)}
.system-graph-inspector-head{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;margin-bottom:14px}
.system-graph-inspector-head h3{margin:3px 0 2px;font:500 22px/1.15 var(--font-display)}
.system-graph-inspector-copy{min-width:0}
.system-graph-inspector-context{display:grid;gap:2px;min-width:0}
.system-graph-inspector-context .eyebrow,.system-graph-inspector-case{white-space:normal;overflow-wrap:anywhere}
.system-graph-inspector-case{color:var(--ink-3);font:10.5px/1.35 var(--font-mono)}
.system-graph-inspector .panel-note{margin-left:0;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}
.system-graph-inspector-mark{display:grid;place-items:center;width:52px;height:52px;border:2px solid currentColor;border-radius:50%;color:var(--accent);background:var(--accent-weak)}
.system-graph-inspector-mark.category-case{border-radius:14px;color:var(--accent-ink)}
.system-graph-inspector-mark.category-organization{border-radius:8px;color:#50718a}
.system-graph-inspector-mark.category-vehicle{border-radius:3px;transform:rotate(45deg);color:#8a6414}
.system-graph-source-image{width:68px;height:68px;object-fit:cover;border:1px solid var(--line-strong);border-radius:var(--r-sm)}
.system-graph-image-provenance{margin:-6px 0 12px;color:var(--ink-3);font:9px/1.4 var(--font-mono);overflow-wrap:anywhere}
.system-graph-kv{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface-2);font-size:11px}
.system-graph-kv dt{color:var(--ink-3)}
.system-graph-kv dd{min-width:0;color:var(--ink);overflow-wrap:anywhere}
.system-graph-inspector-section{display:grid;gap:8px;padding:14px 0;border-top:1px solid var(--line)}
.system-graph-inspector-section h4,.system-graph-accessible h4{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-2)}
.system-graph-actions,.system-graph-navigation{display:flex;flex-wrap:wrap;gap:6px}
.system-graph-navigation .btn{justify-content:flex-start;white-space:normal;text-align:left}
.system-graph-research{margin-inline:-8px;padding-inline:8px;border:1px solid color-mix(in srgb,var(--accent) 34%,var(--line));border-radius:var(--r-sm);background:color-mix(in srgb,var(--accent-weak) 56%,transparent)}
.system-graph-research .panel-note{margin:0;color:var(--ink-2);font-size:10.5px;line-height:1.45}
.system-graph-research .system-graph-navigation{display:grid;gap:8px}
.system-graph-research-item{display:grid;gap:5px;min-width:0}
.system-graph-research-item p{margin:0;color:var(--ink);font-family:var(--font-mono);font-size:10.5px;overflow-wrap:anywhere}
.research-bridge-banner{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 12px;padding:10px 12px;border-left:3px solid var(--accent);border-radius:var(--r-sm);background:var(--accent-weak);color:var(--accent-ink);font-size:11px;line-height:1.45}
.research-bridge-banner p{margin:0;overflow-wrap:anywhere}
.research-bridge-banner .btn{flex:none}
.entity-context-section{display:grid;gap:12px;margin:14px 0 0;padding:14px 0 2px;border-top:1px solid var(--line);color:var(--ink)}
.entity-context-header,.entity-context-subheading,.entity-context-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.entity-context-title{min-width:0}
.entity-context-title h3,.entity-context-title h4{margin:0;color:var(--ink);font:500 16px/1.25 var(--font-display)}
.entity-context-subtitle{margin:3px 0 0;color:var(--ink-3);font:10px/1.4 var(--font-mono)}
.entity-context-header-actions,.entity-context-card-actions,.entity-context-badges{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.entity-context-header-actions{justify-content:flex-end}
.entity-context-subsection{display:grid;gap:8px;padding-top:10px;border-top:1px solid var(--line)}
.entity-context-header+.entity-context-subsection{padding-top:2px;border-top:0}
.entity-context-subsection>h4,.entity-context-subsection>h5,.entity-context-subheading h4,.entity-context-subheading h5{margin:0;color:var(--ink-2);font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.entity-context-subheading{align-items:center}
.entity-context-card-list{display:grid;gap:8px}
.entity-context-card{display:grid;gap:8px;min-width:0;padding:10px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface-2)}
.entity-context-card:focus-within{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-weak-2)}
.entity-context-card-head{align-items:center}
.entity-context-card-title{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
.entity-context-card-title b{min-width:0;overflow-wrap:anywhere}
.entity-context-card-title .chip{max-width:100%;overflow-wrap:anywhere}
.entity-context-facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:4px 10px;margin:0;font-size:10.5px}
.entity-context-facts dt{color:var(--ink-3)}
.entity-context-facts dd{min-width:0;margin:0;overflow-wrap:anywhere;color:var(--ink)}
.entity-context-facts .entity-context-hash{font:9px/1.4 var(--font-mono);word-break:break-word}
.entity-context-facts .entity-context-id{font-family:var(--font-mono);font-size:9.5px}
.entity-context-facts .entity-context-provenance{color:var(--ink-2)}
.entity-context-empty,.entity-context-action-note{margin:0;color:var(--ink-3);font-size:10.5px;line-height:1.45}
.entity-context-note-body{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.45}
.entity-context-attribution{color:var(--ink-3);overflow-wrap:anywhere}
.entity-context-card.is-removed{border-style:dashed;border-color:color-mix(in srgb,var(--warn) 48%,var(--line));background:color-mix(in srgb,var(--surface-2) 92%,var(--warn) 8%)}
.entity-context-history{border-top:1px solid var(--line);padding-top:5px}
.entity-context-history summary{padding:4px 0;color:var(--accent-ink);cursor:pointer;font-size:10.5px;font-weight:650}
.entity-context-history-list{display:grid;gap:5px;margin:5px 0 0;padding-left:17px;color:var(--ink-2);font-size:10px}
.entity-context-history-item{display:grid;gap:2px;min-width:0}
.entity-context-history-item small{color:var(--ink-3);overflow-wrap:anywhere}
.entity-context-history-state{color:var(--ink-3);font:9px var(--font-mono);text-transform:uppercase}
[data-density="compact"] .entity-context-section,.compact-mode .entity-context-section{gap:8px;padding-top:10px}
[data-density="compact"] .entity-context-card,.compact-mode .entity-context-card{gap:6px;padding:7px}
[data-density="compact"] .entity-context-subsection,.compact-mode .entity-context-subsection{gap:6px;padding-top:7px}
.system-graph-expansion{margin-inline:-8px;padding-inline:8px;border:1px solid color-mix(in srgb,var(--warn) 35%,var(--line));border-radius:var(--r-sm);background:color-mix(in srgb,var(--warn) 6%,transparent)}
.system-graph-path-result,.system-graph-boundary{padding:8px 9px;border-left:3px solid var(--accent);background:var(--accent-weak);color:var(--accent-ink);font-size:11px}
.system-graph-path-result.is-no_path,.system-graph-path-result.is-indeterminate_partial_graph{border-left-color:var(--warn);background:var(--inconclusive-bg);color:var(--inconclusive)}
.system-graph-hash{display:block;padding:7px;border-radius:4px;background:var(--surface-2);color:var(--ink-2);font:9px/1.45 var(--font-mono);overflow-wrap:anywhere}
.system-graph-details{margin-top:12px;border-top:1px solid var(--line)}
.system-graph-details summary,.system-graph-accessible>summary{padding:12px 0;color:var(--accent-ink);cursor:pointer;font-weight:650}
.system-graph-attribute-list{display:grid;gap:7px}
.system-graph-attribute{display:grid;gap:2px;padding:8px;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface-2);font-size:11px}
.system-graph-attribute small{color:var(--ink-3);overflow-wrap:anywhere}
.system-graph-warnings{display:grid;gap:8px;margin:14px 0 0;padding-left:18px;color:var(--ink-2);font-size:11px}
.system-graph-accessible{padding:0 14px}
.system-graph-accessible-body{display:grid;grid-template-columns:1fr 1fr;gap:8px 18px;padding:0 0 14px}
.system-graph-accessible-body h4{grid-row:1}
.system-graph-record-list{display:grid;gap:4px;align-content:start;list-style-position:inside}
.system-graph-list-button{color:var(--accent-ink);text-align:left;text-decoration:underline;text-underline-offset:2px}
.system-graph-list-button:hover{color:var(--accent)}
@media (max-width:1050px){
  .system-graph-header{align-items:flex-start;flex-direction:column}.system-graph-saved{width:100%;flex-wrap:wrap}.system-graph-saved .field-label{flex:1;min-width:220px}
  .system-graph-toolbar{grid-template-columns:1fr 2fr 1fr}.system-graph-zoom{grid-column:1/-1}
  .system-graph-filters{flex-wrap:wrap;overflow-x:visible}
  .system-graph-workspace{grid-template-columns:1fr}.system-graph-inspector{max-height:none}.system-graph-stage,.system-graph-svg{min-height:520px}
}
@media (max-width:700px){
  .system-graph-toolbar{grid-template-columns:1fr}.system-graph-zoom{grid-column:auto}.system-graph-status{align-items:flex-start;flex-direction:column}
  .system-graph-stage,.system-graph-svg{min-height:460px}.system-graph-accessible-body{grid-template-columns:1fr}.system-graph-accessible-body h4{grid-row:auto}
  .entity-context-header,.entity-context-subheading,.entity-context-card-head{align-items:flex-start;flex-direction:column}
  .entity-context-header-actions,.entity-context-card-actions{justify-content:flex-start;width:100%}
  .research-bridge-banner{align-items:stretch;flex-direction:column}
  .entity-context-facts{grid-template-columns:1fr;gap:2px}
  .entity-context-facts dt{padding-top:3px}
}
@media (prefers-reduced-motion:reduce){.system-graph-spinner{animation:none}}
