/* Pipelines editor (/workflows/{id}): workflow_editor_screen.dart, the
 * canvas, the node palette and the logs panel. Flutter logical px; the page
 * is drawn at the shell's 90% like the app. The canvas is world units under
 * a transform (editor.js), so card sizes here are the unscaled ones.
 *
 * Flutter's w600 is the Regular face emboldened by Skia, which is much
 * lighter than Chrome's synthetic bold of the same face: side by side, the
 * htmx titles read a size heavier. So w600 here is weight 400 plus a hairline
 * text stroke, calibrated on the captures (ink within 1% at 14 px; Skia
 * emboldens small text relatively more, hence the thinner strokes below
 * 14 px still read the same). w500 is plain 400, as Flutter draws it. */

:root {
  --wfe-grid: rgba(0, 0, 0, .025);
  --wfe-wire-legacy: color-mix(in srgb, var(--text-2) 70%, transparent);
  --wfe-hairline: rgba(255, 255, 255, .05); /* Colors.white 5%: the panels' edge, invisible on light */
  --wfe-hairline-2: rgba(255, 255, 255, .06);
}
:root[data-theme="dark"] {
  --wfe-grid: rgba(255, 255, 255, .03);
  --wfe-wire-legacy: rgba(255, 255, 255, .25);
}

