/* ============================================================================
   shared/graph-canvas.css — the shared node-graph canvas view (graph-canvas.js,
   graph-canvas-standard.mdc). Typed port-to-port nodes, bezier wires, a pannable/
   zoomable view, and the add-node palette. Extracted from the reference canvas in
   the first canvas that grew it, so every graph domain shares one look + grammar.
   SPEC tokens only. Classes are `gc-` prefixed so a host page's own styles never clash.
   ========================================================================== */
/* THE CANVAS TAKES THE HEIGHT IT IS GIVEN — the floor is a HOST decision, not this component's.
   It carried `min-height:520px`, which is not a minimum the canvas can enforce, only a size it can
   exceed its container by: a shared component cannot know how tall its dock is, and where the dock
   was shorter the canvas simply grew past it. Measured, at 1520×900: sound-workspace drew a 520px
   canvas inside a 430px track whose overflow is `visible`, so 90px of it painted over what sits
   below the stage. The pipeline had already met the same thing and answered it locally
   (`pipeline.css`: "would overflow the shortened track and bleed its bottom overlays"), which is
   the tell — a second surface patching a shared rule is the shared rule being wrong
   (`connect-dont-fork.md`). With `min-height:0` the canvas cannot exceed its track anywhere, and a
   host that wants a floor puts one on its own pane, where the available height is actually known. */
.gc-cvs{position:relative;overflow:hidden;background:var(--well) radial-gradient(circle,var(--card) 1px,transparent 1px);background-size:22px 22px;min-height:0;height:100%;cursor:grab}
.gc-cvs.grabbing{cursor:grabbing}
.gc-view{position:absolute;inset:0;transform-origin:0 0}
.gc-wires{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1}
.gc-wires path{fill:none;stroke:var(--faint);stroke-width:2}
.gc-wires path.hot{stroke:var(--accent)}
.gc-wires path.bad{stroke:var(--danger)}
.gc-wires path.selw{stroke:var(--accent-text);stroke-width:2.5}
.gc-wires path.temp{stroke:var(--accent-text);stroke-dasharray:4 3}
.gc-wires path.hit{stroke:transparent;stroke-width:12;pointer-events:stroke;cursor:pointer}
/* EXEC WIRES — a domain-declared capability (B6). Thick `--ink` against the 2 px
   faint data stroke, so the two kinds cannot be mistaken for each other. Only a
   canvas whose graph declared `wirePolicy.imperative` ever assigns this class;
   every other domain keeps the 2 px rule above, unchanged. */
.gc-wires path.gc-exec{stroke:var(--ink);stroke-width:3.5}
.gc-wires path.gc-exec.hot{stroke:var(--ink)}
.gc-wires path.gc-exec.selw{stroke:var(--accent-text);stroke-width:4}
.gc-wires path.gc-exec.temp{stroke:var(--ink);stroke-width:3.5}
.gc-wires path.gc-exec.bad{stroke:var(--danger);stroke-width:3.5}
/* a domain-supplied read-out on the wire (opts.wireLabel) — provenance, so it
   recedes to neutral; `warn` is the one state that earns colour, because it means
   the runtime will act on this wire (ui-and-authoring-docs §2: emphasis follows
   importance). Tabular so counts on parallel wires line up. */
.gc-wires text.gc-wlbl{fill:var(--muted);font:10px 'Figtree','Segoe UI',sans-serif;font-variant-numeric:tabular-nums;pointer-events:none;paint-order:stroke;stroke:var(--well);stroke-width:3px;stroke-linejoin:round}
.gc-wires text.gc-wlbl.warn{fill:var(--warn);font-weight:600}

/* nodes */
.gc-node{position:absolute;width:150px;background:var(--panel);border-radius:8px;font-size:11px;box-shadow:0 3px 10px rgba(0,0,0,.4);z-index:2;cursor:grab}
.gc-node.sel{box-shadow:0 0 0 1.5px var(--accent),0 6px 18px rgba(0,0,0,.5)}
/* CO-SELECTED — two grades of ONE state, never a second colour (hierarchy-standard §7):
   the active node keeps the full ring, a co-selected one takes the same accent at half
   weight. Both halves are load-bearing — without the weaker grade you cannot see what a
   group will take in, and without the difference you cannot see which one the inspector
   is showing. */
