/* ============================================================
   planflow-workflow.css — THE WORKFLOW VIEW of the floating inspector
   (round 25, track K, 2026-10-18).  planflow-inspector.js workflowView:
   the drawer tab "Workflow" (first), opened by the topbar's drawer button
   and by the nav's Tools › Inspector when nothing is selected.

   Owner: the drawer button "should open the inspector but not of a
   specific block rather of the whole workflow … a center of understanding
   and managing the workflow itself with its components."

   Everything here lives inside .pfi-root .wf-insp (the panel), so the
   sheet contributes nothing with the flag off (the panel only exists under
   it) and paints from the panel's own tokens (--text, --label, --muted,
   --well-bg, …), which planflow-night.css remaps for night / contrast.
   The only colours of its own are the type badges, mapped for night below.
   Reuses the panel's classes: .wf-sec / .wf-sec__h, .wf-field, .wf-input,
   .wf-textarea, .wf-unit, .wf-badge, .wf-status, .wf-btn.
   ============================================================ */

/* ---- the view ---- */
.pfi-root .wf-wfv{display:flex;flex-direction:column}
.pfi-root .wf-wfv .wf-sec{margin-top:11px}
.pfi-root .wf-wfv .wf-sec:first-child{margin-top:2px}
.pfi-root .wf-wfv__none{font-size:12px;line-height:1.5;color:var(--label);padding:2px 0}

