/* Work in motion · Operate — graph and worker output styles. */
.wim-graph { display: grid; gap: 10px; min-width: 0; }
.wim-graph__toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wim-graph__control, .wim-graph__role-actions button, .wim-graph__edgelist-items button {
  min-height: 36px; padding: 6px 10px; color: var(--wim-ink, #ecebe6); background: #202326;
  border: 1px solid var(--wim-line-strong, #4b5056); border-radius: 6px; font: inherit; cursor: pointer;
}
.wim-graph__control:hover:not(:disabled), .wim-graph__role-actions button:hover { background: #303033; border-color: #c18a35; }
.wim-graph__control:disabled, .wim-graph__role-actions button:disabled { opacity: .5; cursor: not-allowed; }
.wim-graph__control:focus-visible, .wim-graph__node-head:focus-visible, .wim-graph__port:focus-visible, .wim-graph__edge:focus-visible, .wim-graph__role-input:focus-visible { outline: 2px solid #f0b429; outline-offset: 2px; }
.wim-graph__summary, .wim-graph__hint, .wim-graph__zoom { margin: 0; color: var(--wim-ink-2, #bdbab2); font-size: .8125rem; }
.wim-graph__canvas { position: relative; overflow: auto; max-height: 640px; min-height: 240px; background: #151719; border: 1px solid #34383c; border-radius: 8px; }
.wim-graph__stage { position: relative; transform-origin: top left; }
.wim-graph__nodes { position: absolute; inset: 0; pointer-events: none; }
.wim-graph__edges { position: absolute; inset: 0; overflow: visible; }
.wim-graph__node { position: absolute; width: 220px; height: 150px; box-sizing: border-box; color: var(--wim-ink, #ecebe6); background: #202326; border: 1px solid #4b5056; border-radius: 8px; pointer-events: auto; }
.wim-graph__node:has(.wim-graph__node-head[aria-pressed="true"]) { border-color: #f0b429; background: #292419; }
.wim-graph__node[data-status="failed"] { border-color: #ff8a80; }
.wim-graph__node[data-status="running"] { border-color: #7cb8ff; }
.wim-graph__node-head { display: grid; gap: 5px; width: 100%; min-height: 55px; padding: 9px 14px; text-align: left; color: inherit; background: transparent; border: 0; cursor: grab; touch-action: none; }
.wim-graph__node-head:active { cursor: grabbing; }
.wim-graph__title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wim-graph__meta { color: #bdbab2; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wim-graph__role { padding: 0 14px 8px; }
.wim-graph__role-input { display: block; box-sizing: border-box; resize: none; width: 100%; height: 44px; padding: 5px 7px; color: #ecebe6; background: #151719; border: 1px solid #555a5e; border-radius: 4px; font: inherit; font-size: .75rem; }
.wim-graph__role-input::placeholder { color: #bdbab2; }
.wim-graph__role-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 4px; }
.wim-graph__role-actions button { min-height: 28px; padding: 2px 8px; font-size: .75rem; }
.wim-graph__port { position: absolute; top: calc(50% - 22px); width: 44px; height: 44px; padding: 0; background: transparent; border: 0; cursor: crosshair; touch-action: none; }
.wim-graph__port::after { content: ''; display: block; width: 12px; height: 12px; margin: auto; border: 2px solid #f0b429; border-radius: 50%; background: #202326; }
.wim-graph__port--in { left: -22px; } .wim-graph__port--out { right: -22px; }
.wim-graph__port[data-valid="true"]::after { background: #f0b429; box-shadow: 0 0 0 4px #f0b42940; }
.wim-graph__port[hidden], .wim-graph__role[hidden] { display: none; }
.wim-graph__edge { fill: none; stroke: transparent; stroke-width: 20; pointer-events: stroke; cursor: pointer; }
.wim-graph__edge-line { fill: none; stroke: #aaa59b; stroke-width: 2; pointer-events: none; }
.wim-graph__edge-line[data-state="pending"] { stroke-dasharray: 6 4; }
.wim-graph__edge-line[data-state="satisfied"] { stroke: #7fd1a8; }
.wim-graph__edge-line[data-state="blocked"] { stroke: #ff8a80; }
.wim-graph__edge-line[data-selected="true"] { stroke: #f0b429; stroke-width: 4; }
.wim-graph__feedback { margin: 0; color: #f0c979; font-size: .8125rem; }
.wim-graph__feedback:empty { display: none; }
.wim-graph__port:disabled::after { border-color: #77746d; }
.wim-graph__ghost { fill: none; stroke: #f0b429; stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.wim-graph__edgelist { color: #bdbab2; font-size: .8125rem; }
.wim-graph__edgelist-summary { cursor: pointer; min-height: 32px; }
.wim-graph__edgelist-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.wim-graph__empty { padding: 24px 16px; border: 1px dashed #4b5056; border-radius: 6px; color: #bdbab2; text-align: center; }

/* ── Worker output ─────────────────────────────────────────────────────── */
.wim-out { display: grid; gap: 6px; min-width: 0; }
.wim-out__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--wim-fs-1, .75rem); color: var(--wim-ink-2, #bdbab2); }
.wim-out__meta { flex: 1 1 220px; min-width: 0; font-family: var(--wim-font-mono, monospace); overflow-wrap: anywhere; }
.wim-out__window { color: var(--wim-ink-3, #95928a); }
.wim-out__follow, .wim-out__copy, .wim-out__jump {
  font: 600 var(--wim-fs-1, .75rem)/1.35 var(--wim-font-sans, system-ui, sans-serif); min-height: 32px; padding: 4px 10px;
  color: var(--wim-ink, #ecebe6); background: transparent; border: 1px solid var(--wim-line-strong, #4b5056); border-radius: var(--wim-radius, 6px); cursor: pointer;
}
.wim-out__follow:hover, .wim-out__copy:hover, .wim-out__jump:hover { background: #2a2d31; }
.wim-out__follow[aria-pressed="true"] { border-color: var(--wim-st-run, #7cb8ff); }
.wim-out__follow[aria-pressed="true"]::before { content: "● "; color: var(--wim-st-run, #7cb8ff); }
.wim-out__follow[aria-pressed="false"]::before { content: "○ "; }
.wim-out__status:empty { display: none; }
.wim-out__pre {
  margin: 0; max-height: 360px; overflow: auto; padding: 8px 10px;
  font: 400 var(--wim-fs-2, .8125rem)/1.45 var(--wim-font-mono, monospace);
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 4; font-variant-ligatures: none;
  color: var(--wim-ink, #ecebe6); background: #0d0e0f; border: 1px solid var(--wim-line, #34383c); border-radius: 4px;
}
.wim-out__chunk[data-stream="stderr"] {
  border-inline-start: 2px dashed var(--wim-st-fail, #ff8a80); padding-inline-start: 4px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.wim-out__jump { justify-self: start; border-color: var(--wim-accent, #f0b429); }
.wim-out__details { font-size: var(--wim-fs-1, .75rem); color: var(--wim-ink-3, #95928a); }
.wim-out__details-summary { cursor: pointer; min-height: 28px; padding: 4px 0; }
.wim-out__chunklist { max-height: 160px; overflow: auto; font-family: var(--wim-font-mono, monospace); overflow-wrap: anywhere; }
.wim-out__chunkmeta[data-stream="stderr"] { color: var(--wim-st-fail, #ff8a80); }
.wim-out__empty { color: var(--wim-ink-3, #95928a); font-size: var(--wim-fs-2, .8125rem); }

@media (max-width: 639px) {
  .wim-out__pre { max-height: 240px; }
  .wim-out__follow, .wim-out__copy, .wim-out__jump, .wim-graph__edgelist-summary { min-height: 44px; }
}