.gc-node.msel{box-shadow:0 0 0 1.5px var(--accent-soft),0 4px 14px rgba(0,0,0,.45)}
.gc-node.out{box-shadow:0 0 0 1px var(--accent),0 3px 10px rgba(0,0,0,.4)}
.gc-node.out.sel{box-shadow:0 0 0 1.5px var(--accent),0 6px 18px rgba(0,0,0,.5)}
.gc-node.bad{box-shadow:0 0 0 1.5px var(--danger),0 6px 18px rgba(0,0,0,.5)}
.gc-node.is-head{box-shadow:inset 3px 0 0 var(--accent)}
.gc-nh{height:24px;display:flex;align-items:center;gap:5px;padding:0 8px;background:var(--card);color:var(--text2);font-weight:600;border-radius:8px 8px 0 0}
.gc-node.sel .gc-nh{background:var(--hover)}
.gc-node.out .gc-nh{color:var(--accent-text)}
.gc-nh .gc-rm{margin-left:auto;font-size:11px;color:var(--faint);cursor:pointer}
/* a reference node's asset — provenance, so it recedes to neutral and never competes with the title */
.gc-nref{display:flex;align-items:center;gap:5px;padding:2px 8px 3px;font-family:Consolas,monospace;font-size:10.5px;color:var(--muted);background:var(--card);border-top:1px solid var(--line)}
/* the KIND of graph this node accepts — so a generically-titled reference node cannot overclaim what
   it can point at. Until a Subgraph derives its ports from the referenced graph, the kind is the
   honest statement of the constraint that is actually enforced. */
.gc-nkind{color:var(--faint)}
.gc-nh .gc-rm:hover{color:var(--danger)}
.gc-sub{height:16px;line-height:16px;padding:0 10px;font-size:9.5px;font-family:Consolas,monospace;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid var(--line)}
.gc-sub .gc-sw{display:inline-block;width:9px;height:9px;border-radius:2px;vertical-align:-1px;margin-right:3px;border:1px solid var(--line)}
.gc-body{padding:4px 0}
.gc-row{position:relative;height:18px;line-height:18px;padding:0 10px;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gc-row.rout{text-align:right}
.gc-row .gc-ty{color:var(--faint);font-size:9.5px;font-family:Consolas,monospace}
.gc-row .gc-def{color:var(--faint);font-size:9px;font-style:italic}
.gc-port{position:absolute;top:4.5px;width:9px;height:9px;border-radius:50%;background:var(--faint);border:1.5px solid var(--panel);cursor:crosshair;z-index:3}
.gc-port.pin{left:-4.5px}
.gc-port.pout{right:-4.5px}
.gc-port.wired{background:var(--accent)}
.gc-port:hover{background:var(--accent-text);transform:scale(1.15)}
.gc-port.badp{border-color:var(--danger);background:var(--danger-soft)}
/* EXEC PINS — a chevron, not a circle, so the kind is a shape not a hue
   (ui-and-authoring-docs §8). `--ink` idle, never the data pin's faint dot.
   Prefixed `gc-exec`: a bare `.exec` would be the Input-workspace `.acts` collision
   wearing a different name. */
.gc-port.gc-exec{border-radius:0;width:8px;height:10px;top:4px;clip-path:polygon(0 0,100% 50%,0 100%);background:var(--ink);border:none}
.gc-port.gc-exec.pin{left:-4px}
.gc-port.gc-exec.pout{right:-4px}
.gc-port.gc-exec.wired{background:var(--ink)}
.gc-port.gc-exec:hover{background:var(--accent-text);transform:none}
.gc-port.gc-exec.badp{background:var(--danger)}

/* toolbar + zoom chip */
.gc-tools{position:absolute;top:8px;left:8px;z-index:6;display:flex;gap:6px;font-size:11px;align-items:center}
.gc-tools .b{background:rgba(28,30,36,.92);border:1px solid var(--line);border-radius:6px;padding:2px 9px;color:var(--text2);cursor:pointer}
.gc-tools .b:hover{background:var(--hover);color:var(--accent-text)}
.gc-tools .b.err{border-color:var(--danger);color:var(--danger);background:var(--danger-soft)}
.gc-tools .b.ok{border-color:rgba(127,199,143,.35);color:var(--ok)}
/* the compile READ-OUT — the same chip shape as a toolbar button, deliberately without the
   pointer cursor and hover, because it is not actuable and must not promise that it is */
.gc-tools .gc-stat{background:rgba(28,30,36,.92);border:1px solid var(--line);border-radius:6px;padding:2px 9px;color:var(--text2);cursor:default}
.gc-tools .gc-stat.err{border-color:var(--danger);color:var(--danger);background:var(--danger-soft)}
.gc-tools .gc-stat.ok{border-color:rgba(127,199,143,.35);color:var(--ok)}
.gc-zoom{position:absolute;bottom:8px;right:8px;z-index:6;background:rgba(28,30,36,.92);border:1px solid var(--line);border-radius:6px;padding:2px 8px;color:var(--muted);font-size:11px;font-family:Consolas,monospace;cursor:pointer}
.gc-hint{position:absolute;bottom:8px;left:8px;z-index:6;color:var(--faint);font-size:10.5px;background:rgba(16,17,22,.7);border-radius:6px;padding:2px 8px}
.gc-hint .help-info{min-height:0;margin:0}
.gc-hint .tooltip-popover{top:auto;right:auto;bottom:calc(100% + 6px);left:0}

/* palette */
.gc-palette{position:absolute;z-index:20;width:186px;max-height:340px;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 14px 40px rgba(0,0,0,.6);padding:6px;display:none}
.gc-palette.show{display:block}
.gc-psearch{width:100%;background:var(--well);border:1px solid var(--line);border-radius:7px;color:var(--ink);font:12px inherit;padding:4px 8px;margin-bottom:4px;outline:none}
.gc-psearch:focus{border-color:var(--accent)}
.gc-pflt{color:var(--accent-text);font-size:10px;padding:2px 6px}
.gc-pcat{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);padding:5px 6px 2px}
.gc-pitem{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border-radius:6px;background:var(--card);color:var(--text2);font-size:11.5px;cursor:pointer;margin:2px 0}
.gc-pitem:hover{background:var(--hover);color:var(--accent-text)}
.gc-pitem .pty{font-size:9px;color:var(--faint);font-family:Consolas,monospace}
.gc-pitem.dis{opacity:.4;cursor:not-allowed}