/* ---- 1. the workflow ---- */
.pfi-root .wf-wfv .wf-textarea--wf{min-height:54px;padding:8px 11px}
.pfi-root .wf-wfv .wf-textarea--rules{min-height:84px}
.pfi-root .wf-wfv__facts{display:flex;flex-direction:column;gap:5px;margin:0 0 12px;padding:9px 0 10px;border-top:1px solid var(--divider);border-bottom:1px solid var(--divider)}
.pfi-root .wf-wfv__fact{display:flex;align-items:baseline;gap:10px;font-size:12px;line-height:1.45}
.pfi-root .wf-wfv__k{flex:none;width:76px;color:var(--label);font-weight:500;display:inline-flex;align-items:center;gap:4px}
.pfi-root .wf-wfv__v{flex:1;min-width:0;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pfi-root .wf-wfv__two{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:10px}
.pfi-root .wf-wfv__two .wf-field{margin-bottom:0}
.pfi-root .wf-wfv__select{appearance:none;-webkit-appearance:none;padding-right:26px;cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E8077' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat;background-position:right 9px center;background-size:13px 13px;text-overflow:ellipsis}
.pfi-root .wf-wfv .wf-unit__s{font-size:11px;color:var(--label)}   /* review fix 5: the panel's unit tint measured 3.76:1 in day mode */

/* ---- 2. the last run ---- */
.pfi-root .wf-wfv__run{display:flex;flex-direction:column;gap:10px}
.pfi-root .wf-wfv__runhead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pfi-root .wf-wfv__when{font-size:11.5px;color:var(--label)}
.pfi-root .wf-wfv .wf-status.s-stopped{color:var(--label)}
.pfi-root .wf-wfv .wf-status.s-review{color:#9A6313}
.pfi-root .wf-wfv .wf-status.s-waiting,.pfi-root .wf-wfv .wf-status.s-skipped{color:var(--label)}
.pfi-root .wf-wfv .wf-status.s-waiting .wf-status__dot{animation:wf-blink 1.4s ease-in-out infinite}
.pfi-root .wf-wfv__kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.pfi-root .wf-wfv__kpi{display:flex;flex-direction:column;gap:1px;padding:7px 8px;border:1px solid var(--well-line);border-radius:var(--radius);background:var(--field-bg);min-width:0}
.pfi-root .wf-wfv__kpi b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__kpi i{font-style:normal;font-size:10px;color:var(--label);letter-spacing:.03em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__outs{display:flex;flex-direction:column;gap:2px;padding-top:9px;border-top:1px solid var(--divider)}
.pfi-root .wf-wfv__outhd{font-size:9.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--label);font-weight:600;margin-bottom:3px}
.pfi-root .wf-wfv__outnone{font-size:12px;line-height:1.5;color:var(--label)}
.pfi-root .wf-wfv__out{display:flex;align-items:center;gap:9px;width:100%;padding:6px 7px;margin:0 -7px;width:calc(100% + 14px);border:0;background:transparent;font:inherit;text-align:left;cursor:pointer;border-radius:var(--radius);transition:background .12s}
.pfi-root .wf-wfv__out:hover{background:var(--row-hover)}
.pfi-root .wf-wfv__outmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.pfi-root .wf-wfv__outname{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__outline{font-size:11.5px;color:var(--label);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__go{flex:none;line-height:0;color:var(--muted);opacity:0;transform:translateX(-3px);transition:opacity .12s,transform .12s}
.pfi-root .wf-wfv__go svg{width:15px;height:15px;display:block;transform:rotate(-90deg)}
.pfi-root .wf-wfv__out:hover .wf-wfv__go{opacity:.8;transform:none}

/* ---- 3. the blocks ---- */
.pfi-root .wf-wfv__search{margin-bottom:8px}
.pfi-root .wf-wfv__search::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.pfi-root .wf-wfv__count{font-size:11.5px;color:var(--label);padding:0 0 7px;border-bottom:1px solid var(--divider);margin-bottom:4px}
.pfi-root .wf-wfv__list{display:flex;flex-direction:column}
.pfi-root .wf-wfv__row{display:flex;align-items:center;gap:8px;width:calc(100% + 14px);margin:0 -7px;padding:7px 7px 7px calc(7px + var(--wfv-depth,0) * 16px);border:0;background:transparent;font:inherit;text-align:left;cursor:pointer;border-radius:var(--radius);transition:background .12s;position:relative}
.pfi-root .wf-wfv__row:hover{background:var(--row-hover)}
.pfi-root .wf-wfv__row[hidden]{display:none}
/* the step's indent carries a quiet guide line, like the Execution view's hand-off */
.pfi-root .wf-wfv__row[data-depth="1"]::before,.pfi-root .wf-wfv__row[data-depth="2"]::before,.pfi-root .wf-wfv__row[data-depth="3"]::before{content:"";position:absolute;top:0;bottom:0;left:calc(7px + var(--wfv-depth,0) * 16px - 9px);width:1px;background:var(--well-line)}
.pfi-root .wf-wfv__row .wf-badge{width:30px;justify-content:center;font-size:9.5px;padding:3px 0;border-radius:6px;background:var(--field-bg);border:1px solid var(--well-line)}
.pfi-root .wf-wfv__row .wf-badge::before{display:none}
.pfi-root .wf-wfv .wf-badge--ai_prompt{color:#2F7A5C}
.pfi-root .wf-wfv .wf-badge--generate{color:#5A5EB0}
.pfi-root .wf-wfv .wf-badge--output{color:#8A5E26}      /* review fix 5: #9A6A2C measured 4.21:1 on the well — AA needs 4.5 */
.pfi-root .wf-wfv .wf-badge--plan_group{color:#7E5C28}
.pfi-root .wf-wfv .wf-badge--input{color:#276A8B}       /* review fix 4: the Input family's blue (planflow-blocks.css --pf-family-input #2d799e), darkened for AA on the well as the track did for OUT: 5.35:1 */
.pfi-root .wf-wfv__rowmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.pfi-root .wf-wfv__title{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__meta{font-size:11px;color:var(--label);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__rownum{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:1px;font-size:10.5px;color:var(--label);font-variant-numeric:tabular-nums;max-width:92px}
.pfi-root .wf-wfv__tok,.pfi-root .wf-wfv__cost{white-space:nowrap}
.pfi-root .wf-wfv__tok.is-none{color:var(--muted)}
.pfi-root .wf-wfv__cost em{font-style:normal;color:var(--label)}   /* review fix 5: --muted measured 3.76:1 in day mode */
.pfi-root .wf-wfv__row .wf-status{gap:0;flex:none}
.pfi-root .wf-wfv__row .wf-status.s-idle .wf-status__dot{opacity:.55}

/* ---- 3b. group frames as row groups (round 27, track C): a heading row
   "Group #n · N blocks" in the frame's plum, its members indented under it
   like plan-group steps (the same --wfv-depth guide line) ---- */
.pfi-root .wf-wfv__row--frame{margin-top:4px}
.pfi-root .wf-wfv__row--frame .wf-wfv__title{color:#7D3C78}
.pfi-root .wf-wfv .wf-badge--frame{color:#7D3C78}

/* ---- 4. manage ---- */
.pfi-root .wf-wfv__actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:7px}
.pfi-root .wf-wfv__actions:first-of-type{margin-top:0}
.pfi-root .wf-wfv__actions .wf-btn{width:100%;justify-content:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px}
.pfi-root .wf-wfv__actions .wf-btn span{overflow:hidden;text-overflow:ellipsis}
.pfi-root .wf-wfv__actions .wf-btn svg{width:14px;height:14px;flex:none}
.pfi-root .wf-wfv__runbtn{color:var(--cta);font-weight:600}
.pfi-root .wf-wfv__actions .wf-btn[disabled]{opacity:.55;cursor:wait}
/* review fix 5: the panel wears is-run-locked while the block it hangs on runs (applyRunLock);
   the workflow view is not that block — its hints stay fully readable */
.pfi-root .wf-insp.is-run-locked .wf-wfv .wf-hintb{opacity:1}

/* ---- night / contrast: the badges' own colours, lifted onto the dark
   palette; every other colour above is a panel token planflow-night.css
   already remaps ---- */
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--ai_prompt{color:#8FD3B0}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--generate{color:#B9BCF2}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--output{color:#E3B87A}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--plan_group{color:#DCB873}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--input{color:#8CCBE9}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-badge--frame,
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv__row--frame .wf-wfv__title{color:#D9A3D4}   /* round 27 (track C): the frame's plum lifted for the dark well */
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv__runbtn{color:#8FD3B0}   /* review fix 5: --cta measured 2.22:1 on the night button */
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv .wf-status.s-review{color:#E0B45C}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv__select{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9BEB4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>")}
html:is(.wf-theme-night,.wf-theme-contrast) body.aw-newblocks .pfi-root .wf-wfv__select option{background:var(--surface-solid,#1B221E);color:var(--text)}