.page.wfe-host { padding: 0; overflow: hidden; scrollbar-gutter: auto; }
/* The agent's button stays off the editor (ShellAgentFab._coversControls). */
.page.wfe-host + .fab-wrap { display: none; }
.wfe { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.wfe [x-cloak] { display: none !important; }

/* The editor drops the shell's top bar (page.html): its own bar is the top
 * of the main column, and the loading line runs along the very top. */
.main.wfe-main { --topbar-h: 0px; }

/* ── Top bar (_buildTopBar: 56 high, the three clusters share one centre) ──
 * Two equal flexible sides keep the status line on the bar's centre while
 * there is room; when there is not, the status line gives way first and
 * truncates (the title keeps 160 px, the actions never shrink), so the
 * three never overlap. */
.wfe-bar { position: relative; flex: none; height: 56px; padding: 0 8px 0 16px; display: flex; align-items: center; background: var(--card); border-bottom: 1px solid var(--border); }
.wfe-bar-left { flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 160px; }
.wfe-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); flex: none; }
.wfe-back:hover { background: var(--hover); }
.wfe-title { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: calc(40vw / var(--zoom)); }
.wfe-title b { font-size: 14px; font-weight: 400; -webkit-text-stroke: .35px currentColor; line-height: 21px; letter-spacing: .15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfe-unsaved { flex: none; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; line-height: 1.17; letter-spacing: 0; color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.wfe-source { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.wfe-status { flex: 0 1 auto; min-width: 0; padding: 0 12px; display: flex; align-items: center; overflow: hidden; font-size: 12px; line-height: 1.17; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.wfe-st-idle { display: flex; align-items: center; min-width: 0; max-width: 560px; }
.wfe-st-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wfe-st-err, .wfe-st-ok { display: flex; align-items: center; gap: 4px; margin-left: 10px; min-width: 0; color: var(--error); }
.wfe-st-ok { color: var(--success); }
.wfe-st-msg { overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.wfe-st-err button { display: grid; color: var(--error); }
.wfe-st-run { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 480px; }
/* A run takes the middle of the bar: the line asks for its room instead of
   shrinking to its content, and the bar grows in it, the text after it. */
.wfe-status.is-running { flex: 0 1 560px; }
.wfe-status.is-running .wfe-st-run { flex: 1 1 auto; max-width: none; }
.wfe-st-run em { font-style: normal; font-weight: 500; color: var(--success); overflow: hidden; text-overflow: ellipsis; }
.wfe-status.is-running .wfe-st-run em { flex: 0 1 auto; min-width: 3em; max-width: 260px; }
.wfe-st-run em.is-primary { color: var(--primary); }
.wfe-st-bar { display: block; flex: 0 1 200px; min-width: 40px; height: 4px; border-radius: 2px; background: var(--surface-light); overflow: hidden; }
.wfe-status.is-running .wfe-st-bar { flex: 1 1 auto; min-width: 120px; }
.wfe-st-bar s { display: block; height: 100%; background: var(--success); transition: width 300ms var(--ease-out); }
.wfe-actions { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.wfe-actions-row { display: flex; align-items: center; gap: 8px; }
.wfe-chipbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-light); color: var(--text-2); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.wfe-chipbtn:hover:not([disabled]) { background-image: linear-gradient(var(--hover), var(--hover)); }
.wfe-chipbtn.is-on { background: var(--selected); color: var(--text); }
.wfe-chipbtn[disabled] { color: var(--muted); cursor: default; }
.wfe-chipbtn.is-sched { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.wfe-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 24px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: .1px; white-space: nowrap; }
.wfe-btn > span { display: inline-flex; }
.wfe-btn:hover:not([disabled]) { background-image: linear-gradient(rgba(255, 255, 255, .08), rgba(255, 255, 255, .08)); }
.wfe-btn.is-secondary { background: var(--surface); color: var(--text); }
.wfe-btn.is-secondary:hover:not([disabled]) { background-image: linear-gradient(var(--hover), var(--hover)); }
.wfe-btn[disabled] { background: color-mix(in srgb, var(--text) 12%, transparent); color: color-mix(in srgb, var(--text) 38%, transparent); cursor: default; }
.wfe-btn.is-wide { width: 100%; height: auto; padding: 6px 0; font-weight: 400; -webkit-text-stroke: .35px currentColor; }
.wfe-btn.is-wide[disabled] { background: color-mix(in srgb, var(--primary) 50%, transparent); color: #fff; }

/* Spinners (CircularProgressIndicator, strokeWidth 2) */
.wfe-spin { --c: var(--success); display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c); border-right-color: transparent; animation: wfespin 900ms linear infinite; }
.wfe-spin.is-primary { --c: var(--primary); }
.wfe-spin.is-small { --c: var(--primary); width: 12px; height: 12px; }
.wfe-spin.is-big { --c: var(--primary); width: 20px; height: 20px; }
.wfe-spin.is-white { --c: #fff; }
@keyframes wfespin { to { transform: rotate(360deg); } }

/* ── Body: palette | canvas | side panel ── */
.wfe-body { flex: 1; min-height: 0; display: flex; }

/* Node palette. The fold's container and the palette each draw a right
   border, and the canvas its own left one: three hairlines, as in the app. */
.wfe-pal { flex: none; width: 200px; background: var(--card); border-right: 1px solid var(--border); transition: width 180ms var(--ease-out); position: relative; }
.wfe-pal.is-rail { width: 36px; }
.wfe-pal-open { position: absolute; inset: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.wfe-pal-fold { position: absolute; top: 8px; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); z-index: 1; }
.wfe-pal-fold:hover, .wfe-pal-rail button:hover { background: var(--hover); }
.wfe-pal-head { padding: 17px 16px 8px; font-size: 10px; font-weight: 400; -webkit-text-stroke: .26px currentColor; line-height: 14.5px; letter-spacing: .5px; color: var(--text-2); }
.wfe-pal-search { position: relative; display: flex; align-items: center; height: 40px; margin: 0 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-light); }
.wfe-pal-search .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.wfe-pal-search input { width: 100%; height: 100%; padding: 0 8px 0 43px; border: 0; background: none; outline: none; font-size: 13px; letter-spacing: 0; color: var(--text); }
.wfe-pal-search input::placeholder { font-size: 12px; color: var(--muted); opacity: 1; }
.wfe-pal-search:focus-within { border-color: var(--primary); }
.wfe-pal-list { flex: 1; min-height: 0; overflow: auto; margin-top: 14px; padding: 0 12px 16px; scrollbar-width: thin; }
.wfe-pal-cat { padding: 8px 0 6px; font-size: 10px; font-weight: 400; -webkit-text-stroke: .26px currentColor; line-height: 1.17; letter-spacing: .6px; color: var(--muted); }
.wfe-pitem { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--hover); cursor: grab; user-select: none; touch-action: none; }
.wfe-pitem.is-ghost { opacity: .5; }
.wfe-pbox { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 6px; color: var(--c, var(--text-2)); background: color-mix(in srgb, var(--c, var(--text-2)) 10%, transparent); }
.wfe-ptext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wfe-ptext b { font-size: 12px; font-weight: 400; -webkit-text-stroke: .3px currentColor; line-height: 16px; letter-spacing: .4px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfe-ptext small { font-size: 10px; line-height: 13.3px; letter-spacing: .4px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wfe-pal-none { margin: 0; padding: 12px 12px; font-size: 12px; color: var(--muted); }
.wfe-pal-rail { display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 8px; }
.wfe-pal-rail button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.wfe-pal-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 400; -webkit-text-stroke: .26px currentColor; letter-spacing: .5px; color: var(--text-2); }
.wfe-pfeed { --c: var(--text-2); position: fixed; z-index: 100; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 8px; background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); color: var(--c); }
.wfe-pfeed .ic { width: 20px; height: 20px; }
.wfe-pfeed b { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }

/* ── Canvas ── */
/* overflow: clip, not hidden: a hidden overflow is still a scroll container,
   and focusing a card's button past the edge scrolled the world out from
   under the pan maths (cards stopped landing under the pointer). */
.wfe-canvas {
  flex: 1; min-width: 0; position: relative; overflow: clip; touch-action: none; user-select: none;
  background-color: var(--bg); border: 1px solid var(--border);
  background-image: linear-gradient(to right, var(--wfe-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--wfe-grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.wfe-canvas.is-panning { cursor: grabbing; }
.wfe-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; --s: 1; }
.wfe-graph { position: absolute; left: 0; top: 0; }
.wfe-wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.wfe-wires path { fill: none; stroke: var(--c); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.wfe-wires polygon { fill: var(--c); }
.wfe-edel { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--error); color: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); opacity: 0; transform: scale(calc(.5 / var(--s))); transition: opacity 150ms linear, transform 150ms linear; }
.wfe-edel:hover { opacity: 1; transform: scale(calc(1 / var(--s))); }
.wfe-wire-drag { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; display: none; }
.wfe-wire-drag.is-on { display: block; }
.wfe-wire-drag line { stroke: color-mix(in srgb, var(--primary) 60%, transparent); stroke-width: 2px; }
.wfe-wire-drag.is-bad line { stroke: var(--error); }
.wfe-drop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 16px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-size: 14px; font-weight: 500; pointer-events: none; }
/* 16 from the corner, lifted clear of the agent's button (kAgentFabClearance 64). */
.wfe-zoom { position: absolute; right: 16px; bottom: 80px; padding: 6px 12px; border-radius: 4px; border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 80%, transparent); font-size: 12px; line-height: 1.17; letter-spacing: 0; color: var(--text-2); pointer-events: none; }

/* A node card (_NodeWidget): 200 wide, tinted by its output's type. */
.wfe-node {
  --nc: var(--text-2); --nb: var(--border);
  position: absolute; width: 200px; display: flex; flex-direction: column; padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--nb); background: var(--card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2); cursor: grab;
}
.wfe-node:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .2), 0 4px 15px color-mix(in srgb, var(--nc) 20%, transparent); }
.wfe-node.is-sel { border: 2px solid var(--nc); }
.wfe-canvas.is-moving .wfe-node { cursor: grabbing; }
.wfe-nhead { display: flex; align-items: flex-start; }
.wfe-nicon { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 4px; color: var(--nc); background: color-mix(in srgb, var(--nc) 10%, transparent); }
.wfe-nlabel { flex: 1; min-width: 0; margin: 0 4px 0 8px; font-size: 12px; font-weight: 400; -webkit-text-stroke: .3px currentColor; line-height: 15px; letter-spacing: .4px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wfe-nact { display: flex; gap: 4px; flex: none; }
.wfe-nact > * { display: grid; place-items: center; width: 16px; height: 16px; visibility: hidden; cursor: pointer; }
.wfe-node:hover .wfe-nact > *, .wfe-node.is-sel .wfe-nact > *, .wfe-node.is-testing .wfe-nact > [data-act="test"] { visibility: visible; }
.wfe-nact [data-act="test"] { color: var(--primary); }
.wfe-nact [data-act="test"] .wfe-spin { display: none; }
.wfe-node.is-testing .wfe-nact [data-act="test"] .wfe-spin { display: block; }
.wfe-node.is-testing .wfe-nact [data-act="test"] .ic { display: none; }
.wfe-nact [data-act="dup"] { color: var(--text-2); }
.wfe-nact [data-act="del"] { color: color-mix(in srgb, var(--error) 70%, transparent); }
.wfe-nfoot { margin-top: auto; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 10px; font-weight: 400; line-height: 1.172; letter-spacing: 0; color: var(--muted); }
.wfe-nfoot .ic { color: var(--t); }
.wfe-nfoot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Flutter places the pips from the card's outer edge; CSS from inside its
   border, which is 2 px on a selected card. */
.wfe-port { position: absolute; width: 12px; height: 12px; margin-top: -7px; border-radius: 50%; background: var(--pc); border: 1.5px solid var(--card); }
.wfe-port.is-in { left: -7px; }
.wfe-node.is-sel .wfe-port { margin-top: -8px; }
.wfe-node.is-sel .wfe-port.is-in { left: -8px; }
.wfe-port.is-out { right: -7px; cursor: cell; box-shadow: 0 0 5px color-mix(in srgb, var(--pc) 40%, transparent); }
.wfe-node.is-sel .wfe-port.is-out { right: -8px; }
.wfe-port.is-out::before { content: ""; position: absolute; inset: -9px -9px -9px -9px; }

/* ── Execution Logs (_WorkflowLogsPanel, 360 wide) ── */
.wfe-logs { flex: none; width: 360px; display: flex; flex-direction: column; background: var(--card); border-left: 1px solid var(--wfe-hairline); }
.wfe-logs-head { display: flex; align-items: center; gap: 8px; padding: 16px; border-bottom: 1px solid var(--wfe-hairline); color: var(--text-2); }
.wfe-logs-head b { flex: 1; font-size: 14px; font-weight: 400; -webkit-text-stroke: .35px currentColor; line-height: 20px; letter-spacing: .1px; color: var(--text-2); }
.wfe-x { display: grid; place-items: center; color: var(--text-2); }
.wfe-run-chip { --c: var(--primary); display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; line-height: 1.17; letter-spacing: 0; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.wfe-logs-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.wfe-logs-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.wfe-logs-empty b { margin-top: 16px; font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: .1px; color: var(--text-2); }
.wfe-logs-empty small { margin-top: 4px; font-size: 12px; line-height: 16px; letter-spacing: .4px; color: var(--muted); }
.wfe-log { margin-bottom: 8px; border-radius: 8px; background: var(--surface-light); }
.wfe-log.is-live { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.wfe-log-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; text-align: left; border-radius: 8px; }
.wfe-log-head:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.wfe-log-head > span:first-child { display: grid; flex: none; }
.wfe-log-head .wfe-spin { width: 16px; height: 16px; }
.wfe-log-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wfe-log-name em { font-style: normal; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.wfe-log-name b { font-size: 14px; font-weight: 400; line-height: 20px; letter-spacing: .25px; color: var(--text); }
.wfe-log-name small { font-size: 11px; line-height: 14.7px; letter-spacing: .4px; color: var(--muted); }
.wfe-log-dur { font-size: 11px; letter-spacing: .4px; color: var(--text-2); margin-right: -2px; }
.wfe-log-chev { display: grid; color: var(--muted); }
.wfe-log-chev .ic:last-child, .wfe-log.is-open .wfe-log-chev .ic:first-child { display: none; }
.wfe-log.is-open .wfe-log-chev .ic:last-child { display: block; }
.wfe-log-body { display: none; padding: 0 12px 12px; }
.wfe-log.is-open .wfe-log-body { display: block; }
.wfe-log-body::before { content: ""; display: block; height: 1px; margin: 7.5px 0; background: var(--border); }
.wfe-log-row { display: flex; margin-bottom: 4px; font-size: 11px; line-height: 14.7px; }
.wfe-log-row span { width: 80px; flex: none; color: var(--muted); letter-spacing: .4px; }
.wfe-log-row code, .wfe-log-err, .wfe-log-preview { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--text-2); overflow-wrap: anywhere; }
.wfe-log-err { margin: 8px 0 0; padding: 8px; border-radius: 4px; font-size: 12px; line-height: 16px; white-space: pre-wrap; color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.wfe-log-plabel { margin-top: 8px; font-size: 11px; color: var(--muted); }
.wfe-workers-sum { margin-left: 6px; }
/* A node's job's workers: blue running, green done, red failed, grey waiting. */
.wfe-workers { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.wfe-workers li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 4px 2px; font-size: 12px; }
.wfe-workers small { flex: 1 0 100%; padding-left: 16px; color: var(--error); font-size: 11px; line-height: 15px; white-space: normal; }
.wfe-worker-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.wfe-worker-st { flex: none; color: var(--muted); font-size: 11px; }
.wfe-wdot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.wfe-workers .is-running .wfe-wdot { background: var(--primary); opacity: 1; animation: wfe-wdot-pulse 1.4s ease-in-out infinite; }
.wfe-workers .is-completed .wfe-wdot { background: var(--success); opacity: 1; }
.wfe-workers .is-failed .wfe-wdot { background: var(--error); opacity: 1; }
@keyframes wfe-wdot-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .wfe-workers .is-running .wfe-wdot { animation: none; } }
.wfe-log-preview { margin: 4px 0 0; padding: 8px; border-radius: 4px; font-size: 11px; white-space: pre-wrap; background: rgba(0, 0, 0, .2); }

/* ── The selected node's panel (360 by default, an 8 px drag handle on its left) ── */
.wfe-side { flex: none; display: flex; transition: width 220ms var(--ease-out-cubic); }
.wfe-resize { flex: none; width: 8px; cursor: ew-resize; border-right: 1px solid var(--wfe-hairline-2); }
.wfe-resize.is-on { border-right-color: rgba(255, 255, 255, .20); }
/* A phone: the panel covers the editor's body instead of sitting beside a
   canvas it would leave no room for. Its X brings the canvas back. */
@media (max-width: 767.98px) {
  .wfe-body { position: relative; }
  .wfe-side { position: absolute; inset: 0; z-index: 2; width: auto !important; }
  .wfe-resize { display: none; }
}
.wfe-panel { flex: 1; min-width: 0; background: var(--card); border-left: 1px solid var(--wfe-hairline); }
.wfe-panel-in { height: 100%; display: flex; flex-direction: column; }
.wfe-panel-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--wfe-hairline); }
.wfe-panel-name { flex: 1; min-width: 0; padding: 6px 0; border: 0; background: none; outline: none; font-size: 14px; font-weight: 400; -webkit-text-stroke: .35px currentColor; line-height: 20px; letter-spacing: .1px; color: var(--text-2); }
.wfe-panel-name::placeholder { color: var(--muted); opacity: .75; font-style: italic; font-weight: 300; }
.wfe-viewtog { display: flex; padding: 2px; border-radius: 7px; border: 1px solid var(--border); background: var(--hover); margin-right: -8px; }
.wfe-viewtog button { position: relative; display: grid; place-items: center; width: 28px; height: 24px; border-radius: 5px; color: var(--text-2); border: 1px solid transparent; }
.wfe-viewtog button.is-on { background: var(--surface); border-color: var(--border); color: var(--text); }
.wfe-dot { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.wfe-panel-head .wfe-x { width: 32px; height: 32px; }
.wfe-panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.wfe-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.wfe-badge { --c: var(--text-2); padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 500; line-height: 14px; letter-spacing: .25px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.wfe-soon { margin-top: 16px; padding: 16px; border-radius: 8px; border: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.wfe-soon b { font-size: 13px; font-weight: 400; -webkit-text-stroke: .3px currentColor; color: var(--text-2); }
.wfe-panel-empty { padding: 32px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--muted); }
.wfe-panel-empty b { margin-top: 12px; font-size: 13px; font-weight: 400; -webkit-text-stroke: .3px currentColor; color: var(--text-2); }
.wfe-panel-empty small { margin-top: 6px; font-size: 11px; line-height: 1.4; }
.wfe-panel-foot { padding: 12px 16px 16px; border-top: 1px solid var(--wfe-hairline-2); background: var(--card); }

/* ── The completion notification (NotificationToast, top right) ── */
.wfe-notes { position: fixed; top: calc(var(--topbar-h) + 4px); right: 16px; z-index: 90; }
.wfe-note { display: flex; align-items: flex-start; gap: 12px; width: 320px; padding: 16px; border-radius: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); box-shadow: 0 4px 22px rgba(0, 0, 0, .3); animation: wfenote 300ms var(--ease-out-cubic) both; }
@keyframes wfenote { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.wfe-note-ic { display: grid; place-items: center; padding: 8px; border-radius: 8px; color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); }
.wfe-note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wfe-note-text b { font-size: 13px; font-weight: 500; color: var(--text); }
.wfe-note-text small { font-size: 11px; font-weight: 500; color: var(--success); }
.wfe-note button { display: grid; place-items: center; width: 24px; height: 24px; color: var(--muted); }

/* What Claude saved, played step by step (editor.js, claude): a card or a
   wire waits hidden, then shows lit in the guide's colour for a moment. */
.wfe-world .is-claude-hidden { opacity: 0; pointer-events: none; }
.wfe-node.is-claude { box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent); }
.wfe-wires g.is-claude path { stroke: var(--primary); stroke-width: 3; }
.wfe-claude-note {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  max-width: min(420px, calc(100% - 32px)); padding: 8px 12px; border-radius: 10px;
  background: var(--card); color: var(--text); border: 1px solid var(--primary);
  font-size: 13px; line-height: 1.35; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .wfe-world .wfe-node, .wfe-wires g, .wfe-edel { transition: opacity 240ms ease, box-shadow 240ms ease; }
}
