/* The stage editor (process-editor.js): stages left to right as columns split by hairlines, each part a short list
   with an add link; the outcomes last. No boxed cards, no thick borders. On a phone the columns stack. */
.pe-head h2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pe-sub { font-size: 14px; font-weight: 400; }
.pe-state { display: flex; align-items: center; gap: 6px; }
.pe-note { margin: 0 0 12px; font-size: 13.5px; }
.pe-probs ul { margin: 4px 0 0; padding-left: 18px; }
.pe-flow { display: grid; grid-template-columns: repeat(var(--n), minmax(250px, 1fr)); border-top: 1px solid var(--line); overflow-x: auto; scroll-snap-type: x proximity; }
.pe-col { position: relative; padding: 12px 14px 20px; border-left: 1px solid var(--line); min-width: 0; scroll-snap-align: start; }
.pe-col:first-child { border-left: 0; padding-left: 0; }
/* the arrow from one stage into the next, on the hairline between them */
.pe-col + .pe-col::before { content: ""; position: absolute; left: -5px; top: 22px; width: 8px; height: 8px; border-top: 1px solid var(--text-3); border-right: 1px solid var(--text-3); transform: rotate(45deg); background: var(--bg); }
.pe-ends { background: color-mix(in srgb, var(--text) 2%, transparent); }
.pe-ch { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.pe-ch h3 { margin: 0; font-size: 15px; }
.pe-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); font-variant-numeric: tabular-nums; }
.pe-n.end { color: var(--ok); }
.pe-name { flex: 1; min-width: 0; font: inherit; font-size: 15px; font-weight: 600; border: 0; background: transparent; padding: 4px 2px; border-bottom: 1px solid transparent; color: var(--text); border-radius: 0; }
.pe-name:hover:not(:disabled) { border-bottom-color: var(--line-2); }
.pe-name:focus { outline: none; border-bottom-color: var(--focus, var(--sky)); }
.pe-tools { display: inline-flex; gap: 0; opacity: .55; transition: opacity var(--dur-1, 120ms); }
.pe-col:hover .pe-tools, .pe-tools:focus-within { opacity: 1; }
.pe-tools .iconbtn svg, .pe-x svg { width: 14px; height: 14px; }
.pe .iconbtn { width: 28px; height: 28px; border: 0; background: none; color: var(--text-2); }
.pe .iconbtn:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.pe .iconbtn:disabled { opacity: .35; }
.pe .iconbtn.armed { color: var(--bad); opacity: 1; box-shadow: inset 0 0 0 1px var(--bad); }
.pe-hint { margin: 2px 0 0; font-size: 12.5px; }
.pe-part { padding: 10px 0 2px; }
.pe-part + .pe-part { border-top: 1px solid var(--line); margin-top: 8px; }
.pe-part .prc-k { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pe-inline select { font-size: 12px; min-height: 26px; padding: 0 4px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.pe-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.pe-rows > li { display: flex; align-items: flex-start; gap: 2px; }
.pe-rows > li.bad .pe-row { color: var(--bad-2); }
.pe-rows > li.on .pe-row { background: color-mix(in srgb, var(--sky) 8%, transparent); }
.pe-row { flex: 1; min-width: 0; text-align: left; font: inherit; font-size: 13.5px; line-height: 1.4; color: var(--text); background: none; border: 0; padding: 5px 4px; border-radius: 4px; overflow-wrap: anywhere; cursor: pointer; }
span.pe-row { cursor: default; }
button.pe-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.pe-row .tag2 { font-size: 11px; }
.pe-ki { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; color: var(--text-3); }
.pe-x { opacity: 0; flex: none; }
.pe-rows > li:hover .pe-x, .pe-x:focus-visible { opacity: 1; }
.pe-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-top: 2px; }
.pe-way select { width: 100%; min-height: 34px; font-size: 13.5px; }
.pe-cond { display: grid; gap: 6px; margin-top: 6px; }
.pe-cond select, .pe-cond input { min-height: 32px; font-size: 13px; width: 100%; }
.pe-bad { color: var(--bad-2); font-size: 12.5px; margin: 2px 0 4px; }
.pe-form { display: grid; gap: 10px; padding: 10px 0 12px; margin: 4px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.pe-formrow { display: block !important; }
.pe-form .prc-f input, .pe-form .prc-f select, .pe-form .prc-f textarea { width: 100%; min-height: 36px; font-size: 13.5px; }
.pe-form .prc-two { gap: 8px; }
.pe-row2 { display: flex; gap: 6px; align-items: center; }
.pe-row2 input[type=number] { width: 84px; flex: none; }
.pe-row2 select { flex: 1; min-width: 0; }
.pe-cur { width: 64px !important; flex: none; text-transform: uppercase; }
.pe-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.pe-seg label { position: relative; }
.pe-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pe-seg span { display: inline-block; padding: 5px 10px; font-size: 13px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; color: var(--text-2); }
.pe-seg input:checked + span { color: var(--text); box-shadow: inset 0 0 0 1px var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pe-seg input:focus-visible + span { outline: 2px solid var(--focus, var(--sky)); outline-offset: 1px; }
.pe-only summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.pe-end { padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.pe-end:first-of-type { margin-top: 8px; }
.pe-end .pe-part { padding-top: 4px; }
.pe-adds { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 12px; }

/* Try it: the walk a test subject takes, as a line down the page */
.pe-try { margin-top: 20px; padding-top: 6px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 0 28px; }
.pe-try > .prc-head { grid-column: 1 / -1; }
.pe-try h3 { margin: 0; font-size: 15px; }
.pe-tryform { display: grid; gap: 10px; align-content: start; }
.pe-tryform input, .pe-tryform select { width: 100%; min-height: 36px; }
.pe-walk { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--line-2); display: grid; gap: 14px; }
.pe-walk > li { position: relative; }
.pe-walk > li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--canopy, var(--sky)); }
.pe-walk > li.end::before { background: var(--ok); }
.pe-walk p { margin: 0 0 2px; font-size: 13.5px; }
.pe-walk ul { list-style: none; margin: 4px 0; padding: 0; font-size: 13.5px; display: grid; gap: 2px; }
.pe-then { color: var(--text-2); }
.pe-then.stop { color: var(--warn); }

/* Fourth round: describe a change, their page */
.pe-describe { margin: 0 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.pe-describe > summary { cursor: pointer; font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; list-style: none; }
.pe-describe > summary::-webkit-details-marker { display: none; }
.pe-describe[open] > summary { color: var(--text); margin-bottom: 8px; }
.pe-dform textarea { width: 100%; box-sizing: border-box; }
.pe-dform .prc-actions { margin-top: 6px; align-items: center; flex-wrap: wrap; }
.pe-changes { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.pe-portal { margin-top: 20px; padding-top: 6px; border-top: 1px solid var(--line); max-width: 640px; }
.pe-portal h3 { margin: 0; font-size: 15px; }
.pe-secs { border: 0; padding: 0; margin: 10px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pe-secs legend { padding: 0; margin-bottom: 4px; width: 100%; }
.pe-portal textarea { width: 100%; box-sizing: border-box; }
/* An action's conditions: every one must hold. */
.pe-crow { position: relative; padding-right: 32px; }
.pe-crow > .pe-x { position: absolute; right: 0; top: 0; opacity: 1; }
.pe-and { margin: 8px 0 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.pe-only .pe-add { margin-top: 8px; }
/* A reading or a read compared: how, then with what. */
.pe-form .pe-cmp select { flex: none; width: auto; }
.pe-form .pe-cmp input { flex: 1; min-width: 0; width: auto; }
@media (max-width: 900px) {
  .pe-flow { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .pe-col { border-left: 0; padding: 14px 0 16px; border-top: 1px solid var(--line); }
  .pe-col:first-child { border-top: 0; }
  .pe-col + .pe-col::before { left: 50%; top: -5px; transform: rotate(135deg); }
  .pe-ends { background: none; }
  .pe-tools, .pe-x { opacity: 1; }
  .pe-try { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
