body.scheme-page { --scheme-border:#dce1ec; }
.scheme-top { background:var(--nav); color:#fff; }
.scheme-top-inner { display:flex; align-items:center; gap:14px; max-width:1600px; margin:auto; padding:15px clamp(12px,3vw,34px); flex-wrap:wrap; }
.scheme-top h1 { font-size:clamp(20px,3vw,28px); }
.scheme-top .button { background:#2c354d; border-color:#414a62; color:#fff; }
.scheme-top .button:hover { background:#414a62; }
.scheme-top .dim { color:#c5cde1; }
.scheme-main { max-width:1600px; margin:auto; padding:17px clamp(10px,3vw,34px) 20px; }
.scheme-toolbar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px 16px; margin-bottom:12px; }
.scheme-toolbar label { min-width:min(250px,100%); width:min(33%,380px); }
.scheme-toolbar #feedback { margin-left:auto; align-self:center; }
.scheme-feedback { margin-bottom:12px; }
.scheme-editor-layout { display:grid; grid-template-columns:minmax(0,1fr) 325px; gap:12px; align-items:start; }
.canvas-panel,.scheme-inspector { background:#fff; border:1px solid var(--scheme-border); border-radius:12px; overflow:hidden; min-width:0; }
.canvas-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:9px 10px; border-bottom:1px solid var(--scheme-border); }
.canvas-toolbar .button { padding:5px 9px; }
#zoom-value { min-width:36px; text-align:center; font-size:12px; color:var(--muted); }
.canvas-legend { display:flex; flex-wrap:wrap; gap:4px 10px; color:var(--muted); font-size:11px; }
.canvas-legend span::before { content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--kind); margin-right:4px; }
[data-kind="source"] { --kind:#268b83; --tint:#e3f6f3; }
[data-kind="current"] { --kind:#527cba; --tint:#eaf1ff; }
[data-kind="idea"] { --kind:#754cc5; --tint:#f1eaff; }
[data-kind="result"] { --kind:#388253; --tint:#e9f7ee; }
.canvas-viewport { position:relative; height:clamp(450px,calc(100dvh - 202px),950px); overflow:auto; background-color:#f7f8fc; background-image:radial-gradient(#c8cfe1 1px,transparent 1px); background-size:19px 19px; }
#surface { position:relative; overflow:hidden; }
#plane { position:absolute; inset:0 auto auto 0; transform-origin:top left; }
#edges,#nodes { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
.edge-line { fill:none; stroke:#767e9a; stroke-width:2; }
.edge-label { font-size:12px; font-weight:650; fill:#36425f; text-anchor:middle; paint-order:stroke fill; stroke:#f7f8fc; stroke-width:6px; stroke-linejoin:round; }
.edge-hit { fill:none; stroke:transparent; stroke-width:15; pointer-events:stroke; }
[data-edge] :is(.edge-hit,.edge-label) { cursor:pointer; }
[data-edge] .edge-label { pointer-events:all; }
[data-edge]:is(:hover,:focus-visible,.is-selected) .edge-line { stroke:var(--accent); stroke-width:3; }
.scheme-node { position:absolute; width:218px; height:86px; background:#fff; border:1px solid #d6dbea; border-left:5px solid var(--kind); border-radius:9px; box-shadow:0 3px 8px #25305715; pointer-events:auto; }
.scheme-node.is-selected { outline:2px solid var(--accent); outline-offset:2px; }
.scheme-node-title,.node-grip { border:0; background:transparent; color:var(--ink); }
.scheme-node-title { display:grid; gap:2px; text-align:left; width:100%; height:100%; align-content:center; padding:7px 28px 9px 10px; border-radius:6px; }
.scheme-node-title strong,.scheme-node-title small { overflow:hidden; text-overflow:ellipsis; }
.scheme-node-title strong { font-size:14px; line-height:1.2; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow-wrap:anywhere; }
.scheme-node-title small { color:var(--muted); font-size:11px; white-space:nowrap; }
.node-type { justify-self:start; padding:0 4px; border-radius:3px; background:var(--tint); color:#303b55; font-size:10px; font-weight:700; }
.node-grip { position:absolute; top:5px; right:4px; padding:2px 4px; cursor:grab; touch-action:none; color:var(--muted); }
.node-grip:active { cursor:grabbing; }
.scheme-inspector-head { display:flex; align-items:center; justify-content:space-between; padding:10px 11px; gap:6px; border-bottom:1px solid var(--scheme-border); }
.scheme-inspector-head h2 { font-size:16px; overflow-wrap:anywhere; }
#inspector { display:grid; gap:9px; padding:11px; }
#inspector label textarea { min-height:55px; }
#inspector .edge-row { white-space:normal; display:block; width:100%; text-align:left; overflow-wrap:anywhere; }
#inspector .edge-row + .edge-row { margin-top:4px; }
#inspector h3 { font-size:13px; }
#inspector .inspector-actions { display:flex; gap:6px; flex-wrap:wrap; }
#connect-form { display:grid; gap:9px; }
@media (max-width:910px) {
  .scheme-editor-layout { grid-template-columns:minmax(0,1fr); }
  .canvas-viewport { height:clamp(350px,57dvh,680px); }
}
