/* Flow editor: a wide diagram with a floating toolbar and a narrow stage inspector. Colours come from tokens.css; the few it lacks are declared on .fe-editor. */
.fe-editor {
  --edge: #6f6688; --req: #f87171; --warn: #f59e0b; --opt: #34d399; --hu: #f59e0b; --mix: #22d3ee; --ai: #8b5cf6;
  --mono: ui-monospace, "JetBrains Mono", "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); height: 100%; border: 1px solid var(--line); border-radius: var(--r-screen); overflow: hidden; min-height: 480px;
  background: color-mix(in srgb, var(--k-card) 40%, transparent);
}
.fe-editor button { font: 600 12.5px var(--sans); cursor: pointer; color: var(--ink); }
.fe-editor button:disabled { opacity: .4; cursor: default; }
.fe-editor button:focus-visible, .fe-canvas:focus-visible { outline: 2px solid var(--k-acc2); outline-offset: 2px; }

/* canvas */
.fe-canvas { position: relative; overflow: hidden; cursor: grab; touch-action: none; user-select: none; outline: none;
  background-color: color-mix(in srgb, var(--sunk) 75%, transparent); background-image: radial-gradient(rgba(237, 233, 245, 0.09) 1px, transparent 1px); background-size: 22px 22px; }
.fe-canvas.panning { cursor: grabbing; }
.fe-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fe-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.fe-edges .flow { fill: none; stroke: var(--edge); stroke-width: 2; stroke-linejoin: round; }
.fe-edges marker path { fill: var(--edge); }
.fe-edges .branch { fill: none; stroke: var(--acc); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .85; }
.fe-edges #fe-arrb path { fill: var(--acc); }
.fe-edges .blabel { fill: var(--acc); font: 11.5px var(--sans); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.fe-group { position: absolute; }
.fe-node { position: relative; width: 200px; height: 78px; background: var(--raise); border: 1px solid var(--line-strong); border-radius: var(--r-card); display: flex; gap: 10px; align-items: center; padding: 8px 10px; box-shadow: 0 10px 30px -18px #000; cursor: pointer; transition: border-color .15s, box-shadow .2s; }
.fe-node:hover { border-color: var(--line-acc); }
.fe-group.active .fe-node { border-color: var(--k-acc); box-shadow: 0 0 0 3px var(--acc-soft), 0 0 26px -6px var(--glow); }
.fe-node::before, .fe-node::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--edge); border: 2px solid var(--k-card); }
.fe-node::before { left: -5px; }
.fe-node::after { right: -5px; }
.fe-icon { width: 34px; height: 34px; flex: none; border-radius: var(--r-chip); display: grid; place-items: center; font-size: 17px; border: 1px solid; }
.fe-icon.ai { background: color-mix(in srgb, var(--ai) 16%, transparent); border-color: color-mix(in srgb, var(--ai) 40%, transparent); }
.fe-icon.human { background: color-mix(in srgb, var(--hu) 14%, transparent); border-color: color-mix(in srgb, var(--hu) 38%, transparent); }
.fe-icon.ai-human { background: color-mix(in srgb, var(--mix) 12%, transparent); border-color: color-mix(in srgb, var(--mix) 36%, transparent); }
.fe-node-body { min-width: 0; }
.fe-node-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-node-meta { color: var(--ink-3); font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fe-gate { position: absolute; top: -9px; right: 8px; font: 700 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--k-card); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: var(--r-pill); padding: 3px 7px; }
.fe-gate.choice { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 50%, transparent); }
.fe-gate.check { color: var(--opt); border-color: color-mix(in srgb, var(--opt) 38%, transparent); }
.fe-editor .fe-plus { position: absolute; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border-radius: var(--r-chip); border: 1.5px dashed var(--edge); color: var(--ink-3); background: var(--k-card); transition: border-color .15s, color .15s; }
.fe-editor .fe-plus:hover { border-color: var(--k-acc); color: var(--acc); }
.fe-empty-canvas { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); pointer-events: none; }
.fe-empty-canvas[hidden] { display: none; }

