/* 04.10.0: on-demand workflow drawer; compact Inbox layout remains unchanged. */
.workflow-global-panel{width:min(500px,100vw)}
.workflow-global-panel>.global-panel-body{padding:20px 22px 32px}
.wf-intro{display:flex;align-items:flex-start;gap:12px;justify-content:space-between;margin-bottom:18px}
.wf-intro .eyebrow{font-size:9px;letter-spacing:1.7px}.wf-intro h2{margin:8px 0;font-size:20px;line-height:1.3;overflow-wrap:anywhere}
.wf-intro p,.wf-step p{font-size:12px;line-height:1.65;color:var(--ui-muted);margin:8px 0}
.wf-intro>.icon-button{flex-shrink:0}
.wf-progress{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;border-radius:10px;background:var(--ui-accent-soft);border:1px solid var(--ui-line);font-size:12px;color:var(--ui-accent);margin-bottom:16px}
.wf-progress span{font-size:11px;color:var(--ui-muted)}
.wf-step{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;padding:24px 0;border-bottom:1px solid var(--ui-line)}
.wf-marker{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px solid var(--ui-line);color:var(--ui-muted);background:var(--ui-soft);font-size:11px}
.wf-marker .ui-icon{width:13px;height:13px}.wf-step.complete .wf-marker{background:var(--ui-accent-soft);color:var(--ui-accent);border-color:var(--ui-accent)}
.wf-step h3,.wf-counts h3{font-size:13px;margin:2px 0 10px;font-weight:600;line-height:1.5}.wf-step-content{min-width:0}
.wf-step blockquote{font-size:12px;line-height:1.7;padding:12px;margin:0;background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:8px;overflow-wrap:anywhere;white-space:pre-wrap}
.wf-step .wf-hint,.wf-hint{font-size:10.5px;line-height:1.65;color:var(--ui-muted);margin:10px 0}.wf-owner{display:flex;align-items:center;gap:7px;font-size:12px;margin:8px 0}
.wf-inline{display:flex;align-items:flex-end;gap:8px;margin:10px 0}.wf-inline .wf-field{flex:1;margin:0;min-width:0}
.wf-field{display:flex;flex-direction:column;gap:6px;font-size:11px;margin:12px 0;color:var(--ui-ink)}.wf-field span{font-size:10px;color:var(--ui-muted)}
.wf-field input,.wf-field select,.wf-field textarea,.wf-details select{width:100%;min-width:0;border:1px solid var(--ui-line);border-radius:7px;background:var(--ui-surface);color:var(--ui-ink);font:inherit;font-size:12px;padding:9px 10px;box-sizing:border-box}
.wf-field textarea{resize:vertical;min-height:62px}.wf-field input[type=datetime-local]{color-scheme:light}.wf-form-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.wf-button,.wf-primary{border:1px solid var(--ui-line);padding:8px 11px;border-radius:7px;background:var(--ui-surface);color:var(--ui-ink);font-size:11px;cursor:pointer;line-height:1.4}
.wf-button:hover{background:var(--ui-hover)}.wf-primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-on-accent)}
.wf-button:disabled,.wf-primary:disabled{opacity:.45;cursor:not-allowed}
.wf-callout,.wf-alert{background:var(--ui-accent-soft);border:1px solid var(--ui-line);color:var(--ui-accent);padding:12px;border-radius:8px;font-size:11px;line-height:1.7;margin:12px 0;overflow-wrap:anywhere}
.wf-alert{background:var(--ui-soft);color:var(--ui-ink)}.wf-alert.error{color:var(--ui-danger);border-color:var(--ui-danger)}.wf-alert small{display:block}.wf-alert .wf-button{margin:6px 6px 0 0}
.wf-record{margin:10px 0;padding:12px;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-soft)}.wf-record>div{display:flex;gap:8px;align-items:baseline;justify-content:space-between}
.wf-record strong{font-size:12px;overflow-wrap:anywhere}.wf-status{font-size:10px;white-space:nowrap;color:var(--ui-muted)}.wf-record small{display:block;font-size:10px;line-height:1.6;color:var(--ui-muted);margin:5px 0;overflow-wrap:anywhere}.wf-record .wf-button{margin-top:7px}
.wf-form{margin-top:14px;padding:12px;border:1px solid var(--ui-line);border-radius:10px}.wf-form .wf-field:first-child{margin-top:0}.wf-details{margin:10px 0}.wf-details summary{font-size:11px;color:var(--ui-accent);cursor:pointer;line-height:1.6}.wf-details select{margin-top:10px}
.wf-counts{margin-top:24px}.wf-counts-head{display:flex;align-items:center;justify-content:space-between}.wf-counts h3{display:flex;align-items:center;gap:6px;margin:0}.wf-counts h3 .ui-icon{width:15px;height:15px}
.wf-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0}.wf-metrics>div{display:flex;flex-direction:column;gap:6px;border:1px solid var(--ui-line);border-radius:8px;padding:11px;background:var(--ui-soft)}.wf-metrics span{font-size:9px;color:var(--ui-muted)}.wf-metrics strong{font-size:19px;font-weight:600}
.wf-comparison{font-size:11px;margin:8px 0}.wf-comparison>div,.wf-events>div{display:flex;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid var(--ui-line)}.wf-comparison dd{margin:0}.wf-events{font-size:11px;margin:14px 0}.wf-events small{color:var(--ui-muted);white-space:nowrap}.wf-footer{font-size:10px;line-height:1.75;color:var(--ui-muted);margin:24px 0 0;border-top:1px solid var(--ui-line);padding-top:14px}
html[data-theme=dark] .wf-field input[type=datetime-local]{color-scheme:dark}
@media(max-width:520px){.workflow-global-panel>.global-panel-body{padding:18px 14px 28px}.wf-step{gap:9px}.wf-progress{font-size:11px}.wf-progress span{font-size:10px}.wf-metrics>div{padding:9px}.wf-intro h2{font-size:18px}.wf-form{padding:10px}}

