/* The flow chart (flow.js draws, flowlayout.js places) and its properties (flowedit.js). Tokens only; the accent marks what is
   under the pointer and what is chosen, nothing else. Carried into Studio from FadoFace (branch flowchart, b04d8c8),
   where the owner judged it (2026-11-13/14); the colours are named as Studio names them. */

/* Two pieces the chart had from Rheaface's sheets in FadoFace (grid.css, app.css), carried with it: a small framed
   button, and a row of buttons of which one is pressed */
.fl-tools .g-set-b, .ce .g-set-b, .fe .g-set-b { border: 1px solid var(--rule-2); background: var(--doc); color: var(--ink); border-radius: 8px; padding: 2px 9px; font: inherit; font-size: 12.5px; line-height: 20px; cursor: pointer; white-space: nowrap; }
.fl-tools .g-set-b:hover, .ce .g-set-b:hover, .fe .g-set-b:hover { border-color: var(--ink-3); }
.ce .seg, .fe .seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 999px; padding: 2px; gap: 2px; justify-self: start; }
.ce .seg button, .fe .seg button { background: none; border: 0; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.ce .seg button[aria-pressed="true"], .fe .seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.ce .seg button:disabled, .fe .seg button:disabled { opacity: .45; cursor: default; }
.fl { position: relative; height: 100%; min-height: 220px; overflow: hidden; color: var(--ink); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.fl::before { content: ""; position: absolute; inset: 0; background: var(--ground); }   /* its own ground, whatever the page round it paints: the arrows' casing is this colour */
.fl.grab { cursor: grabbing; }
.fl-pan { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fl-pan.ease { transition: transform .2s ease-out; }
.fl-probe { position: absolute; left: -9999px; top: 0; height: auto; min-height: 0; overflow: visible; visibility: hidden; }
.fl-probe .fl-node { position: static; display: inline-grid; }
.fl-probe .fl-chip { position: static; }

/* the arrows: a casing in the colour of the ground under each line, so one arrow passes over another instead of through it */
.fl-wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.fl-wires path { fill: none; }
.fl-case { stroke: var(--ground); stroke-width: 7; }
.fl-line { stroke: var(--ink-3); stroke-width: 1.5; transition: stroke .12s, opacity .12s; }
.fl-line.main { stroke: var(--ink-2); stroke-width: 2; }   /* the main road */
.fl-hit { stroke: var(--ink); stroke-opacity: 0; stroke-width: 13; pointer-events: stroke; cursor: pointer; }
.fl-wires .fl-head { fill: var(--ink-3); transition: fill .12s, opacity .12s; }
.fl-start path { stroke: var(--ink-2); stroke-width: 2; }   /* the start's arrow is the beginning of the main road */
.fl-start .fl-head { fill: var(--ink-2); stroke: none; }

/* a state: a box with its name and how many documents stand in it, between two end bars that stand a little taller:
   the left one is where documents arrive, the right one where they leave; a bar is as tall as what hangs on it */
.fl-node { position: absolute; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: var(--doc); border: solid var(--rule-2); border-width: 1px 0;
  box-shadow: var(--doc-shadow); cursor: pointer; transition: border-color .12s, opacity .12s; }
.fl-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fl-name { padding: 0 8px 0 11px; font: 600 13.5px/1.25 var(--f-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-count { padding: 0 10px 0 0; font-size: 12px; color: var(--ink-2); }
.fl-bar { position: absolute; width: 9px; display: grid; align-content: center; justify-items: center; gap: 3px; border-radius: 4.5px; background: var(--rule-2); cursor: pointer; transition: background .12s, opacity .12s; }
.fl-bar.has { background: var(--ink-2); }             /* something happens here: a dot for each action, three at most */
.fl-bar i { width: 4px; height: 4px; border-radius: 50%; background: var(--doc); }
.fl-bar i.ai { width: 7px; height: 7px; border-radius: 0; clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%); }   /* an AI agent does this one */
.fl-bar:hover, .fl-bar.open, .fl-bar:focus-visible { background: var(--accent); outline: none; }
.fl-node.on, .fl-node.lit, .fl-node:hover { border-color: var(--ink-3); }
.fl-bar.on:not(.has) { background: var(--ink-3); }
/* a final state: grey, and closed where the others have their way out */
.fl-node.final { background: var(--sunk); color: var(--ink-2); border-right-width: 1px; border-radius: 0 12px 12px 0; box-shadow: none; }
/* what the engine's check found, on the state it is about */
.fl-node.err { border-color: var(--due); }
/* its mark sits on the state's top right corner, drawn after the bars so it stands in front of the exit bar; the ring round it is the ground's */
.fl-flag { position: absolute; width: 17px; height: 17px; border-radius: 50%; background: var(--due); color: var(--doc); font: 700 11.5px/17px var(--f-ui); text-align: center;
  box-shadow: 0 0 0 2px var(--ground); cursor: pointer; transition: opacity .12s; }

/* where documents are born: a ring as tall as a state, standing well before the first one, with a dot in it when something
   happens on creation. A class without states is the ring alone, and the plus on it adds the first state */
.fl-origin { position: absolute; box-sizing: border-box; border: 2px solid var(--ink-2); border-radius: 50%; background: var(--doc); box-shadow: var(--doc-shadow); cursor: pointer; transition: border-color .12s, opacity .12s; }
.fl-origin.has::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--ink-2); transition: background .12s; }
.fl-origin .fl-plus { display: grid; left: calc(100% - 9px); top: calc(50% - 9px); }
.fl-origin:hover, .fl-origin.on, .fl-origin:focus-visible { border-color: var(--accent); outline: none; }
.fl-origin.has:hover::after, .fl-origin.has.on::after { background: var(--accent); }

/* a way out of a state: the button a person presses, and the start of its arrow */
.fl-chip { position: absolute; display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 0 9px 0 11px; border: 1px solid var(--rule-2); border-left: 0; border-radius: 0 11px 11px 0;
  background: var(--doc); color: var(--ink); font: 500 12px/1 var(--f-ui); white-space: nowrap; cursor: pointer; transition: border-color .12s, background .12s, color .12s, opacity .12s; }
.fl-chip-t { overflow: hidden; text-overflow: ellipsis; }
.fl-chip.auto, .fl-chip.timed { border-style: dashed; color: var(--ink-2); }   /* nobody presses this one: it is automatic (silent), or its time brings it */
.fl-mark { flex: none; width: 11px; height: 11px; color: var(--ink-3); }
.fl-chip:hover, .fl-chip.on { border-color: var(--accent); border-style: solid; background: var(--accent-fill); color: var(--on-accent); }
.fl-chip:hover .fl-mark, .fl-chip.on .fl-mark { color: var(--on-accent); }
.fl-chip.lit { border-color: var(--ink-3); }
.fl-chip.err { border-color: var(--due); color: var(--due); }
.fl-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* under the pointer: it and what it touches stand out, the rest steps back */
.fl.hot .fl-node:not(.on):not(.lit), .fl.hot .fl-chip:not(.on):not(.lit), .fl.hot .fl-bar:not(.on):not(.lit), .fl.hot .fl-flag:not(.on):not(.lit), .fl.hot .fl-origin:not(.on) { opacity: .42; }
.fl.hot .fl-line:not(.on):not(.lit), .fl.hot .fl-net .fl-head:not(.on):not(.lit) { opacity: .2; }
.fl-line.lit { stroke: var(--ink); }
.fl-wires .fl-head.lit { fill: var(--ink); }
.fl-line.on { stroke: var(--accent); stroke-width: 2.25; }
.fl-wires .fl-head.on { fill: var(--accent); }

/* what is chosen, while its properties are open; an arrow being pulled out of an exit bar, and the state it would lead to */
.fl-node.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.fl-chip.sel { border-color: var(--accent); border-style: solid; background: var(--accent-fill); color: var(--on-accent); }
.fl-chip.sel .fl-mark { color: var(--on-accent); }
.fl-origin.sel { border-color: var(--accent); }
.fl-rubber { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.fl-node.drop { outline: 2px dashed var(--accent); outline-offset: 3px; }
.fl.pulling { cursor: crosshair; }

/* a plus on the borders of the state under the pointer or chosen: a new state above, below, or after it */
.fl-plus { position: absolute; z-index: 3; display: none; place-items: center; width: 18px; height: 18px; padding: 0; border: 1.5px solid var(--ink-3); border-radius: 50%; background: var(--doc); color: var(--ink-2); cursor: pointer; }
.fl-plus svg { width: 10px; height: 10px; }
.fl-node.on .fl-plus, .fl-node.sel .fl-plus, .fl-node:focus-visible .fl-plus { display: grid; }
.fl.pulling .fl-plus, .fl.grab .fl-plus { display: none; }
.fl-plus.up { left: calc(50% - 9px); top: -10px; }
.fl-plus.down { left: calc(50% - 9px); bottom: -10px; }
.fl-plus.next { left: calc(100% - 2px); top: calc(50% - 9px); }
.fl-plus:hover { border-color: var(--accent); background: var(--accent-fill); color: var(--on-accent); }

/* the card of a transition, and the list an end bar opens */
.fl-tip, .fl-pop { position: absolute; z-index: 5; min-width: 170px; max-width: 320px; padding: 10px 12px 11px; display: grid; gap: 3px; background: var(--doc); border: 1px solid var(--rule-2); border-radius: 10px;
  box-shadow: var(--doc-shadow); font: 400 12.5px/1.4 var(--f-ui); color: var(--ink); cursor: default; pointer-events: none; white-space: normal; }
.fl-tip[hidden], .fl-pop[hidden] { display: none; }
.fl-tip p, .fl-pop p { margin: 0; }
.fl-tip .kicker, .fl-pop .kicker { margin-top: 6px; font-size: 10.5px; }
.fl-pop .kicker:first-child { margin-top: 0; }
.fl-tip-h { font-size: 13.5px; }
.fl-tip-way { color: var(--ink-2); }
.fl-tip-f { font-size: 12px; overflow-wrap: anywhere; }
.fl-tip-n { margin-top: 6px; }
.fl-tip-err { margin-top: 6px; color: var(--due); }
.fl-acts { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.fl-acts li { display: flex; align-items: baseline; gap: 5px; font-size: 12px; }
.fl-acts .fl-mark { align-self: center; color: var(--ink-2); }

/* the chart's own menu at the pointer, in place of the browser's: the shared menu (grid.css, .g-ctx) on the chart's ground */
.fl-menu { cursor: default; }

/* the key: the three places an action hangs, and what a chip's marks say */
.fl-key { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 132px); display: flex; flex-wrap: wrap; gap: 3px 14px; font: 400 11.5px/1.4 var(--f-ui); color: var(--ink-2); cursor: default; pointer-events: none; }
.fl-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.fl-key-st { box-sizing: border-box; width: 19px; height: 11px; border: solid var(--rule-2); border-width: 1px 4px; border-radius: 2px; background: var(--doc); }
.fl-key-st.in { border-left-color: var(--ink-2); }
.fl-key-st.out { border-right-color: var(--ink-2); }
.fl-key-chip { box-sizing: border-box; width: 19px; height: 11px; border: 1px dashed var(--ink-3); border-left: 0; border-radius: 0 6px 6px 0; background: var(--doc); }
.fl.narrow .fl-key { display: none; }

/* the tools: smaller, larger, the whole chart */
.fl-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; cursor: default; }
.fl-tools .g-set-b { display: grid; place-items: center; width: 28px; height: 26px; padding: 0; }
.fl-tools svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) { .fl-pan.ease, .fl-node, .fl-chip, .fl-line, .fl-bar, .fl-flag, .fl-origin { transition: none; } }

/* ---------- the chart with its properties at the side (flowedit.js) ---------- */
.fe { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
.fe.open { grid-template-columns: minmax(0, 1fr) 320px; }
.fe.open.stack { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(200px, 1fr) minmax(0, 46%); }
.fe-stage { position: relative; min-width: 0; min-height: 0; }
.fe-bar { position: absolute; left: 12px; top: 10px; display: flex; gap: 4px; }
.fe-bar .g-set-b { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; }
.fe-bar .g-set-b:disabled { opacity: .45; cursor: default; }
.fe-bar svg, .fe-x svg { width: 14px; height: 14px; flex: none; }
.fe-side { display: grid; align-content: start; gap: 10px; padding: 12px 14px 16px; overflow: auto; min-height: 0; background: var(--sheet); border-left: 1px solid var(--rule); font: 400 13px/1.4 var(--f-ui); color: var(--ink); }
.fe.stack .fe-side { border-left: 0; border-top: 1px solid var(--rule); }
.fe-side[hidden] { display: none; }
.fe-side p { margin: 0; }
.fe-head { display: flex; align-items: center; gap: 6px; }
.fe-grow { flex: 1; }
.fe-head .g-set-b:disabled { opacity: .45; cursor: default; }
.fe-x { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.fe-x:hover { background: var(--sunk); color: var(--ink); }
.fe-f { display: grid; gap: 3px; min-width: 0; }
.fe-f > span:first-child { font-size: 11.5px; color: var(--ink-2); }
.fe-side input[type="text"], .fe-side select { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid var(--rule-2); border-radius: 7px; padding: 5px 8px; background: var(--doc); color: var(--ink); font: inherit; font-size: 13px; }
.fe-side input.code { font-family: var(--f-code); font-size: 12px; }
.fe-side input:disabled { opacity: .5; }
.fe-side input[type="text"]:focus-visible, .fe-side select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.fe-side input::placeholder { color: var(--ink-3); font-family: var(--f-ui); }
.fe-fixed { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px; }
.fe-fixed .code { font-size: 12px; overflow-wrap: anywhere; }
.fe-check { display: flex; align-items: center; gap: 7px; }
.fe-check input { margin: 0; accent-color: var(--accent); }
.fe-line { font-size: 12.5px; }
.fe-note, .fe-err { font-size: 12px; color: var(--due); }
.fe-hint { font-size: 11.5px; }
.fe-sec { display: grid; gap: 5px; padding-top: 9px; border-top: 1px solid var(--rule); }
.fe-none { font-size: 12.5px; }
.fe-acts, .fe-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.fe-acts li { display: flex; align-items: center; gap: 6px; min-height: 24px; padding-left: 8px; border-radius: 6px; background: var(--doc); border: 1px solid var(--rule); font-size: 12px; }
.fe-acts li .code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.fe-acts li .muted { font-size: 11.5px; white-space: nowrap; }
/* an action in its list: a grip carries it to another place in the order; what an AI agent does has its spark */
.fe-grip { flex: none; display: grid; place-items: center; width: 16px; height: 22px; margin-left: -6px; padding: 0; border: 0; background: none; color: var(--ink-3); cursor: grab; touch-action: none; }
.fe-grip svg { width: 14px; height: 14px; }
.fe-grip:hover, .fe-grip:focus-visible { color: var(--ink); outline: none; }
.fe-act { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-ai { flex: none; width: 11px; height: 11px; align-self: center; color: var(--ink-2); }
.fe-acts li.drag { opacity: .5; }
.fe-acts li.into { box-shadow: 0 -2px 0 var(--accent); }
.fe-acts.into-end { box-shadow: 0 2px 0 var(--accent); }
/* choosing an action: a search over the actions a rule may name, in sections by their type */
.fe-pick { display: inline-flex; align-items: center; gap: 5px; justify-self: start; padding: 4px 10px 4px 7px; border: 1px dashed var(--rule-2); border-radius: 7px; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.fe-pick:hover, .fe-pick:focus-visible { border-color: var(--ink-3); color: var(--ink); outline: none; }
.fe-pick svg { width: 13px; height: 13px; }
.fe-picker { display: grid; gap: 4px; }
.fe-opts { max-height: 264px; overflow: auto; display: grid; align-content: start; gap: 1px; padding: 4px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--doc); }
.fe-opt-h { padding: 6px 6px 2px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fe-opt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 7px; padding: 5px 7px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.fe-opt b { font-weight: 500; }
.fe-opt b.code { font-family: var(--f-code); font-size: 12px; color: var(--ink); }
.fe-opt span.code { font-size: 11px; }
.fe-opt .muted { flex-basis: 100%; font-size: 11.5px; }
.fe-opt:hover, .fe-opt.on { background: var(--accent-fill); color: var(--on-accent); }
.fe-opt:hover .muted, .fe-opt.on .muted, .fe-opt:hover .code, .fe-opt.on .code, .fe-opt:hover .fe-ai, .fe-opt.on .fe-ai { color: var(--on-accent); }
.fe-links button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.fe-links button b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-links button .muted { flex: none; font-size: 12px; }
.fe-links button:hover { background: var(--sunk); }
.fe-side select.fe-add { color: var(--ink-2); font-size: 12.5px; }
.fe-toks { display: flex; flex-wrap: wrap; gap: 4px; }
.fe-toks .fe-add { flex: 1 1 110px; width: auto; }
.fe-tok { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 8px; border-radius: 7px; background: var(--doc); border: 1px solid var(--rule-2); font-size: 12.5px; }
.fe-tok .fe-x { width: 18px; height: 18px; }
.fe-side .seg { flex-wrap: wrap; border-radius: 14px; justify-self: stretch; }
.fe-side .seg button { flex: 1 1 auto; font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.fe-fxrow { display: flex; gap: 4px; align-items: center; }
.fe-fxrow input { flex: 1; }
.fe-side .fe-fx { flex: none; height: 28px; padding: 0 8px; font-family: var(--f-code); font-size: 12px; font-style: italic; color: var(--accent); }
.fe-foot { padding-top: 9px; border-top: 1px solid var(--rule); font-size: 11.5px; }