/* floating toolbar: one primary action and four icons */
.fe-controls { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: color-mix(in srgb, var(--k-deep) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 10px 30px -12px #000; }
.fe-editor .fe-add { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid var(--k-acc); border-radius: var(--r-pill); background: linear-gradient(180deg, var(--k-acc), var(--k-acc-deep)); color: #fff; }
.fe-editor .fe-add:hover:not(:disabled) { box-shadow: 0 0 18px -2px var(--glow); }
.fe-move { display: inline-flex; align-items: center; gap: 2px; animation: fe-pop .2s var(--ease); }
.fe-move[hidden] { display: none; }
@keyframes fe-pop { from { opacity: 0; transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) { .fe-move { animation: none; } }
.fe-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.fe-editor .fe-ib { width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-3); transition: background .15s, color .15s; }
.fe-editor .fe-ib:hover:not(:disabled) { background: var(--acc-hover); color: var(--ink); }

/* tool labels under a node */
.fe-tool { position: absolute; left: 36px; height: 22px; line-height: 20px; padding: 0 9px; border-radius: var(--r-pill); font: 11px var(--mono); white-space: nowrap; border: 1px solid; background: var(--k-card); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.fe-tool.req { background: color-mix(in srgb, var(--k-card) 70%, #f43f5e 14%); color: var(--req); border-color: color-mix(in srgb, var(--req) 40%, transparent); }
.fe-tool.opt { background: color-mix(in srgb, var(--k-card) 70%, #34d399 14%); color: var(--opt); border-color: color-mix(in srgb, var(--opt) 40%, transparent); }
.fe-tool.more { color: var(--ink-3); border-style: dashed; border-color: var(--line-strong); }

/* inspector */
.fe-panel { background: color-mix(in srgb, var(--k-card) 80%, transparent); border-left: 1px solid var(--line); overflow: auto; min-width: 0; padding: 12px 14px 16px; }
.fe-panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.fe-panel-head select { flex: 1; min-width: 0; }
.fe-head-btns { display: flex; flex: none; }
.fe-panel .fe-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.fe-panel label, .fe-lab { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 12px 0 5px; display: block; }
.fe-lab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fe-lab label { margin: 0; }
.fe-lab span { font: 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); text-align: right; }
.fe-panel input, .fe-panel textarea, .fe-panel select { width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r-chip); border: 1px solid var(--line-strong); background: var(--code-bg); color: var(--ink); font: 13px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s; }
.fe-panel textarea { height: auto; min-height: 68px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.fe-panel select option { background: var(--k-card); }
.fe-panel input:focus, .fe-panel select:focus, .fe-panel textarea:focus { border-color: var(--k-acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.fe-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.fe-row label { margin-top: 12px; }
.fe-err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.fe-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }
.fe-hint.warn { color: var(--warn); }
.fe-empty { color: var(--ink-3); padding: 30px 10px; text-align: center; }
/* exclusive choices as pills */
.fe-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(255, 255, 255, .02); }
.fe-editor .fe-seg button { flex: 1; height: 26px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-3); font-size: 13.5px; transition: background .2s, color .2s; }
.fe-editor .fe-seg button:hover:not(:disabled) { color: var(--ink); }
.fe-editor .fe-seg button.is-on { background: var(--acc-hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-acc); }
.fe-gate-box { margin-top: 2px; }
.fe-opt-row { display: grid; grid-template-columns: 1fr 120px 26px; gap: 5px; margin-bottom: 5px; align-items: center; }
.fe-gate-box > button, .fe-tool-add button { height: 28px; padding: 0 12px; margin-top: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--acc-soft); }
.fe-gate-box > button:hover:not(:disabled), .fe-tool-add button:hover:not(:disabled) { background: var(--acc-hover); border-color: var(--line-acc); }
.fe-editor .ghost { height: 26px; padding: 0 6px; border: 0; border-radius: var(--r-chip); background: none; color: var(--ink-3); font-weight: 500; }
.fe-editor .ghost:hover:not(:disabled) { color: var(--bad); background: var(--acc-soft); }

/* tools in the panel */
.fe-tool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 26px; gap: 2px 8px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.fe-tool-kind { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; }
.fe-tool-title { grid-column: 1 / -1; font-family: var(--mono); overflow-wrap: anywhere; }
.fe-tool-details { grid-column: 1 / -1; min-width: 0; }
.fe-tool-details > summary { width: fit-content; margin-left: auto; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); cursor: pointer; font: 12px var(--sans); }
.fe-tool-details > summary:focus-visible { outline: 2px solid var(--k-acc2); outline-offset: 2px; }
.fe-tool-description { padding: 8px 0; color: var(--ink-3); overflow-wrap: anywhere; }
.fe-tool-description p { margin: 0 0 8px; white-space: pre-wrap; }
.fe-tool-description a { color: var(--acc); }
.fe-panel .fe-tool-req { display: flex; align-items: center; gap: 4px; margin: 0; font: 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.fe-panel .fe-tool-req input { width: auto; height: auto; }
.fe-tool-add { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 5px; margin-top: 6px; }
.fe-tool-add button { grid-column: 1 / -1; justify-self: start; }

/* the tabs of the stage panel */
.fe-dtabs, .fe-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(255, 255, 255, .02); }
.fe-editor .fe-dtabs button, .fe-editor .fe-tabs button { flex: 1; height: 26px; padding: 0 8px; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-3); font-size: 12px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.fe-editor .fe-dtabs button:hover, .fe-editor .fe-tabs button:hover { color: var(--ink); }
.fe-editor .fe-dtabs button.is-on, .fe-editor .fe-tabs button.is-on { background: var(--acc-hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-acc); }
.fe-tabs { margin: 8px 0 2px; }
.fe-tabs small { font: 10px var(--mono); color: var(--faint); margin-left: 4px; }

/* n8n-style sub-nodes: a dotted spine from the block, a round node per skill or folder, grouped, with names */
.fe-dia { position: absolute; left: 21px; bottom: -6px; width: 10px; height: 10px; transform: rotate(45deg); background: var(--edge); border: 2px solid var(--k-bg); }
.fe-subs { position: relative; width: 238px; padding-top: 12px; }
.fe-subs::before { content: ""; position: absolute; left: 25px; top: 0; bottom: 30px; border-left: 2px dotted var(--edge); }
.fe-sg { position: relative; padding-left: 46px; height: 22px; display: flex; align-items: center; font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.fe-sg::before { content: ""; position: absolute; left: 20px; top: 7px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--k-bg); border: 2px solid var(--edge); }
.fe-sub { position: relative; height: 30px; margin-left: 46px; padding-right: 6px; display: flex; align-items: center; gap: 8px; border-radius: var(--r-pill); cursor: pointer; transition: background .15s; }
.fe-sub::before { content: ""; position: absolute; left: -22px; top: 15px; width: 20px; border-top: 2px dotted var(--edge); }
.fe-sub:hover { background: color-mix(in srgb, var(--k-acc) 10%, transparent); }
.fe-sc { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--k-card2); border: 1.5px solid currentColor; color: var(--k-acc2); }
.fe-sub.opt .fe-sc { border-style: dashed; }
.fe-sn { font-size: 11.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.fe-sm { font: 9.5px var(--mono); color: var(--faint); flex: 0 3 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-editor .fe-sx { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--faint); opacity: 0; transition: opacity .15s, background .15s; flex: none; }
.fe-sub:hover .fe-sx, .fe-editor .fe-sx:focus-visible { opacity: 1; }
.fe-editor .fe-sx:hover { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.fe-sub.more .fe-sc { border-style: dotted; color: var(--faint); font: 600 10px var(--mono); }
.fe-sub.more .fe-sn { color: var(--ink-3); }
.fe-sub.skill .fe-sc, .fe-ic.skill { color: var(--k-acc2); } .fe-sub.mcp .fe-sc, .fe-ic.mcp { color: #22d3ee; } .fe-sub.cli .fe-sc, .fe-ic.cli { color: var(--opt); }
.fe-sub.script .fe-sc, .fe-ic.script { color: var(--warn); } .fe-sub.webhook .fe-sc, .fe-ic.webhook { color: #f472b6; }
.fe-sub.folder .fe-sc, .fe-ic.folder { color: var(--warn); } .fe-sub.file .fe-sc, .fe-ic.file { color: var(--ink-3); } .fe-sub.link .fe-sc, .fe-ic.link { color: #22d3ee; }
.fe-sub.kit .fe-sc, .fe-ic.kit { color: #f472b6; } .fe-sub.template .fe-sc, .fe-ic.template { color: var(--opt); }
.fe-addrow { position: relative; margin: 8px 0 0 46px; display: flex; gap: 6px; }
.fe-editor .fe-addrow button { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); border: 1px dashed var(--edge); background: none; color: var(--ink-3); font-size: 11px; font-weight: 500; transition: .15s; }
.fe-editor .fe-addrow button:hover { border-color: var(--k-acc2); color: var(--k-acc2); background: color-mix(in srgb, var(--k-acc) 8%, transparent); }
.fe-group.drop .fe-node { border-color: var(--opt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--opt) 22%, transparent); }

/* context rows in the panel */
.fe-ctx-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; }
.fe-ctx-row .fe-sc { width: 26px; height: 26px; }
.fe-ctx-name { min-width: 0; }
.fe-ctx-name b { display: block; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-ctx-name span { color: var(--ink-3); font-size: 11px; }
.fe-ctx-row select { width: auto; height: 26px; font-size: 11.5px; padding: 0 6px; }
.fe-src-add { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 5px; margin-top: 8px; }
.fe-src-add select:nth-of-type(2) { grid-column: 1 / -1; }
.fe-src-add button { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 5px; }

/* Last, so border-left: 0 wins over .fe-panel. */
@media (max-width: 860px) {
  .fe-editor { grid-template-columns: 1fr; grid-template-rows: none; }
  .fe-canvas { height: 58vh; }
  .fe-panel { border-left: 0; border-top: 1px solid var(--line); }
}

/* The edit screen (screen.js), as in the design: one bar (back, name, description, status, save), the template switchers, then the editor filling the rest of the window. */
.fl-head { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(8, 6, 13, .8); backdrop-filter: blur(14px); }
.fl-back { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid transparent; color: var(--ink-3); font: 600 12px var(--sans); text-decoration: none; white-space: nowrap; transition: .18s var(--ease); }
.fl-back:hover { color: var(--ink); border-color: var(--k-acc2); background: rgba(139, 92, 246, .08); }
.fl-head input { width: auto; box-shadow: none; outline: 0; }
.fl-head .fl-name { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-chip); background: none; font: 600 19px var(--serif); color: var(--ink); transition: .15s; }
.fl-head .fl-desc { flex: 1.4; min-width: 0; height: 34px; margin: 0; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-chip); background: none; font: 13px var(--sans); color: var(--ink-3); transition: .15s; }
.fl-head .fl-name:hover, .fl-head .fl-desc:hover { border-color: var(--line); }
.fl-head .fl-name:focus, .fl-head .fl-desc:focus { border-color: var(--k-acc2); background: rgba(255, 255, 255, .03); box-shadow: none; }
.fl-head .fl-desc:focus { color: var(--ink); }
.fl-head .fl-id { width: 180px; height: 34px; }
.fl-status { font-size: 12px; color: var(--faint); white-space: nowrap; }
.fl-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.fl-status.is-dirty { color: var(--warn); }
.fl-save { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: var(--r-pill); font: 600 12px var(--sans); white-space: nowrap; cursor: pointer; color: #fff; border: 1px solid var(--k-acc); background: linear-gradient(180deg, var(--k-acc), var(--k-acc-deep)); box-shadow: 0 8px 26px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .18); transition: .18s var(--ease); }
.fl-save:hover:not(:disabled) { box-shadow: 0 0 22px -2px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .18); transform: translateY(-1px); }
.fl-save:disabled { opacity: .5; cursor: default; }
.fl-note { margin: 0; padding: 6px 18px; color: var(--ink-3); font-size: 12px; }
.fl-tpls { display: flex; align-items: center; gap: 6px; padding: 8px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.fl-eyebrow { flex: none; font: var(--eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.fl-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: none; color: var(--ink-3); font: 500 12.5px var(--sans); cursor: pointer; transition: .2s; }
.fl-pill:hover { color: var(--ink); border-color: var(--line-acc); }
.fl-pill small { font: 10px ui-monospace, Menlo, monospace; color: var(--faint); }
.fl-pill.is-on { background: rgba(139, 92, 246, .22); color: var(--ink); border-color: var(--line-acc); box-shadow: 0 0 18px -6px var(--glow); }
.fl-editor { min-height: 480px; position: relative; }
/* Phone width: no fixed height, the canvas and the panel stack and the page scrolls. */
@media (min-width: 861px) { .fl-editor { height: max(480px, calc(100vh - 250px)); } }
@media (max-width: 760px) { .fl-head { height: auto; flex-wrap: wrap; padding: 10px 14px; } .fl-head .fl-name, .fl-head .fl-desc { flex-basis: 100%; } }
/* In the cabinet the editor fills the window below the two bars, with no frame of its own. */
#app.edit-full .fe-editor { border: 0; border-radius: 0; }
@media (min-width: 861px) { #app.edit-full .fl-editor { height: max(480px, calc(100vh - 54px - 45px)); } }
#app.flow-wide { max-width: none; }

/* the pickers under a block: a menu with search, kinds and a list (outside .fe-editor, so everything is styled here) */
.fe-popw { position: fixed; inset: 0; z-index: 95; }
.fe-pop { position: fixed; z-index: 96; max-height: 460px; display: flex; flex-direction: column; border: 1px solid var(--line-acc); border-radius: var(--r-screen); background: color-mix(in srgb, var(--k-deep) 98%, transparent); box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 50px -22px var(--glow); overflow: hidden; animation: fe-pop-in .18s var(--ease); font-family: var(--sans); color: var(--ink); }
@keyframes fe-pop-in { from { opacity: 0; transform: translateY(8px); } }
.fe-pop button { font: 500 12px var(--sans); cursor: pointer; color: var(--ink-3); }
.fe-pop .fe-ph { padding: 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.fe-pop .fe-pbody { overflow-y: auto; padding: 6px; }
.fe-pop .fe-pfoot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }
.fe-pop .fe-pfoot kbd { margin-left: auto; font: 10px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.fe-pop .fe-pfoot select { width: auto; height: 26px; margin-left: auto; padding: 0 8px; font-size: 12px; }
.fe-pop .fe-psearch { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-chip); background: var(--code-bg); color: var(--ink-3); }
.fe-pop .fe-psearch:focus-within { border-color: var(--k-acc); box-shadow: 0 0 0 3px var(--acc-soft); color: var(--ink); }
.fe-pop .fe-psearch input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; box-shadow: none; padding: 0; font-size: 13px; }
.fe-pop .fe-ptabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(255, 255, 255, .02); overflow-x: auto; }
.fe-pop .fe-ptabs button { flex: 1; height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; white-space: nowrap; transition: .2s; }
.fe-pop .fe-ptabs button:hover { color: var(--ink); }
.fe-pop .fe-ptabs button.is-on { background: var(--acc-hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-acc); }
.fe-pop .fe-padd { display: flex; gap: 6px; }
.fe-pop .fe-padd input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: 10px; font-size: 13px; }
.fe-pop .fe-padd-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border: 1px solid var(--k-acc); border-radius: var(--r-pill); background: linear-gradient(180deg, var(--k-acc), var(--k-acc-deep)); color: #fff; font-weight: 600; }
.fe-pop select { height: 26px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--code-bg); color: var(--ink); font: 12px var(--sans); }
.fe-pop .fe-perr { color: var(--bad); font-size: 12px; }
.fe-pop .fe-perr:empty { display: none; }
.fe-pop .fe-pg { padding: 10px 8px 4px; font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.fe-pop .fe-it { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.fe-pop .fe-it:hover, .fe-pop .fe-it.is-cur { background: color-mix(in srgb, var(--k-acc) 14%, transparent); }
.fe-pop .fe-it.taken { opacity: .45; pointer-events: none; }
.fe-pop .fe-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--k-card2); color: var(--k-acc2); }
.fe-pop .fe-tx { min-width: 0; flex: 1; }
.fe-pop .fe-tx b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-pop .fe-tx span { display: block; color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-pop .fe-tag { font: 10px var(--mono); color: var(--faint); }

.fl-side { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: var(--r-pill); border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; }
.fl-side:hover, .fl-side[aria-pressed="true"] { color: var(--ink); border-color: var(--k-acc2); background: rgba(139, 92, 246, .08); }
.fl-side-icon { width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; background: linear-gradient(90deg, currentColor 0 4px, transparent 4px); }

.fe-editor.no-panel { grid-template-columns: minmax(0, 1fr); }
.fe-editor.no-panel .fe-panel { display: none; }
.fe-panel-icon { width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; background: linear-gradient(270deg, currentColor 0 4px, transparent 4px); }
/* In the admin console the editor reaches the bottom of the window, with no frame of its own. */
#app.console .fe-editor { border-width: 1px 0 0; border-radius: 0; }
@media (min-width: 861px) { #app.console .fl-editor { height: max(480px, calc(100vh - 54px)); } }
.fl-head h1.fl-name { flex: none; margin: 0; padding: 0 10px; font: 600 19px var(--serif); line-height: 34px; }
.fl-head span.muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The editor page is a column as tall as the window: the bars take their height and the diagram gets the rest, so its controls stay on screen. */
#app.console .console-body:has(> .fl-head), .us-record:has(> .fl-head) { display: flex; flex-direction: column; overflow: hidden; }
#app.console .console-body:has(> .fl-head) { height: 100dvh; }
.us-record:has(> .fl-head) { height: 100%; }
:is(.console-body, .us-record) > .fl-head, :is(.console-body, .us-record) > .fl-tpls, :is(.console-body, .us-record) > .us-flow-items { flex: none; }
:is(.console-body, .us-record) > .fl-editor { flex: 1; min-height: 0; height: auto !important; display: flex; }
:is(.console-body, .us-record) > .fl-editor > .fe-editor { flex: 1; height: auto; min-height: 0; }

/* The panel shows only what is picked: a block, a skill or a context item. */
.fe-panel-head { align-items: flex-start; margin-bottom: 12px; }
.fe-kind-box { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fe-kind { font: var(--eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--faint); }
.fe-kind-title { font: 600 15px/1.3 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.fe-detail { display: grid; gap: 12px; }
.fe-desc-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.fe-role { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.fe-role b { color: var(--ink-3); font-weight: 600; }
.fe-link { color: var(--k-acc2); font-size: 13px; overflow-wrap: anywhere; }
.fe-detail code { font: 12.5px var(--mono); overflow-wrap: anywhere; }

/* The picked skill or context item keeps its remove button in view. */
.fe-sub.sel { background: color-mix(in srgb, var(--k-acc) 16%, transparent); }
.fe-sub.sel .fe-sx { opacity: 1; color: var(--ink-3); }

.fe-node-desc { margin-top: 3px; color: var(--ink-3); font-size: 10.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.fe-node-meta { margin-top: 1px; }
/* The panel's description: wider and taller, the title takes the whole row. */
.fe-fields textarea#fe-desc { min-height: 150px; resize: vertical; }
.fe-row { grid-template-columns: 1fr; }
.fe-node-desc { margin-top: 2px; }