.workflow-global-panel .wf-primary{color:var(--ui-on-accent,#fff);background:var(--ui-accent);border-color:var(--ui-accent)}

/* 04.10.0: generic button:hover:not(:disabled) used to override the workflow
   accents while leaving pale text on a pale background. Scope all real states. */
.workflow-global-panel .wf-primary:not(:disabled){background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent);opacity:1}
.workflow-global-panel .wf-primary:hover:not(:disabled),
.workflow-global-panel .wf-primary:focus-visible:not(:disabled){background:var(--ui-accent-hover);color:var(--ui-on-accent);border-color:var(--ui-accent-hover);opacity:1}
.workflow-global-panel .wf-primary:active:not(:disabled){background:var(--ui-accent-hover);color:var(--ui-on-accent);border-color:var(--ui-accent-hover)}
.workflow-global-panel .wf-button:hover:not(:disabled){background:var(--ui-hover);color:var(--ui-ink);border-color:var(--ui-line);opacity:1}
.workflow-global-panel .wf-button:focus-visible,.workflow-global-panel .wf-primary:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}
.workflow-global-panel .wf-primary:disabled,.workflow-global-panel .wf-button:disabled{opacity:.45;cursor:not-allowed}
/* Observe content growth without native browser anchoring fighting the controller. */
.message-timeline{overflow-anchor:none;scroll-behavior:auto}
.timeline-content{display:flow-root;min-width:0}

/* 04.10.0: keep completion feedback in the old action slot. A second click must
   not land on the separate Add another follow-up control below this card. */
.wf-task-action{display:flex;align-items:center;min-height:34px;margin-top:7px}
.wf-record .wf-task-action .wf-button{margin-top:0}
.wf-task-completed{display:inline-flex;align-items:center;gap:6px;min-height:34px;box-sizing:border-box;padding:8px 11px;color:var(--ui-muted);font-size:11px;line-height:1.4}
.wf-task-completed svg{width:14px;height:14px;flex-shrink:0}

/* 04.10.0: on-demand lead progression; reuses existing theme and focus rules. */
.wf-stage-form h4{margin:0 0 12px;font-size:13px;font-weight:650;color:var(--ui-ink);}
.wf-stage-tools{margin-top:10px;display:flex;flex-direction:column;align-items:flex-start;gap:9px;}
.wf-stage-history{align-self:stretch;width:100%;min-width:0;}
.wf-stage-history summary{font-size:12px;cursor:pointer;}
.wf-stage-event{border-left:2px solid var(--line);padding:4px 0 7px 11px;margin:12px 0;overflow-wrap:anywhere;}
.wf-stage-event strong{display:block;font-size:12px;}
.wf-stage-event small{display:block;margin-top:4px;}
.wf-stage-event p{font-size:12px;margin:7px 0;white-space:pre-wrap;}
