/* Workflow canvas deliberately shares the routine UI's neutral surface palette. */
:root{--wf-bg:var(--input-bg);--wf-soft:var(--control-bg);--wf-line:var(--border);--wf-text:var(--text);--wf-muted:var(--label-fg);--wf-green:var(--schedule-active-fg);--wf-green-bg:var(--schedule-active-bg);--wf-warning:var(--amber);--wf-focus:var(--focus-ring)}
[data-theme="dark"]{--wf-bg:var(--dark-page);--wf-soft:var(--dark-control);--wf-line:var(--dark-control-line);--wf-text:var(--dark-text);--wf-muted:var(--dark-text-secondary);--wf-green:var(--dark-success);--wf-green-bg:var(--dark-success-bg);--wf-warning:var(--amber);--wf-danger:var(--danger);--wf-focus:var(--focus-ring)}
html{scrollbar-gutter:stable}.wf-editor,.wf-detail{color:var(--wf-text)}.wf-editor [hidden],.wf-detail [hidden]{display:none!important}
.routine-schedule-badge,.routine-runtime-badge,.wf-chip{min-height:22px!important;height:auto;line-height:1.2!important;padding:3px 8px!important;border-width:1px!important;border-radius:6px!important;font-size:12px!important;font-weight:500!important}
.routine-schedule-badge.is-active{color:var(--schedule-active-fg,var(--wf-green))!important;background:var(--schedule-active-bg,var(--wf-green-bg))!important;border:1px solid var(--schedule-active-line,color-mix(in srgb,var(--wf-green-bg) 88%,var(--wf-green)))!important}
.routine-schedule-badge.is-paused{background:var(--schedule-paused-bg,var(--wf-soft))!important;color:var(--schedule-paused-fg,var(--wf-muted))!important;border:1px solid var(--schedule-paused-line,var(--wf-line))!important}.routine-runtime-badge{background:var(--runtime-bg,var(--wf-soft))!important;border:1px solid var(--wf-line)!important;color:var(--runtime-fg,var(--wf-muted))!important}
.wf-editor{max-width:710px;margin:auto}.wf-editor.is-preview{max-width:1160px}.routine-agent-editor-page:has(.is-preview){max-width:1220px}.routine-edit-dialog:has(.wf-editor){--routine-dialog-width:740px;max-width:calc(100vw - 28px)}.routine-edit-dialog:has(.is-preview){--routine-dialog-width:1180px}.routine-edit-dialog .wf-create-title{display:none}.routine-edit-dialog .routine-form{margin-top:0}
.wf-create-title{font-size:23px!important;line-height:1.35;margin:0 0 5px!important}.wf-hint{font-size:12px;line-height:1.6;color:var(--wf-muted);margin:5px 0 9px}.wf-editor .routine-form-linear{gap:13px}.wf-editor .routine-linear-field{margin:12px 0 0!important}.wf-editor textarea[name=instructions]{min-height:120px!important;height:120px;font-size:13px!important;line-height:1.65!important}.wf-editor .routine-kind-switch{margin-bottom:14px}.wf-editor .routine-field-label{font-size:13px!important;margin-bottom:7px!important}.wf-prompt-examples{display:flex;align-items:center;flex-wrap:wrap;gap:6px;color:var(--wf-muted);font-size:11px;margin:9px 0 0}.wf-prompt-examples button{font:inherit;color:var(--wf-text);border:1px solid var(--wf-line);border-radius:5px;padding:4px 7px;background:var(--control-bg,var(--wf-bg));cursor:pointer}
.wf-method{display:flex;justify-content:space-between;gap:15px;align-items:center;border-top:1px solid var(--wf-line);padding-top:12px;margin-top:14px;font-size:13px}.wf-method select{min-width:145px;height:32px;border:1px solid var(--wf-line);border-radius:7px;background:var(--input-bg,var(--wf-bg));color:var(--wf-text);font:inherit}.wf-optional{font-size:12px;color:var(--wf-muted);margin-top:8px}.wf-optional summary{cursor:pointer}.wf-optional label{display:grid;gap:6px;margin-top:10px}.wf-optional input{font-size:13px}.wf-validation{color:var(--wf-warning);font-size:12px;white-space:pre-line;margin:8px 0}.wf-validation:empty{display:none}
.wf-preview-heading{display:flex;align-items:flex-start;gap:16px;justify-content:space-between;margin-bottom:12px}.wf-preview-heading h2{font-size:21px;line-height:1.4;margin:0}.wf-preview-heading .routine-schedule-badge{white-space:nowrap;margin-top:4px}.wf-shell{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:13px;min-width:0}.wf-panel{border:1px solid var(--wf-line);border-radius:11px;background:var(--panel-bg,var(--wf-bg));overflow:hidden;min-width:0}.wf-toolbar{display:flex;align-items:center;gap:6px;padding:9px 11px;border-bottom:1px solid var(--wf-line);flex-wrap:wrap;font-size:12px;min-height:47px}.wf-toolbar-title{color:var(--wf-muted);margin-right:auto}.wf-toolbar button,.wf-toolbar select,.wf-inspector button,.wf-tabs button,.wf-live-bar select{font:inherit;color:var(--wf-text);background:var(--control-bg,var(--wf-bg));border:1px solid var(--wf-line);border-radius:6px;padding:5px 8px;cursor:pointer}.wf-toolbar button:hover,.wf-inspector button:hover{background:var(--wf-soft)}.wf-toolbar button:disabled{opacity:.4;cursor:default}.wf-toolbar select{max-width:130px}.wf-viewport{height:365px;overflow:auto;position:relative;overscroll-behavior:contain;background-image:radial-gradient(var(--wf-line) .65px,transparent .65px);background-size:17px 17px;scrollbar-gutter:stable;background-color:var(--wf-bg)}.wf-board{position:relative;min-width:100%;min-height:100%;touch-action:pan-x pan-y}.wf-stage{position:absolute;left:0;top:0;transform-origin:0 0}.wf-edges{position:absolute;inset:0;overflow:visible;pointer-events:none}.wf-edge{fill:none;stroke:var(--wf-line);stroke-width:1.7;pointer-events:stroke;cursor:pointer}.wf-edge:hover,.wf-edge.selected{stroke:var(--wf-muted);stroke-width:3}.wf-edge.traversed{stroke:var(--wf-green);stroke-width:2.4}.wf-edge-tag{font:12px var(--font-sans);fill:var(--wf-muted);paint-order:stroke;stroke:var(--wf-bg);stroke-width:7px;pointer-events:none}
.wf-node{position:absolute;width:190px;min-height:66px;border:1px solid var(--wf-line);border-radius:10px;background:var(--input-bg,var(--wf-bg));color:var(--wf-text);padding:12px;display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer;user-select:none;touch-action:none;font:inherit}.wf-node.selected{outline:2px solid color-mix(in srgb,var(--wf-muted) 55%,transparent);outline-offset:3px}.wf-node-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:29px;height:29px;border-radius:7px;background:var(--wf-soft);color:var(--wf-muted);font-size:17px}.wf-node-copy{min-width:0;flex:1}.wf-node-title{display:block;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wf-node-subtitle{display:block;color:var(--wf-muted);font-size:11px;margin-top:4px}.wf-node.done{border-color:var(--schedule-active-fg,#8aad8b)}.wf-node.running,.wf-node.working{border-color:var(--wf-green);box-shadow:0 0 0 2px color-mix(in srgb,var(--wf-green) 12%,transparent)}.wf-node.failed,.wf-node.blocked,.wf-node.waiting_approval{border-color:var(--wf-warning)}.wf-node.skipped{opacity:.45}.wf-node-status{font-size:10px;position:absolute;right:7px;top:-8px;background:var(--input-bg,var(--wf-bg));color:var(--wf-green);padding:1px 4px;border-radius:4px}.wf-node.blocked .wf-node-status,.wf-node.failed .wf-node-status,.wf-node.waiting_approval .wf-node-status{color:var(--wf-warning)}.wf-port{position:absolute;bottom:-6px;left:calc(50% - 6px);width:12px;height:12px;display:block;border:2px solid var(--wf-muted);background:var(--input-bg,var(--wf-bg));border-radius:50%;cursor:crosshair}.wf-node:focus-visible,.wf-toolbar button:focus-visible,.wf-inspector button:focus-visible{outline:2px solid var(--wf-focus,#4b85b0);outline-offset:3px}
.wf-canvas-footer{border-top:1px solid var(--wf-line);padding:8px 12px;color:var(--wf-muted);font-size:11px;display:flex;justify-content:space-between;gap:8px}.wf-inspector{padding:14px;border:1px solid var(--wf-line);border-radius:11px;background:var(--panel-bg,var(--wf-bg));min-width:0;max-height:455px;overflow:auto;scrollbar-gutter:stable}.wf-inspector h3{font-size:14px;font-weight:500;margin:0 0 12px}.wf-inspector label{display:block;font-size:12px;color:var(--wf-muted);margin:11px 0}.wf-inspector input:not([type=checkbox]),.wf-inspector textarea,.wf-inspector select{display:block;width:100%;box-sizing:border-box;border:1px solid var(--wf-line);border-radius:6px;background:var(--input-bg,var(--wf-bg));color:var(--wf-text);padding:7px 8px;margin-top:5px;font:12px/1.6 var(--font-body)}.wf-inspector textarea{min-height:85px;resize:vertical}.wf-inspector .wf-small-area{min-height:55px}.wf-inspector p{font-size:12px;line-height:1.7;margin:8px 0}.wf-inspector .wf-node-remove{color:var(--wf-danger,#a04c42);margin-top:12px}.wf-inspector .wf-link-row{display:flex;gap:6px}.wf-inspector .wf-link-row>*{min-width:0;flex:1}.wf-inspector .wf-toggle-search{display:flex;align-items:center;gap:7px;color:var(--wf-text)}.wf-inspector .wf-section{border-top:1px solid var(--wf-line);margin-top:14px;padding-top:12px}.wf-chip{display:inline-flex;background:var(--wf-soft);border:1px solid var(--wf-line);font-size:11px!important}.wf-node-output{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7}.wf-edge-list{display:grid;gap:5px;margin-top:8px}.wf-edge-list button{text-align:left;white-space:normal;font-size:11px}
.wf-tabs{display:flex;gap:24px;border-bottom:1px solid var(--wf-line);margin-top:24px}.wf-tabs button{border:0;border-radius:0;background:transparent;padding:12px 0;color:var(--wf-muted);font-size:13px}.wf-tabs button[aria-pressed=true]{color:var(--wf-text);border-bottom:2px solid var(--wf-text)}.wf-live-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:12px 0;font-size:12px;color:var(--wf-muted)}.wf-live-bar label{display:flex;align-items:center;gap:8px}.wf-live-bar .wf-hint{margin:0}.wf-run{background:var(--wf-bg);border:1px solid var(--wf-line);border-radius:10px;margin:13px 0}.wf-run summary{padding:14px;cursor:pointer;font-size:13px;display:flex;justify-content:space-between;gap:8px}.wf-run-body{padding:0 16px 16px}.wf-result-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:13px}.wf-run-trace{margin:14px 0;border-top:1px solid var(--wf-line);padding-top:12px}.wf-run-trace div{display:flex;justify-content:space-between;gap:10px;font-size:12px;padding:4px 0}.wf-detail [data-wf-settings-panel]{padding:20px 0}.wf-detail [data-wf-settings-panel] h3{font-size:14px}.wf-detail .wf-result-text{margin:12px 0 20px}.wf-empty{padding:45px 10px;color:var(--wf-muted);text-align:center;font-size:13px}.wf-shell.is-readonly .wf-viewport{height:380px}.wf-canvas-steps{padding:14px;display:grid;gap:9px}.wf-canvas-steps button{position:relative;width:100%;min-height:60px;left:auto!important;top:auto!important}.wf-canvas-steps .wf-port{display:none}
@media(min-width:851px) and (max-height:800px){.wf-editor .routine-linear-field{margin-top:8px!important}.wf-editor textarea[name=instructions]{height:100px!important;min-height:100px!important}.wf-editor .wf-hint{margin:3px 0 5px}.wf-editor:not(.is-preview) .routine-form-footer{margin-top:10px!important;padding-top:10px!important}.wf-editor .wf-viewport{height:305px}.wf-inspector{max-height:395px}.wf-method{padding-top:9px;margin-top:10px}.wf-create-title{font-size:21px!important}.routine-agent-editor-page{padding-top:12px!important}}
@media(max-width:850px){.wf-shell{grid-template-columns:minmax(0,1fr)}.wf-inspector{max-height:none}.wf-editor{max-width:100%}.wf-preview-heading{flex-wrap:wrap}.wf-live-bar{flex-wrap:wrap}.wf-viewport{height:335px}.routine-edit-dialog:has(.is-preview){width:calc(100vw - 24px)}}
@media(max-width:540px){.wf-toolbar-title{width:100%}.wf-toolbar{gap:5px}.wf-preview-heading h2{font-size:19px}.wf-method{gap:8px}.wf-method select{min-width:115px;max-width:125px}.wf-inspector{padding:12px}.wf-editor .routine-schedule-control{flex-wrap:wrap!important}.wf-viewport,.wf-shell.is-readonly .wf-viewport{height:280px}.wf-live-bar label{max-width:100%;flex-wrap:wrap}.wf-live-bar select{max-width:250px}.wf-run summary{flex-wrap:wrap}.wf-canvas-footer{flex-wrap:wrap}.wf-editor .routine-form-footer{flex-wrap:wrap}}
/* Scope out legacy source-form label margins; do not resize the browser or hide overflow. */
.routine-agent-editor-page>.routine-editor-crumb{display:none}
.wf-editor,.wf-detail{font-family:var(--font-body)}
.wf-editor .routine-form{display:block}
.wf-editor .routine-kind-switch{margin-bottom:8px}
.wf-editor .routine-editor-banner{padding:6px 10px;margin:0 0 8px;font-size:11px}
.wf-editor .routine-linear-field{gap:4px}
.wf-editor .routine-field-label{margin:0 0 4px!important}
.wf-method>div{min-width:0;flex:1}.wf-editor .wf-method select{width:155px;flex:0 0 155px;margin:0}
.wf-editor .wf-method label{margin:0;font-weight:500}.wf-method .wf-hint{margin-bottom:0}
.wf-editor .routine-schedule-control{margin:0}.wf-editor .routine-schedule-control label{margin-bottom:0}
.wf-editor .routine-form-footer{margin-top:12px!important;padding-top:0!important}
.wf-node{box-sizing:border-box;height:66px}.wf-toolbar button{line-height:1.3}
@media(min-width:851px) and (max-height:800px){
 .routine-agent-editor-page{padding-top:0!important}.wf-editor .routine-kind-switch{margin-bottom:6px}
 .wf-editor textarea[name=instructions]{min-height:80px!important;height:80px!important}
 .wf-editor .routine-editor-tools{padding-top:4px;padding-bottom:6px}.wf-editor .wf-prompt-examples{margin-top:6px}
 .wf-editor .routine-linear-field{margin-top:7px!important}
 .wf-editor .routine-form-footer{margin-top:10px!important}.wf-editor .wf-method{padding-top:7px;margin-top:8px}
 .wf-editor .wf-viewport{height:280px}.wf-editor .wf-inspector{max-height:365px}
}
@media(min-width:851px) and (max-height:800px){
 .wf-editor .routine-editor-banner{min-height:0;padding:4px 9px;font-size:11px;line-height:16px}
 .wf-editor .routine-kind-switch{font-size:12px;line-height:18px}
 .wf-editor .routine-editor-tools{min-height:0;height:23px;box-sizing:border-box;padding:2px 11px 4px;line-height:17px}
 .wf-editor .routine-linear-field{gap:2px}
 .wf-editor .routine-linear-field>.wf-hint{margin:3px 0 0!important;font-size:11px;line-height:17px}
 .wf-editor .routine-form-linear .routine-field-label{margin:0 0 2px!important}
 .wf-editor .wf-prompt-examples{margin-top:5px}.wf-editor .wf-prompt-examples button{padding:3px 6px}
 .wf-editor .wf-optional{margin-top:5px}
 .wf-editor .wf-method .wf-hint{margin:2px 0 0;line-height:17px;font-size:11px}
}

.wf-editor.is-preview{width:100%}.routine-agent-editor-page:has(.is-preview){margin:0 auto;width:100%}
@media(min-width:851px) and (max-height:800px){.wf-editor .wf-viewport{height:380px}.wf-editor .wf-inspector{max-height:465px}}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]){--wf-bg:var(--dark-page);--wf-soft:var(--dark-control);--wf-line:var(--dark-control-line);--wf-text:var(--dark-text);--wf-muted:var(--dark-text-secondary);--wf-green:var(--dark-success);--wf-green-bg:var(--dark-success-bg);--wf-warning:var(--amber);--wf-danger:var(--danger);--wf-focus:var(--focus-ring)}}

