/* AU ONE STUDIO · workflow.css — visual workflow designer (node canvas) */
.wfcanvas{max-width:580px;margin:0 auto}
.wfnode{background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r);box-shadow:var(--shadow2);
  overflow:hidden;position:relative;animation:popin var(--dur-3) var(--ease-spring);
  transition:border-color var(--dur-2) var(--ease),box-shadow var(--dur-2) var(--ease),transform var(--dur-2) var(--ease)}
.wfnode:hover{border-color:var(--muted2);box-shadow:var(--shadow);transform:translateY(-1px)}
.wfnode.term{padding:13px 15px;display:flex;align-items:center;gap:12px}
.wfnode .nic{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;color:#fff;flex:none;
  box-shadow:var(--shadow2),inset 0 1px 0 rgba(255,255,255,.22)}
.wfnode .nhead{display:flex;align-items:center;gap:10px;padding:11px 13px;background:var(--glass2);border-bottom:1px solid var(--stroke2)}
.wfnode .nhead .nt{font-weight:800;font-size:14px;min-width:0}
.wfnode .nhead .nt input{background:transparent;border:0;font-weight:800;font-size:14px;width:100%;padding:2px 0;
  border-bottom:1.5px solid transparent;transition:border-color var(--dur-1) var(--ease)}
.wfnode .nhead .nt input:hover{border-bottom-color:var(--stroke)}
.wfnode .nhead .nt input:focus{outline:none;box-shadow:none;border-bottom-color:var(--brand)}
.wfnode .nmode{font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;padding:2.5px 8px;border-radius:6px}
.wfnode .nbody{padding:13px}
.wfnode .nctl{display:flex;gap:3px;margin-left:auto}
.wfnode .nctl button{width:28px;height:28px;border-radius:8px;background:var(--glass);border:1px solid var(--stroke2);
  display:grid;place-items:center;color:var(--ink2);
  transition:background var(--dur-1) var(--ease),color var(--dur-1) var(--ease),transform var(--dur-1) var(--ease)}
.wfnode .nctl button:hover{background:var(--brandS);color:var(--link);transform:translateY(-1px)}
.wfnode .nctl button:active{transform:scale(.92)}

/* connector: gradient spine + insert button that blooms on hover */
.wfconn{position:relative;height:34px;display:grid;place-items:center}
.wfconn .ln{position:absolute;top:0;bottom:0;width:2px;border-radius:2px;
  background:linear-gradient(180deg,var(--stroke),var(--brand) 50%,var(--stroke));opacity:.55}
.wfconn .ins{position:relative;z-index:2;width:26px;height:26px;border-radius:50%;background:var(--glass);
  border:1px solid var(--stroke);display:grid;place-items:center;color:var(--link);box-shadow:var(--shadow2);
  opacity:.7;transition:transform var(--dur-2) var(--ease-spring),opacity var(--dur-1) var(--ease),
    background var(--dur-1) var(--ease),color var(--dur-1) var(--ease)}