/* subgraphs — an openable composite node + the dive breadcrumb (graph-canvas-standard §1.1) */
.gc-node.sub{box-shadow:0 0 0 1px var(--accent-soft),0 3px 10px rgba(0,0,0,.4)}
.gc-nh .gc-dive{margin-left:auto;font-size:11px;color:var(--muted);cursor:pointer}
.gc-nh .gc-dive:hover{color:var(--accent-text)}
.gc-nh .gc-dive ~ .gc-rm{margin-left:6px}
.gc-crumbs{display:none;align-items:center;gap:4px}
.gc-crumbs.show{display:flex}
.gc-crumb{background:rgba(28,30,36,.92);border:1px solid var(--line);border-radius:6px;padding:2px 8px;color:var(--text2);cursor:pointer;font-size:11px}
.gc-crumb:hover{color:var(--accent-text);border-color:var(--muted)}
.gc-crumb.cur{color:var(--accent-text);border-color:var(--accent);cursor:default}
.gc-crumbsep{color:var(--faint);font-size:11px}

/* ---- DERIVED ANNOTATIONS ---------------------------------------------------
   A read-only marker the canvas DERIVES rather than stores: it has no node in
   the graph, cannot be dragged, cannot be deleted, and disappears the moment the
   thing it reflects goes away. The Effect domain's external-channel chip is the
   first — a channel a steering module queries that no emitter here publishes, so
   the perception link has something to terminate on instead of pointing at
   nothing (flocking-authoring.html §9.1).

   It reads QUIETER than a node on purpose: a node is authored, this is observed,
   and emphasis follows importance. Dashed border for "not a thing you made". */
.gc-annot{position:absolute;width:130px;background:var(--card);border:1px dashed var(--muted);
  border-radius:8px;font-size:10.5px;z-index:1;cursor:help;opacity:.92}
.gc-annot:hover{opacity:1;border-color:var(--warn)}
.gc-annot .gc-ah{display:flex;align-items:center;gap:5px;padding:3px 8px;color:var(--text2);
  font-family:Consolas,monospace;font-size:10.5px}
.gc-annot .gc-akind{color:var(--warn);font-size:9.5px;text-transform:uppercase;letter-spacing:.04em}
.gc-annot .gc-anote{padding:0 8px 4px;color:var(--faint);font-size:10px;font-variant-numeric:tabular-nums}
/* the derived link: dashed and amber, so it can never be mistaken for an
   authored event wire (solid, accent) or a data wire (dashed, violet) */
.gc-wires path.gc-perc{stroke:var(--warn);stroke-width:1.2;stroke-dasharray:4 3;fill:none;opacity:.85}