.wf-editor [data-wf-preview]:enabled{background:var(--primary-bg,#242424);border-color:var(--primary-bg,#242424);color:var(--primary-fg,#fff)}
.wf-editor [data-wf-preview]:enabled:hover{background:var(--primary-hover,#333);border-color:var(--primary-hover,#333)}
.wf-editor [data-wf-preview]:disabled{background:var(--disabled-bg,#b8b8b6);border-color:var(--disabled-bg,#b8b8b6);color:var(--disabled-fg,#fff);opacity:1;cursor:not-allowed;box-shadow:none;transform:none}

/* Reuse the opportunity-list arrow template, dimensions, palette and easing. */
.wf-node-picker{position:relative;min-width:130px}.wf-node-picker>summary{display:flex;align-items:center;gap:12px;list-style:none;cursor:pointer;border:1px solid var(--wf-line);border-radius:6px;padding:6px 10px;color:var(--wf-text);background:var(--control-bg,var(--wf-bg));font:inherit}.wf-node-picker>summary::-webkit-details-marker{display:none}.wf-node-picker[open]>summary .fgroup-arrow{transform:rotate(-180deg)}.wf-node-picker>summary:hover .fgroup-arrow{color:var(--text)}.wf-node-picker>summary:focus-visible{outline:2px solid var(--wf-focus,#4b85b0);outline-offset:3px}.wf-node-menu{position:absolute;z-index:40;top:calc(100% + 5px);left:0;min-width:100%;box-sizing:border-box;padding:5px;border:1px solid var(--wf-line);border-radius:7px;background:var(--overlay-bg,var(--wf-bg));box-shadow:0 6px 20px #0002}.wf-node-menu button{display:block;width:100%;text-align:left;border:0;white-space:nowrap}.wf-node-menu button[aria-pressed=true]{background:var(--selected-bg,var(--wf-soft))}.wf-viewport.is-panning,.wf-viewport.is-panning *{cursor:grabbing!important}.wf-viewport{overscroll-behavior:contain}.wf-gesture-hint{margin-left:auto;white-space:nowrap}
/* Background shorthands must not erase the shared native-select arrow. */
.wf-method select,.wf-toolbar select,.wf-inspector select,.wf-live-bar select{background-color:var(--input-bg,var(--wf-bg));background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888580' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;padding-right:26px}

/* Direct wiring: generous hit areas without enlarging the existing node cards. */
.wf-port,.wf-input-port{touch-action:none;z-index:2}
.wf-port::before,.wf-input-port::before{content:"";position:absolute;inset:-7px;border-radius:50%}
.wf-input-port{position:absolute;top:-6px;left:calc(50% - 6px);width:12px;height:12px;border:2px solid var(--wf-muted);background:var(--input-bg,var(--wf-bg));border-radius:50%}
.wf-port-label{position:absolute;top:11px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:10px;line-height:15px;color:var(--wf-muted);background:var(--wf-bg);padding:0 3px;border-radius:3px;pointer-events:none}
.wf-port:hover{border-color:var(--wf-focus,var(--focus-ring));background:var(--wf-soft)}
.wf-port,.wf-input-port{box-sizing:border-box;top:calc(50% - 6px);bottom:auto;width:12px;height:12px}
.wf-port{right:-6px;left:auto}
.wf-input-port{left:-6px}
.wf-port-label{top:50%;left:15px;transform:translateY(-50%)}
.wf-method-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;min-width:0}
.wf-method-actions button{min-height:28px;padding:3px 8px;line-height:20px;font-size:12px;white-space:nowrap}
.wf-import-status{margin:5px 0 0;color:var(--wf-muted);font-size:12px}.wf-import-status:empty{display:none}.wf-import-status.is-error{color:var(--wf-warning)}
@media(max-width:540px){.wf-method{align-items:flex-start;flex-wrap:wrap}.wf-method-actions{justify-content:flex-start;width:100%}}
.wf-viewport.is-connecting,.is-connecting .wf-node{cursor:crosshair}
.wf-node.can-connect .wf-input-port{border-color:var(--wf-focus,var(--focus-ring));box-shadow:0 0 0 3px color-mix(in srgb,var(--wf-focus,var(--focus-ring)) 18%,transparent)}
.wf-node.is-connect-target{outline:2px solid var(--wf-focus,var(--focus-ring));outline-offset:3px}
.wf-node.is-connect-invalid{outline:2px solid var(--wf-danger,var(--danger));outline-offset:3px;cursor:not-allowed}
.wf-connection-preview{fill:none;stroke:var(--wf-focus,var(--focus-ring));stroke-width:2;stroke-dasharray:6 4;pointer-events:none}
.wf-connection-preview.is-invalid{stroke:var(--wf-danger,var(--danger))}

.wf-example-confirm{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding:10px 12px;border:1px solid var(--wf-line);border-radius:8px;background:var(--panel-bg,var(--wf-bg));font-size:12px}
.wf-example-confirm p{margin:0;color:var(--wf-muted)}
.wf-example-confirm>div{display:flex;gap:6px;flex-shrink:0}
.wf-example-confirm .btn{min-height:28px;padding:3px 10px;font-size:12px;line-height:20px;border-radius:6px}
@media(max-width:540px){.wf-example-confirm{align-items:flex-start;flex-direction:column}.wf-example-confirm>div{align-self:flex-end}}

/* Claude Code subagent frontmatter builder. Keep the check mark native-looking
   while giving every optional key an explicit, reversible enabled state. */
.wf-agent-frontmatter{margin-top:16px;padding:15px;border:1px solid var(--wf-line);border-radius:12px;background:var(--panel-bg,var(--wf-bg))}.wf-agent-frontmatter-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.wf-agent-frontmatter-heading h2{font-size:16px;line-height:1.35;margin:0}.wf-agent-frontmatter-heading .wf-hint{max-width:560px;margin:4px 0 0}.wf-agent-frontmatter-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.wf-agent-frontmatter-actions .btn{min-height:28px;padding:3px 8px;font-size:12px;white-space:nowrap}.wf-agent-targets{display:flex;gap:9px;flex-wrap:wrap;margin:13px 0 0;padding:8px 10px;border:1px solid var(--wf-line);border-radius:8px}.wf-agent-targets legend{padding:0 5px;color:var(--wf-muted);font-size:11px}.wf-agent-targets label{display:grid;grid-template-columns:auto auto;column-gap:6px;align-items:center;min-width:150px;padding:5px 8px;border-radius:7px;color:var(--wf-text);font-size:12px;cursor:pointer}.wf-agent-targets label:has(input:checked){background:var(--selected-bg,var(--wf-soft))}.wf-agent-targets input{accent-color:var(--wf-focus,#3f73a8)}.wf-agent-targets small{grid-column:2;color:var(--wf-muted);font-size:10px}.wf-agent-config-grid{display:grid;grid-template-columns:minmax(0,1.03fr) minmax(300px,.97fr);gap:13px;margin-top:13px;align-items:start}.wf-agent-fields{display:grid;gap:7px;min-width:0}.wf-agent-section-title{padding:7px 0 2px;border-top:1px solid var(--wf-line);color:var(--wf-muted);font-size:11px;letter-spacing:.02em}.wf-agent-section-title:first-child{border-top:0;padding-top:0}.wf-agent-field{display:grid;gap:6px;margin:0;padding:8px 9px;border:1px solid var(--wf-line);border-radius:8px;background:var(--input-bg,var(--wf-bg));color:var(--wf-text);font-size:12px;min-width:0}.wf-agent-field-head{display:flex;align-items:center;gap:6px;min-width:0;line-height:18px}.wf-agent-field-head code{margin-left:2px;color:var(--wf-text);font:11px var(--font-mono,monospace);overflow-wrap:anywhere}.wf-agent-field-head b{margin-left:auto;color:var(--wf-green);font-size:10px;font-weight:500}.wf-agent-field-head>input[type=checkbox]{position:absolute;opacity:0;width:1px;height:1px}.wf-agent-enable-box{display:inline-grid;place-items:center;width:17px;height:17px;border-radius:5px;background:var(--wf-focus,#3c79b4);color:#fff;font-size:12px;line-height:1;flex:none;opacity:.28}.wf-agent-field:has(.wf-agent-field-head>input[type=checkbox]:checked) .wf-agent-enable-box{opacity:1}.wf-agent-field:has(.wf-agent-field-head>input[type=checkbox]:focus-visible){outline:2px solid var(--wf-focus);outline-offset:2px}.wf-agent-field.is-required{border-color:color-mix(in srgb,var(--wf-focus) 42%,var(--wf-line))}.wf-agent-field input:not([type=checkbox]),.wf-agent-field textarea,.wf-agent-field select{width:100%;box-sizing:border-box;border:1px solid var(--wf-line);border-radius:6px;background:var(--control-bg,var(--wf-bg));color:var(--wf-text);padding:6px 8px;font:12px/1.55 var(--font-body);min-width:0}.wf-agent-field textarea{resize:vertical;min-height:46px}.wf-agent-field input:disabled,.wf-agent-field textarea:disabled,.wf-agent-field select:disabled{opacity:.45;cursor:not-allowed}.wf-agent-field.is-disabled{opacity:.58}.wf-agent-field select{background-color:var(--control-bg,var(--wf-bg));background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888580' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;padding-right:25px}.wf-agent-tool-options{display:flex;gap:5px;flex-wrap:wrap}.wf-agent-tool-options label{display:inline-flex;align-items:center;gap:4px;margin:0;padding:3px 6px;border:1px solid var(--wf-line);border-radius:5px;background:var(--control-bg,var(--wf-bg));font-size:10px;color:var(--wf-muted);cursor:pointer}.wf-agent-tool-options label:has(input:checked){border-color:var(--wf-focus);color:var(--wf-text);background:var(--selected-bg,var(--wf-soft))}.wf-agent-tool-options input{margin:0;accent-color:var(--wf-focus)}.wf-agent-switch{display:inline-flex;align-items:center;gap:7px;color:var(--wf-text);font-size:12px}.wf-agent-switch input{accent-color:var(--wf-focus)}.wf-agent-note{color:var(--wf-muted);font-size:10px;line-height:1.45}.wf-agent-validation{margin:2px 0 0;color:var(--wf-warning);font-size:11px;line-height:1.6;white-space:pre-line}.wf-agent-validation:empty{display:none}.wf-agent-preview{position:sticky;top:12px;min-width:0;border:1px solid var(--wf-line);border-radius:9px;overflow:hidden;background:var(--wf-bg)}.wf-agent-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 10px;border-bottom:1px solid var(--wf-line);font-size:12px}.wf-agent-preview-heading>div{display:flex;align-items:center;gap:8px}.wf-agent-preview-heading span{color:var(--wf-muted);font-size:10px}.wf-agent-preview-heading [data-agent-import-status]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wf-agent-preview pre{margin:0;padding:11px 12px;max-height:315px;overflow:auto;color:var(--wf-text);background:var(--input-bg,var(--wf-bg));font:11px/1.65 var(--font-mono,monospace);white-space:pre-wrap;overflow-wrap:anywhere}.wf-agent-prompt-label{display:grid;gap:5px;padding:10px 10px 0;color:var(--wf-muted);font-size:11px}.wf-agent-prompt-label textarea{width:100%;box-sizing:border-box;min-height:150px;resize:vertical;border:1px solid var(--wf-line);border-radius:6px;background:var(--control-bg,var(--wf-bg));color:var(--wf-text);padding:8px;font:11px/1.6 var(--font-body)}.wf-agent-json-preview{border-top:1px solid var(--wf-line)!important;margin-top:10px!important}.wf-agent-frontmatter code{font-family:var(--font-mono,monospace)}
@media(max-width:850px){.wf-agent-config-grid{grid-template-columns:minmax(0,1fr)}.wf-agent-preview{position:static}.wf-agent-frontmatter-heading{flex-direction:column}.wf-agent-frontmatter-actions{justify-content:flex-start}.wf-agent-preview pre{max-height:240px}}
@media(max-width:540px){.wf-agent-frontmatter{padding:11px}.wf-agent-targets label{min-width:0;flex:1 1 130px}.wf-agent-frontmatter-actions .btn{flex:1 1 auto}.wf-agent-field{padding:7px}.wf-agent-tool-options label{font-size:10px}}
.wf-agent-yaml-label{padding:7px 12px 0;color:var(--wf-muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.wf-agent-preview pre{padding:7px 12px 11px}
/* The same editor is reused inside the node inspector.  Collapse its desktop
   two-column layout so the narrow right rail remains usable. */
.wf-inspector .wf-agent-frontmatter{margin:12px 0 0;padding:9px;border-radius:8px}.wf-inspector .wf-agent-frontmatter-heading{display:block}.wf-inspector .wf-agent-frontmatter-heading h2{font-size:14px}.wf-inspector .wf-agent-frontmatter-heading .wf-hint{font-size:10px}.wf-inspector .wf-agent-frontmatter-actions{justify-content:flex-start;margin-top:8px}.wf-inspector .wf-agent-frontmatter-actions .btn{min-height:26px;font-size:11px}.wf-inspector .wf-agent-targets{display:block;margin-top:9px}.wf-inspector .wf-agent-targets label{display:grid;min-width:0}.wf-inspector .wf-agent-config-grid{display:block;margin-top:9px}.wf-inspector .wf-agent-preview{position:static;margin-top:9px}.wf-inspector .wf-agent-preview pre{max-height:210px}.wf-inspector .wf-agent-prompt-label textarea{min-height:100px}.wf-inspector .wf-agent-section-title{font-size:10px}.wf-inspector .wf-agent-field{padding:7px;font-size:11px}

/* Give editing space to the canvas, not repeated explanatory chrome. */
.wf-editor.is-preview .wf-preview-heading{margin-bottom:8px;gap:10px}
.wf-preview-heading>div{min-width:0}
.wf-compact-hint{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wf-editor.is-preview .wf-toolbar{min-height:38px;padding:4px 9px;gap:5px;box-sizing:border-box}
.wf-editor.is-preview .wf-node-picker{min-width:105px}
.wf-editor.is-preview .wf-toolbar button,.wf-editor.is-preview .wf-node-picker>summary{min-height:28px;padding:3px 8px;box-sizing:border-box;line-height:20px}
.wf-editor.is-preview .wf-canvas-footer{padding:5px 10px;line-height:17px}
.wf-editor.is-preview .wf-inspector{padding:11px}
.wf-editor.is-preview .wf-inspector h3{margin-bottom:8px}
.wf-editor.is-preview .wf-inspector label{margin:8px 0}
.wf-capability-picker{margin:12px 0;padding:10px;border:1px solid var(--wf-line);border-radius:7px;max-height:170px;overflow:auto;scrollbar-width:thin}.wf-capability-picker legend{padding:0 5px;color:var(--wf-muted);font-size:12px}.wf-capability-picker label{display:grid!important;grid-template-columns:auto minmax(0,1fr);column-gap:7px;align-items:center;margin:7px 0!important;color:var(--wf-text)!important}.wf-capability-picker label input{grid-row:1 / span 2}.wf-capability-picker label small{grid-column:2;color:var(--wf-muted);font-size:10px;line-height:1.4}
.wf-editor.is-preview .wf-inspector input:not([type=checkbox]),.wf-editor.is-preview .wf-inspector select{padding-top:4px;padding-bottom:4px;margin-top:4px}
.wf-editor.is-preview .routine-form-footer{margin-top:4px;padding-top:0;gap:8px}
.wf-editor.is-preview .routine-form-footer .btn{min-height:30px;padding:4px 11px;line-height:20px;border-radius:7px}
@media(min-width:851px){
 .wf-editor.is-preview .wf-viewport{height:clamp(380px,calc(100dvh - 300px),760px)}
 .wf-editor.is-preview .wf-inspector{max-height:calc(clamp(380px,calc(100dvh - 300px),760px) + 66px)}
 .routine-edit-dialog:has(.is-preview){height:calc(100dvh - 48px);display:flex;flex-direction:column}
 .routine-edit-dialog:has(.is-preview) .routine-modal-heading{flex-shrink:0;margin-bottom:10px}
 .routine-edit-dialog:has(.is-preview) .routine-modal-body{display:flex;flex-direction:column;overflow:hidden}
 .routine-edit-dialog .wf-editor.is-preview{display:flex;flex-direction:column;flex:1;min-height:0}
 .routine-edit-dialog .wf-editor.is-preview [data-wf-form]{display:flex;flex-direction:column;flex:1;min-height:0;gap:4px}
 .routine-edit-dialog .wf-editor.is-preview [data-wf-step-two]{display:flex;flex-direction:column;flex:1;min-height:0}
 .routine-edit-dialog .wf-editor.is-preview [data-wf-canvas]{flex:1;min-height:0}
 .routine-edit-dialog .wf-editor.is-preview .wf-shell{height:100%;grid-template-rows:minmax(0,1fr)}
 .routine-edit-dialog .wf-editor.is-preview .wf-panel{display:flex;flex-direction:column;min-height:0}
 .routine-edit-dialog .wf-editor.is-preview .wf-toolbar,.routine-edit-dialog .wf-editor.is-preview .wf-canvas-footer{flex-shrink:0}
 .routine-edit-dialog .wf-editor.is-preview .wf-viewport{flex:1;min-height:160px;height:auto}
 .routine-edit-dialog .wf-editor.is-preview .wf-inspector{max-height:100%;box-sizing:border-box}
 .routine-edit-dialog .wf-editor.is-preview .routine-form-footer{flex-shrink:0}
}
@media(max-width:850px){.wf-editor.is-preview .wf-viewport{height:clamp(340px,55dvh,560px)}}
.wf-editor [data-wf-step-one] .wf-prompt-examples{display:flex}
@media(min-width:851px){
 .wf-editor.is-preview .wf-preview-heading>div{display:flex;align-items:center;gap:12px;overflow:hidden}
 .wf-editor.is-preview .wf-preview-heading h2{flex-shrink:0;font-size:19px}
 .wf-editor.is-preview .wf-preview-heading .wf-hint{margin:0}
 .routine-edit-dialog:has(.is-preview){padding-top:18px;padding-bottom:18px}
 .routine-edit-dialog .wf-editor.is-preview .routine-form-footer{margin-top:4px}
}
.wf-editor{min-width:0}
.wf-editor .wf-session-reset{display:flex;flex:none;flex-direction:row;align-items:center;flex-wrap:wrap;gap:6px 12px;margin-top:8px}
.wf-session-reset .btn{flex:none}
.wf-session-reset .wf-hint{margin:0}

/* Compact first-step controls: retain text size and full-width task naming. */
.wf-editor .routine-form input[name="name"],
.wf-editor .routine-form input[name="goal"],
.wf-editor .routine-form input[name="compose_time"],
.wf-editor .routine-form #wf-architecture { height:28px; min-height:28px; padding:2px 9px; border-width:1px; border-radius:6px; }
.wf-editor .wf-prompt-examples button { height:24px; min-height:24px; box-sizing:border-box; padding:1px 6px; line-height:20px; border-width:1px; }

/* Keep the frontmatter block as a clone source; detailed editing lives on canvas Agent nodes. */
.wf-editor>.wf-agent-frontmatter{display:none}
.wf-default-resource-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:9px}
.wf-default-resource-grid fieldset{min-width:0;margin:0;padding:7px 8px;border:1px solid var(--wf-line);border-radius:7px}
.wf-default-resource-grid legend{padding:0 4px;color:var(--wf-muted);font-size:11px}
.wf-default-resource-grid label{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:6px;align-items:center;margin:5px 0;color:var(--wf-text);font-size:11px}
.wf-default-resource-grid label input{grid-row:1 / span 2;margin:0;accent-color:var(--wf-focus)}
.wf-default-resource-grid label small{grid-column:2;color:var(--wf-muted);font-size:10px}
.wf-default-resource-grid .wf-hint{margin:4px 0;font-size:10px}
.wf-editor.is-preview .routine-form-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.wf-editor.is-preview .routine-form-footer .btn{flex:0 0 auto;white-space:nowrap}
.wf-modal-schedule{display:inline-flex;align-items:center;max-width:42%;padding:4px 10px;border:1px solid var(--wf-line);border-radius:999px;background:var(--wf-soft);color:var(--wf-muted);font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wf-modal-schedule.is-active{border-color:color-mix(in srgb,var(--wf-green) 58%,var(--wf-line));background:color-mix(in srgb,var(--wf-green-bg) 74%,var(--surface));color:var(--wf-green)}
.wf-modal-schedule.is-paused{border-color:color-mix(in srgb,var(--wf-warning) 58%,var(--wf-line));background:color-mix(in srgb,var(--wf-warning) 12%,var(--surface));color:var(--wf-warning)}
.wf-viewport{overflow-x:auto;overflow-y:hidden}
.routine-edit-dialog:has(.wf-editor.is-preview) .wf-preview-heading{display:none}
@media(min-width:851px){
 .routine-edit-dialog:has(.wf-editor.is-preview){overflow:hidden}
 .routine-edit-dialog:has(.wf-editor.is-preview) .wf-preview-heading{display:none}
}
@media(max-width:850px){.wf-default-resource-grid{grid-template-columns:minmax(0,1fr)}.wf-modal-schedule{max-width:50%}}
/* Managed Skills and Plugins can be selected directly on each canvas node. */
.wf-agent-managed-options{display:grid;gap:5px;max-height:150px;overflow:auto;padding:2px 0;scrollbar-width:none;-ms-overflow-style:none}
.wf-agent-managed-options::-webkit-scrollbar{width:0;height:0;display:none}
.wf-agent-managed-options label{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:6px;align-items:center;margin:0;padding:4px 6px;border:1px solid var(--wf-line);border-radius:5px;background:var(--control-bg,var(--wf-bg));font-size:10px;color:var(--wf-muted);cursor:pointer}
.wf-agent-managed-options label:has(input:checked){border-color:var(--wf-focus);background:var(--selected-bg,var(--wf-soft));color:var(--wf-text)}
.wf-agent-managed-options label input{grid-row:1 / span 2;margin:0;accent-color:var(--wf-focus)}
.wf-agent-managed-options label small{grid-column:2;color:var(--wf-muted);font-size:9px}
.wf-agent-managed-options .wf-hint{margin:4px 0;font-size:10px}
.wf-inspector{scrollbar-width:none;-ms-overflow-style:none;scrollbar-gutter:auto}
.wf-inspector::-webkit-scrollbar{width:0;height:0;display:none}
.wf-inspector .wf-agent-frontmatter{margin-right:-14px;border-radius:8px 0 0 8px}
.wf-editor.is-preview .wf-inspector .wf-agent-frontmatter{margin-right:-11px}
.wf-editor.is-preview .wf-viewport{scrollbar-width:none;-ms-overflow-style:none;scrollbar-gutter:auto}
.wf-editor.is-preview .wf-viewport::-webkit-scrollbar{width:0;height:0;display:none}
/* Give node settings room while keeping the task goal separate from optional overrides. */
@media(min-width:851px){.wf-editor.is-preview .wf-shell{grid-template-columns:minmax(0,1fr) clamp(340px,36%,420px)}}
.wf-editor.is-preview .wf-inspector{padding:14px}
.wf-general-settings{margin-top:14px}
.wf-general-settings h4{margin:0;font-size:14px;font-weight:500;color:var(--wf-text)}
.wf-general-settings>.wf-hint{font-size:11px;margin:5px 0 12px}
.wf-custom-settings{margin-top:18px;border-top:1px solid var(--wf-line);padding-top:14px}
.wf-custom-settings>summary,.wf-agent-exports>summary{cursor:pointer;color:var(--wf-text);font-size:13px;font-weight:500;line-height:22px}
.wf-custom-settings>summary>span{margin-left:8px;color:var(--wf-muted);font-size:11px;font-weight:400}
.wf-editor.is-preview .wf-custom-settings .wf-agent-frontmatter{margin-right:-14px;padding:12px;border-left:0;border-top:0;border-bottom:0;border-radius:0;background:transparent}
.wf-inspector .wf-agent-field{margin:0!important;padding:9px}
.wf-inspector .wf-agent-field-head{cursor:pointer;min-height:22px}
.wf-inspector .wf-agent-key{margin-left:auto;color:var(--wf-muted);font-size:10px}
.wf-inspector .wf-agent-field:has([data-agent-enabled]:not(:checked))>:not(.wf-agent-field-head){display:none}
.wf-inspector .wf-agent-tool-options label{display:inline-flex;margin:0;padding:4px 6px}
.wf-inspector .wf-agent-managed-options label{display:grid;margin:0}
.wf-inspector .wf-agent-exports{margin-top:14px;border-top:1px solid var(--wf-line);padding-top:10px}
.wf-inspector .wf-agent-exports .wf-agent-field{margin-top:10px!important}
.wf-editor .routine-form-footer{display:flex;justify-content:flex-end;align-items:center;gap:8px}
.wf-editor .routine-form-footer .btn{flex:0 0 auto;min-width:max-content;white-space:nowrap}
.wf-editor .routine-form-footer .wf-action-label{display:inline;white-space:nowrap}
.wf-entry-settings{display:grid;gap:10px;margin-top:16px}
.wf-editor .wf-entry-settings>.wf-optional,.wf-editor .wf-entry-settings .ar-option-row>.wf-optional,.wf-editor .wf-entry-settings>.wf-method{margin:0;border:1px solid var(--wf-line);border-radius:9px;padding:11px 13px;background:var(--panel-bg,var(--wf-bg));min-width:0}
.wf-entry-settings .wf-optional summary{color:var(--wf-text);font-weight:500;line-height:22px}
.wf-entry-settings .wf-optional summary .wf-hint{margin-left:8px;font-size:11px;font-weight:400}
.wf-entry-settings .ar-option-row{display:grid;gap:10px}
.wf-entry-settings .wf-method>label{margin:0;font-weight:500}
.wf-entry-settings .wf-method-actions{flex:0 1 auto}
.wf-entry-settings .wf-method select{width:auto;min-width:155px;max-width:220px;flex:0 1 auto}
.wf-entry-settings .wf-import-status:empty{display:none}
.wf-resource-links{display:flex;flex-wrap:wrap;gap:14px;margin-top:10px;font-size:11px}
.wf-resource-links a{color:var(--wf-muted)}
.wf-selection-reason{margin-bottom:14px;border:1px solid var(--wf-line);border-radius:8px;padding:10px}
.wf-selection-reason>summary{cursor:pointer;color:var(--wf-text);font-weight:500}
.wf-selection-reason p{margin:8px 0 0;line-height:1.6;overflow-wrap:anywhere}
.wf-plan-candidate{padding:16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);margin:12px 0}
.wf-plan-candidate h3{margin:0 0 8px}.wf-plan-candidate ol{padding-left:24px}.wf-plan-candidate li{margin:10px 0}.wf-plan-candidate li p{margin:4px 0;color:var(--wf-muted);font-size:14px;line-height:1.6}
.wf-plan-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}.wf-plan-actions .btn{white-space:nowrap;flex:none}