.wfcanvas:hover .wfconn .ins{opacity:1}
.wfconn .ins:hover{background:var(--brand);color:#fff;transform:scale(1.15);box-shadow:var(--glow-brand)}
.wfconn .ins:active{transform:scale(1)}
.wfpalette{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:18px}
.wfpalette .btn{border-style:dashed}
.wfhint{margin:0 0 14px}

/* ---- flowchart card polish (Jotform-style) ------------------------------- */
/* node subtitle: who approves this step, under the editable name */
.wfnode .ncardmain{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
.wfnode .nsub{display:flex;align-items:center;gap:5px;font-size:11.5px;color:var(--muted);min-width:0}
.wfnode .nsub svg{flex:none;color:var(--muted2)}
.wfnode .nsubwho{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
/* condition + branch tags below the head, like flow-builder route labels */
.wfnodetags{padding:8px 13px 0}
.wfcondchip{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:3px 9px;border-radius:999px;
  background:var(--warnS);color:var(--warn)}
.wfbranches{display:flex;gap:8px;flex-wrap:wrap;padding:9px 13px 12px}
.wfbranch{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:999px}
.wfbranch.ok{background:var(--okS);color:var(--ok)}
.wfbranch.bad{background:var(--badS);color:var(--bad)}
.wfbranch svg{flex:none}

/* connector stage label (Submitted / Approved) */
.wfconn{gap:6px}
.wfconn .connlbl{position:relative;z-index:2;font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;
  color:var(--ok);background:var(--okS);padding:2px 8px;border-radius:999px;box-shadow:var(--shadow2)}

/* Start / Completed terminal cards */
.wfnode.wfterm{padding:12px 15px;display:flex;align-items:center;gap:12px;border-radius:999px}
.wfnode.wfterm.start{background:var(--glass2)}
.wfnode.wfterm.end{background:var(--okS);border-color:transparent}
.wfterm .wftermt b{font-size:13.5px}

/* ---- "Workflow Elements" palette rail ------------------------------------ */
.wfelements{position:sticky;top:12px;align-self:start;display:flex;flex-direction:column;gap:7px;
  background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r);box-shadow:var(--shadow2);padding:12px}
.wfeltitle{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:2px 4px 6px}
.wfel{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:9px 10px;border-radius:11px;
  background:var(--glass2);border:1px solid var(--stroke2);cursor:pointer;
  transition:background var(--dur-1) var(--ease),border-color var(--dur-1) var(--ease),transform var(--dur-1) var(--ease)}
.wfel:hover{background:var(--brandS);border-color:var(--brand);transform:translateY(-1px)}
.wfel:active{transform:scale(.98)}
.wfelic{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;color:#fff;flex:none;
  box-shadow:var(--shadow2),inset 0 1px 0 rgba(255,255,255,.22)}
.wfelt{display:flex;flex-direction:column;min-width:0}
.wfelt b{font-size:12.5px;font-weight:700;line-height:1.25}
.wfelt small{font-size:10.5px;color:var(--muted)}

/* dotted flow canvas surface */
.wfcanvaswrap{background:
    radial-gradient(circle at 1px 1px, var(--stroke2) 1px, transparent 0) 0 0/18px 18px;
  border:1px solid var(--stroke2);border-radius:var(--r);padding:18px 14px;min-height:220px;overflow:auto}
.wfcanvaswrap .wfcanvas{max-width:560px;margin:0 auto}

/* Platform Experience: select-to-edit inspector rail — .inspector is the SAME
   class the schema editor's right column already uses (components.css). The
   grid is now 3 columns: elements palette | flow canvas | inspector. */
.wfbuilder{display:grid;grid-template-columns:200px minmax(0,1fr) 330px;gap:16px;align-items:start}
.wfnode.sel{border-color:var(--brand);box-shadow:0 0 0 2px var(--brandS),var(--shadow)}
.wfnode .nhead[data-action]{cursor:pointer}
/* medium: drop the inspector to a full-width row under palette+canvas */
@media(max-width:1180px){
  .wfbuilder{grid-template-columns:190px minmax(0,1fr)}
  .wfbuilder>.inspector{grid-column:1 / -1}
}
/* small: single column; palette becomes a horizontal wrapping tray up top */
@media(max-width:700px){
  .wfbuilder{grid-template-columns:1fr}
  .wfelements{position:static;flex-direction:row;flex-wrap:wrap}
  .wfel{flex:1 1 160px}
  .wfelt small{display:none}
}

/* ---- P4 · multi-approver steps (signers list + completion rule) ----------
   The inspector rail mirrors the flow-builder "Approve & Sign" panel: labelled
   sections, a compact signers list you add rows to, then the completion rule.
   Everything below is new class names only — no existing selector is changed,
   so a step that never gains a second approver renders exactly as before. */
.nbody .wfsec{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:800;text-transform:uppercase;
  letter-spacing:.05em;color:var(--muted);margin:14px 0 7px}
.nbody .wfsec:first-child{margin-top:0}
.nbody .wfsec .wfcount{font-size:10px;background:var(--brandS);color:var(--brand);border-radius:999px;padding:1px 7px}
.nbody .wfsec .wfaddsig{margin-left:auto;text-transform:none;letter-spacing:0}

/* outcome pills — the fixed Approve / Deny outcomes of an approval step */
.wfoutcomes{display:flex;gap:7px;flex-wrap:wrap}
.wfoutcome{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;
  padding:6px 12px;border-radius:8px;flex:1;justify-content:center}
.wfoutcome.ok{background:var(--okS);color:var(--ok)}
.wfoutcome.bad{background:var(--badS);color:var(--bad)}

.wfsigreq{display:flex;gap:8px;flex-wrap:wrap}
.wfsigreq .checkline{margin:0;padding:5px 9px;flex:1}

/* one signer row: avatar chip, role/person pickers, remove */
.wfsigners{display:flex;flex-direction:column;gap:6px}
.wfsigner{display:flex;align-items:center;gap:6px}
.wfsigner .inp.sm{padding:6px 8px;font-size:12px;min-width:0;flex:1}
.wfsigav{width:26px;height:26px;border-radius:8px;flex:none;display:grid;place-items:center;
  background:var(--brandS);color:var(--brand)}
.wfsigdel{width:26px;height:26px;flex:none;border-radius:8px;background:var(--glass);
  border:1px solid var(--stroke2);color:var(--muted);display:grid;place-items:center;cursor:pointer}
.wfsigdel:hover{background:var(--badS);color:var(--bad);border-color:var(--bad)}

/* avatar stack on the node header — "who signs this step" at a glance */
.wfavstack{display:inline-flex;flex:none;align-items:center}
.wfav{width:19px;height:19px;border-radius:50%;display:grid;place-items:center;font-size:8.5px;font-weight:800;
  background:var(--brand);color:#fff;border:2px solid var(--card);margin-right:-6px;letter-spacing:-.02em}
.wfav.more{background:var(--muted2);color:var(--ink)}
.wfavstack .wfav:last-child{margin-right:2px}
.wfsigchip{display:inline-flex;align-items:center;gap:3px;font-size:9.5px;font-weight:800;flex:none;
  padding:2px 6px;border-radius:999px;background:var(--warnS);color:var(--warn);margin-left:4px}

/* ---- P4 · runtime: per-approver progress on the approval chain ---------- */
.wfvotes{display:flex;flex-direction:column;gap:5px;margin-top:7px}
.wfvote{display:flex;align-items:center;gap:7px;font-size:11.5px}
.wfvote .wfav{margin-right:0;border-color:transparent}
.wfvote .vn{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wfvote .vs{margin-left:auto;font-weight:800;font-size:10px;text-transform:uppercase;letter-spacing:.04em;
  padding:2px 7px;border-radius:999px;background:var(--glass2);color:var(--muted);flex:none}
.wfvote .vs.ok{background:var(--okS);color:var(--ok)}
.wfvote .vs.bad{background:var(--badS);color:var(--bad)}
.wfvote .vsig{width:34px;height:20px;flex:none;border-radius:4px;background:#fff;border:1px solid var(--stroke2);
  object-fit:contain}
.wfprog{font-size:11px;font-weight:700;color:var(--muted);margin-top:2px}

/* ---- P4 · Approve & Sign pad in the decision modal ---------------------- */
.sigpad{border:1px dashed var(--stroke);border-radius:10px;background:#fff;position:relative;overflow:hidden}
.sigpad canvas{display:block;width:100%;height:150px;touch-action:none;cursor:crosshair}
.sigpad .sigclear{position:absolute;top:6px;right:6px;font-size:11px;font-weight:700;padding:3px 9px;border-radius:7px;
  background:rgba(0,0,0,.06);border:0;color:#444;cursor:pointer}
.sigpad .sigclear:hover{background:rgba(0,0,0,.12)}
.sigpad .sighint{position:absolute;left:0;right:0;bottom:10px;text-align:center;font-size:11px;color:#9aa0a6;pointer-events:none}
.sigpad.signed .sighint{display:none}

/* ---- P6 · path choices (branching) ---------------------------------------
   A choice node routes; it does not approve. It borrows the node card shell so
   the canvas stays one visual language, but uses --warn and neutral branch
   pills — deliberately NOT the ok/bad palette, because a threshold has no good
   and bad side and reusing approve/deny colours here would teach exactly the
   model this feature is not. */
.wfnode.wfcond .nsub{white-space:normal}
.wfnode.wfcond .nsub b{font-weight:800;color:var(--ink)}
.wfbranch.neutral{background:var(--glass2);color:var(--muted)}

/* validation strip — problems with the drawn flow, shown while designing it */
.wfissues{margin:0 0 12px;display:flex;flex-direction:column;gap:6px;padding:10px 12px}
.wfissue{display:flex;align-items:flex-start;gap:7px;font-size:12px;line-height:1.45}
.wfissue svg{flex:none;margin-top:2px}
.wfissue.error{color:var(--bad)}
.wfissue.warn{color:var(--warn)}
