.question-network-open{position:fixed;top:122px;left:24px;z-index:15;padding:9px 13px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--bg);font:12px system-ui;cursor:pointer}
.question-network-dialog{width:min(1050px,calc(100vw - 28px));max-height:90dvh;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--bg,#faf8f3);color:var(--ink,#30382c);overflow:auto}
.question-network-dialog::backdrop{background:#0007}
.question-network-dialog header{display:flex;align-items:center;gap:12px}.question-network-dialog h2{flex:1;font:500 21px system-ui;margin:0}.question-network-dialog button{padding:7px 11px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:inherit;cursor:pointer}
.network-legend{display:flex;flex-wrap:wrap;gap:15px;font:12px system-ui}.network-caution,.question-network-dialog [role=status],.question-network-detail{font:12px/1.5 system-ui;color:var(--dim)}
.question-network-dialog svg{display:block;width:100%;min-height:280px;border:1px solid var(--line);border-radius:12px;background:var(--card)}
.network-edge{stroke:#558dc9;stroke-opacity:.55}.edge-similarity{stroke-dasharray:5 5}.edge-answer{stroke:#639a75;stroke-opacity:.3}.edge-implication{stroke:#b989dc;stroke-opacity:.9}
.network-node{cursor:pointer}.network-node circle{fill:var(--bg,#faf8f3);stroke:#558dc9;stroke-width:2}.network-node[data-verdict=Y] circle{stroke:#639a75}.network-node[data-verdict=N] circle{stroke:#c97868}.network-node text{fill:var(--ink,#30382c);font:10px system-ui}.node-answer text{font-size:15px}.network-node:focus circle,.network-selected circle{stroke-width:5;filter:drop-shadow(0 0 4px #558dc966)}
@media(max-width:600px){.question-network-open{top:83px;left:16px;padding:6px 9px;font-size:10px}.question-network-dialog{padding:12px}.question-network-dialog h2{font-size:17px}.network-legend{gap:6px;font-size:10px}.question-network-dialog svg{min-width:600px}.question-network-dialog{overflow:auto}}
.network-node .network-density-halo{stroke:none;fill:#4285d4;pointer-events:none;filter:none}
.network-selected .network-density-halo,.network-node:focus .network-density-halo{stroke:none;filter:none}
.density-hidden .network-density-halo{display:none}
.network-density-control{display:flex;align-items:center;gap:7px;font:12px system-ui;margin:10px 0 6px}
.network-density-control input{width:16px;height:16px;accent-color:#4285d4}
.network-density-description{font:12px/1.5 system-ui;color:var(--dim);margin:5px 0}
/* The question network is available only in the desktop layout. */
@media(max-width:1100px){
 .question-network-open,.question-network-dialog{display:none!important}
}
.network-zoom-controls{display:flex;align-items:center;gap:8px;margin:12px 0;font:12px system-ui}
.network-zoom-controls output{min-width:44px;text-align:center;font-variant-numeric:tabular-nums}
.network-zoom-controls span{color:var(--dim);margin-left:5px}
.question-network-dialog svg{overscroll-behavior:contain}
.network-controls-details{margin:14px 0;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.network-controls-details>summary{cursor:pointer;font:500 12px/1.5 system-ui;color:var(--ink)}
.network-controls-details>summary:focus-visible{outline:2px solid #4285d4;outline-offset:4px}
.network-controls-details[open]>summary{margin-bottom:10px}
.network-branch-grid{overflow-x:auto;margin-top:12px;border:1px solid var(--line);border-radius:10px}
.network-branch-grid table{width:100%;border-collapse:collapse;font:12px/1.5 system-ui}
.network-branch-grid caption{text-align:left;padding:10px 12px;color:var(--dim)}
.network-branch-grid th,.network-branch-grid td{padding:9px 12px;text-align:left;border-top:1px solid var(--line);vertical-align:middle}
.network-branch-grid th{background:var(--card);color:var(--ink);font-weight:600}
.network-branch-grid td:not(:first-child){white-space:nowrap;font-variant-numeric:tabular-nums}
.network-branch-grid td:first-child{width:70%}
.network-branch-grid button{border:0!important;background:transparent!important;text-align:left;color:var(--ink);padding:0!important;text-decoration:underline;text-underline-offset:3px}
/* Nodes represent questions; answer values belong in the selected-question details. */
.network-node.node-question .network-core{stroke:#558dc9;fill:var(--bg,#faf8f3)}
/* Compact question nodes and stronger connection contrast. */
.network-edge{stroke:#397db6;stroke-opacity:.78}
.edge-similarity{stroke-dasharray:6 3}
.edge-implication{stroke:#9866bb;stroke-opacity:.95}
.network-node.node-question .network-core{stroke-width:1.7}
.question-network-detail{margin:14px 0 18px;font:16px/1.55 system-ui;color:var(--ink)}
.question-network-detail>strong{display:block;font:600 clamp(20px,2vw,26px)/1.3 system-ui;margin-bottom:8px;color:var(--ink)}
.question-network-detail>p{font:16px/1.55 system-ui;margin:8px 0 12px}
/* Reserve a compact selection heading while keeping the chart in normal flow. */
@media(min-width:1101px){
 .question-network-dialog>.question-network-detail{height:126px;box-sizing:border-box;overflow:auto;scrollbar-gutter:stable;margin:14px 0 18px}
 .question-network-dialog>svg{height:500px;min-height:500px}
}
.network-branch-panel{margin:12px 0}
@media(min-width:1101px){
 .question-network-dialog{width:min(1440px,calc(100vw - 40px));height:min(900px,92dvh);max-height:92dvh;overflow:hidden;box-sizing:border-box}
 .question-network-dialog>header{height:38px;margin-bottom:14px}
 .network-workspace{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:20px;height:calc(100% - 52px);min-height:0}
 .network-workspace>svg{width:100%;height:100%;min-height:0;min-width:0;box-sizing:border-box}
 .network-sidebar{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 8px 8px 0}
 .network-sidebar .question-network-detail{height:auto;margin:0 0 16px;overflow:visible}
 .network-sidebar .question-network-detail>strong{font-size:22px}
 .network-sidebar .question-network-detail>p{font-size:15px}
 .network-sidebar .network-branch-grid th,.network-sidebar .network-branch-grid td{padding:8px 7px}
 .network-sidebar .network-branch-grid td:first-child{width:auto}
 .network-sidebar .network-branch-grid td:last-child{white-space:normal}
}
/* Keep the desktop network free of visible vertical scrollbars. */
@media(min-width:1101px){
 .question-network-dialog{overflow:hidden}
 .network-sidebar{scrollbar-width:none;scrollbar-gutter:auto}
 .network-sidebar::-webkit-scrollbar{display:none;width:0;height:0}
 .network-branch-grid{scrollbar-width:none}
 .network-branch-grid::-webkit-scrollbar{display:none}
}
/* Header help opens as a popover without resizing the chart. */
.question-network-dialog>header>.network-controls-details{position:relative;flex:none;margin:0;padding:8px 11px;overflow:visible}
.question-network-dialog>header>.network-controls-details>summary{white-space:nowrap;margin:0;background:transparent}
.question-network-dialog>header>.network-controls-details[open]{position:absolute;z-index:30;right:140px;top:20px;width:330px;max-height:300px;overflow:auto;background:var(--bg);box-shadow:0 8px 28px #0002}
.question-network-dialog{position:fixed}
/* Place the functional sidebar to the left of the chart. */
@media(min-width:1101px){
 .network-workspace{grid-template-columns:350px minmax(0,1fr)}
 .network-workspace>.network-sidebar{grid-column:1;grid-row:1}
 .network-workspace>svg{grid-column:2;grid-row:1}
}
/* Connections use node-center coordinates; transparent interiors keep them visible. */
.network-node.node-question .network-core{fill:transparent}
.network-edge{stroke-linecap:round}
.question-network-dialog svg.is-panning,.question-network-dialog svg.is-panning *{cursor:grabbing!important;user-select:none}
.network-edge{stroke-linejoin:round;fill:none}
.network-grouping-control{display:flex;flex-direction:column;gap:6px;margin:12px 0;font:12px system-ui}
.network-grouping-control select{padding:7px 9px;border:1px solid var(--line);border-radius:7px;background:var(--bg);color:var(--ink);font:inherit}
/* Neutral question nodes; blue identifies the current selection. */
.network-node.node-question .network-core{stroke:#b9bec5;fill:transparent;filter:none}
.network-node.node-question.network-selected .network-core{stroke:#4285d4;stroke-width:3;filter:none}
.network-node:focus{outline:none}
.network-node.node-question:focus-visible .network-core{stroke:#4285d4}
.network-controls-details>summary:focus{outline:none;box-shadow:none}
.network-controls-details>summary:focus-visible{outline:none!important;box-shadow:none!important}
/* Connection colors follow node selection. */
.network-edge,.edge-implication{stroke:#b9bec5}
.network-edge.network-edge-selected{stroke:#4285d4}
/* Flow only along the selected question's connections. */
.network-edge.network-edge-selected{stroke-dasharray:5 4;animation:network-selected-flow 1.1s linear infinite}
@keyframes network-selected-flow{from{stroke-dashoffset:0}to{stroke-dashoffset:-18}}
@media(prefers-reduced-motion:reduce){.network-edge.network-edge-selected{animation:none}}
/* Opaque node faces mask the edge underneath; center dots follow selection. */
.network-node.node-question .network-core{fill:var(--card,#f0ebe2)}
.network-node.node-question .network-center-dot{fill:#b9bec5;stroke:none;filter:none;pointer-events:none}
.network-node.node-question.network-selected .network-center-dot{fill:#4285d4;stroke:none;filter:none}
/* A two-beat pulse highlights selection without moving the node or its label. */
.network-node.network-selected .network-core,.network-node.network-selected .network-center-dot{transform-box:fill-box;transform-origin:center;animation:network-heartbeat 1.5s ease-in-out infinite}
@keyframes network-heartbeat{0%,30%,100%{transform:scale(1)}10%{transform:scale(1.13)}18%{transform:scale(1)}24%{transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.network-node.network-selected .network-core,.network-node.network-selected .network-center-dot{animation:none}}
.community-network-tool .question-network-open{position:static;margin:8px 0;padding:12px 16px}

.network-plot{grid-column:2;grid-row:1;min-height:0;min-width:0;overflow:auto}
.network-plot svg{width:100%;height:auto;min-height:0;box-sizing:border-box}
.network-plot .network-node text{font-size:14px;paint-order:stroke;stroke:var(--bg,#faf8f3);stroke-width:3px;stroke-linejoin:round}
.network-selection-area{fill:#4285d4;stroke:#4285d4;stroke-width:38;stroke-linejoin:round;stroke-linecap:round;opacity:.14}
:root[data-theme=dark] .network-selection-area{fill:#84baff;stroke:#84baff;opacity:.2}
.network-system text{fill:var(--ink,#30382c);font:600 16px system-ui}
.network-group-density{color:var(--accent,#427e96)}
.network-group-density text{fill:var(--ink,#30382c);font:600 14px system-ui}
.network-plot svg{cursor:grab;touch-action:none;user-select:none}
.network-map-dot{fill:var(--ink,#30382c);opacity:.14}
.network-map-caption{font:13px system-ui;fill:var(--dim,#666)}
.network-map-topic{font:600 15px system-ui;fill:var(--ink,#30382c);paint-order:stroke;stroke:var(--card,#fff);stroke-width:5px}
.is-topic-map .network-node .network-core{stroke:var(--card,#fff);stroke-width:2}
.is-topic-map .network-node .network-center-dot{fill:var(--card,#fff)}
.network-workspace:has(.network-sidebar[hidden]){grid-template-columns:minmax(0,1fr)}
.network-workspace:has(.network-sidebar[hidden])>.network-plot{grid-column:1}
.network-node.network-selected>text{visibility:hidden}
.network-full-question{box-sizing:border-box;width:fit-content;max-width:100%;margin:auto;padding:4px 9px;border:1px solid var(--line,#bbb);border-radius:7px;background:var(--card,#fff);color:var(--ink,#30382c);font:600 14px/1.35 system-ui;text-align:center;overflow-wrap:anywhere}
