/* Workflow workbench: scoped to the workflow route and its three editing areas. */
.workflow-editor {
  --wf-line:#dce2e4; --wf-text:#24343a; --wf-muted:#6d7b81;
  --wf-accent:#255d50; --wf-soft:#edf4f1; --wf-surface:#f7f9fa;
  color:var(--wf-text); font-size:12px;
}
main:has(.workflow-editor.wf-workspace){max-width:none;padding:18px 20px 20px}
.workflow-editor .page-heading{margin-bottom:14px;gap:12px}
.workflow-editor .page-heading h1{font-size:23px;letter-spacing:-.65px}
.workflow-editor .page-heading p{color:var(--wf-muted);font-size:12px;margin-top:5px}
.workflow-editor .page-heading .eyebrow{font-size:9px;margin-bottom:6px}
.workflow-editor .panel{border:1px solid var(--wf-line);border-radius:6px;box-shadow:none;background:#fff}
.workflow-editor .btn{border-radius:4px;font-size:11px;min-height:34px;padding:8px 11px;box-shadow:none}
.workflow-editor .btn.primary{background:var(--wf-accent)}
.workflow-editor .btn.secondary{border-color:var(--wf-line);color:#40545a}
.workflow-editor .btn.ghost:hover{background:#f0f4f4}
.workflow-editor .btn.danger{color:#a64d42}
.workflow-editor :is(button,a,input,textarea,select):focus-visible{outline:2px solid #3d7b6b;outline-offset:3px}
.workflow-editor .builder-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;padding:12px 15px;margin:0 0 10px}
.wf-breadcrumbs{display:flex;align-items:center;flex-wrap:wrap;gap:7px;color:var(--wf-muted);font-size:11px}
.wf-breadcrumbs strong{color:var(--wf-text);font-weight:600}
.wf-breadcrumbs>span[aria-hidden]{color:#a4afb3}
.workflow-editor .wf-breadcrumbs{flex-direction:row;margin:0 0 7px}
.wf-breadcrumbs button{background:transparent;padding:0;font:inherit;color:var(--wf-muted);text-align:left}
.wf-breadcrumbs button:hover{color:var(--wf-accent);text-decoration:underline}
.workflow-editor .wf-history-button{min-width:31px;padding:5px;font-size:19px;line-height:1}
.wf-version{display:flex;align-items:center;gap:9px}
.wf-version strong{font-size:12px;font-weight:600}
.wf-version small{color:var(--wf-muted);font-size:10px;line-height:1.5;margin-top:3px}
.wf-draft-dot{width:7px;height:7px;flex:0 0 7px;background:#47806b;border-radius:50%}
.wf-draft-dot.modified{background:#bd8942}
.workflow-editor .editor-controls{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
.wf-profile-note{padding:7px 2px;margin:0 0 7px;font-size:10px;line-height:1.65;color:var(--wf-muted)}
.wf-profile-note a{color:var(--wf-accent);text-decoration:underline;margin-left:5px;text-underline-offset:2px}
.workflow-editor .builder-audio{padding:9px 13px;margin:0 0 10px;color:var(--wf-muted)}
.workflow-editor .builder-audio>summary{font-size:11px;cursor:pointer}
.workflow-editor .builder-audio[open]>summary{margin-bottom:14px}
.workflow-editor #wf-routing-warnings:empty{display:none}
.workflow-editor .routing-error{display:block;width:100%;text-align:left;background:#fff9ef;color:#87612c;border:1px solid #ecdcbf;border-radius:4px;padding:9px 12px;font:inherit;font-size:11px;margin:0 0 8px}
.workflow-editor .notice{border-radius:4px;font-size:11px;line-height:1.65}
.workflow-editor .notice.warning{background:#fff8eb;color:#896128}

/* Each side panel scrolls independently; the canvas takes the available space. */
.workflow-editor .builder-layout{display:grid;grid-template-columns:220px minmax(0,1fr) 320px;gap:10px;align-items:stretch;height:calc(100dvh - 248px);min-height:320px;min-width:0}
.workflow-editor :is(.builder-library,.builder-inspector){position:relative;top:auto;grid-row:auto;grid-column:auto;min-height:0;max-height:none;overflow:auto;scrollbar-width:thin;scrollbar-color:#bcc8c9 transparent}
.workflow-editor .builder-library{display:block;padding:0}
.workflow-editor .builder-library h2{padding:14px 13px 11px;margin:0;font-size:12px;letter-spacing:0}
.wf-palette-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:12px}
.wf-palette-heading>small{color:var(--wf-muted);font-size:9px;white-space:nowrap}
.workflow-editor .wf-template-picker{padding:0 11px 12px;gap:5px}
.workflow-editor .wf-template-picker>span{font-size:9px;color:var(--wf-muted)}
.workflow-editor .wf-template-picker select{font-size:11px;height:35px;padding:7px}
.wf-palette-group{padding:0 10px 5px}
.workflow-editor .wf-palette-group h3{font-size:10px;color:#7b8c93;letter-spacing:.5px;font-weight:600;text-transform:uppercase;margin:6px 2px 9px}
.workflow-editor .builder-library>.wf-help,.workflow-editor .builder-library>.text-link{margin:9px 12px 14px;font-size:10px!important;line-height:1.7}
.workflow-editor .library-item .wf-palette-copy{flex:1;min-width:0}
.workflow-editor .library-item .wf-palette-badge{font-size:8px;padding:2px 4px;border:1px solid #e1e6e9;border-radius:3px;background:#f8fafb;margin:0 0 0 auto}
.workflow-editor .library-item[data-wf-library^='block:lookup'] .wf-palette-symbol{color:#4a7196;border-color:#d7e2ed;background:#f0f5fa;font-size:10px}
.workflow-editor .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.wf-palette-search{display:block;margin:0 10px 10px}
.wf-palette-search input,input.wf-palette-search{width:100%;min-width:0;height:34px;padding:8px 10px;border:1px solid var(--wf-line);border-radius:4px;background:#f8fafb;color:var(--wf-text);font:inherit;font-size:11px}
.wf-palette-search input::placeholder{color:#87959a}
.wf-template-list{display:block;padding:5px 7px 9px;margin:0}
.wf-template-list button{position:relative;display:block;width:100%;padding:9px 10px;border:1px solid transparent;border-radius:4px;background:transparent;text-align:left;color:var(--wf-text);font:inherit;cursor:pointer}
.wf-template-list button+button{margin-top:2px}
.wf-template-list button span{display:block;font-size:11px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.wf-template-list button small{display:block;font-size:10px;font-weight:400;color:var(--wf-muted);margin-top:3px;line-height:1.5}
.wf-template-list button.selected{background:var(--wf-soft);border-color:#d0e0d9}
.wf-template-list button.selected::before{content:'';position:absolute;inset:9px auto 9px -1px;width:3px;background:var(--wf-accent);border-radius:0 2px 2px 0}
.wf-template-list button:hover{background:#f1f5f5}
.wf-library-section{border-top:1px solid var(--wf-line);padding:0 10px;margin:0;color:var(--wf-text)}
.wf-library-section>summary{padding:13px 2px;font-size:11px;font-weight:600;cursor:pointer}
.wf-library-section>div{padding:0 0 9px}
.workflow-editor .library-item{display:flex;align-items:center;justify-content:flex-start;gap:9px;width:100%;min-height:53px;padding:8px;margin:0 0 5px;border:1px solid #e3e8ea;border-radius:4px;background:#fff;color:var(--wf-text);text-align:left;font:inherit;font-size:11px;cursor:pointer}
.workflow-editor .library-item>span:not(.wf-palette-symbol){min-width:0;font-size:11px}
.workflow-editor .library-item strong{display:block;font-size:11px;line-height:1.5;font-weight:600}
.workflow-editor .library-item small{display:block;color:var(--wf-muted);font-size:9px;font-weight:400;line-height:1.5;margin-top:2px}
.workflow-editor .library-item>small{margin-left:auto;white-space:nowrap}
.workflow-editor .library-item:hover:not(:disabled){background:#f7faf9;border-color:#a5beb4}
.workflow-editor .library-item:disabled{opacity:.65;background:#f8f9fa;cursor:not-allowed}
.workflow-editor .wf-palette-symbol{display:grid;place-items:center;width:29px;height:29px;flex:0 0 29px;border-radius:5px;border:1px solid #dce5e3;background:#f3f7f6;color:#50776a;font:12px/1 Consolas,monospace}
.workflow-editor .library-item[data-wf-library='block:choice'] .wf-palette-symbol{color:#a0763b;border-color:#ecdfc9;background:#fcf7ee}
.workflow-editor .library-item[data-wf-library='block:lookup'] .wf-palette-symbol{color:#4a7196;border-color:#d7e2ed;background:#f0f5fa}
.workflow-editor .library-item[data-wf-library='block:transfer'] .wf-palette-symbol{color:#79618a;border-color:#e4dce9;background:#f7f3fa}
.wf-keyboard-note{margin:0;padding:12px 12px 14px;border-top:1px solid var(--wf-line);font-size:10px;line-height:1.8;color:var(--wf-muted)}
.wf-insert-notice{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#edf5f1;border-bottom:1px solid #d4e3dc;color:#386653;padding:9px 13px;font-size:11px;line-height:1.55}
.wf-insert-notice button{flex-shrink:0;color:#386653}
.wf-palette-panel .wf-insert-notice{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin-bottom:10px;padding:10px 12px;overflow-wrap:anywhere;font-size:10px}
.wf-palette-panel .wf-insert-notice strong{font-size:10px}

/* Graph canvas, routes and explicit connection ports. */
.workflow-editor .builder-canvas{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--wf-surface)}
.wf-canvas-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;flex:0 0 auto;min-height:48px;padding:9px 13px;border-bottom:1px solid var(--wf-line);background:#fff}
.wf-canvas-toolbar>span{color:var(--wf-muted);font-size:11px}
.wf-canvas-toolbar strong{color:var(--wf-text);font-size:12px;font-weight:600}
.wf-canvas-toolbar>div:first-child{flex:1;min-width:0}
.wf-canvas-toolbar>div:first-child>strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wf-canvas-toolbar>div:first-child>span{display:block;font-size:9px;color:var(--wf-muted);margin-top:3px}
.wf-canvas-toolbar>.text-link{font-size:10px;white-space:nowrap}
.workflow-editor .builder-view-switch{display:inline-flex;align-items:center;flex:0 0 auto;gap:0;padding:0;background:#fff;border:1px solid #d9e1e3;border-radius:4px;overflow:hidden}
.workflow-editor .builder-view-switch button{padding:6px 9px;border:0;border-radius:0;background:transparent;color:var(--wf-muted);font:inherit;font-size:10px}
.workflow-editor .builder-view-switch button+button{border-left:1px solid #d9e1e3}
.workflow-editor .builder-view-switch button[aria-pressed=true]{background:#edf3f0;color:#315e50;font-weight:600}
.workflow-editor #wf-diagram-host,.workflow-editor .workflow-canvas-shell{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;min-width:0}
.workflow-editor .diagram-toolbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:8px 12px;min-height:42px;background:#fafbfc;border-bottom:1px solid #e2e7e9}
.workflow-editor .diagram-toolbar strong{font-size:11px;font-weight:500;color:#52666c}
.workflow-editor .diagram-toolbar small{color:var(--wf-muted);font-size:10px;line-height:1.5;max-width:none;margin:2px 0 0}
.workflow-editor .diagram-zoom{display:flex;align-items:center;gap:4px;margin-left:auto}
.workflow-editor .diagram-zoom button{display:inline-flex;align-items:center;justify-content:center;min-height:27px;min-width:27px;padding:5px 7px;border:1px solid #dbe2e5;border-radius:4px;background:#fff;color:#50656b;font-size:10px;line-height:1.4}
.workflow-editor .diagram-zoom button:hover{border-color:#9bb9ac;background:#f1f6f3}
.workflow-editor .diagram-zoom span{min-width:35px;font-size:10px;color:var(--wf-muted);text-align:center}
.workflow-editor .diagram-scroll{position:relative;flex:1 1 auto;min-height:220px;max-height:none;overflow:auto;overscroll-behavior:contain;background:#f7f9fb;background-image:radial-gradient(#cbd4d8 .8px,transparent .8px);background-size:20px 20px;cursor:grab;scrollbar-width:thin;scrollbar-color:#bcc8cc #edf1f3;touch-action:none}
.workflow-editor .diagram-scroll:is(.is-panning,.panning){cursor:grabbing;user-select:none}
.workflow-editor .diagram-scroll.connecting{cursor:crosshair}
.workflow-editor .diagram-size{position:relative;min-width:100%;min-height:100%}
.workflow-editor .diagram-stage{position:relative;transform-origin:top left}
.workflow-editor .diagram-connections{position:absolute;inset:0;overflow:visible;pointer-events:none}
.workflow-editor .diagram-edge{fill:none;stroke:#9aaab2;stroke-width:1.7;pointer-events:none}
.workflow-editor .diagram-edge.active{stroke:#3f7968;stroke-width:2.3}
.workflow-editor .diagram-edge.loop{stroke-dasharray:5 4}
.workflow-editor .diagram-edge.fixed{stroke:#afbdc4;stroke-dasharray:4 3}
.workflow-editor .diagram-edge.editable{stroke:#8da5ad}
.workflow-editor .diagram-edge-hit{fill:none;stroke:transparent;stroke-width:16;pointer-events:stroke;cursor:pointer}
.workflow-editor .diagram-edge-hit:hover{stroke:#3f796819}
.workflow-editor .diagram-connection-preview{fill:none;stroke:#3f7968;stroke-width:2;stroke-dasharray:6 4;pointer-events:none}
.workflow-editor .diagram-connection-preview[hidden]{display:none}
.workflow-editor .diagram-edge-label{display:block;width:100%;height:28px;padding:5px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #dce4e7;border-radius:4px;background:#fff;color:#5b7078;font:10px/1.6 'Segoe UI',sans-serif;opacity:1!important;pointer-events:auto}
.workflow-editor .diagram-edge-label:hover:not(:disabled),.workflow-editor .diagram-edge-label.active{border-color:#8eafa3;background:#f0f7f3;color:#315e50}
.workflow-editor .diagram-node,.workflow-editor .diagram-node:is(.choice,.lookup,.transfer,.start,.end,.confirm){
  --node-accent:#7e9a96;--node-soft:#edf4f2;
  position:absolute;background:#fff;border:1px solid #cbd6db;border-left:3px solid var(--node-accent);
  border-radius:6px;overflow:visible;box-shadow:0 2px 5px #223c4810;
}
.workflow-editor .diagram-node.choice{--node-accent:#b38b4e;--node-soft:#fcf5e9}
.workflow-editor .diagram-node.lookup{--node-accent:#6488b0;--node-soft:#eff4fa}
.workflow-editor .diagram-node.transfer{--node-accent:#9675a5;--node-soft:#f6f0f9}
.workflow-editor .diagram-node:is(.start,.end,.confirm){--node-accent:#55917b;--node-soft:#edf6f1}
.workflow-editor .diagram-node.patient{--node-accent:#6f929a;--node-soft:#eef5f6}
.workflow-editor .diagram-node.announcement{--node-accent:#8d9aa4;--node-soft:#f2f5f7}
.workflow-editor .diagram-node.selected{border-color:#4e8c76;outline:2px solid #4e8c76;outline-offset:2px;box-shadow:0 2px 8px #245a4619}
.workflow-editor .diagram-node.unreachable{opacity:.72;border-style:dashed}
.workflow-editor .diagram-node.is-dragging{cursor:grabbing;box-shadow:0 5px 18px #223c4820;z-index:5}
.workflow-editor .diagram-card{display:flex;flex-direction:column;align-items:stretch;width:100%;height:98px;min-height:98px;padding:12px 14px 10px;text-align:left;border:0;border-radius:4px 4px 0 0;background:transparent;color:var(--wf-text);cursor:grab;opacity:1!important}
.workflow-editor .diagram-card:active{cursor:grabbing}
.workflow-editor .diagram-card:hover:not(:disabled){background:#f7fafa}
.workflow-editor .diagram-card small{font-size:9px;font-weight:600;letter-spacing:.55px;line-height:1.5;text-transform:uppercase;color:#73868e}
.workflow-editor .diagram-card strong{display:block;width:100%;margin:6px 0 4px;font-size:13px;font-weight:600;line-height:1.4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.workflow-editor .diagram-card>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;line-height:1.55;color:#77888f}
.workflow-editor .wf-node-outputs{padding-bottom:10px}
.workflow-editor .wf-node-terminal{height:29px;padding:7px 12px;border-top:1px solid #e9edef;color:#7d8d94;background:#fafcfc;font-size:9px;line-height:1.5;border-radius:0 0 4px 4px}
.workflow-editor .wf-output-row{position:relative;display:flex;align-items:center;gap:6px;height:26px;min-height:26px;padding:3px 16px 3px 12px;border-top:1px solid #e9edef;background:#fafcfc;color:#60767e;font-size:10px;line-height:1.6}
.workflow-editor .wf-output-row:last-child{border-radius:0 0 4px 4px}
.workflow-editor .wf-port-label{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;font-size:10px;text-align:left;background:transparent;color:#60767e;padding:0;line-height:1.6}
.workflow-editor button.wf-port-label:hover{color:#255d50;text-decoration:underline;text-underline-offset:2px}
.workflow-editor .wf-port{position:absolute;z-index:3;display:block;width:16px;height:16px;padding:0;border:2px solid #8fa7ad;border-radius:50%;background:#fff;cursor:crosshair;box-shadow:0 0 0 3px #f7f9fb}
.workflow-editor .wf-port::after{content:'';position:absolute;inset:-7px;border-radius:50%}
.workflow-editor .wf-port-input{left:-11px;top:41px}
.workflow-editor .wf-port-output{right:-9px;top:50%;transform:translateY(-50%)}
.workflow-editor .wf-port:hover,.workflow-editor .wf-port:focus-visible,.workflow-editor .wf-port.connecting-source{background:#3e7a65;border-color:#3e7a65;box-shadow:0 0 0 4px #d8ebe2}
.workflow-editor .wf-port-input.valid-target{border-color:#3e7a65;background:#e8f5ee;box-shadow:0 0 0 4px #d8ebe2}
.workflow-editor .wf-port-input.invalid-target{border-color:#c9d1d5;background:#e7ecef;cursor:not-allowed;box-shadow:none}
.workflow-editor .wf-port-fixed{cursor:default;background:#b5c3c8;border-color:#b5c3c8}
.workflow-editor .wf-route-insert{display:inline-grid;place-items:center;flex:0 0 19px;width:19px;height:19px;border:1px solid #d4dfe2;border-radius:3px;padding:0;background:#fff;color:#69818a;font:12px/1 'Segoe UI',sans-serif}
.workflow-editor .wf-route-insert:hover{border-color:#88ad9f;color:#2c6a53;background:#f0f7f3}
.workflow-editor .diagram-connection-status{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto;padding:8px 12px;border-bottom:1px solid #d5e5dc;color:#346653;background:#edf6f1;font-size:11px;line-height:1.55}
.workflow-editor .diagram-connection-status:empty{display:none}
.workflow-editor .diagram-connection-status button{background:transparent;color:#346653;text-decoration:underline;font-size:10px;white-space:nowrap}
.workflow-editor .diagram-note{flex:0 0 auto;padding:8px 12px;border-top:1px solid var(--wf-line);background:#fff;color:var(--wf-muted);font-size:10px;line-height:1.6}
.workflow-editor .diagram-tasks{flex:0 0 auto;padding:10px 13px;border-top:1px solid var(--wf-line);background:#fff;max-height:190px;overflow:auto}
.workflow-editor .diagram-tasks h3{font-size:11px;margin:0 0 9px}
.workflow-editor .diagram-tasks>p{font-size:10px;color:var(--wf-muted)}
.workflow-editor .diagram-tasks .wf-step-row{margin-bottom:6px}
.workflow-editor .diagram-tasks .wf-step-select{padding:8px}
.workflow-editor .diagram-tasks .wf-step-number{width:22px;height:22px;flex-basis:22px;font-size:10px}
.workflow-editor .wf-team-drawer{margin:0;padding:10px 13px;font-size:11px;color:#586e75}
.workflow-editor .wf-team-drawer>summary{cursor:pointer;line-height:1.6}
.workflow-editor .wf-team-drawer[open]>summary{margin-bottom:10px}
.workflow-editor .diagram-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:340px;padding:30px;background:var(--wf-surface);color:#47616a;font-size:12px;text-align:center}
.workflow-editor .diagram-loading>span:last-child{color:var(--wf-muted);font-size:11px}
.workflow-editor .diagram-spinner{width:24px;height:24px;border:2px solid #d9e4df;border-top-color:#3f7968;border-radius:50%}
.workflow-editor .diagram-drop{display:none}

/* Inspector: readable field groups and a stable title. */
.workflow-editor .builder-inspector{padding:0 15px 16px;background:#fff}
.wf-inspector-heading{position:relative;padding:14px 0 12px;margin-bottom:14px;border-bottom:1px solid var(--wf-line)}
.wf-inspector-heading small{display:block;padding-right:22px;color:var(--wf-muted);font-size:9px;font-weight:600;letter-spacing:.6px;line-height:1.7}
.workflow-editor .wf-inspector-heading h2{font-size:16px;line-height:1.4;letter-spacing:-.3px;margin:4px 0 0;padding-right:20px;color:var(--wf-text);overflow-wrap:anywhere}
.wf-inspector-heading code{display:block;margin-top:7px;color:#8a999f;font-size:9px;overflow-wrap:anywhere}
.workflow-editor .wf-inspector-close{position:absolute;top:12px;right:0;display:grid;place-items:center;padding:0;width:25px;height:25px;border-radius:4px;background:#f3f6f7;color:#71848c;font-size:16px;line-height:1}
.workflow-editor .wf-inspector-close:hover{background:#e8eeef;color:#315f50}
.workflow-editor .wf-block-id{display:block;overflow-wrap:anywhere;margin:-4px 0 15px;color:#8a999f;font-size:9px}
.workflow-editor .wf-property-details{margin-top:18px;padding-top:12px;border-top:1px solid var(--wf-line);color:#657a82;font-size:11px}
.workflow-editor .wf-property-details>summary{font-size:11px;line-height:1.6}
.workflow-editor .wf-general-links .library-item{min-height:34px;padding:8px 10px}
.workflow-editor .wf-general-links .library-item>span{margin-left:auto;color:#8ca099}
.workflow-editor .builder-inspector section,.wf-inspector-group{padding-bottom:13px;margin-bottom:16px;border-bottom:1px solid var(--wf-line)}
.workflow-editor .builder-inspector section:last-child{border:0;margin-bottom:0}
.workflow-editor .builder-inspector h3{margin:17px 0 11px;color:#41565e;font-size:11px;font-weight:600;letter-spacing:.05px}
.workflow-editor .builder-inspector .field{margin:13px 0;gap:6px}
.workflow-editor .field>span{font-size:11px;line-height:1.5;color:#536b75}
.workflow-editor .field textarea,.workflow-editor .field input,.workflow-editor .field select{width:100%;padding:8px 10px;border:1px solid #d4dee2;border-radius:4px;background:#fff;color:var(--wf-text);font:inherit;font-size:12px;line-height:1.6}
.workflow-editor .field input,.workflow-editor .field select{height:37px}
.workflow-editor .field textarea{min-height:78px;resize:vertical}
.workflow-editor .field textarea[readonly],.workflow-editor .field input[readonly]{background:#f4f7f7;color:#71848c}
.workflow-editor .field small{color:#82939b;font-size:10px;line-height:1.6}
.workflow-editor .task-check{align-items:flex-start;gap:8px;font-size:11px;line-height:1.65;margin:12px 0;color:#506770}
.workflow-editor .task-check input{margin-top:2px;accent-color:var(--wf-accent)}
.wf-help{margin:9px 0;font-size:11px!important;line-height:1.7;color:var(--wf-muted)!important}
.wf-help a{color:var(--wf-accent);text-decoration:underline;text-underline-offset:2px}
.workflow-editor .branch-controls{border-color:var(--wf-line);margin-top:18px}
.wf-inspector-actions{display:flex;flex-wrap:wrap;gap:6px;border-top:1px solid var(--wf-line);margin-top:18px;padding-top:13px}
.wf-source-meta{margin:12px 0;font-size:11px;line-height:1.6}
.wf-source-meta>div{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid #edf1f2}
.wf-source-meta dt{color:var(--wf-muted)}
.wf-source-meta dd{text-align:right;overflow-wrap:anywhere;margin:0;color:#4e656e}
.wf-variable-list{border:1px solid var(--wf-line);border-radius:4px;background:#f8fafb}
.wf-variable-list>div{padding:8px 10px;border-bottom:1px solid var(--wf-line);overflow-wrap:anywhere}
.wf-variable-list>div:last-child{border:0}
.wf-variable-list strong{display:block;font-size:11px;font-weight:500}
.wf-variable-list code{display:block;margin-top:4px;color:#5a7b75;font-size:10px;line-height:1.5}

/* Accessible list editing stays available alongside the graphical canvas. */
.workflow-editor .builder-lane,.workflow-editor .wf-frame{padding:18px;overflow:auto;min-height:0;flex:1;background:#fafcfc}
.wf-lane-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px}
.wf-lane-title small{color:var(--wf-muted);font-size:9px;font-weight:500;letter-spacing:.8px}
.workflow-editor .wf-lane-title h2{font-size:18px;color:var(--wf-text);margin:5px 0 0}
.workflow-editor .wf-lane-title h3{font-size:13px;margin:5px 0 0}
.wf-lane-title .text-link{font-size:10px;white-space:nowrap}
.wf-team-title{border-top:1px solid var(--wf-line);margin-top:22px;padding-top:18px}
.wf-fixed-step{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;margin-bottom:10px;border:1px solid #dce5e1;border-left:3px solid #a2bab0;border-radius:4px;background:#f2f6f4;color:var(--wf-muted);font-size:10px}
.wf-fixed-step strong{font-size:11px;font-weight:600;color:#4e6d60}
.wf-fixed-step span{text-align:right}
.wf-step-row{display:flex;flex-wrap:wrap;min-width:0;margin:0 0 9px;border:1px solid var(--wf-line);border-left:3px solid transparent;border-radius:4px;background:#fff}
.wf-step-row.selected{border-color:#8fae9f;border-left-color:var(--wf-accent)}
.wf-step-row:focus-visible{outline:2px solid #3f7968;outline-offset:2px}
.wf-step-select{display:flex;align-items:flex-start;gap:11px;flex:1;min-width:0;text-align:left;padding:13px 10px;border:0;background:transparent;color:var(--wf-text);cursor:pointer}
.wf-step-number{display:flex;align-items:center;justify-content:center;width:26px;height:26px;flex:0 0 26px;border:1px solid #dce5e3;border-radius:4px;background:#f4f7f7;color:#73878b;font:11px/1 Consolas,monospace}
.wf-step-copy{display:block;min-width:0;flex:1}
.wf-step-copy strong{display:block;font-size:12px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.wf-step-copy small{display:block;color:var(--wf-muted);font-size:10px;line-height:1.5;margin-top:4px}
.wf-step-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:6px;color:#7a8b91;font-size:11px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.wf-step-actions{display:flex;flex-direction:column;align-self:flex-start;gap:2px;padding:6px 5px 4px 0}
.wf-step-actions button{padding:4px 7px;border:0;border-radius:3px;background:transparent;color:#72858b;font:12px/1.2 'Segoe UI',sans-serif}
.wf-step-actions button:hover{background:#edf3f1}
.wf-step-route{flex:0 0 100%;min-width:0;padding:7px 12px 7px 48px;border-top:1px solid #edf1f2;background:#fafcfc}
.workflow-editor .route-line{display:flex;gap:8px;padding:2px 0;color:#71868c;font-size:10px;line-height:1.6}
.workflow-editor .route-line>span:first-child{flex:1}
.workflow-editor .route-line>span:last-child{flex:1.25;text-align:right}
.wf-frame>h2{margin:0 0 8px;font-size:18px}
.wf-frame>p{margin:0 0 18px;color:var(--wf-muted);font-size:12px;line-height:1.75}
.wf-frame-step{display:flex;align-items:center;gap:12px;width:100%;margin-bottom:9px;padding:13px;border:1px solid var(--wf-line);border-radius:4px;background:#fff;color:var(--wf-text);text-align:left;font:inherit;cursor:pointer}
.wf-frame-step.selected{border-color:#92afa2;background:#f2f7f4}
.wf-frame-step strong{display:block;font-size:12px}
.wf-frame-step small{display:block;margin-top:4px;font-size:10px;color:var(--wf-muted);line-height:1.6}
.wf-empty{padding:22px 12px;margin-bottom:12px;border:1px solid var(--wf-line);border-radius:4px;font-size:11px;color:var(--wf-muted)}

@media(min-width:1800px){
  .workflow-editor .builder-layout{grid-template-columns:240px minmax(0,1fr) 340px}
}
@media(min-width:1101px){
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-columns:220px minmax(0,1fr)}
}
@media(min-width:1101px) and (max-width:1300px){
  .workflow-editor .builder-layout{grid-template-columns:190px minmax(0,1fr) 290px;gap:8px}
  .workflow-editor .builder-inspector{padding-inline:12px}
  .workflow-editor .editor-controls{gap:3px}
  .workflow-editor .editor-controls .btn{padding-inline:8px;font-size:10px}
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-columns:190px minmax(0,1fr)}
}
@media(max-width:1100px){
  main:has(.workflow-editor.wf-workspace){padding:16px}
  .workflow-editor .builder-layout{grid-template-columns:180px minmax(0,1fr);grid-template-rows:minmax(540px,calc(100dvh - 238px)) auto;height:auto;min-height:0;align-items:stretch}
  .workflow-editor .builder-library{grid-column:1;grid-row:1}
  .workflow-editor .builder-canvas{grid-column:2;grid-row:1}
  .workflow-editor .builder-inspector{grid-column:1 / -1;grid-row:2;max-height:none;overflow:visible}
  .workflow-editor .builder-inspector .wf-inspector-heading{padding-top:16px}
  .workflow-editor .wf-step-route{padding-left:12px}
  .workflow-editor .builder-bar{align-items:flex-start}
  .workflow-editor .diagram-toolbar small{max-width:260px}
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-rows:minmax(540px,calc(100dvh - 238px))}
}
@media(max-width:760px){
  main:has(.workflow-editor.wf-workspace){padding:14px 12px}
  .workflow-editor .page-heading{align-items:flex-start}
  .workflow-editor .page-heading h1{font-size:22px}
  .workflow-editor .page-heading p{font-size:11px}
  .workflow-editor .builder-bar{padding:11px;gap:10px}
  .workflow-editor .editor-controls{width:100%;gap:5px}
  .workflow-editor .editor-controls .btn{padding:7px 9px;font-size:10px;min-height:32px}
  .workflow-editor .builder-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(500px,70dvh) auto auto;gap:10px}
  .workflow-editor .builder-canvas{grid-column:1;grid-row:1}
  .workflow-editor .builder-inspector{grid-column:1;grid-row:2}
  .workflow-editor .builder-library{grid-column:1;grid-row:3;max-height:500px}
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-rows:minmax(500px,70dvh) auto}
  .workflow-editor .wf-inspector-hidden .builder-library{grid-row:2}
  .wf-template-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .wf-template-list button+button{margin:0}
  .wf-library-section>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .workflow-editor .library-item{margin:0;min-width:0}
  .wf-library-section .wf-help{grid-column:1 / -1}
  .wf-keyboard-note{display:none}
  .wf-canvas-toolbar{padding:9px 10px}
  .workflow-editor .diagram-toolbar{padding:8px 10px;gap:6px}
  .workflow-editor .diagram-toolbar small{max-width:210px;font-size:9px}
  .workflow-editor .diagram-zoom{margin-left:0}
  .workflow-editor .diagram-scroll{min-height:200px}
  .workflow-editor .diagram-tasks{max-height:140px}
  .workflow-editor .builder-lane,.workflow-editor .wf-frame{padding:13px}
  .wf-fixed-step{align-items:flex-start}
  .wf-fixed-step span{max-width:60%}
}
@media(prefers-reduced-motion:reduce){
  .workflow-editor *,.workflow-editor *::before,.workflow-editor *::after{scroll-behavior:auto!important;transition:none!important}
}
.workflow-editor .editor-controls .wf-history-button{font-size:18px}

/* Keep the editor controls compact so the first screen shows the actual graph. */
.main-shell:has(.workflow-editor.wf-workspace)>.topbar{height:50px;padding-inline:20px}
.workflow-editor .wf-page-heading{min-height:31px;margin-bottom:9px;align-items:center}
.workflow-editor .wf-page-heading>div{display:flex;align-items:baseline;gap:12px;min-width:0}
.workflow-editor .wf-page-heading .eyebrow{display:none}
.workflow-editor .wf-page-heading h1{font-size:21px;line-height:1.2;white-space:nowrap}
.workflow-editor .wf-page-heading p{margin:0;font-size:10px;line-height:1.5;color:#829097}
.workflow-editor .wf-page-heading>a{font-size:10px;white-space:nowrap}
.workflow-editor .builder-bar{padding:8px 12px;gap:9px;margin-bottom:6px}
.workflow-editor .wf-breadcrumbs{margin-bottom:4px;font-size:10px;line-height:1.5}
.workflow-editor .wf-version{gap:7px}
.workflow-editor .wf-version>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
.workflow-editor .wf-version strong{font-size:10px;line-height:1.5}
.workflow-editor .wf-version small{font-size:9px;line-height:1.5;margin:0}
.workflow-editor .wf-profile-note{padding:2px 1px;margin-bottom:7px;font-size:9px;line-height:1.5}
.workflow-editor .editor-controls .btn{min-height:31px;padding:6px 9px;font-size:10px}
.workflow-editor .editor-controls .wf-history-button{font-size:17px;min-width:27px;padding:4px}
.workflow-editor .wf-canvas-toolbar{min-height:38px;padding:6px 10px;gap:7px}
.workflow-editor .wf-canvas-toolbar strong{font-size:11px}
.workflow-editor .wf-canvas-toolbar>div:first-child>span{font-size:9px;margin-top:2px}
.workflow-editor .builder-view-switch button{padding:5px 8px;font-size:9px}
.workflow-editor .diagram-toolbar{min-height:33px;padding:5px 10px;gap:6px}
.workflow-editor .diagram-toolbar>div:first-child{min-width:0;flex:1}
.workflow-editor .diagram-toolbar>div:first-child strong{display:none}
.workflow-editor .diagram-toolbar small{margin:0;font-size:9px;line-height:1.5}
.workflow-editor .diagram-zoom{gap:3px;flex-shrink:0}
.workflow-editor .diagram-zoom button{min-height:25px;min-width:25px;padding:4px 6px;font-size:9px}
.workflow-editor .diagram-zoom span{font-size:9px;min-width:31px}
.workflow-editor .diagram-connection-status{padding:5px 10px;font-size:10px;line-height:1.5}
.workflow-editor .diagram-note{padding:6px 10px;font-size:9px;line-height:1.5}
.workflow-editor .wf-team-drawer{padding:7px 10px;font-size:10px;line-height:1.5}
.workflow-editor .builder-audio{padding:7px 11px;margin-top:8px;margin-bottom:0}
.workflow-editor .builder-audio>summary{font-size:10px;line-height:1.5}
.workflow-editor #wf-routing-warnings{flex-shrink:0;max-height:100px;overflow:auto}

@media(min-width:1101px){
  .main-shell:has(.workflow-editor.wf-workspace)>main{height:calc(100dvh - 50px);min-height:0;padding:11px 16px 12px}
  .main-shell:has(.workflow-editor.wf-workspace)>footer{display:none}
  .workflow-editor.wf-workspace{display:flex;flex-direction:column;height:100%;min-height:0}
  .workflow-editor .wf-page-heading{flex-shrink:0}
  .workflow-editor #workflow-form{display:flex;flex:1;min-height:0}
  .workflow-editor #workflow-form>fieldset{display:flex;flex-direction:column;flex:1;min-height:0}
  .workflow-editor .builder-bar,.workflow-editor .wf-profile-note,.workflow-editor .builder-audio{flex-shrink:0}
  .workflow-editor .builder-layout{flex:1;height:auto;min-height:0}
  .workflow-editor .diagram-scroll{min-height:110px}
  .workflow-editor .diagram-loading{min-height:110px}
  .workflow-editor .builder-audio[open]{max-height:220px;overflow:auto}
}
@media(max-width:1100px){
  .workflow-editor .wf-page-heading>div{display:block}
  .workflow-editor .wf-page-heading p{margin-top:4px}
  .workflow-editor .builder-layout{grid-template-rows:minmax(380px,calc(100dvh - 210px)) auto}
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-rows:minmax(380px,calc(100dvh - 210px))}
}
@media(max-width:760px){
  .main-shell:has(.workflow-editor.wf-workspace)>.topbar{height:45px;padding-inline:14px}
  .workflow-editor .wf-page-heading{align-items:flex-start}
  .workflow-editor .wf-page-heading p{max-width:250px}
  .workflow-editor .wf-page-heading>a{font-size:9px;max-width:110px;white-space:normal;text-align:right;line-height:1.6}
  .workflow-editor .builder-layout{grid-template-rows:minmax(430px,65dvh) auto auto}
  .workflow-editor .builder-layout.wf-inspector-hidden{grid-template-rows:minmax(430px,65dvh) auto}
  .workflow-editor .diagram-toolbar small{max-width:none}
  .workflow-editor .diagram-zoom{margin-left:auto}
  .workflow-editor .diagram-scroll{min-height:160px}
}

