/* The shared product screens, once, for both apps.
 *
 * AUTHORED — this file is the source, and it is the ONLY definition of how a screen in
 * `packages/product-ui` looks. `apps/desktop` @imports it and the Flask app includes it,
 * the same arrangement `connectors.css` already has, and for the same reason: two
 * stylesheets kept in step by hand are two stylesheets that drift.
 *
 * WHY IT EXISTS AT ALL, which is a specific failure rather than tidiness. ADR-0012's risk
 * list says "two shells, one component, two CSS baselines — shared components will surface
 * that immediately", and on 2026-09-07 they did: /tasks was swapped to the shared board and
 * every task card rendered INVISIBLE in a browser. The card is a <button>, the Flask
 * stylesheet says `button{background:var(--accent);color:var(--on-accent)}`, and white text on a light
 * card hides the id, the title and the owner. `.board`, `.cards`, `.pill`, `.filters`,
 * `.task`, `.title` and `.mono` did not exist on that side at all. Nothing caught it:
 * vitest renders in jsdom with no stylesheet, and the smoke lane checks the DESKTOP
 * renderer, where every one of those rules is defined.
 *
 * EVERYTHING IS SCOPED UNDER `.pui`, and that is deliberate rather than defensive. Both
 * shells already define `.card`, `.badge` and friends for their own screens — the Flask app
 * for thirty Jinja pages that have not migrated yet. An unscoped file included after theirs
 * would silently restyle all of them, which is a much worse bug than the one being fixed
 * and would arrive without a single failing test. The mount points carry the class:
 * `react_screen.html` on the web, the shell container on the desktop.
 *
 * SO IT MUST BE SELF-SUFFICIENT. It may not lean on either shell's element defaults —
 * `button`, `label`, `input` and `select` differ between them, which is how this started.
 * A rule here states what it needs.
 *
 * NO HEX LITERALS BELOW THIS COMMENT (2026-09-07). This file used to carry eighty of them,
 * and that was not untidiness — it was a functional hole. The desktop then rendered these
 * screens dark, where every token flipped and no literal did, so an amber chip written as a
 * literal stayed a light pill on a dark ground (light only since ADR-0067). They collapsed onto twenty-four roles with three additions to packages/ui/
 * tokens.json — `--on-accent`, `--accent-ink`, `--err-strong` — described there. Two small
 * light-mode shifts came with it, both deliberate: the ok and err hairlines and fills are now
 * the palette's (--ok-line/--ok-soft, --err-line/--err-soft) rather than this file's near-misses. Being the palette is the point.
 */

/* ---------------------------------------------------------------- connectors
 *
 * `connectors.css`, SCOPED. Emitted by scripts/build_connectors.py from the same authored
 * file the Jinja management page inlines, so there is one definition of how a connector tile
 * looks and two places it is served — never two stylesheets kept in step by hand.
 *
 * WHY IT IS HERE, AT THE TOP, AND NOT AT THE BOTTOM. `.legend` and `.gt` are defined in both
 * files. On the desktop `styles.css` has imported `@connectors-css` before `@product-ui-css`
 * since 2026-09-02, so this file's versions have always won and the Connectors screen has
 * always rendered correctly under that cascade. Appending the block instead would have
 * reversed the order on the web only — the two surfaces would then disagree about `.legend`
 * on every shared screen, which is exactly the class of bug this file's header describes.
 *
 * DO NOT EDIT BELOW THE MARKER. Edit packages/ui/connectors.css and run
 * `python3 scripts/build_connectors.py`; `make check` fails when the two drift. */

/* connectors-scoped: generated by scripts/build_connectors.py — do not edit */
/* The Connectors screen, once, for both apps.
 *
 * AUTHORED — the CSS itself is the source, and scripts/build_connectors.py mirrors it into a
 * generated block in the web app's _integrations_style.html. The desktop @imports this file
 * directly. Neither app declares a connector rule of its own any more.
 *
 * WHY IT IS SHARED AT ALL, when the markup cannot be. One side is Jinja rendered by Flask
 * and the other is React in Electron, so there is no component to share and there never
 * will be one. What CAN be shared is every rule below — and once it is, "the same
 * connector-card layout" and "the same badge colours" stop being a paragraph somebody has
 * to re-read before each change and become a file that is either included or not.
 *
 * EVERY COLOUR IS A TOKEN, with two deliberate exceptions: `.tile .icon` and
 * `dialog.cdlg .dhead .icon` are `color:#fff` because their BACKGROUND is a vendor's own
 * brand colour, set inline per card from packages/ui/connectors.json. That background does
 * not follow the palette, so neither may the text on it.
 *
 * The values used to be hardcoded hex here (#e7f6ec, #b2ccff,
 * #fffaeb …), which is why the web page had no dark mode and could not have had one: a
 * literal has no second value. They are packages/ui/tokens.json roles now, so this file
 * follows whichever palette the host app is showing.
 *
 * CLASS NAMES ARE THE WEB'S EXISTING ONES, deliberately unchanged, so the website's markup
 * did not have to move to adopt this. The desktop's new components were written to match
 * them instead — the app followed the site, not the other way round.
 *
 * SCOPING. `.badge` is base.html's own class and is styled app-wide there; the two rules
 * below reach it only inside `.dstate` and `.conn`, which are the only places the connector
 * UI uses it. Nothing here may select a bare `.badge`, `.card`, `.note` or `.pill` — those
 * belong to the two host stylesheets and would collide.
 */

.pui /* ------------------------------------------------------------------ the toolbar */

.ctoolbar{display:flex;gap:10px;align-items:center;margin:14px 0 18px;flex-wrap:wrap}
.pui .ctoolbar .csearch{flex:1 1 320px;min-width:0;position:relative}
.pui .ctoolbar .csearch input{width:100%;padding:9px 12px 9px 34px;border:1px solid var(--line);
  border-radius:var(--radius-md);background:var(--panel);color:var(--ink);font-size:var(--text-md)}
.pui .ctoolbar .csearch input:focus{outline:2px solid var(--accent-line);outline-offset:-1px}
.pui .ctoolbar .csearch::before{content:"⌕";position:absolute;left:11px;top:50%;
  transform:translateY(-50%);color:var(--ink-2);font-size:var(--text-lg)}
.pui .ctoolbar select.cfilter{padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-md);
  background:var(--panel);font-size:var(--text-sm);color:var(--ink);width:auto}
.pui .ctoolbar .cclose{margin-left:auto}

.pui .cinfo{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius-md);
  padding:10px 14px;margin-bottom:20px}
.pui .cinfo summary{cursor:pointer;font-size:var(--text-sm);font-weight:600;color:var(--ink-2)}
.pui .cinfo .legend{margin-top:8px}

.pui .legend{font-size:var(--text-sm);color:var(--ink-2);max-width:80ch}
.pui .legend b{color:var(--ink)}
.pui .legend.tight{margin:6px 0;padding-left:18px;line-height:1.9}

.pui /* ------------------------------------------------------------------ category sections */

.cat-sect{margin:26px 0 12px}
.pui .cat-sect .cat-h{font-size:var(--text-sm);font-weight:650;letter-spacing:.2px;color:var(--ink)}
.pui .cat-sect .cat-sub{color:var(--ink-2);font-size:var(--text-sm);margin-top:2px}

.pui .tilegrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
@media (max-width:720px){.pui .tilegrid{grid-template-columns:1fr}}

.pui /* ------------------------------------------------------------------ the connector card */

/* THE SHADOWS WERE LITERALS UNTIL 2026-09-19,
.pui and this comment used to defend that: the web
   app owned `--shadow`/`--shadow-lg`,
.pui tokens.json said the desktop had nothing to reconcile
   them against,
.pui and naming the values here "is what keeps the card the same object on both".
   It kept the card the same object and made it the WRONG one on the darker of the two — the
   value is #101828 at 4%,
.pui which reads as depth on #f6f7f9 and as a grey smear on #0e1116.
   Both shadows are in the palette now,
.pui with dark halves,
.pui so the card is the same object AND
   the shadow is a shadow on whichever surface it lands. */
button.tile{display:flex;gap:12px;align-items:flex-start;text-align:left;width:100%;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-md);padding:13px 14px;
  cursor:pointer;font:inherit;color:inherit;
  box-shadow:var(--shadow);
  transition:border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease)}
.pui button.tile:hover:not(:disabled){border-color:var(--accent-line);box-shadow:var(--shadow-lg)}
.pui button.tile:disabled{cursor:not-allowed;opacity:.55}
.pui .tile .icon{flex:none;width:38px;height:38px;border-radius:var(--radius-sm);display:flex;
  align-items:center;justify-content:center;color:#fff;font-size:var(--text-xs);font-weight:700;
  letter-spacing:.2px}
.pui .tile .body{flex:1;min-width:0}
.pui .tile .row1{display:flex;align-items:center;gap:6px}
.pui .tile .row1 .tname{font-weight:600;font-size:var(--text-md)}
.pui /* CLAMPED,
.pui and this is not cosmetic. A vendor missing from connectors.json falls back to
   the connector's registry `notes`,
.pui which is a paragraph — and one such card silently set
   the height of every card in its grid row. The fallback has to be survivable,
.pui because the
   whole point of it is that adding a provider to the registry cannot break this page. */
.tile .tdesc{color:var(--ink-2);font-size:var(--text-xs);margin-top:2px;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pui .tile .status{flex:none;margin-left:6px}
.pui .tile .verified{color:var(--ok-line);font-size:var(--text-2xs)}

.pui .tstat-connect{display:inline-block;font-size:var(--text-xs);font-weight:600;color:var(--accent);
  border:1px solid var(--accent-line);background:var(--accent-soft);border-radius:var(--radius-sm);
  padding:4px 10px}
.pui .tstat-ok{display:inline-flex;width:24px;height:24px;border-radius:50%;
  background:var(--ok-soft);border:1px solid var(--ok-line);color:var(--ok-ink);
  align-items:center;justify-content:center;font-size:var(--text-sm);font-weight:700}
.pui .tstat-blocked{display:inline-block;font-size:var(--text-2xs);color:var(--ink-2);
  border:1px solid var(--line);background:var(--panel-2);border-radius:var(--radius-sm);padding:4px 8px}
.pui /* ------------------------------------------------------------------ status chips */

/* The valve position. Four values,
.pui one colour each,
.pui and `off` deliberately grey — the
   default for everything has to look like the absence of a decision,
.pui not like a state. */
.pos{border-radius:var(--radius-pill);padding:1px 9px;font-size:var(--text-2xs);border:1px solid var(--line);
  text-transform:lowercase;letter-spacing:.2px;display:inline-block}
.pui .pos-off{color:var(--ink-2)}
.pui .pos-read{color:var(--accent);border-color:var(--accent-line);background:var(--accent-soft)}
.pui .pos-recommend{color:var(--info);border-color:var(--info-line);background:var(--info-soft)}
.pui .pos-execute{color:var(--warn-ink);border-color:var(--warn-line);background:var(--warn-soft);
  font-weight:600}

.pui /* Credential health. Six server states collapse to four looks,
.pui because `revoked` and
   `expired` need the same thing done about them and the sentence beside the chip says
   which one it was. */
.hs{border-radius:var(--radius-pill);padding:1px 9px;font-size:var(--text-2xs);border:1px solid var(--line);
  display:inline-block}
.pui .hs-connected{background:var(--ok-soft);border-color:var(--ok-line);color:var(--ok-ink)}
.pui .hs-revoked,
.pui .hs-expired{background:var(--err-soft);border-color:var(--err-line);
  color:var(--err)}
.pui .hs-error{background:var(--warn-soft);border-color:var(--warn-line);color:var(--warn-ink)}
.pui .hs-unchecked,
.pui .hs-not_connected{background:var(--bg);color:var(--ink-2)}

.pui .gt{border-radius:var(--radius-xs);padding:0 6px;font-size:var(--text-2xs);background:var(--warn-soft);
  border:1px solid var(--warn-line);color:var(--warn-ink)}
.pui .gt0{background:var(--panel-2);border-color:var(--line);color:var(--ink-2)}

.pui .dc{font-size:var(--text-2xs);border:1px solid var(--err-line);background:var(--err-soft);
  color:var(--err);border-radius:var(--radius-xs);padding:0 6px}

.pui .dstate .badge,
.pui .conn .badge{background:var(--panel-2);border:1px solid var(--line);
  color:var(--ink-2);border-radius:var(--radius-pill);padding:2px 10px;font-size:var(--text-xs);
  display:inline-block}
.pui .dstate .badge.on,
.pui .conn .badge.on{color:var(--ok-ink);border-color:var(--ok-line);
  background:var(--ok-soft)}
.pui .dstate .badge.off,
.pui .conn .badge.off{color:var(--ink-2)}

.pui /* ------------------------------------------------------------------ the detail dialog */

/* A native <dialog> on BOTH sides. The desktop used to expand a table row instead,
.pui which is
   a different interaction as well as a different look; React can call showModal() on a ref
   perfectly well,
.pui and doing so buys Escape,
.pui the top layer and ::backdrop for free — and
   means these rules are literally the same rules,
.pui not two that resemble each other. */
dialog.cdlg{border:1px solid var(--line);border-radius:var(--radius-lg);padding:0;
  width:min(640px,92vw);max-height:85vh;background:var(--panel);color:var(--ink);
  box-shadow:var(--shadow-xl)}
.pui dialog.cdlg::backdrop{background:var(--scrim)}
.pui dialog.cdlg .dhead{display:flex;align-items:center;gap:12px;padding:16px 18px;
  border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--panel);
  border-radius:var(--radius-lg) var(--radius-lg) 0 0}
.pui dialog.cdlg .dhead .icon{flex:none;width:34px;height:34px;border-radius:var(--radius-sm);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:var(--text-2xs);font-weight:700}
.pui dialog.cdlg .dhead .tt{font-weight:650;font-size:var(--text-lg)}
.pui dialog.cdlg .dhead .cat{color:var(--ink-2);font-size:var(--text-xs)}
.pui dialog.cdlg .dclose{margin-left:auto;background:none;border:0;color:var(--ink-2);
  font-size:var(--text-2xl);cursor:pointer;line-height:1;padding:4px}
.pui dialog.cdlg .dbody{padding:14px 18px 18px;overflow:auto;max-height:calc(85vh - 58px)}

.pui .dstate{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}

.pui .sect2{font-weight:600;font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.04em;
  color:var(--ink-2);margin:8px 0 4px}
.pui .cdlg .sect2{margin-top:16px}

.pui /* ------------------------------------------------------------------ operations,
.pui accounts */

.ops{margin:10px 0 0;border-top:1px solid var(--line);padding-top:8px}
.pui .op{display:flex;gap:10px;align-items:baseline;font-size:var(--text-sm);padding:2px 0;flex-wrap:wrap}
.pui .op .k{min-width:52px;color:var(--ink-2);font-size:var(--text-2xs);text-transform:uppercase;
  letter-spacing:.4px}

.pui .conns{margin-top:12px;border-top:1px dashed var(--line);padding-top:10px}
.pui .conn{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding:4px 0}
.pui .conn .ref{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:1px 7px;font-size:var(--text-xs)}
.pui .conn .cl{font-weight:500;font-size:var(--text-sm);color:var(--ink)}

.pui .cform{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:8px}
.pui .cform .mini{font-size:var(--text-sm);padding:3px 7px}
.pui .credform{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:4px 0 2px 0}
.pui .credform .mini{font-size:var(--text-sm);padding:3px 7px;min-width:22ch}
.pui .vform{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;margin-top:10px}
.pui .vform label{margin:0 0 3px}
.pui .cdlg .vform{align-items:flex-end}

.pui button.linkish{background:none;border:0;color:var(--ink-2);font-size:var(--text-xs);cursor:pointer;
  text-decoration:underline;padding:0}

.pui /* A sign-in and the repositories under it.
 *
 * The indent and the rule down the left are the whole point: they say the rows below belong
 * to the row above and hold nothing of their own. The website draws the same relationship
 * with `.gitauth`'s green left border and a `.repotbl` beneath it — this is that shape,
.pui * generalised off `auth_id` rather than off the word "git",
.pui so any connector that grows a
 * two-level account model gets it. */
.signin-block{margin:2px 0 10px}
.pui .repolist{margin-left:14px;padding-left:12px;border-left:2px solid var(--line)}
.pui /* NOWRAP,
.pui with the label doing the giving. A repository ref is `owner/long-repository-name`
   and wrapping put one row's action on its own line,
.pui left-aligned,
.pui while its neighbours'
   stayed right — which reads as a different kind of row rather than a longer one. */
.repo{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;padding:3px 0;
  font-size:var(--text-sm);min-width:0}
.pui .repo .ref{flex:none;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:1px 7px;font-size:var(--text-xs)}
.pui .repo .cl{font-weight:500;color:var(--ink);min-width:0;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.pui .repo .badge{flex:none}
.pui .repo > button{flex:none;margin-left:auto}
.pui .repo-avail{color:var(--ink-2);font-size:var(--text-xs);text-transform:uppercase;
  letter-spacing:.04em;margin:8px 0 3px}

.pui /* Running one operation. Sits inside the `.op` row it belongs to,
.pui so the arguments and the
   result stay attached to the thing they are arguments and a result FOR — a shared panel at
   the bottom would make "which operation produced this" a question. */
.runpanel{flex:1 0 100%;margin:6px 0 10px;padding:10px 12px;background:var(--panel-2);
  border:1px solid var(--line);border-radius:var(--radius-sm)}
.pui .runpanel label{display:block;margin-bottom:8px}
.pui .runpanel label > span{display:block;font-size:var(--text-2xs);color:var(--ink-2);margin-bottom:3px}
.pui .runpanel input,
.pui .runpanel select{width:100%;font-size:var(--text-sm);padding:4px 7px;
  border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink)}
.pui .runpanel .row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pui .runpanel pre{max-height:260px;overflow:auto;background:var(--panel);border:1px solid
  var(--line);border-radius:var(--radius-sm);padding:8px;margin:8px 0 0;
  font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}

.pui /* Why a control is not offered HERE. Both apps show every action in the same place; the one
   that cannot perform it shows the disabled control and this line,
.pui rather than omitting it
   and leaving the two screens a different shape. */
.whynot{color:var(--ink-2);font-size:var(--text-xs);margin:4px 0 0}
.pui /* What just happened,
.pui as opposed to what is always true. It was drawn as `.whynot` at first
   and read as one more line of explanation — a result the reader had to hunt for among the
   notes that were already there. */
.didit{color:var(--ok-ink);background:var(--ok-soft);border:1px solid var(--ok-line);
  border-radius:var(--radius-sm);padding:6px 10px;font-size:var(--text-xs);margin:6px 0 8px}

.pui /* ------------------------------------------------------------------ transient states

   The one state the website genuinely does not have. It renders on the server,
.pui so the page
   arrives complete or not at all; the desktop fetches over IPC and has a gap to fill. The
   skeleton is here rather than in the app's own stylesheet so that the day the website
   grows a client-side refresh,
.pui it fills that gap with this exact shape. */

.cskel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
@media (max-width:720px){.pui .cskel{grid-template-columns:1fr}}
.pui .cskel div{height:74px;border:1px solid var(--line);border-radius:var(--radius-md);
  background:var(--panel-2);animation:cpulse 1.4s ease-in-out infinite}
@keyframes cpulse{0%,100%{opacity:.55}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.pui .cskel div{animation:none}}

.pui /* ------------------------------------------------------------------ guided connect
 * The connect wizard (2026-09-26) and the screen's search-first header. Same token roles as
 * everything above; nothing here is a colour of its own.
 */
.ctoolbar.chero .csearch input{padding:12px 14px 12px 38px;font-size:var(--text-md)}
.pui .ctoolbar .csearch-hint{flex:1 0 100%;margin:0;font-size:var(--text-sm);color:var(--ink-2)}
.pui .cchips{display:flex;flex-wrap:wrap;gap:var(--space-6);margin:var(--space-4) 0 var(--space-12)}
.pui .cchip{border:1px solid var(--line);background:var(--panel);color:var(--ink-2);
  border-radius:var(--radius-pill);padding:4px 12px;font-size:var(--text-sm);cursor:pointer;
  /* ONE LINE, ELLIPSIS (wow 09 T4, G3 at 360: a long category wrapped inside its pill). */
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:100%}
.pui .cchip.on{border-color:var(--accent-line);background:var(--accent-soft);color:var(--accent-ink)}

.pui dialog.cwiz{width:min(640px,calc(100vw - 32px))}
.pui .cwiz .wsteps{list-style:none;display:flex;flex-wrap:wrap;gap:var(--space-4) var(--space-12);
  margin:0;padding:10px 18px;border-bottom:1px solid var(--line);background:var(--panel-2);
  font-size:var(--text-xs);color:var(--ink-2)}
.pui .cwiz .wsteps li{display:flex;align-items:center;gap:6px}
.pui .cwiz .wsteps .wn{width:18px;height:18px;border-radius:var(--radius-pill);display:inline-flex;
  align-items:center;justify-content:center;border:1px solid var(--line);font-size:var(--text-2xs)}
.pui .cwiz .wsteps li.now{color:var(--ink);font-weight:600}
.pui .cwiz .wsteps li.now .wn{border-color:var(--accent);background:var(--accent);color:var(--bg)}
.pui .cwiz .wsteps li.done .wn{border-color:var(--ok-line);background:var(--ok-soft);color:var(--ok-ink)}
.pui .cwiz .wlead{font-size:var(--text-md);color:var(--ink);margin:0 0 var(--space-12)}
.pui .cwiz .wchoices{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:var(--space-8)}
.pui .cwiz .wchoice{display:flex;flex-direction:column;gap:4px;text-align:left;padding:12px;
  border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);
  cursor:pointer;color:var(--ink)}
.pui .cwiz .wchoice span{color:var(--ink-2);font-size:var(--text-xs)}
.pui .cwiz .wchoice:hover,
.pui .cwiz .wchoice.on{border-color:var(--accent-line)}
.pui .cwiz .wform,
.pui .secretfields{display:flex;flex-direction:column;gap:var(--space-10)}
.pui .cwiz .whow{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius-md);
  padding:8px 12px;font-size:var(--text-sm)}
.pui .cwiz .whow summary{cursor:pointer;font-weight:600;color:var(--ink-2)}
.pui .cwiz .whow ol{margin:8px 0;padding-left:18px;color:var(--ink-2)}
.pui .wfield{display:flex;flex-direction:column;gap:4px;font-size:var(--text-sm)}
.pui .wfield > span{font-weight:600;color:var(--ink)}
.pui .wfield em{color:var(--err);font-style:normal}
.pui .wfield small,
.pui .cwiz .wrow2 small{color:var(--ink-2);font-size:var(--text-xs)}
.pui .wfield input:not([type=checkbox]),
.pui .wfield select,
.pui .wfield textarea,
.pui .cwiz .wrow2 input{
  padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);
  background:var(--panel);color:var(--ink);font-size:var(--text-sm);width:100%}
.pui .cwiz .wrow2{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-10)}
.pui .cwiz .wrow2 label{display:flex;flex-direction:column;gap:4px;font-size:var(--text-sm)}
.pui .cwiz .wrow2 label > span{font-weight:600}
@media (max-width:520px){.pui .cwiz .wrow2{grid-template-columns:1fr}}
.pui .cwiz .wnav{display:flex;align-items:center;gap:var(--space-8);margin-top:var(--space-16)}
.pui .cwiz .wresult{display:flex;flex-direction:column;gap:4px;padding:12px;margin-bottom:var(--space-12);
  border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel-2);
  font-size:var(--text-sm)}
.pui .cwiz .wresult.ok{border-color:var(--ok-line);background:var(--ok-soft);color:var(--ok-ink)}
.pui .cwiz .wresult.bad{border-color:var(--warn-line);background:var(--warn-soft);color:var(--warn-ink)}
.pui .cwiz .wresult code{white-space:pre-wrap;word-break:break-word}
.pui .cwiz .wsignin{margin-bottom:var(--space-12)}
.pui .cwiz .wcheck{display:flex;gap:var(--space-8);align-items:flex-start;font-size:var(--text-sm)}
.pui .cwiz .wcheck small{color:var(--ink-2)}
.pui .crecs{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--space-10);
  margin-bottom:var(--space-16)}
.pui .crec{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border:1px solid var(--accent-line);
  border-radius:var(--radius-md);background:var(--accent-soft);font-size:var(--text-sm)}
.pui .crec b{color:var(--ink)}
.pui .crec .who{color:var(--ink-2);font-size:var(--text-xs)}
.pui .crec button{align-self:flex-start}
.pui /* The website's multi-field key form sits in the wizard's column,
.pui left-aligned like every
   other field — `.credform`'s centred row is right for the one-token form and wrong here. */
.credform.secretfields{flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:var(--space-10)}
.pui .credform.secretfields > button{align-self:flex-start}
/* end connectors-scoped */

/* ---------------------------------------------------------------- pending
 *
 * The placeholder every shared screen shows between asking and being answered. See
 * packages/product-ui/components/Pending.tsx for why it is bars rather than a spinner. */

.pui .card.pending {
  display: grid;
  gap: 10px;
}

.pui .pbar {
  height: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  animation: pui-pending 1.4s ease-in-out infinite;
}
/* Each bar a little shorter and a little later than the one above, so the block reads as
   text arriving rather than as three identical rectangles throbbing in unison. */
.pui .pbar:nth-child(3) {
  width: 82%;
  animation-delay: 0.15s;
}
.pui .pbar:nth-child(4) {
  width: 64%;
  animation-delay: 0.3s;
}

@keyframes pui-pending {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* A pulse is decoration, and decoration is exactly what this setting asks to be spared. The
   bars stay — they are the layout — they simply stop moving. */
@media (prefers-reduced-motion: reduce) {
  .pui .pbar {
    animation: none;
  }
}

/* Visually hidden, still read aloud. For the sentence that says what the bars mean. */
.pui .vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- the base size
 *
 * A SHARED SCREEN MUST NOT BE A DIFFERENT SIZE DEPENDING ON THE DOOR. This file styles
 * nearly everything it draws, but an element it says nothing about inherits the SHELL's
 * body size — and the three shells did not agree: `apps/desktop/src/renderer/styles.css`
 * and the Flask console both say 14px, `apps/web` says 15px. Nothing compared them, which
 * is finding C4's shape for a third time (see packages/ui/tokens.json).
 *
 * It is a no-op TODAY, because apps/web does not mount `.pui`. It is here so that it stays
 * a no-op: the guarantee is that these screens are the size this file says, not the size
 * whichever application happens to have mounted them.
 */
.pui {
  font-size: var(--text-md);
}

/* ---------------------------------------------------------------- focus
 *
 * THE KEYBOARD RING, and it is here rather than in each shell because it was in NEITHER.
 * One `:focus` rule existed across the whole product (connectors.css, on a search box).
 *
 * WHAT THERE WAS INSTEAD, measured rather than assumed: the user agent's own default, which
 * in Chrome is `outline: auto 1px` in the system accent — the browser's default blue — at zero
 * offset. That is not nothing, and saying so would be wrong. It is a 1px dark blue drawn
 * flush against the control's own border, and against this palette's dark ground
 * (a dark `--panel`) it sits at roughly 1.6:1, which is below any threshold worth naming.
 * The product had never made a decision about it either way.
 *
 * So: 2px, offset, in `--accent`, which is a token and therefore reads against `--bg`,
 * `--panel` and `--panel-2` in BOTH palettes rather than only the one the OS happens to be
 * in. `:focus-visible`, not `:focus`, so a mouse click does not leave a ring behind — that
 * is the whole reason the pseudo-class exists, and the ring is for the person who cannot see
 * the cursor.
 */
.pui :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* A task card IS a <button> (see `.pui .card.task` below), it fills its column, and the
   column scrolls. An outset ring on the card nearest an edge is clipped by that scroll box;
   inset, it is always whole. */
.pui .task:focus-visible {
  outline-offset: -2px;
}

/* ---------------------------------------------------------------- motion
 *
 * THERE WAS NONE. Not "a little": `transition` appeared ZERO times in 2,704 lines, so
 * nothing in the shared product ever moved. A button looked identical the instant before
 * and the instant after the pointer reached it, and the only feedback a press gave was the
 * screen changing some time later. Eight `:hover` rules existed in the whole file and the
 * generic `.pui button` had none at all — the most-used control in the product was inert.
 *
 * WHAT IS ANIMATED, AND WHAT DELIBERATELY IS NOT. Colour, border and elevation — the
 * properties that say "this responds to you". Nothing that moves an element while the
 * pointer is merely OVER it: a card that lifts on hover shifts what is under the cursor,
 * which on a board of forty cards reads as drift rather than as polish. `:active` is a
 * different case and does move 1px, because by then the button is already held down and the
 * press is the thing being confirmed. Layout properties (width, height, margin) are
 * excluded outright — animating them costs a reflow per frame and is the usual reason a
 * long list feels slow.
 *
 * THE DURATIONS ARE TOKENS, so the whole product agrees on how quickly it answers, and the
 * curve decelerates — fast to start, settling at the end, which is what makes 120ms read as
 * immediate rather than as lag. See packages/ui/tokens.json.
 *
 * HOVER IS MIXED TOWARD `--ink`, NOT DARKENED. `color-mix(in srgb, var(--accent) 88%,
 * var(--ink))` darkens the button in light mode and LIGHTENS it in dark, because `--ink`
 * flips; a hardcoded darkening would sink a dark-mode button into the page it sits on. The
 * same trick the file already uses at `.pui .spk`.
 *
 * AND IT ALL STOPS FOR prefers-reduced-motion — the last rule in this section, written
 * against `.pui *` so that it also covers transitions added after this comment was. */

.pui button,
.pui a,
.pui summary,
.pui input,
.pui select,
.pui textarea {
  transition:
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}

.pui button:not(:disabled):active {
  transform: translateY(1px);
}

/* The three generic buttons, which between them are most of the clickable surface of the
   product and none of which acknowledged a pointer before today. */
.pui button.primary:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
  border-color: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.pui button.sec:not(:disabled):hover,
.pui button.card:not(:disabled):hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* A modal that simply APPEARS is hard to tell from the page having been replaced; a scrim
   that fades says "this is on top of what you were reading, and it is still there". */
.pui dialog[open],
.pui dialog[open]::backdrop {
  animation: pui-fade-in var(--motion-base) var(--motion-ease);
}

@keyframes pui-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* The request, honoured once for everything above. `.pui .pbar`'s own `animation: none`
   stays where it is: it says something this rule cannot, which is that the bars are the
   layout and only the pulse is decoration. */
@media (prefers-reduced-motion: reduce) {
  .pui *,
  .pui *::before,
  .pui *::after,
  .pui *::backdrop {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .pui button:not(:disabled):active {
    transform: none;
  }
}

.pui button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.pui .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  /* A hairline alone is a drawn rectangle; the hairline plus a 1px lift is a surface
     sitting on the page. The token has a dark half, which is the whole reason it is a
     token — see packages/ui/tokens.json's elevation note. */
  box-shadow: var(--shadow);
}

.pui .card h2 {
  font-size: var(--text-md);
  margin: 0 0 10px;
}

.pui .card .sub {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.pui .row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* A STACKED FIELD INSIDE A ROW. `.pui label` is `display:block` with a bottom margin —
 * right for a form, wrong beside a button, where the margin pushes the label's baseline
 * off the button's and the row reads as misaligned. Inside a row a label is a flex item
 * that ends level with its neighbours. Found by looking at the item screen's share row. */
.pui .row > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

/* And a picker needs room for its longest option, not for its current one. */
.pui .row > label select,
.pui .row > select {
  min-width: 130px;
}

/* A COLUMN WITH A GAP, and until stage 2 only one shell knew it. `.stack` was stated in
   `apps/desktop/src/renderer/styles.css` and nowhere else, so 44 uses of it across the shared
   screens were a flex column in the app and a plain block in a browser — every gap, and every
   `style={{ gap: n }}` written on top of one, silently absent on the web. Review is simply the
   first screen carrying one to enter `make parity`, which reported it as 6,060 pixels: the
   same content, 14px lower on the desktop, because only the desktop had the gaps.
   It is stated HERE now, once, and the desktop's copy is gone. */
.pui .stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* A stack of controls pinned to the right edge — the task page's Refresh over Edit/Submit. */
.pui .stack.items-end {
  align-items: flex-end;
}

.pui .spread {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pui .pill {
  display: inline-block;
  font-size: var(--text-2xs);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.pui .pill.ok {
  color: var(--ok-ink);
  border-color: var(--ok);
}

.pui .pill.err {
  color: var(--err);
  border-color: var(--err);
}

.pui .pill.warn {
  color: var(--warn-ink);
  border-color: var(--warn);
}

.pui .banner {
  border: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: var(--text-sm);
}

.pui .banner.err {
  border-color: var(--err);
  background: color-mix(in srgb, var(--err) 10%, transparent);
}

.pui td.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.pui .empty {
  color: var(--ink-2);
  padding: 24px;
  text-align: center;
}

/* --------------------------------------------------------------- alerts
 *
 * A severity edge, so the list reads before the words do — the same left-border idea
 * `.risk` uses on the Command Centre and the Jinja `.alert.sev-*` rules used on the web.
 * Colour is the whole point here rather than decoration: somebody scanning this screen is
 * looking for the red one. */

.pui .card.alert {
  border-left-width: 4px;
}
.pui .card.alert.sev-error {
  border-left-color: var(--err);
}
.pui .card.alert.sev-warn {
  border-left-color: var(--warn);
}
.pui .card.alert.sev-info {
  border-left-color: var(--accent);
}

/* A preference row: a checkbox and a two-line label that stays beside it rather than
   wrapping under. Lifted from the web's `_notifications.html`, which is the only place this
   pattern existed. */

.pui .pref {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}
.pui .pref + .pref {
  border-top: 1px solid var(--line);
}
.pui .pref input {
  margin-top: 2px;
  flex: none;
}
.pui .pref span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}


/* wow W4 EN4: the alerts are rows of one list card now; the severity edge rides on the row
   as an inset hairline (no stack of bordered boxes, P5), still the colour a scanner looks for. */
.pui .en4-page .sv-li.alert.sev-error { box-shadow: inset 3px 0 0 var(--err); }
.pui .en4-page .sv-li.alert.sev-warn { box-shadow: inset 3px 0 0 var(--warn); }
.pui .en4-page .sv-li.alert.sev-info { box-shadow: inset 3px 0 0 var(--accent); }
.pui .en4-page .sv-li.alert .sv-li-btn { cursor: default; padding-left: 14px; }
.pui .en4-page .sv-li.alert .sv-li-btn:hover { background: transparent; }
/* ---------------------------------------------------------------- modal
 *
 * A NATIVE <dialog>, which is what `connectors.css` already uses for `dialog.cdlg` and what
 * ConnectorDialog.tsx's own comment recommended in passing: "Escape, focus containment and
 * the top layer, none of which the app's older `.scrim`/`.modal` pair had". This is that
 * pair being retired. The element buys all three from the browser, so components/Modal.tsx
 * carries no focus-trap loop of its own.
 *
 * The scrim is `::backdrop` now, not a positioned div — which also means it cannot be
 * out-stacked by anything, because the top layer sits above every z-index on the page.
 *
 * `.modal` KEEPS ITS CLASS NAME. It is the selector two drive scripts already query
 * (apps/desktop/tests/ui/requirements.drive.js), and a native dialog carrying it is still a
 * `.modal` to them. Only the box's positioning moved from the wrapper onto the element. */

.pui dialog.modal {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  width: min(720px, calc(100vw - 48px));
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-xl);
  /* A modal <dialog> is centred by the UA's own margin:auto; these only stop a long one
     touching the viewport edge on a short window. */
  margin: auto;
}

/* ONE SCRIM, from 2026-09-19. This was a black 55% scrim and the connector dialog's
   was a navy 45% scrim — the same gesture on the same surface dimming the page two
   different ways depending on which button you had pressed, and neither of them flipping
   with the palette. */
.pui dialog.modal::backdrop {
  background: var(--scrim);
}

.pui .modal h2 {
  margin: 0 0 4px;
  font-size: var(--text-xl);
}

/* A label/value list. Written for the board modal, and now also what the task record uses
   -- the same pairs answering the same question, so they should not look like two different
   things depending on which screen you reached them from. */
.pui .modal dl,
/* MY QUESTIONS (moved from the desktop in stage 2). The screen carried these two as inline
   styles; the stylesheet owns them, so the move does not import drift with it. */
.pui .ask-entry {
  margin-bottom: 16px;
}
.pui .ask-entry:last-child {
  margin-bottom: 0;
}
.pui .ask-answer {
  margin-top: 8px;
}

.pui .card dl {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 6px 12px;
  margin: 14px 0;
  font-size: var(--text-sm);
}

.pui .modal dt,
.pui .card dt {
  color: var(--ink-2);
}

.pui .modal dd,
.pui .card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pui .modal ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ---------------------------------------------------------------- board */

/* The board record's markdown, shown as it was written. NOT parsed: a markdown renderer is
   a dependency and an XSS surface, and what a reader needs from `## Acceptance criteria` is
   its content and its line breaks, both of which survive as pre-formatted text. Wrapped
   rather than scrolled, because a long line of prose is the common case here. */
.pui .taskbody {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  max-height: 340px;
  overflow-y: auto;
}

/* ---------------------------------------------------------------- filters */

/* The board's narrowing controls, boxed so they read as one instrument rather than as
   stray dropdowns floating above the lanes -- the same shape the web board uses. */
.pui .filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* THE SEARCH, as its own bar above the filter panel rather than a field inside it. Inside,
   it read as one control among nine and was looked straight past (2026-09-17). */
.pui .task-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-bottom: 10px;
}

.pui .task-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-line);
}

.pui .task-search-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-2);
}

/* The bar carries its own Clear beside the count; the browser's ✕ would be a second one. */
.pui .task-search input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.pui .task-search input[type='search'] {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: var(--text-xl);
  padding: 8px 0;
}

.pui .task-search-count {
  color: var(--ink-2);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.pui .task-search .mini {
  width: auto;
}

.pui .task-search-key {
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
  font-size: var(--text-xs);
  color: var(--ink-2);
}

/* The global `label` is a stacked form field with a bottom margin. Inside a filter row it
   is a column in a flex line instead, so the margin goes and a floor width stops "Any"
   collapsing a select to nothing. */
.pui .filters .row label {
  margin-bottom: 0;
  flex: 1 1 150px;
  min-width: 130px;
  /* Capped, or the filter that wraps onto a second row is the only item there and grows to
     the full width -- one enormous select under six ordinary ones. */
  max-width: 200px;
}

/* Clear sits on the baseline of the selects, not of their captions. */
.pui .filters .row > button {
  align-self: flex-end;
}

/* A button that reads as prose -- for an action offered inside a sentence, where a real
   button would break the line it is explaining. */
.pui .link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  width: auto;
}

.pui .board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pui .board section {
  min-width: 0;
}

.pui .board h2 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin: 0 0 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.pui .board .cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pui .board .card.task {
  text-align: left;
  width: 100%;
  padding: 10px;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pui .board .card.task .title {
  font-weight: 550;
  line-height: 1.35;
}

.pui .board .card.task:hover {
  border-color: var(--accent);
}

/* The parked plane (ADR-0054): under the lanes, collapsed, quieter than live work. */
.pui .parked-plane {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.pui .parked-plane > summary {
  cursor: pointer;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: center;
}
.pui .parked-plane .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.pui .parked-plane .card.task {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  opacity: 0.85;
}
.pui .parked-plane .card.task .title {
  font-weight: 550;
  line-height: 1.35;
}
.pui .parked-plane .card.task .btn {
  align-self: flex-start;
}

/* ---------------------------------------------------------------- self-sufficiency
 *
 * What follows is what NEITHER shell could be relied on for. Each one is here because a
 * shared screen uses it and at least one side did not have it — or, worse, had it meaning
 * something else.
 */

/* THE BUG THAT PROMPTED THIS FILE. A task card is a <button> so that it is focusable and
 * reachable by keyboard, which is right — but `button` is the most heavily styled element
 * in both shells, and the Flask app paints it accent-on-white. State the card's own colours
 * and it cannot inherit either shell's idea of what a button looks like. */
.pui .card.task,
.pui button.card {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 400;
}

/* Muted and small. The Flask app has both, the desktop neither, and the shared screens use
 * them together on almost every secondary line. */
.pui .mut {
  color: var(--ink-2);
}

.pui .sm {
  font-size: var(--text-sm);
}

/* An inline monospace run. The desktop had `td.mono` only, which never matched the spans
 * the shared screens use it on. */
.pui .mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* A small neutral chip: a pinned model, a queue count. Distinct from `.pill`, which carries
 * state colour. The Flask app has one; the desktop does not. */
.pui .badge {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: var(--text-2xs);
  vertical-align: middle;
}

/* EXECUTION STATE, and the colours are the point rather than decoration: somebody scanning a
 * board is asking "why is this not running", and the answer is a colour before it is a word.
 * `draft` and `manual` are waiting on a person, `paused` and `stalled` on a problem,
 * `running` and `remote` are fine. */
.pui .ex {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
}

.pui .ex-running,
.pui .ex-remote {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pui .ex-paused,
.pui .ex-stalled {
  border-color: var(--err-line);
  background: var(--err-soft);
  color: var(--err);
}

.pui .ex-manual,
.pui .ex-human_blocked {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
}

/* The Clear-filters button reads as prose rather than as an action bar. */
.pui .clear {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 0;
  font-size: var(--text-sm);
  cursor: pointer;
}

/* A secondary button and a compact one. The Flask app scopes both to `button`, the desktop
 * has neither, and a shared screen must not have to know which shell it is in. */
.pui button.sec {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 400;
}

.pui button.mini,
.pui select.mini {
  padding: 4px 9px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

/* A stacked field: caption above control. The Flask app and the desktop disagree about
 * `label`, and the filter row depends on the stacked form.
 *
 * THE VALUES ARE THE DESKTOP'S, to the pixel, and deliberately so: those rules already
 * exist there, and inventing my own here would shift every form on the desktop's shared
 * screens for no reason anybody asked for. This file's job is to give the web what the
 * desktop had, not to redesign both. */
.pui label {
  display: block;
  /* ALL FOUR SIDES, not just the bottom. `base.html` gives the bare `label` element
     `margin: 12px 0 4px`, and a rule stating only `margin-bottom` let the TOP margin through
     on the web. Between siblings it collapsed into the one above and nobody could see it;
     on a label that is first in its box it could not, and the sign-in's first field sat 12px
     lower in a browser (stage 2, `make parity`). Same family as `font-size` below. */
  margin: 0 0 12px;
  /* SIZED BY WHAT CONTAINS IT, said here so the web cannot decide otherwise. `base.html`
     styles the bare `label` element for its server-rendered forms, and an element rule beats
     inheritance — so a `.pui` label inside a row that asks for `--text-xs` came out at
     `--text-sm` on the web and at `--text-xs` on the desktop. People's role row is `tight`,
     which is exactly that case: one point of text per chip, compounding along the row, was
     the 44,545 pixels `make parity` reported once the chips themselves matched. A screen that
     wants a size states it (`label.pref`, `label.fld`, `.rolerow.tight`); a label inherits. */
  font-size: inherit;
}

.pui label > span {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-2);
  margin-bottom: 4px;
}


/* ------------------------------------------------------------ the task record (TaskDetail)
 *
 * wow W4 r2 (P5, P11). Each column is ONE card whose sections (Goal, Acceptance criteria,
 * Dependencies, the ticket; what it needs from a person, judged, recorded) are divided by
 * hairlines, not a stack of bordered boxes. A panel that is not a `.card` (the PM's task panel)
 * keeps its own look. As a section of the journey (`.td-sub-head`) the title sits over its
 * controls, which run as one row under it, so no tall control column leaves a void beside it. */
.pui .td-cols { align-items: start; }
.pui .td-col {
  display: flex; flex-direction: column; min-width: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden;
}
.pui .td-col > .card { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 16px 18px; }
.pui .td-col > :not(:first-child) { border-top: 1px solid var(--line); }
.pui .td-sub-head > .spread { flex-direction: column; align-items: stretch; gap: 10px; }
.pui .td-sub-head .td-controls { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
/* MOVE ON ITS OWN LINE, from the column's left edge (wow 07 D20): beside Refresh/Edit it was a
   narrow right-aligned stack whose picker wrapped, so "Move to", the select, Move and its hint
   sat out of line with the column. Its hint keeps the banner rhythm's 14 px above the next block
   (the amber "Not ready to submit" it used to touch). */
.pui .td-sub-head { margin-bottom: var(--space-14); }
.pui .td-sub-head .td-move { flex-basis: 100%; align-items: flex-start; }
.pui .td-col > .sect + .card { border-top: 0; }
.pui .td-col:empty { display: none; }
/* ---------------------------------------------------------------- activity
 *
 * The company's history as a timeline. Lifted from `_activity.html`'s own <style> block,
 * which is where it lived when only the web had this screen — the dots and the rail are the
 * part worth keeping, because the rail is what makes "newest first" legible and the colour
 * answers "what kind of event" before the words do.
 *
 * `k-*` colours the kind chip and `ev-*` the dot, from the same `kind` string. Both come
 * from the server: a client inventing its own categories would be a client deciding what
 * counts as what.
 */
.pui .feed {
  border-left: 2px solid var(--line);
  margin-left: 6px;
}

.pui .ev {
  position: relative;
  padding: 2px 0 16px 22px;
}

.pui .ev-dot {
  position: absolute;
  left: -7px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-2);
  border: 2px solid var(--bg);
}

.pui .ev-created .ev-dot {
  background: var(--accent);
}

.pui .ev-submitted .ev-dot {
  background: var(--accent-ink);
}

.pui .ev-scored .ev-dot {
  background: var(--ok);
}

.pui .ev-checkpoint .ev-dot {
  background: var(--warn);
}

.pui .ev-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

/* THE ROW HEAD WRAPS AS WHOLE TOKENS (wow W4 r4, C1 at 360): the kind, the task link, the
 * project pill and the time each broke onto two lines ("PAR-" / "0001", "18h" / "ago"). Each
 * token keeps its line; the head wraps between them, and the time is pushed to the end. */
.pui .ev-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.pui .ev-top > * {
  white-space: nowrap;
}
.pui .ev-top > .ev-ago {
  margin-left: auto;
}

.pui .ev-kind {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  color: var(--ink-2);
}

.pui .k-created {
  color: var(--accent-ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.pui .k-submitted {
  color: var(--accent-ink);
  border-color: var(--accent-line);
}

.pui .k-scored {
  color: var(--ok-ink);
  border-color: var(--ok-line);
  background: var(--ok-soft);
}

.pui .k-checkpoint {
  color: var(--warn-ink);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.pui .ev-prod {
  font-size: var(--text-2xs);
  color: var(--info);
  border: 1px solid var(--info-line);
  background: var(--info-soft);
  border-radius: var(--radius-pill);
  padding: 0 7px;
}

.pui .ev-text {
  margin-top: 5px;
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- costs
 *
 * A KPI row, a bar chart and wide tables. Every class here existed on exactly one side:
 * `.grid`/`.g4`/`.kpi`/`.tbl-wrap` in the Flask app's base.html, `.bar-*` inside
 * `_costs.html`'s own <style> block, and `.statv` on the desktop. The shared screen uses
 * the WEB's names because its Costs screen was the richer of the two, and a third set
 * invented here would be classes neither shell defines — which is how /tasks shipped
 * invisible.
 */
.pui .grid {
  display: grid;
  gap: 14px;
}

/* FIVE ACROSS, for the dashboard's KPI row. `dashboard.html` used `.g5` and the shared
 * stylesheet only had `.g4`, so the fifth tile wrapped onto a row of its own — found by
 * looking at the page rather than by anything failing. Collapses on the same breakpoints
 * as `.g4`, because five 1fr columns on a laptop is five unreadable ones. */
.pui .g5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1100px) {
  .pui .g5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .pui .g5 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .pui .g5 { grid-template-columns: 1fr; }
}

.pui .g4 {
  grid-template-columns: repeat(4, 1fr);
}

.pui .g2 {
  grid-template-columns: 2fr 1fr;
}

/* THE TASK PAGE'S TWO COLUMNS.
 *
 * Grid items stretch to the tallest row by default, so the right-hand column's last card
 * grew a long tail of empty panel whenever the ticket on the left was long. `start` makes
 * each column as tall as its own content, which is what a rail is.
 *
 * ONE CLASS RATHER THAN AN INLINE STYLE, because the shared screens may only use classes
 * both shells define — an inline style would work here and then be copied to somewhere it
 * does not. The file header says why that rule exists: /tasks once shipped invisible.
 */
.pui .grid.top {
  align-items: start;
}

@media (max-width: 820px) {
  .pui .g4 {
    grid-template-columns: 1fr 1fr;
  }

  .pui .g2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .pui .g4 {
    grid-template-columns: 1fr;
  }
}

.pui .kpi {
  font-size: var(--text-3xl);
  font-weight: 650;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

/* A WIDE TABLE SCROLLS INSIDE ITSELF rather than widening the page. Without this a
 * five-column table pushes the whole layout sideways on a narrow window, and the reader
 * loses the nav rather than the last column. */
.pui .tbl-wrap {
  overflow-x: auto;
}

/* A TABLE IN A SHARED SCREEN IS THE SAME TABLE ON BOTH SURFACES. This file set the table's
   width and size and left the CELLS to each shell, which does not agree: the desktop pads
   7px/8px and aligns to the top, Flask pads 8px/10px, centres, and puts its headers in small
   uppercase. Every row of the Projects table drifted a little further down the page in a
   browser than in the app — 294,000 pixels by the bottom, with identical content, which is
   what `make parity`'s canvas diff is for (2026-09-23). The desktop's values, which are the
   ones the redesign drew. */
.pui table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}
.pui th,
.pui td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.pui th {
  color: var(--ink-2);
  font-weight: 550;
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: normal;
}

/* Spend by day. Bars rather than numbers because "is it growing" is a shape question, and
 * the labels are tabular so the column does not jitter as the digits change. */
.pui .bar-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pui .bar-lbl {
  width: 44px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pui .bar-track {
  flex: 1;
  height: 14px;
  background: var(--panel-2);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.pui .bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-xs);
}

.pui .bar-val {
  width: 64px;
  flex: none;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------------- EN2 ledger (wow W4)
 *
 * Costs, Audit, Activity, Executor and the desktop Audit queue on the page grammar
 * (packages/ui/page.css): a PageHero, a control row, one card of big numbers, quiet list cards.
 * The number row replaces `.kpi`'s 27 px with `sv-num-xl` / `sv-num-lg` (components/LedgerParts.tsx).
 *
 * `.pui h2` (17-shell.css) weighs 0,1,1 and so beats page.css's `.sv-h2` (0,1,0): a ListCard's
 * title would draw at the shell's 18 px with a 10 px foot. Scoped here to the ledger screens,
 * which is the part this file owns; the same collision on other archetypes is the shell's to
 * settle once (reported, wow W4 EN2). */
.pui .ent-ledger .sv-h2 { font-size: var(--text-2xl); margin: 0; }
.pui .ent-ledger .sv-h3 { margin: 0; }

.pui .ent-control {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.pui .ent-control p { margin: 2px 0 0; }
.pui .ent-control-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pui .ent-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.pui .ent-nums[data-cols='3'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pui .ent-num { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@container sv-page (max-width: 720px) {
  .pui .ent-nums, .pui .ent-nums[data-cols='3'] { grid-template-columns: 1fr 1fr; }
}

/* A row's ₹ sits at its right edge, so the column of amounts reads down the card. */
.pui .ent-ledger .sv-li-title .sv-money { margin-left: auto; font-variant-numeric: tabular-nums; }

/* A Ledger screen drawn as a section of the Executor: the same parts, no page frame. */
.pui .ent-sub { display: flex; flex-direction: column; gap: 18px; }
.pui .ent-sub .ent-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .pui .ent-sub .ent-nums { grid-template-columns: 1fr 1fr; }
}

/* Activity's timeline inside ONE quiet card (P5): the rail and the dots stay — they are what
   make "newest first" legible — but each event loses its own bordered box. */
.pui .ent-ledger .ev-body { background: transparent; border: 0; border-radius: 0; padding: 0 0 2px; }
.pui .ent-ledger .feed { margin: 4px 0 0 6px; }
/* ------------------------------------------------------------ decisions queue
 *
 * "Awaiting you" — the queue of things parked for a person. Lifted from
 * `decisions.html`'s own <style> block, which is where it lived while the web was the only
 * surface that drew this screen properly (the desktop had the same data in a four-column
 * table, two columns of which were always empty; ADR-0012 stage 4).
 *
 * THE ACCENT HEXES ARE THE WEB'S OWN, kept rather than tokenised, for the same reason the
 * Activity block above keeps its `k-*` colours: these are semantic per-state accents that
 * `tokens.json` does not model, and inventing token names for them here would put a second
 * palette beside the real one. If they are ever tokenised it should be one change covering
 * both blocks.
 *
 * `hot` is the decisions half. A decision is a question nobody has answered; a review is
 * work that ran and needs signing off. The amber border says which without a word.
 */
.pui .sect {
  font-size: var(--text-md);
  margin: 26px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.pui .dec {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 13px;
  background: var(--panel);
}

.pui .dec.hot {
  border-color: var(--warn-line);
}

.pui .dtop {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pui .did {
  font-size: var(--text-xs);
  color: var(--ink-2);
}

.pui .ex {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: var(--text-2xs);
  white-space: nowrap;
  font-weight: 600;
}

.pui .ex-human {
  color: var(--warn-ink);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.pui .ex-review {
  color: var(--info);
  border-color: var(--info-line);
  background: var(--info-soft);
}

.pui .prio {
  font-size: var(--text-2xs);
  font-weight: 700;
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  border: 1px solid var(--line);
}

.pui .pP0 {
  color: var(--err);
  border-color: var(--err-line);
  background: var(--err-soft);
}

.pui .pP1 {
  color: var(--warn-ink);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.pui .pP2 {
  color: var(--accent-ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.pui .pP3 {
  color: var(--ink-2);
}

.pui .pchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: var(--text-2xs);
}

/* The title is a <button> when the shell gave the screen a way to open a task, and a plain
 * <div> when it did not. Both must look like the same heading, so the button is stripped of
 * every button affordance — the same trap the board's task cards documented above. */
.pui .dtitle {
  display: block;
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 2px 0 6px;
  line-height: 1.35;
  text-align: left;
}

.pui button.dtitle-btn {
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.pui button.dtitle-btn:hover {
  color: var(--accent);
}

.pui .dsum {
  color: var(--ink-2);
  font-size: var(--text-sm);
  margin: 0 0 11px;
  line-height: 1.5;
}

.pui .why {
  list-style: none;
  margin: 0 0 12px;
  padding: 9px 12px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--warn-ink);
}

.pui .why li {
  margin: 3px 0;
  padding-left: 15px;
  position: relative;
}

.pui .why li::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: 0.7;
}

.pui .rec {
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: var(--text-sm);
  color: var(--ok-ink);
  margin-bottom: 11px;
}

.pui .reclbl {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ok-ink);
  font-weight: 700;
  margin-right: 6px;
}

.pui .opts {
  margin-bottom: 12px;
}

.pui .optlbl {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.pui .opt {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: var(--text-sm);
  margin-bottom: 6px;
}

.pui .opt .ol {
  font-weight: 600;
  font-size: var(--text-2xs);
  color: var(--ink-2);
  flex: none;
  margin-top: 1px;
}

.pui .dacts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------- approvals and the audit chain
 *
 * Lifted from `approvals.html` and `audit.html`, which each carried their own <style> block
 * while the web was the surface that drew these properly. The desktop had both as plain
 * tables — and on the audit screen it had no chain verdict at all, which is the thing the
 * page exists to state.
 *
 * The accent hexes are the web's own, kept for the reason the Activity and decisions blocks
 * above keep theirs: these are per-state accents `tokens.json` does not model.
 */

/* An open gate. The amber left edge is load-bearing: it is what makes a list of these read
 * as "waiting on you" rather than as history. */
.pui .ap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn-line);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin-bottom: 10px;
}

.pui .ap-t {
  display: flex;
  gap: 9px;
  align-items: baseline;
  flex-wrap: wrap;
}

.pui .gt {
  border-radius: var(--radius-xs);
  padding: 0 7px;
  font-size: var(--text-xs);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  font-weight: 600;
  white-space: nowrap;
}

/* The evidence, as chips. A gated approval cannot be opened without it, so an empty list
 * here means something has gone wrong rather than that nobody bothered. */
.pui .ev {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pui .ev li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--ink-2);
}

.pui .noev {
  color: var(--err);
  font-size: var(--text-sm);
}

.pui .acts {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 11px;
  flex-wrap: wrap;
}

/* THE CHAIN VERDICT. Loud on purpose in both directions: "verifies" is the answer somebody
 * came here for, and a break is the one thing on this screen that cannot be missed. */
.pui .chain {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid;
  font-size: var(--text-sm);
}

.pui .chain.ok {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: var(--ok-ink);
}

.pui .chain.bad {
  background: var(--err-soft);
  border-color: var(--err-line);
  color: var(--err);
}

.pui .chain b {
  display: block;
  font-size: var(--text-md);
  margin-bottom: 2px;
}

/* A truncated hash, for comparing two rows by eye. */
.pui .hsh {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--ink-2);
}

/* Outcome colours, shared by both screens' tables. The class is built from the server's own
 * `outcome` string, so an outcome nobody has styled falls through to the inherited colour
 * rather than to a wrong one. */
.pui .oc-allowed { color: var(--ok-ink); }
.pui .oc-executed { color: var(--accent); }
.pui .oc-needs_approval { color: var(--warn-ink); }
.pui .oc-denied,
.pui .oc-failed { color: var(--err); }

/* ------------------------------------------------------------------ command centre
 *
 * Lifted from `_command.html`. The desktop's version of this screen rendered Python dict
 * reprs, so there was no second look to reconcile — one surface had the screen and the other
 * had its debris (ADR-0012 stage 4).
 */

/* Four tiles across, then two, then one. The breakpoints are the web's own. */
.pui .ccrow {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .pui .ccrow { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .pui .ccrow { grid-template-columns: 1fr; }
}

.pui .tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.pui .tile .lbl {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
}

.pui .tile .big {
  font-size: var(--text-3xl);
  font-weight: 650;
  letter-spacing: -0.6px;
  margin-top: 2px;
}

/* A TILE IS COLOURED BY WHAT IT REPORTS. Green is an answer, not an absence of one: "no
 * risks" and "chain intact" are the two things a founder most wants to see at a glance. */
.pui .tile.hot { border-color: var(--warn-line); background: var(--warn-soft); }
.pui .tile.bad { border-color: var(--err-line); background: var(--err-soft); }
.pui .tile.good { border-color: var(--ok-line); background: var(--ok-soft); }

/* A ranked risk. The left edge carries the severity, so the list is scannable without
 * reading the chips. */
.pui .risk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.pui .risk.critical { border-left-color: var(--err-strong); }
.pui .risk.high { border-left-color: var(--err); }
.pui .risk.medium { border-left-color: var(--warn-line); }
.pui .risk.low { border-left-color: var(--line); }

.pui .risk .rt {
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.pui .risk .rd {
  color: var(--ink-2);
  font-size: var(--text-sm);
  margin: 4px 0 0;
}

.pui .risk .fx {
  font-size: var(--text-sm);
  margin: 8px 0 0;
}

.pui .risk .fx b {
  color: var(--ink-2);
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--text-2xs);
  letter-spacing: 0.4px;
}

.pui .sv {
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--line);
}

.pui .sv-critical {
  background: var(--err-soft);
  border-color: var(--err-line);
  color: var(--err);
  font-weight: 700;
}

.pui .sv-high { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.pui .sv-medium { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.pui .sv-low { color: var(--ink-2); }

/* An entitlement bar. `err` at the cap, `warn` near it — the colour is the warning, and the
 * numbers beside it are what makes it actionable. */
.pui .bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 6px;
}

.pui .bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.pui .bar i.warn { background: var(--warn); }
.pui .bar i.err { background: var(--err); }

/* A label/value line, used by the quality, valve, spend and entitlement panels. */
.pui .qi {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}

.pui .qi:last-child { border-bottom: 0; }


/* ------------------------------------------------------------ EN4 on the page grammar
 *
 * wow W4 EN4 (Command: Dashboard, Command, Inbox, Alerts, Decisions, Approvals, Board, TaskDetail,
 * TaskMap). Each screen draws `.sv-page.en4-page` and the grammar's pieces (page.css).
 *
 * THE BRIDGE. Three of this file's shared rules outrank page.css inside `.pui`: `.pui button`
 * (0,1,1) beats `.sv-li-btn` (0,1,0) and ties `.sv-seg button` (0,1,1) — a tie the desktop
 * resolves for product-ui (page.css is imported first) and the web for page.css (linked after),
 * a parity fault; `.pui h2` (0,1,1) beats `.sv-h2`. Scoped to `.en4-page` so no other screen
 * moves; the same three lines belong in a shared part once every archetype is converted
 * (reported to the chair, wow W4). Values are page.css's, restated, never new sizes. */
.pui .en4-page .sv-h2 { font-size: var(--text-2xl); margin: 0; }
/* The ListCard row and the Seg's tabs are restated once for every `.sv-page` now
   (14-shared-primitives.css, "P11 once"); only the h2 and the control-row pills stay here. */
.pui .en4-page .sv-control > button,
.pui .en4-page .sv-card-head > button { min-height: 36px; border-radius: var(--radius-pill); padding: 0 16px; }
@media (pointer: coarse) {
  .pui .en4-page .sv-control > button, .pui .en4-page .sv-card-head > button { min-height: 44px; }
}
.pui .en4-page .sv-card .tbl-wrap { margin: 0; }

/* The stat row (num-lg): one quiet card, hairline cells; `data-tone` is a 3 px top line, never a fill. */
.pui .en4-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; padding: 0; overflow: hidden;
}
/* Each cell draws the hairline on its left and top; the card's overflow clips the outer ones, so
   only the lines BETWEEN cells show, however the grid wraps. */
.pui .en4-stat {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line);
}
.pui .en4-stat[data-tone="hot"] { box-shadow: inset 0 3px 0 var(--warn-line), -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.pui .en4-stat[data-tone="bad"] { box-shadow: inset 0 3px 0 var(--err-line), -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.pui .en4-stat[data-tone="good"] { box-shadow: inset 0 3px 0 var(--ok-line), -1px 0 0 var(--line), 0 -1px 0 var(--line); }
/* The Dashboard's estate: one card, its sections divided by hairlines (P5). */
.pui .en4-estate { display: flex; flex-direction: column; gap: 0; }
.pui .en4-estate > .en4-sect { padding: 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pui .en4-estate > .en4-sect:first-child { padding-top: 0; border-top: 0; }
.pui .en4-estate > .en4-sect:last-child { padding-bottom: 0; }
.pui .en4-estate .en4-pair > section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* My queue's projects: hairline rows of one list. */
.pui .en4-groups > .en4-group { padding: 10px 0; }

/* Two cards side by side on a wide page, stacked under 1000 px. */
.pui .en4-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .pui .en4-pair { grid-template-columns: minmax(0, 1fr); } }

/* Dashboard: the company line under the lede, the queue's per-project groups. */
.pui .en4-company { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pui .en4-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; }

/* A list ‖ its TrustNote (Decisions, Approvals): the note sits beside the actions it is about
   (P9) on a wide page, and under the list's head on a narrow one. Not the Workbench: nothing
   here is AI-made, so no ring column. */
.pui .en4-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 14px; align-items: start; }
.pui .en4-split-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pui .en4-split-aside { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1000px) {
  .pui .en4-split { grid-template-columns: minmax(0, 1fr); }
  .pui .en4-split-aside { position: static; order: -1; }
}

/* Decisions: a queue card is a row of one list card now (P5), its warm edge an inset hairline. */
.pui .en4-page .sv-li > .dec { border: 0; border-radius: 0; margin: 0; padding: 14px 10px; background: transparent; }
.pui .en4-page .sv-li > .dec.hot { box-shadow: inset 3px 0 0 var(--warn-line); padding-left: 14px; }
/* Approvals: an open gate is a row of the Open list card, the amber edge an inset hairline. */
.pui .en4-page .sv-li > .ap {
  border: 0; border-radius: 0; margin: 0; padding: 14px 10px 14px 14px; background: transparent;
  box-shadow: inset 3px 0 0 var(--warn-line);
}
/* --------------------------------------------------------- roles: roster and scorecard
 *
 * Two sources, both of which stop being available to a shared screen. The score classes
 * (`.sc`, `.s-0`…`.s-5`, `.s-na`, `.src`) live in the Flask app's `base.html`, which the
 * desktop does not have; the roster and sparkline classes lived in `_roles.html`'s own
 * <style> block, which is deleted with it. Both are reproduced here so one component can
 * render on both surfaces.
 *
 * `.s-na` IS GREY, NOT RED, and that is the whole point of it existing: `null` is "nobody
 * scored this" and red would read as "scored badly". The comment in base.html says the same
 * thing, and it is worth saying twice.
 */
.pui .sc {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.pui .s-0,
.pui .s-1 { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.pui .s-2 { color: var(--warn-ink); border-color: var(--warn-line); background: var(--warn-soft); }
.pui .s-3 { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.pui .s-4,
.pui .s-5 { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-soft); }
.pui .s-na { color: var(--ink-2); opacity: 0.75; }

.pui .src {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-2);
  margin-left: 4px;
}

/* A per-lane task count on a roster row. */
/* A STAT CHIP THAT IS A CONTROL. The roster's per-lane counts became buttons on
   2026-09-19 — "cto has 3 blocked" is a board query the product could already run — and a
   <button> arrives with the shell's own background, border, font and padding, which would
   have made one row of chips look like a row of grey buttons and the rest like chips. This
   states nothing new about how a chip looks; it only stops the element deciding. */
.pui button.stat {
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
}

.pui button.stat:not(:disabled):hover {
  border-color: currentColor;
}

.pui .stat {
  display: inline-block;
  font-size: var(--text-2xs);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 7px;
  margin: 1px 3px 1px 0;
  color: var(--ink-2);
  white-space: nowrap;
}

.pui .st-active { color: var(--accent); border-color: var(--accent-line); }
.pui .st-review { color: var(--info); border-color: var(--info-line); }
.pui .st-blocked { color: var(--err); border-color: var(--err-line); }
.pui .st-done { color: var(--ok-ink); border-color: var(--ok-line); }

/* A warning badge, for an owner nobody declared as a role or a flagged operator. The web
 * writes this as an inline style; a class is the same thing said once. */
.pui .badge.warn { color: var(--warn-ink); border-color: var(--warn-line); }

/* THE SPARKLINE. `.na` is a 2px stub rather than nothing: a week with no evaluation is a
 * gap in the record, and an absent bar would read as a week that scored zero. */
.pui .spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.pui .spk {
  width: 8px;
  background: var(--accent);
  border-radius: var(--radius-xs);
  min-height: 2px;
}

.pui .spk.na { background: var(--line); }

.pui .up { color: var(--ok-ink); font-weight: 600; }
.pui .down { color: var(--err); font-weight: 600; }

/* ------------------------------------------------------------------------ people
 *
 * The membership editor. `rolecheck` exists in the Flask app's `base.html`; reproduced here
 * because the desktop has no base.html and this screen now runs on both (founder ruling,
 * 2026-09-07 — the desktop gets the membership writes).
 */
.pui .rolerow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

/* Inside a table cell the row has to stay compact, or a nine-role workspace makes every
 * row four lines tall. */
.pui .rolerow.tight {
  gap: 2px 8px;
  font-size: var(--text-xs);
}

.pui .rolecheck {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
  color: var(--ink-2);
  /* A ROLE IS A CHIP, and this is where that is said (stage 2). `base.html` drew the border,
     the radius, the padding and the fill; this rule stated none of them, so the same screen
     came out as chips on the web and as bare checkboxes on the desktop — 127,356 pixels
     apart, which is what `make parity` reported the moment People entered it. No Jinja page
     uses the class any more, so the four declarations moved here rather than being matched
     in two places. */
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  background: var(--panel-2);
  cursor: pointer;
}

.pui .rolecheck input {
  margin: 0;
  width: auto;
}

/* A checked role is the statement being made, so it stops being muted. */
.pui .rolecheck:has(input:checked) {
  color: var(--ink);
  font-weight: 600;
}


/* ------------------------------------------------------------- en3: the page grammar
 *
 * EN3 People pages (People, Roles, Team, Agents, Invites, Org, Items) on page.css's grammar
 * (wow W4). `.en3` sits on each page's `.sv-page`. The shell's own element rules (`.pui h2` 18 px,
 * `.pui button` 6/12 radius 6) are 0,1,1 and beat page.css's single classes, so inside an EN3
 * page the grammar's pieces state their own values again at 0,3,0. These are page.css's values,
 * restated, never new ones. (A shared home for them is the chair's call: 17-shell is shared.)
 */
.pui .en3 .sv-h2 { font-size: var(--text-2xl); margin: 0; }
.pui .en3 .sv-card { margin: 0; }
.pui .en3 .sv-seg button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-3);
}
.pui .en3 .sv-seg button:hover { color: var(--ink); }
.pui .en3 .sv-seg button[aria-selected="true"] {
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.pui .en3 .sv-li-btn {
  min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--radius-lg); background: transparent;
}
.pui .en3 .sv-li-btn:hover { background: var(--hover); }
.pui .en3 .sv-li[data-on] > .sv-li-btn { background: var(--panel-2); }
/* The pill at the dense control height (P11), on the page's own actions. */
.pui .en3 .en3-acts button,
.pui .en3 .sv-li-acts button,
.pui .en3 .sv-dash-act button {
  min-height: 34px; padding: 0 16px; border-radius: var(--radius-pill);
}
@media (pointer: coarse) {
  .pui .en3 .sv-seg button, .pui .en3 .sv-li-btn,
  .pui .en3 .en3-acts button, .pui .en3 .sv-li-acts button, .pui .en3 .sv-dash-act button { min-height: 44px; }
}
.pui .en3 .en3-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* A row that is not one button: its text, its controls, its action (People's role chips). */
.pui .en3 .en3-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 16px; padding: 10px; }
.pui .en3 .en3-row > .sv-li-main { flex: 1 1 200px; }
.pui .en3 .en3-row-roles { flex: 2 1 320px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pui .en3 .en3-form { display: flex; flex-direction: column; gap: 8px; }
.pui .en3 .en3-form .sv-small { margin: 0; }
/* Big numbers (components/CountRow): one quiet card, figures side by side, wrapping on a phone. */
.pui .en3 .en3-counts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
}
/* Roles: the score at a row's end, and the three tabular cards (the scorecard is a table by
   nature: criteria are columns). Their old `mt-*` margins are the page's 18 px gap now. */
.pui .en3 .en3-row > .sv-persona { margin-top: 2px; }
.pui .en3 .en3-score { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pui .en3 .en3-table { display: flex; flex-direction: column; gap: 10px; }
.pui .en3 .en3-table > p, .pui .en3 .en3-table > .sv-small { margin: 0; }
/* Invites: the sign-up mode line and the forms' sentences sit in the page's rhythm, not on margins. */
.pui .en3 .en3-note, .pui .en3 .en3-form p { margin: 0; }
.pui .en3 .en3-form input:where(:not([type='checkbox'])) { max-width: 420px; }
/* An older `.card` left inside an EN3 page (Pending, an item's body, the knowledge panel) sits in
   the page's 18 px gap; its own bottom margin would double the rhythm. */
.pui .en3 > .card { margin: 0; }
/* ------------------------------------------------------------------------ executor
 *
 * The live log tail. `pre` because the worker's own line breaks are the structure — a
 * wrapped log is a log nobody can scan — and it scrolls inside its own box rather than
 * making the page tall.
 */
.pui pre.log {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  white-space: pre;
}

/* The resume button. Green because it is the safe direction, and the pause beside it is
 * already `.danger` — the pair has to read at a glance on a screen somebody opens because
 * something is wrong. */
.pui button.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--on-accent);
}

.pui button.ok:disabled {
  opacity: 0.55;
}

/* A tight list, for the checkpoint's blocked tasks and recent decisions. The default `ul`
 * spacing is written for prose; these are two- and three-item facts. */
.pui ul.tight {
  margin: 4px 0 0;
  padding-left: 18px;
}

.pui ul.tight li {
  margin: 2px 0;
}


/* ------------------------------------------------------------------------ EN2 (wow W4)
 *
 * The Executor on the page grammar. The pause card and its TrustNote sit side by side (P9:
 * trust beside the action), stacking at a narrow page. The live log takes the Usha ring only
 * while a run is live (chair ruling): then it is the one loud object and drops its own card,
 * because the ring is the frame; otherwise it is a quiet sv-card like every other section. */
.pui .ent-hold { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; align-items: start; }
/* The pause control on the page surface, level with the trust note's title (P5, wow W4 r2). */
.pui .ent-hold-act { padding: 12px 0; min-width: 0; }
.pui .ent-hold-act > .row { flex-wrap: wrap; align-items: center; }
@container sv-page (max-width: 720px) {
  .pui .ent-hold { grid-template-columns: 1fr; }
}
.pui .ent-log { min-width: 0; }
.pui .ent-log:not(.sv-card) { padding: 16px 18px; }
.pui .ent-log pre.log { border: 0; }

/* A task as a hairline row: id, title, owner on one line. */
.pui .ent-task .sv-li-btn { align-items: center; cursor: default; }
.pui .ent-task .sv-li-btn:hover { background: transparent; }
.pui .ent-task .sv-li-main { flex: 1; min-width: 0; }
/* ------------------------------------------------------------------ settings
 *
 * NINE COMPARTMENTS DOWN A SIDEBAR that SELECTS rather than scrolls, which was
 * `settings.html`'s own design and the reason it stopped feeling monolithic. The sidebar is
 * `<button>`s here rather than `<a href="#…">`: the shared screen holds the selection in
 * state, so there is no hash to own and no server round trip to avoid.
 *
 * A NOTE ON `.pref`. `.pui label` is `display:block` with a bottom margin and
 * `.pui label > span` is block too — the stacked-field default the filter rows need. A
 * preference row is a checkbox BESIDE its caption, so it overrides both rather than
 * fighting them with `!important`.
 */

.pui .setgrid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}

/* The sidebar becomes a wrapping chip strip once it can no longer sit beside the content. */
@media (max-width: 900px) {
  .pui .setgrid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.pui .setnav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: sticky;
  top: 18px;
}

.pui .setnav > span {
  display: contents;
}

.pui button.setlink {
  display: block;
  width: 100%;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
}

.pui button.setlink:hover {
  color: var(--ink);
  background: var(--panel);
}

.pui button.setlink.active {
  color: var(--ink);
  background: var(--panel);
  border-left-color: var(--accent);
  font-weight: 500;
}

.pui .setnav .grp {
  display: block;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
  opacity: 0.75;
  margin: 14px 0 4px;
  padding-left: 12px;
}

.pui .setnav > span:first-child .grp {
  margin-top: 0;
}

/* AT PHONE WIDTH, ONE SCROLLING ROW (wow W4 r3, P5/P11; rule R1 as SME's Seg): not a wall of
   bordered chips. The Seg's track and pills, scrollbar hidden, the edge that hides a compartment
   faded (Settings sets data-more-*); 34 px on a mouse, 44 px under pointer: coarse. */
@media (max-width: 900px) {
  .pui .setnav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--panel-2);
    margin: 0 0 var(--space-12);
  }
  .pui .setnav::-webkit-scrollbar { display: none; }
  .pui .setnav[data-more-end] { -webkit-mask-image: linear-gradient(to left, transparent, black 40px); mask-image: linear-gradient(to left, transparent, black 40px); }
  .pui .setnav[data-more-start] { -webkit-mask-image: linear-gradient(to right, transparent, black 40px); mask-image: linear-gradient(to right, transparent, black 40px); }
  .pui .setnav[data-more-start][data-more-end] {
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
  }

  .pui button.setlink {
    flex: none;
    width: auto;
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    white-space: nowrap;
  }

  .pui button.setlink.active {
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  }

  /* A group heading cannot break a row of pills, so it steps out. */
  .pui .setnav .grp {
    display: none;
  }
}

@media (max-width: 900px) and (pointer: coarse) {
  .pui button.setlink { min-height: 44px; }
}

/* `letter-spacing` STATED, because base.html still carries an unscoped `.msec-h` for its own
   Jinja pages and its -.2px reached the shared Settings title in a browser only — the one
   difference left on that screen when `make parity` narrowed its region (review 2, item 2). */
.pui .msec-h {
  margin: 0 0 6px;
  font-size: var(--text-xl);
  letter-spacing: -0.2px;
}

.pui .msec-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 14px;
}

.pui .compartment + .compartment {
  margin-top: 26px;
}

/* A plain link rendered as a button, because the shared screen does not own navigation —
 * the shell does, through `onNavigate`. A surface with no navigation renders text instead. */
/* A RUN OF TASK IDS, inline. `.row` is the product's flex row and is block-level, which is
   right for the detail screen's labelled line and wrong everywhere else these appear: inside
   a `<dd>` of the task record's `<dl>` grid, and inside the sentence "blocked by …" on a
   decision card. Both of those have to stay on their own line, so this is an inline-flex
   that wraps and keeps a gap, rather than a second block container.
   See packages/product-ui/components/TaskLinks.tsx. */
.pui .trefs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  vertical-align: baseline;
}

/* A task id is one token: it never breaks inside itself (wow 07 D20, G3); a row of them wraps
   between ids, as .trefs' flex-wrap already lets it. */
.pui button.linky {
  white-space: nowrap;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.pui .banner.ok {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.pui select {
  padding: 6px 10px;
  font-size: var(--text-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
}

/* ---- the edition comparison ---- */

.pui .planrow {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 820px) {
  .pui .planrow {
    grid-template-columns: 1fr;
  }
}

.pui .plan {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--panel);
}

.pui .plan.cur {
  border-color: var(--accent);
}

.pui .plan h3 {
  margin: 0 0 2px;
  font-size: var(--text-lg);
}

.pui .plan .tag {
  color: var(--ink-2);
  font-size: var(--text-sm);
  margin: 0 0 10px;
}

.pui .feat {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

.pui .feat:last-child {
  border-bottom: 0;
}

.pui .yes {
  color: var(--ok-ink);
}

.pui .no {
  color: var(--ink-2);
}

/* ---- alerts and preferences ---- */

.pui .alerts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pui .alert {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  background: var(--panel);
  color: var(--ink);
}

.pui .alert .adot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--ink-2);
}

.pui .alert.sev-info .adot {
  background: var(--accent);
}

.pui .alert.sev-warn {
  border-color: var(--warn);
}

.pui .alert.sev-warn .adot {
  background: var(--warn);
}

.pui .alert.sev-error {
  border-color: var(--err);
}

.pui .alert.sev-error .adot {
  background: var(--err);
}

.pui .atext {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.pui .prefs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 640px) {
  .pui .prefs {
    grid-template-columns: 1fr;
  }
}

.pui label.pref {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 0;
  cursor: pointer;
}

.pui label.pref input {
  margin-top: 3px;
  flex: none;
  width: auto;
}

.pui label.pref > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: var(--text-md);
  color: var(--ink);
  margin-bottom: 0;
}

/* ---- delivery channels: in-app works, external is a documented seam ---- */

.pui .chans {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pui .chan {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
}

.pui .chan.on {
  border-color: var(--ok);
}

.pui .chan .ci {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: var(--text-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
  flex: none;
}

.pui .cbody {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.pui .cstate {
  font-size: var(--text-2xs);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.pui .cstate.on {
  color: var(--ok-ink);
  border-color: var(--ok);
}


/* The page is a `.sv-page` (wow W4 r3): the gap under the hero is its 18 px beat. The Display
   compartment's TrustNote sits between the panel's heading and its choices. */
.pui .setpanels .sv-trust {
  margin-bottom: 12px;
}

/* CONNECTORS' HEAD (wow W4 EN5): the same gap under the hero, and its TrustNote ("Connected as
   you, never shared.") beside the h1 as a narrow card, under it once the hero wraps. */
.pui .sv-hero:has(#connectors-title) {
  margin-bottom: 16px;
}
.pui .sv-hero:has(#connectors-title) .sv-hero-aside {
  flex: 0 1 320px;
}

/* ------------------------------------------------------------ Connectors on the grammar
 * wow W4 r2 (P5, P11). The page is a `.sv-page`; each category's tiles are ONE card, the tiles
 * divided by hairlines (each draws its line on the left and top, the card's overflow clips the
 * outer ones), not a grid of bordered boxes. The page's 18 px gap is the rhythm, so the
 * category heads drop their own margins. */
.pui .conn-page .cat-sect { margin: 0 0 10px; }
.pui .conn-page .tilegrid {
  gap: 0; margin: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden;
}
.pui .conn-page .tilegrid > .tilebox { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); min-width: 0; }
.pui .conn-page .tilegrid button.tile { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 14px 16px; }
.pui .conn-page .tilegrid button.tile:hover:not(:disabled) { background: var(--hover); box-shadow: none; }
.pui .conn-page .tstat-connect { border-radius: var(--radius-pill); }
/* -------------------------------------------------------------- dependency map
 *
 * WEB-ONLY UNTIL 2026-09-08 — the desktop had no dependency map at all, so none of these
 * rules existed on that side. They are lifted from `task_map.html`'s own <style> block,
 * which is the only place they lived.
 *
 * THE NODE COLOURS ARE NOT HERE, AND NOR ARE THE LEGEND'S. Both arrive in the response
 * (`graph.nodes[].fill` and `graph.palette`) because the LAYOUT is the server's and the
 * palette is part of the layout — `insights._DAG_STATUS` owns it. The first version of
 * this block restated those five colours as CSS and two were already wrong against the
 * boxes they described. Only the structural rules live here.
 */


.pui .critbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  margin-bottom: 14px;
}

.pui .clabel {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 600;
}

.pui button.cnode {
  font: 12px/1 var(--font-mono);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
}

.pui button.cnode:disabled {
  cursor: default;
}

.pui button.cnode:hover:not(:disabled) {
  border-color: var(--accent);
}

.pui .carrow {
  color: var(--ink-2);
  margin: 0 2px;
}

.pui .dagframe {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
  padding: 6px;
}

.pui .dag {
  display: block;
  min-width: 100%;
}

.pui .dag g:hover rect {
  filter: brightness(1.25);
}

/* `.maplegend`, NOT `.legend`, AND THE RENAME IS A BUG FIX.
 *
 * Two unrelated things carried this class: the task map's key — a flex row of colour chips —
 * and `connectors.css`'s `.legend`, which is a PARAGRAPH. This rule is later in the file, so
 * it won, and every explanatory paragraph on the Connectors screen was laid out as a flex
 * container: each `<b>` became a flex item on its own line, and the sentence broke into three
 * with a stray semicolon starting one of them.
 *
 * IT HAD BEEN WRONG ON THE DESKTOP SINCE THE TASK MAP LANDED. `styles.css` imports
 * `@connectors-css` before `@product-ui-css` and the app's shell carries `.pui`, so the same
 * cascade applied there; the Connectors migration then carried it to the web faithfully,
 * which is one stylesheet doing exactly what it is for. Found on 2026-09-13 by opening both
 * screens and looking — no test in this repository renders CSS, so nothing else could have.
 *
 * Renaming the SPECIALISED one rather than the general one: `.legend` is the paragraph in two
 * stylesheets and a dozen screens, and this is one key on one map. */
.pui .maplegend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 12px;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.pui .maplegend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pui .lchip {
  width: 20px;
  height: 3px;
  border-radius: var(--radius-xs);
  display: inline-block;
}

.pui .lchip.crit {
  /* The critical path is the accent, not a fourth blue two shades off it. */
  background: var(--accent);
  box-shadow: 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
}

.pui .lchip.dep {
  /* A dependency edge sits between the hairline and the muted ink — mixed from the two so
     it follows the palette into dark mode instead of staying a light grey there. */
  background: color-mix(in srgb, var(--ink-2) 45%, var(--panel));
}

.pui .lchip.box {
  width: 13px;
  height: 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
}

/* NO LANE COLOURS HERE. They arrive per status in the response, from the same table the
   nodes were painted with (`insights._DAG_STATUS`). Five hexes restated in CSS is exactly
   how this legend came to claim `--err-soft` for a box painted a hard-coded pink. */

.pui .lsep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 2px;
}

.pui .indwrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pui button.indchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
}

.pui button.indchip:disabled {
  cursor: default;
}

.pui button.indchip:hover:not(:disabled) {
  border-color: var(--ink-2);
}

.pui button.indchip .iid {
  font: 11px var(--font-mono);
  color: var(--ink-2);
}

.pui button.indchip.st-done { opacity: 0.6; }
.pui button.indchip.st-blocked { border-color: var(--err-line); }

/* The map's filter row. `.filters` above is the board's, which is a search box and a
   handful of buttons; these are stacked caption-over-select fields. */
.pui .filters .frow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
}

.pui .filters .frow + .frow {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pui label.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-2xs);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0;
}

.pui label.fld > span {
  margin-bottom: 0;
  font-size: var(--text-2xs);
  text-transform: inherit;
  letter-spacing: inherit;
}

.pui label.fld select {
  min-width: 130px;
  text-transform: none;
  letter-spacing: normal;
}

/* ---------------------------------------------------------- a project's items
 *
 * `textarea` HAS NO RULE ON EITHER SHELL. The Flask app styled it inside `task_new.html`'s
 * own <style> block — which went with that page on 2026-09-08 — and the desktop never had
 * one at all. Two shared screens now compose long text (the board's new-task form and an
 * item's body), so it is stated here, which is the rule this file's header sets out: a
 * rule here says what it needs rather than leaning on either shell's defaults.
 */

.pui textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.pui textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* An item's BODY is prose, not a log. `pre.log` above is `white-space: pre` on purpose —
 * a wrapped log is a log nobody can scan — and that is exactly wrong for a paragraph
 * somebody typed. Same box, opposite wrapping, and the two are named apart so neither
 * quietly acquires the other's behaviour. */
.pui pre.doc {
  margin: 0;
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* ITEMS AS A SECTION OF THE PROJECT PANEL (wow W4 r4, C2 at 360): "Drafts, notes and insights"
 * sat flush under the "Archive this project" button. A new section gets the section beat above
 * it, and a hairline says where the project's settings end. `.sv-page .sv-page` zeroes the
 * margin, hence the extra class in the selector. */
.pui .sv-page.items-sub {
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--line);
}
/* ------------------------------------------------------------- the workspace picker
 *
 * Lifted from `workspace_choose.html`'s own <style> block, which is the only place these
 * lived — the desktop's Workspaces page used plain `.card` rows and had no grid.
 *
 * `.wscard` IS A BUTTON, restyled out of its default chrome rather than a div with a click
 * handler, so the whole card is one keyboard-reachable control. On a surface that cannot
 * switch it renders as a div instead, which is why the rules below name neither.
 */

.pui .wsgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
  margin-top: 18px;
  max-width: 920px;
}

.pui .wscard {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 17px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.pui button.wscard:disabled {
  cursor: default;
}

.pui button.wscard:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.pui .wscard.on {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.pui .wscard-h {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.pui .wscard-n {
  font-weight: 650;
  font-size: var(--text-xl);
  letter-spacing: -0.2px;
}

.pui .wscard-p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}

.pui .wscard-f {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* The project chip and its colour dot. `base.html` defines both for the thirty Jinja
 * screens; this file may not lean on that (see the header), and the desktop had neither. */
.pui .pchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  font-size: var(--text-sm);
}

.pui .pchip.sm {
  padding: 1px 8px;
  font-size: var(--text-2xs);
  background: var(--panel-2);
}

.pui .pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: var(--ink-2);
}

/* Six, cycled by position, so a project keeps its colour as a reader moves between a Jinja
 * page and a shared one.
 *
 * THEY ARE PALETTE TOKENS NOW. This block held base.html's six values copied out as hex,
 * with a note asking for exactly the move that happened on 2026-09-08: `p0..p5` live in
 * packages/ui/tokens.json, so `scripts/build_tokens.py` emits them into this file's palette
 * AND into base.html's generated block, and the two copies that had to be kept in step by
 * hand are one declaration. What made the note actionable rather than aspirational is
 * `shared-ui-baseline.test.ts`, which now refuses a hex colour here at all. */
.pui .pdot.p-0 { background: var(--p0); }
.pui .pdot.p-1 { background: var(--p1); }
.pui .pdot.p-2 { background: var(--p2); }
.pui .pdot.p-3 { background: var(--p3); }
.pui .pdot.p-4 { background: var(--p4); }
.pui .pdot.p-5 { background: var(--p5); }

/* --------------------------------------------- Projects: the template table (wow W4 r4)
 *
 * THE RADIO IS A REAL TARGET: 18 px of control plus 8 px of margin round it is 34 px on a
 * mouse, and 13 px of margin is 44 px under `pointer: coarse` (never shrink a touch target).
 * The team a workspace lacks carries a dagger, and the note under the table says what it
 * means once (the per-row sentence wrapped every row to three lines).
 */
.pui .vt-table input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 8px;
}
.pui .vt-table .vt-pick {
  width: 1%;
  padding: 0;
  vertical-align: top;
}
.pui .vt-note {
  margin: 10px 0 0;
}
@media (pointer: coarse) {
  .pui .vt-table input[type='radio'] {
    margin: 13px;
  }
}

/* AT PHONE WIDTH (<= 820 px, RAIL_DRAWER_MAX_PX) EACH ROW IS A STACKED HAIRLINE BLOCK — the
 * five columns in a 330 px card were clipped on the right ("Staffed b…") and "What it does"
 * wrapped to ten lines. The radio and the name share the first line; each later cell names
 * its column from `data-label`. Nothing is wider than the card. */
@media (max-width: 820px) {
  .pui .vt-table,
  .pui .vt-table tbody,
  .pui .vt-table tr,
  .pui .vt-table td {
    display: block;
    width: auto;
  }
  .pui .vt-table thead {
    display: none;
  }
  .pui .vt-table tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .pui .vt-table td {
    grid-column: 2;
    border-bottom: 0;
    padding: 2px 0;
    overflow-wrap: anywhere;
  }
  .pui .vt-table td.vt-pick {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: auto;
  }
  .pui .vt-table td.vt-name {
    padding-top: 8px;
  }
  .pui .vt-table td[data-label]::before {
    content: attr(data-label) ' · ';
    color: var(--ink-3);
  }
}

/* -------------------------------------------- Workspaces: the form and the tiles (wow W4 r4)
 *
 * The Create button ends level with its Name input, not centred on the label + input pair
 * (it sat 17 px higher). The lede belongs to the tile list: 18 px under the form card, 10 px
 * over the tiles (it floated 80 px above them). The current workspace's tile is a disabled
 * button, and a disabled button takes the browser's grey text — it read as switched off, so
 * it keeps the ink a live card uses.
 */
.pui .row.ws-create {
  align-items: flex-end;
}
.pui .ws-lede {
  margin: 18px 0 0; /* the 18 px beat (page.css --sv-rhythm; this sheet names only palette tokens) */
}
.pui .ws-lede + .wsgrid {
  margin-top: 10px;
}
.pui button.wscard:disabled {
  color: var(--ink);
  opacity: 1;
}
.pui .wscard-f {
  color: var(--ink-2);
}
/* ------------------------------------------------------- asking about a task
 *
 * Lifted from `task_detail.html`'s own <style> block. The desktop had no ask panel at all
 * until 2026-09-07, and none of these existed on that side.
 *
 * A TRANSCRIPT, NOT A CHAT. `services/ask` is deliberately single-turn and stateless — the
 * prompt is rebuilt from the task each time and the run has no tools — so these are two
 * columns of standalone exchanges rather than a threaded conversation, and they are styled
 * to read that way.
 */

.pui .asklog {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.pui .asklog > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pui .amsg {
  max-width: 90%;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: var(--text-md);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.pui .amsg.you {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--ink);
}

.pui .amsg.ai {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

/* A FAILED QUESTION IS NOT AN ANSWER, and must not read as one. */
.pui .amsg.err {
  align-self: flex-start;
  background: var(--err-soft);
  border: 1px solid var(--err-line);
  color: var(--err);
}

.pui .amsg .who {
  display: block;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
  margin-bottom: 3px;
}

.pui .adots {
  color: var(--ink-2);
}

/* NO `.g2` HERE. It already exists above at `2fr 1fr`, and redefining it as `1fr 1fr`
 * further down the file would have silently re-laid-out every screen already using it —
 * the Dashboard's integrity pair among them. Caught by grepping for the selector before
 * adding it, which is the only thing that would have caught it: nothing renders two
 * screens side by side. The task page uses the existing pair.
 */


/* ------------------------------------------------------------------ the task journey
 *
 * Seven steps on one line, wrapping on a narrow window rather than scrolling sideways: the
 * bar is a summary, and a summary you have to scroll is not one.
 *
 * COLOUR IS NEVER THE ONLY SIGNAL. Each state also carries a mark — `✓` for done, `!` for
 * blocked — because the difference between "this happened" and "this cannot happen" is the
 * whole point of the bar, and a red-green pair is exactly the distinction a colour-blind
 * reader loses. The marks are `aria-hidden`; the sentence is on the button's `title`.
 */
.pui .jrn { padding: 12px 14px; }

.pui .jrn-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pui .jrn-step button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

/* NOT `cursor:not-allowed`. A shell that passes no `onGo` renders these as status, and a
 * "forbidden" cursor would say the step was refusing rather than that it was never a link. */
.pui .jrn-step button:disabled { cursor: default; opacity: 1; }

.pui .jrn-done button { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-soft); }
.pui .jrn-now button {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.pui .jrn-blocked button {
  color: var(--warn-ink);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}
.pui .jrn-later button { opacity: .62; }

.pui .jrn-here button { outline: 2px solid var(--accent-line); outline-offset: 1px; }

.pui .jrn-mark { font-size: var(--text-2xs); line-height: 1; }

.pui .jrn-next {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
  max-width: 88ch;
}

.pui .jrn-next b { color: var(--ink); }


/* ------------------------------------------------------------------ EN1 on the page grammar
 * (wow W4 EN1: Review, My questions, the task journey, the Lead, the analytics pair). The app's
 * buttons on a converted page wear the canvas pill at the dense control height (P11): 36 px on
 * a mouse, 44 under `pointer: coarse`. The grammar's own controls (tabs, rows, refine chips)
 * keep theirs. */
.pui .en1-page button:not(.sv-li-btn):not([role="tab"]):not(.sv-refine) { min-height: 36px; border-radius: var(--radius-pill); padding: 0 16px; }
@media (pointer: coarse) {
  .pui .en1-page button:not(.sv-li-btn):not([role="tab"]):not(.sv-refine) { min-height: 44px; }
}
.pui .en1-page .en1-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.pui .en1-page .sv-list > .sv-li > .sv-dash { margin: var(--space-6) 0; }
/* `.pui h2` / `.pui .card h2` (0,1,1) outrank page.css's `.sv-h2` (0,1,0): on an EN1 page the
   grammar's h2 takes its own step back (P6: 21 = --text-2xl). */
.pui :is(.en1-page, .pmdesk.sv-page) .sv-h2 { font-size: var(--text-2xl); margin: 0; }
/* The Lead's turns in its ring: hairline-divided, newest first (P5). */
.pui .lead.en1-page .lead-turn + .lead-turn { border-top: 1px solid var(--line); margin-top: var(--space-12); padding-top: var(--space-12); }
.pui .lead.en1-page .lead-turn > p { margin: 0 0 var(--space-6); }
/* The journey's stages: the grammar's pill row; a stage with nothing to show yet stays visible, greyed. */
.pui .tjrn.en1-page .tjrn-stages button:disabled { opacity: .45; cursor: default; }
/* Review (r2 → r3, P5): the Mine/Show all switch is as wide as its two tabs, not a page-wide track;
   the list column is ONE card — finished work (CheckQueue `inCard`, shared) and the plans waiting are
   two parts, each under its h2, split by a hairline; rows are hairline-divided, no bullets, no boxes. */
.pui .en1-page > .sv-seg { align-self: flex-start; }
.pui .review-queues { display: flex; flex-direction: column; gap: var(--space-8); }
.pui .review-queues .review-checks > .sub { margin: 0 0 var(--space-8); }
.pui .review-queues .review-checks .sv-li { padding: var(--space-8) 0; }
.pui .review-queues .review-checks + .review-part { border-top: 1px solid var(--line); padding-top: var(--space-14); margin-top: var(--space-6); }
/* The typed brief (P4 footnote 2): one row, the input growing, inside the ring until an answer opens. */
.pui .review .review-brief { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: center; }
.pui .review .review-brief > .banner { grid-column: 1 / -1; margin: 0; }
.pui .review .sv-ring-in > .review-brief { padding: var(--space-8); }
/* My questions (r2, P4): the typed ask sits under the answer slot, above its TrustNote. */
.pui .myq.en1-page .myq-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: end; }
.pui .myq.en1-page .myq-ask > input, .pui .myq.en1-page .myq-ask > .banner { grid-column: 1 / -1; }
.pui .myq.en1-page .myq-ask > textarea { resize: vertical; min-width: 0; }
/* --------------------------------------------------------------- primitives
 *
 * packages/product-ui/components/ui/ (ADR-0027 Stage 1). Tokens only, and varied by DATA
 * ATTRIBUTE rather than inline style: `data-gap="8"` is `gap: var(--space-8)`, one rule per
 * step, so a gap cannot be anything but a step on the scale. Nothing uses these yet; Stage 2
 * is the first consumer, which is why adding them changes no screen. */

.pui .ui-stack { display: flex; flex-direction: column; }
.pui .ui-cluster { display: flex; flex-wrap: wrap; align-items: center; }
.pui .ui-stack[data-gap="2"], .pui .ui-cluster[data-gap="2"] { gap: var(--space-2); }
.pui .ui-stack[data-gap="4"], .pui .ui-cluster[data-gap="4"] { gap: var(--space-4); }
.pui .ui-stack[data-gap="6"], .pui .ui-cluster[data-gap="6"] { gap: var(--space-6); }
.pui .ui-stack[data-gap="8"], .pui .ui-cluster[data-gap="8"] { gap: var(--space-8); }
.pui .ui-stack[data-gap="10"], .pui .ui-cluster[data-gap="10"] { gap: var(--space-10); }
.pui .ui-stack[data-gap="12"], .pui .ui-cluster[data-gap="12"] { gap: var(--space-12); }
.pui .ui-stack[data-gap="14"], .pui .ui-cluster[data-gap="14"] { gap: var(--space-14); }
.pui .ui-stack[data-gap="16"], .pui .ui-cluster[data-gap="16"] { gap: var(--space-16); }
.pui .ui-stack[data-gap="20"], .pui .ui-cluster[data-gap="20"] { gap: var(--space-20); }
.pui .ui-stack[data-gap="24"], .pui .ui-cluster[data-gap="24"] { gap: var(--space-24); }
.pui .ui-stack[data-gap="32"], .pui .ui-cluster[data-gap="32"] { gap: var(--space-32); }

.pui .ui-toolbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: var(--toolbar-h);
  padding: 0 var(--space-12);
  background: var(--material-toolbar);
  border-bottom: 1px solid var(--line);
}
.pui .ui-toolbar-leading,
.pui .ui-toolbar-trailing { display: flex; align-items: center; gap: var(--space-6); }
.pui .ui-toolbar-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--weight-semibold);
}

.pui .ui-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-8);
  border: 1px solid;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
}
.pui .ui-chip[data-tone="neutral"] { color: var(--ink-2); background: var(--panel-2); border-color: var(--line); }
.pui .ui-chip[data-tone="accent"] { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.pui .ui-chip[data-tone="ok"] { color: var(--ok-ink); background: var(--ok-soft); border-color: var(--ok-line); }
.pui .ui-chip[data-tone="warn"] { color: var(--warn-ink); background: var(--warn-soft); border-color: var(--warn-line); }
.pui .ui-chip[data-tone="err"] { color: var(--err); background: var(--err-soft); border-color: var(--err-line); }
.pui .ui-chip[data-tone="info"] { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }

.pui .ui-kbd { display: inline-flex; gap: var(--space-2); }
.pui .ui-kbd kbd {
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: var(--leading-base);
}

/* PROVENANCE: text always, plus a shape per tier, so it never rests on colour alone —
 * human a solid rule, an AI draft a dashed outline, final a check (hollow when local). */
.pui .ui-prov {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-2) var(--space-8);
  border: 1px solid;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
}
.pui .ui-prov[data-tier="human"] {
  color: var(--prov-human-ink);
  background: var(--prov-human-soft);
  border-color: var(--prov-human-line);
}
.pui .ui-prov[data-tier="human"] .ui-prov-glyph {
  align-self: stretch;
  width: var(--space-2);
  background: currentColor;
}
.pui .ui-prov[data-tier="draft"] {
  color: var(--prov-draft-ink);
  background: var(--prov-draft-soft);
  border-color: var(--prov-draft-line);
  border-style: dashed;
}
.pui .ui-prov[data-tier="draft"] .ui-prov-glyph { display: none; }
.pui .ui-prov[data-tier="final"] {
  color: var(--prov-final-ink);
  background: var(--prov-final-soft);
  border-color: var(--prov-final-line);
}
.pui .ui-prov[data-tier="final"] .ui-prov-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  border: 1px solid var(--prov-final-ink);
  border-radius: 50%;
  background: var(--prov-final-ink);
  color: var(--panel);
  font-size: var(--text-2xs);
}
.pui .ui-prov[data-tier="final"][data-verified="false"] .ui-prov-glyph {
  background: transparent;
  color: var(--prov-final-ink);
}
/* An override is said in words, after the actor, in amber — never by the amber alone. */
.pui .ui-prov-override {
  padding: 0 var(--space-4);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-xs);
  background: var(--warn-soft);
  color: var(--warn-ink);
}


/* ------------------------------------------------ P11 once: the grammar's geometry in a page
 *
 * wow W4 r2 (Enterprise r1 "shared cause 3"). Inside `.pui` the shell's element rules outrank the
 * page grammar: `.pui button` (17-shell, 0,1,1) beats `.sv-li-btn` / `.sv-refine` (0,1,0) and ties
 * `.sv-seg button` (0,1,1) — a tie the desktop resolves for product-ui (page.css is imported
 * first) and the web for page.css (linked after), so a ListCard row drew as a grey 6 px box. The
 * families restated the grammar one by one (`.en4-page`, `.en3`); the ledger pages (Executor,
 * Costs, Audit, Activity) never did. Here it is said ONCE for every `.sv-page`:
 *
 *   1. the grammar's own controls get back what `.pui button` takes from them — page.css's
 *      values, restated (apps/desktop/tests/product-ui/page-geometry-css.test.tsx holds them
 *      equal to page.css in both import orders, on a mouse and under pointer: coarse);
 *   2. an ordinary button (no class, or primary / sec / danger / ok / ghost) is the canvas pill at
 *      page.css's `.sv-page .st-btn` height, 44 px under pointer: coarse;
 *   3. an older `.card` takes `--radius-card` and the long soft shadow, and the page's 18 px gap
 *      instead of its own bottom margin.
 * The page sits in `:where()`, so each rule weighs what its subject needs and no more: a screen's
 * own classed rule (`.pui button.card`, `.pui .card.task`, `button.mini`) still wins. The one
 * exception is the ordinary button: `.pui button` is later in the cascade (17-shell), so it takes
 * (0,2,1) from a real `.sv-page`, and its kinds sit in `:where()` — a grammar control
 * (`.sv-li-btn`, `.sv-refine`, a Seg's `role="tab"`) is never its subject. */
.pui :where(.sv-page) .sv-seg button {
  padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--ink-3); font: var(--weight-medium) 14px var(--font-sans);
}
.pui :where(.sv-page) .sv-seg button:hover { color: var(--ink); }
.pui :where(.sv-page) .sv-seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); }
.pui :where(.sv-page) .sv-li-btn {
  padding: 8px 10px; border: 0; border-radius: var(--radius-lg); background: transparent; color: inherit; font: inherit;
}
.pui :where(.sv-page) .sv-li-btn:hover { background: var(--hover); }
.pui :where(.sv-page) .sv-li[data-on] > .sv-li-btn { background: var(--panel-2); }
.pui :where(.sv-page) .sv-refine {
  padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--panel); color: var(--ink-2); font: var(--weight-regular) 14px var(--font-sans);
}
.pui :where(.sv-page) .sv-refine:hover { border-color: var(--accent); color: var(--ink); }

.pui .sv-page button:where(:not([class]), .primary, .sec, .danger, .ok, .ghost):where(:not([role="tab"], .mini)) {
  min-height: 36px; padding: 0 16px; border-radius: var(--radius-pill);
}
@media (pointer: coarse) {
  .pui .sv-page button:where(:not([class]), .primary, .sec, .danger, .ok, .ghost):where(:not([role="tab"], .mini)) {
    min-height: 44px;
  }
}

.pui :where(.sv-page) .card { border-radius: var(--radius-card); box-shadow: var(--shadow); }
.pui :where(.sv-page) > .card { margin: 0; }
/* --------------------------------------------------------------- workstage
 *
 * The canvas and the inspector (packages/product-ui/components/Workstage.tsx, ADR-0027 Stage
 * 2a). The inspector exists only while something is inspected, so the canvas has the full
 * width otherwise. Its width is the clamp below until the separator moves; then it is one of
 * the `data-width` steps, a rule per STEP_PX between --inspector-min and --inspector-max
 * (primitives.test.tsx checks there is one for every step). On the web the page scrolls, so
 * the inspector is sticky and as tall as the viewport; the desktop's styles.css makes both
 * panes scroll inside its window instead. */

.pui .ws { position: relative; display: flex; align-items: flex-start; min-height: 0; }
.pui .ws-canvas { flex: 1; min-width: 0; }
.pui .ws:not([data-overlay]) .ws-canvas { min-width: var(--canvas-min); }
.pui .ws-inspector {
  position: sticky;
  top: 0;
  flex: none;
  width: clamp(var(--inspector-min), 25%, var(--inspector-max));
  max-height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.pui .ws-inspector[data-width="300"] { width: 300px; }
.pui .ws-inspector[data-width="310"] { width: 310px; }
.pui .ws-inspector[data-width="320"] { width: 320px; }
.pui .ws-inspector[data-width="330"] { width: 330px; }
.pui .ws-inspector[data-width="340"] { width: 340px; }
.pui .ws-inspector[data-width="350"] { width: 350px; }
.pui .ws-inspector[data-width="360"] { width: 360px; }
.pui .ws-inspector[data-width="370"] { width: 370px; }
.pui .ws-inspector[data-width="380"] { width: 380px; }
.pui .ws-inspector[data-width="390"] { width: 390px; }
.pui .ws-inspector[data-width="400"] { width: 400px; }
.pui .ws-inspector[data-width="410"] { width: 410px; }
.pui .ws-inspector[data-width="420"] { width: 420px; }
.pui .ws-inspector[data-width="430"] { width: 430px; }
.pui .ws-inspector[data-width="440"] { width: 440px; }
.pui .ws[data-overlay] .ws-inspector {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-popover);
  box-shadow: var(--shadow-xl);
}
.pui .ws-separator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--space-6);
  cursor: col-resize;
  z-index: var(--z-sticky);
}
.pui .ws-separator:hover,
.pui .ws-separator:focus-visible { background: var(--accent-soft); }

/* The task inspector's contents. */
.pui .ti-body { padding: var(--space-12) var(--space-16); }
.pui .ti-title { margin: 0; font-size: var(--text-lg); line-height: var(--leading-tight); }
.pui .ti-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-6) var(--space-12);
  margin: 0;
  font-size: var(--text-sm);
}
.pui .ti-facts dt { color: var(--ink-2); }
.pui .ti-facts dd { margin: 0; }

/* A dependency-map node opens its task in the inspector; it always could, now that every shell
 * provides one (ADR-0027), so the pointer is unconditional and no longer an inline style. */
.pui .tmap-node { cursor: pointer; }

/* --------------------------------------------------------------- the board at canvas width
 *
 * ADR-0027 Stage 2b. One status row, one filter bar, and a grouped list the board draws when
 * the canvas is narrower than BREAKPOINTS.boardList (an open inspector makes it so). Tokens
 * only, and no inline style anywhere in it. */

/* ONE STATUS ROW: the executor, the server's warnings (the mock-plane banner stays visible,
 * compact), and the legend behind a disclosure. */
.pui .bs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-12);
  margin-bottom: var(--space-8);
  line-height: var(--leading-tight);
  font-size: var(--text-sm);
}
.pui .bs-exec { display: inline-flex; align-items: center; gap: var(--space-6); }
.pui .bs-warn {
  padding: var(--space-2) var(--space-8);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--ink);
}
.pui .bs-legend summary { cursor: pointer; color: var(--ink-2); }
.pui .bs-legend[open] { flex-basis: 100%; }
.pui .bs-legend p { margin: var(--space-4) 0 0; }

/* THE FILTER BAR, one row: search, Filters, Lanes | List. */
.pui .bf {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.pui .bf .task-search { flex: 1; min-width: 0; margin-bottom: 0; padding: var(--space-2) var(--space-12); }
.pui .bf .task-search input[type='search'] { padding: var(--space-4) 0; }
.pui .bf-anchor { position: relative; }
.pui .bf-on { border-color: var(--accent-line); color: var(--accent-ink); }
.pui .bf-pop {
  position: absolute;
  top: calc(100% + var(--space-4));
  right: 0;
  z-index: var(--z-popover);
  width: min(560px, 80vw);
  margin: 0;
  box-shadow: var(--shadow-xl);
}
.pui .bf-view {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pui .bf-view button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: var(--space-4) var(--space-10);
}
.pui .bf-view button.on { background: var(--accent-soft); color: var(--accent-ink); }

/* The active filters, each removable. */
.pui .bf-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  margin: calc(0px - var(--space-4)) 0 var(--space-10);
  font-size: var(--text-sm);
}
.pui .bf-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-8);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.pui .bf-x {
  border: 0;
  background: transparent;
  padding: 0 var(--space-4);
  color: inherit;
  line-height: 1;
}

.pui .board-area { min-width: 0; }

/* THE LIST: groups by status, dense rows. */
.pui .bl { display: flex; flex-direction: column; gap: var(--space-6); }
.pui .bl-head { margin: 0; font-size: var(--text-sm); line-height: var(--leading-tight); }
.pui .bl-head button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.pui .bl-caret { width: 1em; }
.pui .bl-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}
.pui .bl-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: var(--row-h);
  padding: 0 var(--space-8) 0 0;
  border-top: 1px solid var(--line);
}
.pui .bl-row:first-child { border-top: 0; }
.pui .bl-row[aria-current='true'] { background: var(--accent-soft); }
.pui .bl-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-10);
  border: 0;
  background: transparent;
  padding: var(--space-4) var(--space-12);
  text-align: left;
  font: inherit;
  color: inherit;
}
.pui .bl-id { flex: none; color: var(--ink-2); font-size: var(--text-xs); }
.pui .bl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pui .bl-owner { flex: none; color: var(--ink-2); font-size: var(--text-xs); }
.pui .bl-row select.mini { flex: none; width: auto; margin: 0; border-radius: var(--radius-pill); }
/* An empty lane is one muted hairline row inside its card (wow W4 r2, C2 P10), not a bare "—". */
.pui .bl-empty { padding: var(--space-8) var(--space-12); color: var(--ink-3); font-size: var(--text-sm); }

/* AT PHONE WIDTH (wow W4 r2, C2 at 360: P5, P11). The search takes the filter bar's whole first
 * row (it was squeezed to "Sea"); Filters and Lanes | List sit under it. A row stays a hairline
 * row inside its lane's one card, and stacks: the title first (it was squeezed to nothing), the
 * id and chips under it, then "Move to…" below them — never over the chips. Held by
 * board-phone-css.test.tsx. */
/* Base before the phone rule below: same specificity, so source order decides (wow W4 r4 —
   it sat after the media block and kept flex-end at 360). */
.pui .en4-board-acts { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 820px) {
  .pui .bf { flex-wrap: wrap; }
  .pui .bf .task-search { flex: 1 1 100%; }
  .pui .bl-row { flex-wrap: wrap; align-items: flex-start; padding: 0 0 var(--space-8); }
  .pui .bl-open { flex: 1 1 100%; flex-wrap: wrap; row-gap: var(--space-4); padding-top: var(--space-8); }
  .pui .bl-title { flex: 1 1 100%; order: -1; white-space: normal; }
  .pui .bl-row select.mini { margin: 0 var(--space-12); }
  /* wow W4 r4 (C2 at 360): the hero's aside takes the whole row here, so the actions pack from
     the start, flush under the lede — `flex-end` pushed them to x 135 of 720. The executor note
     is a muted note that wraps, its command a `code` token. */
  .pui .en4-board-acts { justify-content: flex-start; }
  .pui .bs-exec { flex-wrap: wrap; row-gap: var(--space-4); }
}

/* The board's own page header sits closer to what it heads: every pixel above the first task
 * is one fewer task on screen (Stage 2b target: the first row within 200px of the canvas top). */
.pui header.board-head { margin-bottom: var(--space-10); }

/* The task inspector's Stage 2b contents: an icon close, the start of the description, and
 * the latest run. */
.pui .ti-close {
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-xl);
  line-height: 1;
}
.pui .ti-close:hover { background: var(--panel-2); color: var(--ink); }
.pui .ti-desc p { margin: 0; white-space: pre-wrap; font-size: var(--text-sm); }
.pui .ti-desc p + p { margin-top: var(--space-4); }
.pui .ti-run {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-10) var(--space-12);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.pui .ti-run h3 { margin: 0; font-size: var(--text-xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.pui .ti-run-summary { margin: 0; font-size: var(--text-sm); }


/* wow W4 EN4: the board's head is a PageHero (kicker, h1 with its warm word, the count as lede)
 * with the board's buttons as the hero's aside — no extra row above the first task.
 *
 * wow W4 r2 (P11, P5): the board is a `.sv-page` like every other page, so it keeps the 1120
 * column and the 18 px rhythm (kicker → hero as on the other pages), and the lanes are ONE card:
 * columns divided by hairlines, each task a hairline row in its column, not a stack of bordered
 * boxes. Dragging, the menu and the inspector are unchanged; only the paint moved. */
.pui header.board-head.en4-page { display: flex; flex-direction: column; gap: 8px; }
/* 18 px: page.css's --sv-rhythm. This sheet names only palette tokens (shared-ui-baseline), and
   --sv-rhythm is the page grammar's own, declared in page.css, not in tokens.css. */
.pui .board-page > header.board-head.en4-page { margin: 0; gap: 18px; }
.pui .board-page .board {
  gap: 0; padding: 14px 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
}
.pui .board-page .board > section { padding: 0 12px; box-shadow: -1px 0 0 var(--line); }
.pui .board-page .board > section:first-child { box-shadow: none; }
.pui .board-page .board .cards { gap: 0; }
.pui .board-page .board .card.task {
  border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent;
  padding: 10px 6px;
}
.pui .board-page .board .card.task:first-child { border-top: 0; }
.pui .board-page .board .card.task:hover { background: var(--hover); }
/* ---------------------------------------------------------------- the shell
 * ONE SHELL, BOTH SURFACES (ADR-0027, amended; accepted 2026-09-23). These rules drew the
 * desktop's chrome from apps/desktop/src/renderer/styles.css until 2026-09-23. They are here
 * because the chrome is now `packages/product-ui/shell/AppShell.tsx`, which Flask mounts too
 * — and a shared component styled by one shell's private stylesheet is exactly the drift
 * ADR-0012's risk list names. Scoped under `.pui` like everything else in this file: the
 * shell's root element carries both classes.
 *
 * WHAT STAYED BEHIND in the desktop's stylesheet: the drag regions
 * (`-webkit-app-region`), which are a native affordance a browser has no use for, and
 * `.segmented`, which belongs to the desktop-only Ask & dashboards screen.
 */

/* ---------------------------------------------------------------- layout */

/* THE SAME `code` AND THE SAME TICK BOX ON BOTH SURFACES — two more inherited-from-the-shell
   differences `make parity`'s canvas diff found on 2026-09-23. Flask draws `code` as a chip
   with a fill and a hairline; the desktop draws it as bare monospace, so the workspace slug on
   Settings was a chip in a browser and plain text in the app. And the desktop's generic
   `input` rule (a panel fill, full width) reaches radio buttons and checkboxes, so the
   Projects list drew grey radios in the app and white ones in a browser.

   The CHIP is the shared look, because it is what the screens were written around; the tick
   boxes go back to what the platform draws, which is what a radio is supposed to look like.
   (The Projects list's radios still differ, and that one is NOT styling: they are `disabled`
   where the surface cannot act on them — see the parity harness's declared regions.) */
.pui code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--panel-2);
}
.pui input[type='radio'],
.pui input[type='checkbox'] {
  /* `revert`, not a set of values: the desktop's own `input` rule gives every field a panel
     fill, a border and full width, none of which belongs on a tick box. Reverting hands the
     control back to the platform, which is what a radio should look like on both. */
  all: revert;
  accent-color: var(--accent);
}

/* A BUTTON IN A SHARED SCREEN LOOKS THE SAME ON BOTH SURFACES, which it did not until
   2026-09-23: this file styled `.primary`, `.sec` and `.tile` but never the plain one, so a
   shared screen's ordinary button inherited the SHELL's — a grey panel button on the desktop
   and a solid accent one in Flask (`base.html`: `button,.btn{background:var(--accent)}`).
   The Dashboard's Refresh was blue in a browser and grey in the app, and the first canvas
   diff of `make parity` found it on every screen at once.

   THE DESKTOP'S NEUTRAL LOOK WINS, because that is what the redesign drew and what every
   screenshot in the stage reports shows. `.primary` is still the accent one — an emphasis a
   screen asks for, not one a surface imposes. The Jinja pages keep their own button, which
   is why this is scoped under `.pui` like everything else here. */
.pui button {
  font: inherit;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink);
}
.pui button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
.pui button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* THREE MORE OF THE SAME, found when the Executor joined `make parity` (founder review 2,
   item 3). Each is an element this file never styled, so each shell supplied its own.

   `button.danger` — Pause executor was red ink on a grey button in the app (the desktop's
   global `button.danger { color: var(--err) }`) and a plain grey one in a browser, where
   base.html's own `button.danger` loses to `.pui button` above on source order. base.html's
   is the design, and the one the resume button's comment assumes: an err-soft fill, an
   err-line border, err ink.

   Text fields — a white field in the app, a panel-2 one in a browser. The app's look, as for
   the plain button, on the scale's radius (the radius ratchet refuses a new raw 6px). The
   exclusions sit in `:where()` so the rule weighs (0,1,1) — enough to beat base.html's
   `input[type=text]` on source order, and no more, so `.pui .filters input` and the other
   specific field rules here still win.

   `h2` — a `sub` screen's header, like the Executor's nested Costs, drew at the browser's
   default 1.5em in the app and at base.html's `--text-lg` in a browser. base.html's is a
   decision and the default is not. `.pui .card h2` and the rest still win where they apply. */
.pui button.danger {
  background: var(--err-soft);
  border-color: var(--err-line);
  color: var(--err);
}
.pui input:where(:not([type='radio']):not([type='checkbox'])),
.pui select,
.pui textarea {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
}
.pui h2 {
  font-size: var(--text-lg);
  margin: 0 0 10px;
}

/* THE CHROME STATES WHAT IT NEEDS, like every other rule in this file. The desktop's
   stylesheet gives `button` a bordered panel look and the Flask app gives it a solid accent
   one, so a chrome button that inherited would be a grey button on one surface and a blue one
   on the other — which is exactly what the first web mount showed for "Sign out". */
.pui .sidebar button,
.pui .win-toolbar button {
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.pui .sidebar .foot .foot-signout {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 400;
}
.pui .sidebar .foot .foot-signout:hover {
  border-color: var(--accent);
}

.pui.shell {
  /* THE SHELL STATES ITS OWN TYPE. Both surfaces set a font and a line-height on `body` and
     they are not the same declaration — the desktop's own sans alias, and the Flask app's
     shorthand ending in Roboto with a 1.55 leading. Inheriting meant the same sidebar rendered in
     two different stacks with a 5px difference in the brand's box, which
     `apps/desktop/scripts/parity.mjs` measured on the first run. The palette owns both. */
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-base);
  /* WHAT THE PLATFORM DRAWS, AND IN WHICH SCHEME. The desktop's stylesheet declared
     `color-scheme: light dark` and the Flask app declared nothing, so every radio, checkbox
     and scrollbar the browser draws itself came out differently in the app than in a
     browser — the Projects list, found by `make parity`'s canvas diff (2026-09-23). It
     belongs to the shell, which is the thing that spans both. */
  color-scheme: light dark;
  display: grid;
  /* THE SIDEBAR'S WIDTH IS A TOKEN, because a second thing measures from it: the web puts
     a server-rendered page beside this grid rather than inside it (base.html), and a literal
     here would be a literal there too, drifting the day one of them changed. */
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

.pui .sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  /* No top padding: the first child is the 38px strip the traffic lights sit in. */
  padding: 0 12px 12px;
  gap: 4px;
  /* THE SIDEBAR IS TALLER THAN THE WINDOW IS ALLOWED TO BE. Measured: its content comes to
     720px — 44px of title-bar padding, a brand, three section headings, twelve tabs, and a
     footer carrying a name, a workspace with three roles, the control-plane pill and Sign
     out — against a `minHeight: 640` in main/index.ts. Without this the sidebar simply grew
     past the `height:100vh` shell and Sign out sat 58px below the fold, reachable only by
     scrolling the whole document, which also scrolled `.main` out from under itself. */
  overflow: hidden;
}
/* THE SIDEBAR'S TOP STRIP (window chrome ruled 2026-09-21): empty, --toolbar-h tall, level with
   the window toolbar beside it; the traffic lights sit in it and it drags the window. */
.pui .sidebar-strip {
  flex: none;
  height: var(--toolbar-h);
  margin: 0 -12px;
}

.pui .sidebar .brand {
  font-weight: 650;
  padding: 0 10px 14px;
  letter-spacing: -0.01em;
}
.pui .sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* The tabs are what gives when there is not enough height — the brand identifies the app
     and the footer says who you are and how to leave, and neither is a list.
     `min-height: 0` is the whole fix and it is not obvious: a flex item's default
     `min-height: auto` refuses to shrink below its content, so `overflow-y: auto` alone
     does nothing at all here — the box never gets smaller than its contents, so it never
     has anything to scroll. */
  min-height: 0;
  overflow-y: auto;
}
.pui .sidebar nav button {
  border: none;
  background: none;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink-2);
}
.pui .sidebar nav button.active {
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 550;
}
/* A group of tabs that do one job. The heading is what stops "Dashboard" and "Dashboards"
   reading as a typo for each other. */
.pui .sidebar .nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pui .sidebar .nav-section + .nav-section {
  margin-top: 14px;
}
.pui .sidebar .nav-heading {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0.72;
  padding: 0 10px 4px;
}
/* A HEADING IS A DISCLOSURE (Stage 2b): it opens and closes its tabs. Reset from the sidebar's
   tab-button look, so it still reads as a heading. */
.pui .sidebar nav .nav-heading {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  border-radius: 0;
}
.pui .sidebar nav .nav-heading:hover {
  opacity: 1;
}
.pui .sidebar .nav-caret {
  width: 1em;
}
.pui .sidebar .nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pui .sidebar .nav-tabs[hidden] {
  display: none;
}
/* A nav button is full-bleed against the sidebar's edge, so an outset ring is clipped on one
   side. Inset instead — the same ring, drawn inside the button. */
.pui .sidebar nav button:focus-visible {
  outline-offset: -2px;
}
.pui .sidebar .foot {
  margin-top: auto;
  font-size: var(--text-xs);
  color: var(--ink-2);
  padding: 10px;
  line-height: 1.6;
}
/* One line each, however long the name and the roles are. `min-width: 0` is here for the
   same reason it is on `.sidebar nav`: without it a flex/grid child refuses to shrink below
   its content, and `text-overflow` needs the box to be narrower than the text to do
   anything at all. */
/* WHAT IS WAITING, beside the entry it waits on. `base.html` drew this as a badge on the
   decision bell; the bell is gone and the count belongs on the entry itself. */
.pui .sidebar .nav-tabs button {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.pui .sidebar .nav-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* WHICH INSTALLATION — the stage of the control plane this session talks to, in the toolbar.
   The three tones carry the same meaning on both surfaces, and `loud` is prod: the emphasis
   base.html's `.badge.stage-prod` had, kept, because with one database per stage and prod
   reachable from any machine, mistaking it for dev is the expensive error. */
.pui .win-stage {
  margin-left: auto;
  padding: 2px var(--space-10);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  line-height: 1.6;
  white-space: nowrap;
}
.pui .win-stage-quiet {
  color: var(--ink-2);
  background: var(--pill);
}
.pui .win-stage-warn {
  color: var(--warn-ink);
  border-color: var(--warn-line);
  background: var(--warn-soft);
}
.pui .win-stage-loud {
  color: var(--on-accent);
  border-color: var(--err);
  background: var(--err-strong);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ACTING AS (web): a select in the foot, sized like the pill above it. The desktop passes no
   `acting`, so nothing is drawn there — see ShellChrome. */
.pui .sidebar .foot .foot-acting {
  display: block;
  margin-top: 8px;
}
.pui .sidebar .foot .foot-acting-lbl {
  display: block;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
  margin-bottom: 2px;
}
/* NARROWED: a founder who has stepped down to developer for the afternoon needs to see why
   an approval button is missing, rather than assume it broke. `.wschip.hat.narrowed` carried
   this in base.html; it came back with the review of 2026-09-23. */
.pui .sidebar .foot .foot-acting[data-narrowed] .foot-acting-lbl {
  color: var(--accent-ink);
  opacity: 1;
}
.pui .sidebar .foot .foot-acting[data-narrowed] select {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 550;
}
.pui .sidebar .foot .foot-acting select {
  width: 100%;
  font: inherit;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink);
}
.pui .sidebar .foot .foot-signout {
  margin-top: 10px;
  width: 100%;
}
.pui .sidebar .foot .who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* THE WORKSTAGE FILLS THE WINDOW (ADR-0027 Stage 2a). `.main` used to be the scroller with
   the page padding; now it holds the canvas and the inspector side by side, and EACH scrolls
   on its own — so opening a task beside the board leaves the board's scroll where it was.
   The page padding moved to the canvas, same values. */
.pui .main {
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.pui .main > .ws {
  flex: 1;
  align-items: stretch;
  min-height: 0;
  /* NOT `auto`, which resolves to the content's min-content width: the board's fixed-width
     lanes are ~1150px, the row grew to fit them, and the inspector was pushed out past the
     window's right edge (found in the running app; jsdom does no layout). At 0 the row is the
     window's width and the canvas scrolls the wide board sideways, as it did before. */
  min-width: 0;
}
.pui .main .ws-canvas {
  overflow-y: auto;
  /* THE DENSITY TOKENS (Stage 7): comfortable is 28px / 32px, which is what this was. */
  padding: var(--page-py) var(--page-px) 64px;
}
/* ---- compact density (ADR-0027 Stage 7). `data-density` is on the shell's <main>, so it
   reaches the canvas and the inspector and never the sidebar. Comfortable is today's look and
   needs no rule; these are what compact changes beyond the tokens the rules above read. */
.pui.main {
  font-size: var(--text-body);
}
.pui[data-density='compact'] th,
.pui[data-density='compact'] td {
  padding: var(--cell-py) var(--cell-px);
}
.pui[data-density='compact'] .stack {
  gap: var(--stack-gap);
}
.pui[data-density='compact'] .card {
  padding: 10px 12px;
}
/* The desktop's window is the viewport, so the inspector is as tall as the canvas and scrolls
   itself, rather than the web's sticky pane over a scrolling page. */
.pui .main .ws-inspector {
  position: relative;
  max-height: none;
}
/* A SCREEN'S FIRST HEADER, wherever the canvas puts it. The desktop wraps each history entry
   in a `.dk-entry` (App.tsx keeps a list mounted under a full view) and the web does not, so
   a rule written for the desktop's wrapper alone gave the same screen 20px more air in the
   app than in a browser — which `make parity` measured on Approvals, 451,000 pixels apart
   with identical content (2026-09-23). */
.pui .ws-canvas > header:not(.board-head),
.pui .ws-canvas > .dk-entry > header:not(.board-head) {
  margin-bottom: 20px;
}
/* NOT A PAGEHERO'S h1 (wow W4 step 2, 2026-11-01). At 0,2,1 this beat page.css's `.sv-h1`
   (0,1,0), so a PageHero inside the Enterprise shell drew its h1 at 21 px. `:where()` adds no
   specificity, so every h1 without `.sv-h1` matches exactly as before, at the same weight and
   in the same order; a `.sv-h1` takes the grammar's size. Pinned by
   apps/desktop/tests/product-ui/shell-h1-css.test.tsx. */
.pui .main h1:where(:not(.sv-h1)) {
  font-size: var(--text-2xl);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.pui .main header p {
  margin: 0;
  color: var(--ink-2);
}
/* ---------------------------------------------------------------- window chrome
   ADR-0027 Stage 2b (window chrome ruled 2026-09-21): a full-height sidebar, and a stage beside
   it — the window toolbar over the canvas and inspector. */

.pui .stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
}
.pui .stage > .main {
  flex: 1;
}

.pui .win-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-12);
  height: var(--toolbar-h);
  padding: 0 var(--space-12);
  background: var(--material-toolbar);
  border-bottom: 1px solid var(--line);
}
.pui .win-nav {
  display: flex;
  gap: var(--space-2);
}
.pui .win-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  height: 26px;
  padding: 0 var(--space-8);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
}
.pui .win-btn:not(:disabled):hover {
  background: var(--panel-2);
  color: var(--ink);
}
.pui .win-btn:disabled {
  opacity: 0.4;
}
.pui .win-nav .win-btn {
  font-size: var(--text-xl);
  line-height: 1;
}
.pui .win-switch {
  position: relative;
}
.pui .win-switch-btn {
  color: var(--ink);
  font-weight: 550;
}
.pui .win-chevron {
  color: var(--ink-2);
  font-size: var(--text-2xs);
}
.pui .win-menu {
  position: absolute;
  top: calc(100% + var(--space-4));
  left: 0;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
}
.pui .win-item {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.pui .win-item:hover,
.pui .win-item:focus-visible {
  background: var(--accent-soft);
}
.pui .win-check {
  width: 1em;
  color: var(--accent);
}
.pui .win-sep {
  height: 1px;
  margin: var(--space-4) 0;
  background: var(--line);
}

/* THE TOP BAR'S RIGHT-HAND END (Part C): Home, the SME OS | Enterprise OS switch and the
   account menu. The same three, in the same order, as SME OS's bar (starter.css .st-topbar). */
.pui .win-site {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.pui .win-stage + .win-site {
  margin-left: 0;
}
.pui .win-os {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--pill);
}
.pui .win-os-opt {
  padding: 2px var(--space-10);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.pui .win-os-opt[aria-pressed='true'] {
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  opacity: 1;
}
.pui .win-os-opt[data-refused='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
/* "Explore more" (founder 2026-11-29): the switch's last pill, a menu of SME OS / Enterprise OS,
   right-aligned under the trigger (the bar sits at the window's right edge). */
.pui .win-os-more {
  position: relative;
  display: inline-flex;
}
.pui .win-os-more-btn::after {
  content: '\25BE';
  margin-left: var(--space-4);
  font-size: var(--text-2xs);
}
.pui .win-os-menu {
  left: auto;
  right: 0;
  min-width: 180px;
}
.pui .win-os-menu .win-item[aria-checked='true'] {
  font-weight: 600;
  opacity: 1;
  cursor: default;
}
.pui .win-os-menu .win-item[aria-checked='true']::after {
  content: '\2713';
  margin-left: auto;
  color: var(--accent);
}
.pui .win-os-menu .win-item[data-refused='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pui .win-account {
  position: relative;
}
.pui .win-account-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pui .win-account-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-2xs);
  font-weight: 700;
}
.pui .win-account-menu {
  left: auto;
  right: 0;
}
.pui .win-account-who {
  display: grid;
  gap: 2px;
  padding: var(--space-6) var(--space-8);
  font-size: var(--text-xs);
}
/* WHERE AN SME OS ACCOUNT ASKS FOR ENTERPRISE ACCESS (2026-10-11), under the toolbar. */
.pui .win-activate {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8) var(--space-12);
  padding: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: var(--text-sm);
}
.pui .win-activate p {
  flex: 1 1 360px;
}
.pui .win-activate-asked {
  font-weight: 600;
}
.pui .win-activate-problem {
  color: var(--err);
}
.pui .win-error {
  padding: var(--space-6) var(--space-8);
  color: var(--err);
  font-size: var(--text-xs);
}


/* ---------------------------------------------------------------- the rail as a status board (P8)
 * A closed section's heading carries its entries' waiting counts, added up (AppShell.tsx), so
 * Decisions' count is on the rail whichever section is open. */
.pui .sidebar nav .nav-heading .nav-count {
  letter-spacing: 0;
  text-transform: none;
}
/* The foot reads as the rail's end, not as one more entry (r1: the name sat flush under the
   last entry of an open section). */
.pui .sidebar .foot {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: var(--space-12);
}

/* ---------------------------------------------------------------- the rail as a drawer (phone)
 * wow W4, prompt 03: Enterprise at phone width follows SME OS's phone rules. At 360 px the rail
 * stayed a 232 px column and the page was ~96 px wide on both surfaces. At or under 820 px —
 * the SME phone shell's breakpoint (starter.css `.st-home--phone`), RAIL_DRAWER_MAX_PX in
 * lib/nav.ts, held equal by shell-phone-drawer.test.tsx — the page takes the whole width and
 * the rail is off-canvas: opened by the toolbar's 44 px menu button, closed by the scrim,
 * Escape or a choice (shell/rail-drawer.ts). Closed it is `visibility: hidden`, so it leaves
 * the tab order; open, the stage beside it is inert. Above 820 px none of this applies. */
.pui .win-rail-btn,
.pui .rail-backdrop,
.pui .win-palette-icon {
  display: none;
}
@media (max-width: 820px) {
  .pui.shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .pui .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-modal);
    width: min(var(--sidebar-max), 86vw);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--motion-base) var(--motion-ease), visibility 0s linear var(--motion-base);
  }
  .pui .sidebar[data-open] {
    transform: none;
    visibility: visible;
    transition: transform var(--motion-base) var(--motion-ease);
  }
  .pui .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) - 1);
    background: var(--scrim);
  }
  /* 44 px on a phone, as every SME phone target is (sops/engineering/build-a-mobile-screen.md). */
  .pui .win-rail-btn {
    display: inline-flex;
    justify-content: center;
    gap: var(--space-6);
    min-width: 44px;
    min-height: 44px;
    font-size: var(--text-xl);
    color: var(--ink);
  }
  .pui .sidebar nav button,
  .pui .sidebar .foot .foot-signout {
    min-height: 44px;
  }
  /* THE TOOLBAR IS TWO ROWS, never three, and nothing is clipped (wow W4 r2, C1/C2 at 360).
     Row one: Menu (the word, not only the icon), back/forward, the workspace (the brand of this
     window; it gives way first, with an ellipsis) and the account as its avatar alone. Row two,
     flush left: search (its words give way to the icon, its name stays), Home, the OS switch
     and the stage badge at the right. `.win-site` is `display: contents` so Home, the switch
     and the account are placed one by one; the zero-height `::after` is the line break between
     the rows. The palette's key hint is a mouse-and-keyboard aid. Held by
     shell-phone-toolbar.test.tsx. */
  .pui .win-toolbar {
    height: auto;
    min-height: var(--toolbar-h);
    flex-wrap: wrap;
    row-gap: 0;
    /* 4 px between items: with the 16 px gutters, 8 px left the OS switch ≈ 6 px short of
       "SME OS · Enterprise OS" at 360, so it ellipsized (wow W4 r4). Every item is ≥ 44 px. */
    column-gap: var(--space-4);
    /* The 16 px side gutter every page keeps (wow W4 r4: the stage pill hugged the right
       edge at x 703 of 720 with 8 px). */
    padding: var(--space-4) var(--space-16);
  }
  .pui .win-toolbar::after {
    content: '';
    order: 6;
    flex: 0 0 100%;
    height: var(--space-4);
  }
  .pui .win-rail-btn {
    order: 1;
  }
  .pui .win-nav {
    order: 2;
  }
  /* Basis 0 on the one elastic item of each row (the workspace name here, the OS switch on
     row two): a wrapping flex line breaks on the items' basis before anything shrinks, so an
     `auto` basis wraps the avatar or the stage pill instead of ellipsizing (wow W4 r4). */
  .pui .win-switch {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
  }
  .pui .win-switch-btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pui .win-site {
    display: contents;
  }
  .pui .win-account {
    order: 5;
    flex: none;
  }
  .pui .win-account-btn {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .pui .win-account-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  /* SEARCH IS ITS ICON ALONE at this width (wow W4 r4: the words ellipsized to "S…"). The
     button's aria-label keeps its name; the words stay in the DOM, visually hidden. */
  .pui .win-palette {
    order: 7;
    flex: none;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    overflow: hidden;
  }
  .pui .win-palette-icon {
    display: inline;
    flex: none;
    font-size: var(--text-xl);
  }
  .pui .win-palette-lbl {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .pui .win-site-home {
    order: 8;
    flex: none;
  }
  .pui .win-os {
    order: 9;
    flex: 1 1 0;
    min-width: 0;
    max-width: max-content;
  }
  .pui .win-os-opt {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The stage pill stays whole at the end of row two; the OS switch before it gives way
     (basis 0, options ellipsize). Row one cannot take the pill: on the desktop the Mac window
     buttons' offset already fills it. */
  .pui .win-stage {
    order: 10;
    flex: none;
    margin-left: 0;
  }
  .pui .win-palette kbd {
    display: none;
  }
  .pui .stage {
    height: 100dvh;
  }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .pui .sidebar,
  .pui .sidebar[data-open] {
    transition: none;
  }
}
/* ---------------------------------------------------------------- sign in
 *
 * ONE SCREEN, TWO HOSTS (stage 2, founder ruling 2026-09-24). The web mounts it in
 * `login.html` over a server-rendered form; the desktop mounts it before there is a shell.
 * Neither host's page frame is the same — base.html's body and `#content`, the desktop's
 * renderer root — so the screen owns the viewport outright rather than inheriting a margin
 * from whichever one it landed in. Everything it looks like is stated here, including the
 * heading, which each host otherwise styles its own way.
 */
.pui.signin {
  position: fixed;
  inset: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 16px 32px;
  background: var(--bg);
  color: var(--ink);
  /* ITS OWN TYPE, as `.pui.shell` states its own and for the same reason: the page sits
     outside the shell, so without these it inherits each host's `body` — the desktop's sans
     alias and the Flask app's 1.55 leading — and `make parity` measured the same form
     running taller in a browser, every line of it. */
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-base);
  color-scheme: light dark;
}
.pui .signin-box {
  width: 100%;
  max-width: 360px;
}
/* THE HEAD IS A PAGEHERO NOW (wow W4 EN5): its `.sv-h1` takes the grammar's size, so this rule
   names every OTHER h1 only — `:where()` adds no specificity, as `17-shell`'s shell rule does.
   The gap under the hero is the old lede's 18 px. */
.pui .signin-box h1:where(:not(.sv-h1)) {
  font-size: var(--text-2xl);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.pui .signin-lede {
  margin: 0 0 18px;
}
.pui .signin-box .sv-hero {
  margin-bottom: 18px;
}
.pui .signin-submit {
  width: 100%;
  margin-top: 4px;
}
.pui .signin-foot {
  margin: 12px 0 0;
  text-align: center;
}
/* Besides a password: Google and forgot password. The web draws them as links (they work with
   scripts off), a device as buttons — one look for both, so `make parity` sees one screen. */
.pui .signin-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.pui .signin-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.pui .signin-google:hover:not(:disabled) {
  background: var(--panel-2);
}
.pui .signin-google-mark {
  flex: none;
}
.pui .signin-forgot {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.pui .signin-forgot:hover {
  text-decoration: underline;
}
/* The device's half: drawn last, and set apart so it reads as this machine's rather than as
   more of the form. */
.pui .signin-device {
  margin-top: 16px;
}
.pui .signin-device-h {
  margin-bottom: 12px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
}
.pui .signin-found {
  margin-top: 6px;
}
.pui .signin-look {
  margin-left: 4px;
  padding: 1px 8px;
  font-size: var(--text-xs);
}
.pui .signin-stay {
  margin-bottom: 12px;
}
.pui .signin-passkey {
  width: 100%;
}
.pui .signin-device-foot {
  margin: 8px 0 0;
  text-align: center;
}


/* wow W4 r2 (P5, P11). Sign in is not a `.sv-page` (it owns the viewport), so the shared "P11 once"
 * rule does not reach it: its form card takes `--radius-card`, its buttons the canvas pill at the
 * dense height (44 under pointer: coarse; "Look again" at the 34 px chip height, never the 28 px
 * it drew), and the device's half reads as more of the one form — a hairline above it, not a
 * second bordered card. */
.pui .signin-box > .card { border-radius: var(--radius-card); }
.pui .signin-box > .card.signin-device {
  border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent;
  padding: 16px 0 0;
}
.pui .signin-box button:where(.signin-submit, .signin-passkey),
.pui .signin-box .signin-google { min-height: 40px; border-radius: var(--radius-pill); }
.pui .signin-box button.signin-look { min-height: 34px; padding: 0 14px; border-radius: var(--radius-pill); }
@media (pointer: coarse) {
  .pui .signin-box button:where(.signin-submit, .signin-passkey),
  .pui .signin-box button.signin-look,
  .pui .signin-box .signin-google { min-height: 44px; }
}
/* ---------------------------------------------------------------- the run timeline
 *
 * A WINDOWED LOG (ADR-0027 Stage 3): RunConsole draws only the rows in view, which works only
 * because every row is exactly one line of one height. `ROW_PX` in RunConsole.tsx is 22 and
 * so is this; change one, change both. The class used to be the bare `.log`, which only the
 * desktop's stylesheet styled — a monospaced, ruled log in the app and plain text in a
 * browser. It is stated here, once.
 *
 * `--font-mono`, THE TOKEN, and never `--mono`: that is an alias only the desktop's stylesheet
 * defines, so the five shared rules that used it fell back to the body font on the web.
 * Stage 3 moved all five to the token; PlanPreview's two inline uses go in Stage 7 with the
 * rest of that file's inline styles.
 */
.pui .run-log {
  max-height: 380px;
  overflow-y: auto;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.pui .run-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  box-sizing: border-box;
  height: 22px;
  line-height: 21px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
}
.pui .run-seq {
  flex: none;
  min-width: 42px;
  color: var(--ink-2);
}
.pui .run-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- agents
 *
 * The fleet and its Activity Queue (ADR-0027 Stage 4a). The list takes the width; the queue
 * sits beside it on a wide canvas and under it on a narrow one, because "what changed" is
 * read alongside "what is running", not instead of it.
 */
.pui .agents-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.pui .agents-bar label.fld {
  margin: 0;
  min-width: 220px;
}
.pui .agents-finished {
  align-items: center;
}
.pui .agents-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  /* The fleet ‖ the queue keep the grammar's split at 1120 (wow W4 EN3); under 900 they stack. */
  align-items: start;
}
@media (max-width: 900px) {
  .pui .agents-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pui .agents-latest {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The queue's two heads are the grammar's h3 step inside its card (P6): --text-xl (17; the grammar says 16.5, which is off the type scale), not the shell's 14. */
.pui .en3 .agents-queue h2.sv-h2 {
  margin: 0 0 8px;
  font-size: var(--text-xl);
}
.pui .en3 .agents-fleet .sv-small .link { padding: 0; }
.pui .agents-queue h2 + .queue-list + h2 {
  margin-top: 16px;
}
.pui .queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pui .queue-line {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.pui .queue-line:last-child {
  border-bottom: 0;
}
.pui .queue-needs .pill {
  margin-right: 4px;
}

/* ---------------------------------------------------------------- inbox
 *
 * One list of what waits on a founder (ADR-0027 Stage 4b). Each row carries its provenance
 * tier as WORDS in a pill; the tint is a hint for the eye and never the only signal, which is
 * why every tier class below changes a colour and nothing else.
 */
.pui .inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pui .inbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.pui .inbox-row:last-child {
  border-bottom: 0;
}
.pui .inbox-open {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pui .inbox-kind {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
}
.pui .inbox-title {
  font-weight: 600;
}
.pui .pill.tier {
  flex: none;
}
.pui .pill.tier-ai {
  border-color: var(--warn);
}
.pui .pill.tier-verified {
  border-color: var(--ok);
}
.pui .pill.tier-local {
  border-color: var(--err);
}


/* wow W4 EN4: the rows are the grammar's ListRow now; the kind, summary and meta stack under
   the title as one desc, each on its own line. */
.pui .en4-page .sv-li .inbox-kind,
.pui .en4-page .sv-li .inbox-summary,
.pui .en4-page .sv-li .inbox-meta { display: block; }
/* ---------------------------------------------------------------- ⌘K and ?
 *
 * The command palette and the key map (ADR-0027 Stage 5): two overlays drawn from the one
 * command registry. Above the stage, below nothing — they are modal while open.
 */
.pui.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}
.pui .palette {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 22%, transparent);
  overflow: hidden;
}
.pui .palette-input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  font-size: var(--text-md);
  background: transparent;
}
.pui .palette-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 50vh;
  overflow-y: auto;
}
.pui .palette-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.pui .palette-item.active {
  background: var(--panel-2);
}
.pui .palette-title {
  flex: 1;
  min-width: 0;
}
.pui .palette-empty {
  padding: 10px;
}
.pui kbd,
.pui .palette-key {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.pui .keymap {
  width: 100%;
  max-width: 520px;
  max-height: 76vh;
  overflow-y: auto;
}
.pui .keymap h2 {
  margin: 0;
}
.pui .keymap-section h3 {
  margin: 14px 0 6px;
  font-size: var(--text-sm);
}
.pui .keymap-list {
  margin: 0;
}
.pui .keymap-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
}
.pui .keymap-row dt {
  min-width: 96px;
  display: flex;
  gap: 4px;
}
.pui .keymap-row dd {
  margin: 0;
}
.pui .win-palette kbd {
  margin-left: 6px;
}

/* A lane a dragged card may drop into (Stage 6): an outline, and the lane's own words say what
   it is — the colour is not the only signal, the lane heading is. */
.pui .board > section.lane-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}
.pui .card.task[draggable='true'] {
  cursor: grab;
}

/* ---------------------------------------------------------------- vibrancy (macOS)
 *
 * ADR-0027 Stage 6. `dk-vibrancy` is set on <html> by the desktop on a Mac only, where the
 * window is transparent over the OS `sidebar` material (apps/desktop main/window-chrome.ts).
 * Stated HERE rather than in the desktop's stylesheet because it styles the shared shell: the
 * web never carries the class, so for a browser these rules do not exist.
 *
 * ONLY THE SIDEBAR IS TRANSLUCENT. The stage keeps the palette's background, so every screen's
 * canvas reads exactly as it does on the web — which is what `make parity` holds.
 */
html.dk-vibrancy,
html.dk-vibrancy body {
  background: transparent;
}
html.dk-vibrancy .pui .sidebar {
  background: color-mix(in srgb, var(--panel) 62%, transparent);
}
html.dk-vibrancy .pui .stage {
  background: var(--bg);
}
.pui .density-choice + .density-choice {
  margin-top: 8px;
}


/* THE DRAWER ON A MAC (rail-drawer.ts): at ≤ 820 px the rail slides over the page, so it is
   solid there (62 % would show the page through it), and the toolbar's first row starts clear
   of the traffic lights, which no longer have the rail's strip to sit in. Only the first row:
   the lights are 38 px tall, so the second row (search, Home, the OS switch) starts flush left
   instead of indented under them (wow W4 r2, C1/C2). */
@media (max-width: 820px) {
  html.dk-vibrancy .pui .sidebar {
    background: var(--panel);
  }
  html.dk-vibrancy .pui .win-rail-btn {
    margin-left: 70px;
  }
}

/* AT PHONE WIDTH THE LIGHTS GET THEIR OWN STRIP (wow 07 D20, G6 off-edge). The 70 px indent
   above put Menu 54 px in from the page’s left edge on every desktop phone shot, while
   the web's sits flush. At ≤ 480 px there is no room to indent past the lights, so they keep the
   --toolbar-h strip they sit in on the sidebar (trafficLightPosition centres them in it, in
   apps/desktop/src/main/index.ts) above the toolbar, and row one starts flush left like the
   web's. */
@media (max-width: 480px) {
  html.dk-vibrancy .pui .win-rail-btn {
    margin-left: 0;
  }
  html.dk-vibrancy .pui .win-toolbar {
    padding-top: var(--toolbar-h);
  }
}
/* ---------------------------------------------------------------- layout classes, from the tokens
 *
 * ADR-0027 Stage 7: every Stage 0 ratchet at 0. These replace the inline `style={{…}}` objects
 * the shared screens and the desktop's pages carried — 533 of them — and they are what that
 * ratchet was written to force: every spacing a step of `--space-*`, every size a step of
 * `--text-*`, stated in the stylesheet where the scale rules can read it. Off-scale values were
 * SNAPPED to the nearest step on the way in, a half-step rounding UP for text so nothing got
 * harder to read (12.5px → --text-sm, 11.5px → --text-xs; 18px → --space-16, …). Nothing off
 * the scale moved here intact.
 *
 * `!important`, DELIBERATELY. An inline style beat every rule in this sheet; a class with plain
 * specificity would lose to a more specific component rule (`.pui .card h2`) and quietly bring
 * back the margin the inline style was there to remove. Each of these stands exactly where the
 * inline style stood, and no further: they name one property each.
 *
 * Shorthands come first so a shorthand class and a side class compose the way the inline
 * shorthand did (`m-0 mb-10` is `margin: 0 0 10px`). Padding's shorthand is `pad-*`, NOT
 * `p-*`: base.html's `.p-0` … `.p-3` are the task priority colours, and `p-0` there would have
 * painted every padded element the P0 red on the web (the web-leak guard caught it).
 */
.pui .m-0 { margin: 0 !important; }
.pui .pad-0 { padding: 0 !important; }
.pui .pad-8 { padding: var(--space-8) !important; }
.pui .border-0 { border: 0 !important; }
.pui .border-warn { border-color: var(--warn) !important; }
.pui .bt-0 { border-top: 0 !important; }
.pui .bt-line { border-top: 1px solid var(--line) !important; }
.pui .c-err { color: var(--err) !important; }
.pui .c-ink { color: var(--ink) !important; }
.pui .c-warn-ink { color: var(--warn-ink) !important; }
.pui .d-block { display: block !important; }
.pui .d-flex { display: flex !important; }
.pui .d-inline-flex { display: inline-flex !important; }
.pui .dim { opacity: 0.75 !important; }
.pui .ff-mono { font-family: var(--font-mono) !important; }
.pui .flex-1 { flex: 1 !important; }
.pui .flex-none { flex: none !important; }
.pui .flex-nowrap { flex-wrap: nowrap !important; }
.pui .flex-wrap { flex-wrap: wrap !important; }
.pui .fs-2xs { font-size: var(--text-2xs) !important; }
.pui .fs-3xl { font-size: var(--text-3xl) !important; }
.pui .fs-md { font-size: var(--text-md) !important; }
.pui .fs-sm { font-size: var(--text-sm) !important; }
.pui .fs-xl { font-size: var(--text-xl) !important; }
.pui .fs-xs { font-size: var(--text-xs) !important; }
.pui .fw-600 { font-weight: 600 !important; }
.pui .gap-10 { gap: var(--space-10) !important; }
.pui .gap-12 { gap: var(--space-12) !important; }
.pui .gap-14 { gap: var(--space-14) !important; }
.pui .gap-2 { gap: var(--space-2) !important; }
.pui .gap-4 { gap: var(--space-4) !important; }
.pui .gap-6 { gap: var(--space-6) !important; }
.pui .gap-8 { gap: var(--space-8) !important; }
.pui .items-center { align-items: center !important; }
.pui .items-start { align-items: flex-start !important; }
.pui .justify-between { justify-content: space-between !important; }
.pui .justify-end { justify-content: flex-end !important; }
.pui .maxh-340 { max-height: 340px !important; }
.pui .maxw-420 { max-width: 420px !important; }
.pui .maxw-620 { max-width: 620px !important; }
.pui .maxw-prose { max-width: 78ch !important; }
.pui .mb-0 { margin-bottom: 0 !important; }
.pui .mb-10 { margin-bottom: var(--space-10) !important; }
.pui .mb-12 { margin-bottom: var(--space-12) !important; }
.pui .mb-14 { margin-bottom: var(--space-14) !important; }
.pui .mb-16 { margin-bottom: var(--space-16) !important; }
.pui .mb-2 { margin-bottom: var(--space-2) !important; }
.pui .mb-20 { margin-bottom: var(--space-20) !important; }
.pui .mb-4 { margin-bottom: var(--space-4) !important; }
.pui .mb-6 { margin-bottom: var(--space-6) !important; }
.pui .mb-8 { margin-bottom: var(--space-8) !important; }
.pui .minw-0 { min-width: 0px !important; }
.pui .minw-120 { min-width: 120px !important; }
.pui .minw-150 { min-width: 150px !important; }
.pui .minw-170 { min-width: 170px !important; }
.pui .minw-220 { min-width: 220px !important; }
.pui .minw-260 { min-width: 260px !important; }
.pui .minw-320 { min-width: 320px !important; }
.pui .ml-16 { margin-left: var(--space-16) !important; }
.pui .ml-6 { margin-left: var(--space-6) !important; }
.pui .ml-8 { margin-left: var(--space-8) !important; }
.pui .mt-0 { margin-top: 0 !important; }
.pui .mt-10 { margin-top: var(--space-10) !important; }
.pui .mt-12 { margin-top: var(--space-12) !important; }
.pui .mt-14 { margin-top: var(--space-14) !important; }
.pui .mt-16 { margin-top: var(--space-16) !important; }
.pui .mt-2 { margin-top: var(--space-2) !important; }
.pui .mt-20 { margin-top: var(--space-20) !important; }
.pui .mt-4 { margin-top: var(--space-4) !important; }
.pui .mt-6 { margin-top: var(--space-6) !important; }
.pui .mt-8 { margin-top: var(--space-8) !important; }
.pui .nowrap { white-space: nowrap !important; }
.pui .overflow-x-auto { overflow-x: auto !important; }
.pui .pb-2 { padding-bottom: var(--space-2) !important; }
.pui .pb-4 { padding-bottom: var(--space-4) !important; }
.pui .pl-16 { padding-left: var(--space-16) !important; }
.pui .pl-8 { padding-left: var(--space-8) !important; }
.pui .pr-8 { padding-right: var(--space-8) !important; }
.pui .pre-wrap { white-space: pre-wrap !important; }
.pui .pt-0 { padding-top: 0 !important; }
.pui .pt-14 { padding-top: var(--space-14) !important; }
.pui .pt-2 { padding-top: var(--space-2) !important; }
.pui .pt-4 { padding-top: var(--space-4) !important; }
.pui .ta-left { text-align: left !important; }
.pui .ta-right { text-align: right !important; }
.pui .w-130 { width: 130px !important; }
.pui .w-160 { width: 160px !important; }
.pui .w-180 { width: 180px !important; }
.pui .w-240 { width: 240px !important; }
.pui .w-70 { width: 70px !important; }
.pui .w-90 { width: 90px !important; }
.pui .w-auto { width: auto !important; }
.pui .w-full { width: 100% !important; }
.pui .w-min { width: 1% !important; }
.pui .wrap-anywhere { overflow-wrap: anywhere !important; }

/* ---------------------------------------------------------------- data-driven values
 *
 * ADR-0027 Stage 7. What was left inline once the layout moved to the classes above is a
 * handful of values that come FROM DATA — a bar's share of a total, a chart's measured height,
 * a vendor's brand colour, how deep a department sits, which rows of a long console are drawn.
 * Those cannot be a class; they arrive as custom properties on the element (`style={{ '--bar-w':
 * … }}`) and the rule below reads them — ALWAYS WITH A FALLBACK, so an element drawn without
 * its data (a design artboard, a first render) shows the neutral case rather than an absence. The ratchet in shared-ui-baseline-ratchets.test.ts allows a
 * style object ONLY of custom properties with COMPUTED values — a literal there would be a
 * design value smuggled past it, and fails.
 */
.pui .spk { height: var(--spark-h, 2px); }
.pui .bar-fill,
.pui .bar i { width: var(--bar-w, 0%); }
.pui .lchip.box { background: var(--chip-fill, var(--panel-2)); border-color: var(--chip-stroke, var(--line)); }
/* A vendor's brand colour, only on an icon that names one (`.brand`). */
.pui .icon.brand { background: var(--brand-bg, var(--ink-2)); }
.pui .org-dept {
  margin-bottom: var(--space-14);
  margin-left: calc(var(--depth, 0) * 18px);
}
.pui .run-rows {
  padding-top: var(--pad-top, 0);
  padding-bottom: var(--pad-bottom, 0);
}
/* The note under the executor picker sits tight to it — the one negative step on purpose. */
.pui .remote-note {
  margin-top: calc(-1 * var(--space-6));
  margin-bottom: var(--space-12);
}
/* Desktop pages (apps/desktop), which render inside the same `.pui` shell. */
.pui .kv-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-6) var(--space-12);
  font-size: var(--text-sm);
}
.pui .machine-box {
  margin-top: var(--space-12);
  padding: var(--space-12);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.pui .chart-svg {
  width: 100%;
  height: var(--chart-h, auto);
  max-height: var(--chart-max, none);
}
.pui .meter {
  display: inline-block;
  width: 52px;
  height: 6px;
  border-radius: var(--radius-xs);
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.pui .meter-fill {
  display: block;
  width: var(--meter-w, 0%);
  height: 100%;
  background: var(--accent);
}
.pui .meter-fill.err { background: var(--err); }


/* ---------------------------------------------------------------- from the desktop's stylesheet
 *
 * ADR-0027 Stage 7: the desktop-leak ratchet at 0. These were global rules in
 * apps/desktop/src/renderer/styles.css that named a class shared screens render, so the desktop
 * drew those screens with declarations a browser never saw. They are HERE now, verbatim, as
 * `.pui :where(<the old selector>)` — and `:where()` is the whole trick: it keeps each rule at
 * the specificity it had there (one class), so wherever a shared `.pui` rule already set a
 * property it still wins exactly as it did on the desktop, and the desktop renders as before.
 * What changes is the web, which now gets the properties only the desktop had: the direction
 * every stage of this redesign has moved the two surfaces. Each rule's own comment came with it.
 *
 * The window's drag regions are among them. `-webkit-app-region` does nothing in a browser.
 *
 * FIVE VALUES CHANGED ON THE WAY, because this sheet is the palette's and that one was not: a
 * literal shadow and a literal scrim became `--shadow` and `--scrim`, which follow the scheme,
 * and three literal radii became the steps they already equalled (8, 12, 999px).
 */
.pui :where(button.primary) {
  background: var(--accent);
  border-color: var(--accent);
  /* White until 2026-09-07, which was right in light and wrong in dark: `--accent` is a
     pale blue there and white text sank into it. The palette owns the pairing now. */
  color: var(--on-accent);
}
.pui :where(button.danger) {
  color: var(--err);
}
/* Visually hidden, still read aloud — for a sentence that names what a live region is
   waiting on. Declared here as well as in the `.pui`-scoped stylesheet, because the screens
   that have not moved to packages/product-ui need it too and must not reach into a scope
   they are not inside. */
.pui :where(.vh) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.pui :where(.segmented button.active) {
  background: var(--panel);
  color: var(--ink);
  font-weight: 550;
  box-shadow: var(--shadow);
}
.pui :where(.card) {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}
.pui :where(.card h2) {
  font-size: var(--text-md);
  margin: 0 0 10px;
}
.pui :where(.card .sub) {
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.pui :where(.row) {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.pui :where(.spread) {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.pui :where(.grid2) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pui :where(.grid3) {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.pui :where(.pill) {
  display: inline-block;
  font-size: var(--text-2xs);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.pui :where(.pill.ok) {
  color: var(--ok-ink);
  border-color: var(--ok);
}
.pui :where(.pill.err) {
  color: var(--err);
  border-color: var(--err);
}
.pui :where(.pill.warn) {
  color: var(--warn-ink);
  border-color: var(--warn);
}
.pui :where(.banner) {
  border: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: var(--text-sm);
}
.pui :where(.banner.err) {
  border-color: var(--err);
  background: color-mix(in srgb, var(--err) 10%, transparent);
}
.pui :where(td.mono) {
  font-family: var(--mono);
  font-size: var(--text-xs);
}
.pui :where(.empty) {
  color: var(--ink-2);
  padding: 24px;
  text-align: center;
}
/* ---------------------------------------------------------------- modal
 *
 * `.scrim` is gone. Every dialog in this app now goes through
 * packages/product-ui/components/Modal.tsx, which renders a native <dialog> — see that
 * file for why a positioned div was not merely uglier but functionally short: no Escape,
 * no focus containment, no focus restoration, and no role for a screen reader to announce.
 * The backdrop is `::backdrop` and the stacking is the top layer, so neither needs a rule
 * about z-index any more.
 *
 * The class name stays `.modal`, so every rule below — and the two drive scripts that
 * query `.modal` — keeps working against the element that replaced the div. */
.pui :where(dialog.modal) {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  /* Not `min(720px, 100%)`: a modal <dialog> is sized against the VIEWPORT, so 100% left it
     edge to edge with no gutter on a narrow window. */
  width: min(720px, calc(100vw - 48px));
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px;
  margin: auto;
}
.pui :where(dialog.modal)::backdrop {
  background: var(--scrim);
}
.pui :where(.modal h2) {
  margin: 0 0 4px;
  font-size: var(--text-xl);
}
/* A label/value list. Written for the board modal, and now also what the task record uses
   -- the same pairs answering the same question, so they should not look like two different
   things depending on which screen you reached them from. */
.pui :where(.modal dl),
.pui :where(.card dl) {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 6px 12px;
  margin: 14px 0;
  font-size: var(--text-sm);
}
.pui :where(.modal dt),
.pui :where(.card dt) {
  color: var(--ink-2);
}
.pui :where(.modal dd),
.pui :where(.card dd) {
  margin: 0;
  overflow-wrap: anywhere;
}
.pui :where(.modal ul) {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  line-height: 1.7;
}
.pui :where(.log) {
  font-family: var(--mono);
  font-size: var(--text-xs);
  line-height: 1.65;
  max-height: 240px;
  overflow-y: auto;
}
.pui :where(.log div) {
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}
.pui :where(.analysis .tables button.active) {
  background: var(--panel-2);
}
.pui :where(.analysis .tables button .sub) {
  font-size: var(--text-2xs);
}
/* ---------------------------------------------------------------- filters */
/* The board's narrowing controls, boxed so they read as one instrument rather than as
   stray dropdowns floating above the lanes -- the same shape the web board uses. */
.pui :where(.filters) {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.pui :where(.filters input[type='search']) {
  margin-bottom: 12px;
}
/* The global `label` is a stacked form field with a bottom margin. Inside a filter row it
   is a column in a flex line instead, so the margin goes and a floor width stops "Any"
   collapsing a select to nothing. */
.pui :where(.filters .row label) {
  margin-bottom: 0;
  flex: 1 1 150px;
  min-width: 130px;
  /* Capped, or the filter that wraps onto a second row is the only item there and grows to
     the full width -- one enormous select under six ordinary ones. */
  max-width: 200px;
}
/* Clear sits on the baseline of the selects, not of their captions. */
.pui :where(.filters .row > button) {
  align-self: flex-end;
}
/* A button that reads as prose -- for an action offered inside a sentence, where a real
   button would break the line it is explaining. */
.pui :where(.link) {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  width: auto;
}
.pui :where(.board) {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pui :where(.board section) {
  min-width: 0;
}
.pui :where(.board h2) {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin: 0 0 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.pui :where(.board .cards) {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pui :where(.board .card.task) {
  text-align: left;
  width: 100%;
  padding: 10px;
  margin: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pui :where(.board .card.task .title) {
  font-weight: 550;
  line-height: 1.35;
}
.pui :where(.board .card.task:hover) {
  border-color: var(--accent);
}
/* Dashboard stat row. Tabular numerals so the digits line up between cards, and a wrapping
   grid rather than fixed columns so four stats do not become a horizontal scroll on a
   narrow window. */
.pui :where(.stats) {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.pui :where(.stat) {
  min-width: 96px;
}
.pui :where(.statv) {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pui :where(.statv.err) {
  color: var(--err);
}
/* Section switcher inside a page. Wraps rather than scrolls, because six of these on a
   narrow window is a normal case and a hidden seventh tab is not. */
.pui :where(.tabs) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* THE DRAG REGIONS. The window moves by the sidebar's top strip and by any empty part of the
   toolbar. EVERY control inside one is no-drag, or pressing it would move the window instead —
   desktop-shell.test.tsx reads this rule and checks each control against it. */
.pui :where(.sidebar-strip),
.pui :where(.win-toolbar) {
  -webkit-app-region: drag;
  user-select: none;
}
.pui :where(.sidebar-strip button),
.pui :where(.sidebar-strip input),
.pui :where(.sidebar-strip select),
.pui :where(.sidebar-strip a),
.pui :where(.win-toolbar button),
.pui :where(.win-toolbar input),
.pui :where(.win-toolbar select),
.pui :where(.win-toolbar a),
.pui :where(.win-toolbar [role='menu']) {
  -webkit-app-region: no-drag;
}

/* ---------------------------------------------------------------- team
 *
 * THE TEAM SCREEN (2026-09-26) — Org and Employees as one page. Written for it because the
 * founder's report was specific: "when I am clicking any button, the UI is very broken. The
 * boxes are misaligned". The cause was structural, not a colour: forms opened INSIDE table
 * cells (a hire form, a skills editor, a release reason, all in one `<td>`), and the editor's
 * `.form-grid` had no rule at all. So nothing here is a table. People are cards in a wrapping
 * grid; a member, and a skill, open in a side panel (a `<dialog>` through the one Modal, pinned
 * to the right); adding someone is a stepped dialog. Every field is a caption over a
 * full-width control, and every row of buttons is a flex row that wraps.
 */
.pui .team .grow { flex: 1 1 auto; min-width: 0; }
.pui .team-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-12);
}
/* The tab row is the grammar's pill Seg (page.css `.sv-seg`, wow W4 EN3): it wraps between tabs
   when they don't fit (prompt 07 D18, which overrides Q25's scrolling row). Its buttons take `.pui .en3 .sv-seg button` (07); here only the
   count chip inside a tab. */
.pui .team-tabs .team-n { margin-left: var(--space-6); }
.pui .team-n {
  font-size: var(--text-2xs); background: var(--pill); color: var(--ink-2);
  padding: 1px 7px; border-radius: var(--radius-pill);
}
.pui .team-tabs button[aria-selected="true"] .team-n { background: var(--accent-soft); color: var(--accent-ink); }
.pui .team-field { width: 100%; box-sizing: border-box; font: inherit; }
.pui .team-search { flex: 1 1 280px; max-width: 420px; }

/* Members and teams are rows of one list card now (wow W4 EN3), not a grid of bordered cards. */
.pui .team .team-could { display: flex; flex-direction: column; gap: var(--space-10); }
.pui .team .team-empty-acts { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-10); }
.pui .team .team-empty-acts > p { margin: 0; }
.pui .team .sv-li-btn > .sv-persona { margin-top: 2px; }
.pui .team-who { display: flex; align-items: center; gap: var(--space-10); }
.pui .team-who b { display: block; font-size: var(--text-md); }
.pui .team-av {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-grid;
  place-items: center; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: var(--text-sm);
}
.pui .team-status {
  flex: none; font-size: var(--text-2xs); font-weight: 600; padding: 2px 8px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--ink-2);
}
.pui .team-status.on { color: var(--ok-ink); background: var(--ok-soft); border-color: var(--ok-line); }
.pui .team-status.off { color: var(--warn-ink); background: var(--warn-soft); border-color: var(--warn-line); }
.pui .team-meta { display: block; color: var(--ink-2); font-size: var(--text-xs); }
.pui span.team-meta:where(.team-subh *, .team-item *, h2 *) { display: inline; }
.pui .team-purpose {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pui .team-chips { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.pui .team-chip {
  font-size: var(--text-2xs); padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--pill); color: var(--ink);
}
.pui .team-chip.spec { background: var(--info-soft); color: var(--info); }
.pui .team-chip.more { color: var(--ink-2); }

.pui .team-empty {
  text-align: center; padding: var(--space-32) var(--space-24); background: var(--panel);
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
}
.pui .team-empty h2 { font-size: var(--text-xl); margin: 0 0 var(--space-8); }
.pui .team-empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto var(--space-16); }
.pui .team-empty-line { color: var(--ink-2); margin: var(--space-8) 0; }
/* The whole catalogue at once (2026-10-11): a count, two buttons, and a confirm with the reason. */
.pui .team-hireall-row { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-8); }
.pui .team-hireall-confirm { margin-top: var(--space-12); padding: var(--space-12); border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--panel-2); }
.pui .team-subh {
  display: flex; align-items: baseline; gap: var(--space-8); font-size: var(--text-lg);
  margin: 0 0 var(--space-10);
}
.pui .team-hint {
  display: flex; gap: var(--space-10); align-items: flex-start; padding: var(--space-10) var(--space-12);
  margin-bottom: var(--space-14); background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--ink);
}
.pui .team-hint > span:first-child {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid;
  place-items: center; background: var(--accent); color: var(--on-accent);
  font-size: var(--text-2xs); font-weight: 700;
}
.pui .team-bar { align-items: center; margin-bottom: var(--space-10); }

.pui .team-roles {
  display: grid; gap: var(--space-10);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.pui .team-role-wrap { display: flex; }
.pui button.team-role,
.pui .team-role {
  flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: var(--space-4);
  text-align: left; padding: var(--space-12); background: var(--panel); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-md); font-size: var(--text-sm);
}
.pui .team-role > span:not(.team-meta) { color: var(--ink-2); }
.pui button.team-role:hover:not(:disabled) { border-color: var(--accent-line); }
.pui button.team-role.on { border-color: var(--accent); background: var(--accent-soft); }
.pui .team-role.off { background: var(--panel-2); }
.pui .team-role.off summary { font-size: var(--text-xs); color: var(--ink-2); cursor: pointer; }

.pui .team-list {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel);
  overflow: hidden;
}
.pui .team-item {
  display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-12) var(--space-14);
  border-top: 1px solid var(--line);
}
.pui .team-item:first-child { border-top: 0; }
.pui .team-tag {
  display: inline-block; font-size: var(--text-2xs); padding: 1px 7px; margin-left: var(--space-4);
  border-radius: var(--radius-pill); background: var(--pill); color: var(--ink-2);
  vertical-align: middle;
}
.pui .team-tag.ours { background: var(--ok-soft); color: var(--ok-ink); }

/* The two dialogs. `[open]` on the display rule, because a closed <dialog> is display:none
   by the UA and a class rule saying `flex` would draw it anyway. */
.pui dialog.modal.team-dialog,
.pui dialog.modal.team-drawer { padding: 0; overflow: hidden; }
.pui dialog.modal.team-dialog[open],
.pui dialog.modal.team-drawer[open] { display: flex; flex-direction: column; }
/* A steady height, so the box does not jump between the add dialog's three steps. */
.pui dialog.modal.team-dialog {
  width: min(680px, calc(100vw - 32px)); max-height: 88vh; min-height: min(560px, 88vh);
}
.pui dialog.modal.team-drawer {
  width: min(480px, 100vw); height: 100vh; max-height: 100vh; margin: 0 0 0 auto;
  border-radius: 0; border-width: 0 0 0 1px;
}
.pui .team-dh { padding: var(--space-16) var(--space-20); border-bottom: 1px solid var(--line); }
.pui .team-dh h2 { margin: 0; font-size: var(--text-xl); }
.pui .team-dh .spread { align-items: center; }
.pui .team-db {
  flex: 1 1 auto; overflow-y: auto; padding: var(--space-16) var(--space-20);
  display: flex; flex-direction: column; gap: var(--space-14);
}
.pui .team-df {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-10);
  flex-wrap: wrap; padding: var(--space-12) var(--space-20); border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.pui button.team-x {
  flex: none; width: 30px; height: 30px; padding: 0; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--ink-2);
  font-size: var(--text-xl); line-height: 1;
}
.pui button.team-x:hover:not(:disabled) { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.pui button.team-link {
  background: none; border: 0; padding: 0 var(--space-4); color: var(--accent-ink);
  text-decoration: underline; font-size: var(--text-sm); align-self: flex-start;
}
.pui .team-steps {
  display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); list-style: none;
  margin: var(--space-12) 0 0; padding: 0; font-size: var(--text-sm); color: var(--ink-2);
}
.pui .team-steps li { display: flex; align-items: center; gap: var(--space-6); }
.pui .team-steps b {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line); font-size: var(--text-2xs);
}
.pui .team-steps li.on { color: var(--ink); font-weight: 600; }
.pui .team-steps li.on b { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.pui .team-steps li.done b { border-color: var(--ok); color: var(--ok-ink); }
.pui .team-why { color: var(--ink-2); font-size: var(--text-sm); margin: 0; }
.pui .team-count {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8);
  color: var(--ink-2); font-size: var(--text-xs); margin: 0;
}
.pui .team-warn { color: var(--err); font-size: var(--text-sm); margin: 0; }
.pui .team-note { color: var(--warn-ink); font-size: var(--text-xs); margin: var(--space-6) 0 0; }
.pui label.team-label { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; }
.pui label.team-label > span:first-child { font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); margin: 0; }
.pui .team-form {
  display: grid; gap: var(--space-12); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.pui .team-form .team-wide { grid-column: 1 / -1; }
.pui .team-sec { display: flex; flex-direction: column; gap: var(--space-6); }
.pui .team-cap {
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2);
}
.pui .team-skills { display: flex; flex-direction: column; gap: var(--space-6); }
.pui .team-skill {
  display: flex; align-items: center; gap: var(--space-8); padding: var(--space-6) var(--space-10);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
}
.pui .team-skill select { width: auto; }
.pui .team-row-btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-8); }
.pui .team-confirm {
  display: flex; flex-direction: column; gap: var(--space-10); padding: var(--space-12);
  border: 1px solid var(--err-line); background: var(--err-soft); border-radius: var(--radius-sm);
}
.pui .team-details summary { cursor: pointer; font-size: var(--text-sm); color: var(--ink-2); }
.pui .team-dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-4) var(--space-12); margin: var(--space-8) 0 0; font-size: var(--text-sm); }
.pui .team-dl dt { color: var(--ink-2); }
.pui .team-dl dd { margin: 0; }
.pui .team-pre {
  white-space: pre-wrap; margin: 0; padding: var(--space-10) var(--space-12); font-size: var(--text-sm);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  max-height: 40vh; overflow: auto;
}
.pui .team-fieldset {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-10) var(--space-12);
  margin: 0; display: flex; flex-direction: column; gap: var(--space-6);
}
.pui .team-fieldset legend { font-size: var(--text-xs); color: var(--ink-2); padding: 0 var(--space-4); }
.pui label.team-check { display: flex; align-items: center; gap: var(--space-8); margin: 0; font-size: var(--text-sm); }


/* The Org screen's position rows, as Team's Company setup tab shows them (2026-09-26). The
   row's buttons are one gapped group that never wraps a single control onto its own line;
   the gate-5 reason is a full-width row of its own under the position, so typing it no
   longer widens the actions column and pushes the table sideways. */
.pui .org-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.pui tr.org-confirm td { background: var(--accent-soft); border-top: 0; }
.pui .org-confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.pui .org-confirm-row input { flex: 1 1 280px; }

/* Teams of people (2026-09-26): a team's badge is a rounded square so it never reads as a
   person's round avatar; a card shows its members as a small overlapping stack; a member row
   in a team panel is one button — avatar, name, title and what they own there. */
.pui .team-av-sq { border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); }
.pui .team-av.sm { width: 30px; height: 30px; font-size: var(--text-2xs); }
.pui .team-av.xs {
  width: 24px; height: 24px; font-size: var(--text-2xs); border: 2px solid var(--panel);
  margin-left: -6px;
}
.pui .team-av.xs:first-child { margin-left: 0; }
.pui .team-av.xs.more { background: var(--pill); color: var(--ink-2); }
.pui .team-faces { display: flex; align-items: center; min-height: 24px; }
.pui button.team-person {
  display: flex; align-items: flex-start; gap: var(--space-10); width: 100%; text-align: left;
  padding: var(--space-8) var(--space-10); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.pui button.team-person:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
.pui button.team-person b { margin-right: var(--space-4); }
.pui .team-resp {
  display: block; margin-top: var(--space-4); font-size: var(--text-sm); color: var(--ink);
  padding-left: var(--space-8); border-left: 2px solid var(--accent-line);
}
.pui .team-duties { margin: 0; padding-left: var(--space-20); display: flex; flex-direction: column; gap: var(--space-4); }
.pui .team-member-edit {
  display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-10);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
}
.pui .team-member-edit .team-check { font-size: var(--text-xs); color: var(--ink-2); }
.pui .team-addrow { display: flex; gap: var(--space-8); }
.pui .team-addrow .team-field { flex: 1 1 auto; }
.pui .team-starters {
  display: grid; gap: var(--space-10); text-align: left; max-width: 760px; margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.pui button.team-starter {
  display: flex; flex-direction: column; gap: var(--space-4); text-align: left;
  padding: var(--space-12); background: var(--panel); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-md); font-size: var(--text-sm);
}
.pui button.team-starter span { color: var(--ink-2); }
.pui button.team-starter:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.pui button.team-starter.blank { border-style: dashed; }

/* Knowledge (2026-09-26): each item's kind is a small labelled badge — a note, a link and a
   file look different at a glance, with words rather than icons nobody has learned; the
   add dialog's kind switch is a segmented control, not three separate forms. */
.pui button.team-item.team-kb {
  width: 100%; text-align: left; background: var(--panel); color: var(--ink); border: 0;
  border-top: 1px solid var(--line); border-radius: 0;
}
.pui .team-list > button.team-item.team-kb:first-child { border-top: 0; }
.pui button.team-item.team-kb:hover:not(:disabled) { background: var(--accent-soft); }
.pui .team-kb b { margin-right: var(--space-4); }
.pui .team-kind {
  flex: none; min-width: 42px; text-align: center; font-size: var(--text-2xs); font-weight: 700;
  padding: 3px 6px; border-radius: var(--radius-xs); background: var(--pill); color: var(--ink-2);
}
.pui .team-kind.k-note { background: var(--accent-soft); color: var(--accent-ink); }
.pui .team-kind.k-link { background: var(--ok-soft); color: var(--ok-ink); }
.pui .team-kind.k-file { background: var(--warn-soft); color: var(--warn-ink); }
.pui .team-excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: var(--space-4) 0; font-size: var(--text-sm); color: var(--ink-2);
}
.pui label.team-inline { display: flex; align-items: center; gap: var(--space-8); margin: 0; }
.pui label.team-check.off { color: var(--ink-2); opacity: .7; }
.pui .team-seg {
  display: inline-flex; gap: var(--space-2); padding: var(--space-4); margin-top: var(--space-12);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.pui .team-seg button {
  border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px;
  border-radius: var(--radius-sm); font-weight: 500;
}
.pui .team-seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.pui a.team-url { color: var(--accent-ink); word-break: break-all; }


/* Org on the page grammar (wow W4 EN3): its department and knowledge cards sit in the page's
   18 px gap, so the old card margin goes (it doubled the rhythm). */
.pui .en3 .org-dept, .pui .en3[data-screen="org"] > .card { margin: 0; }
/* ------------------------------------------------------------------ analysis threads
 * A list of threads beside the open one, and the open one reading top to bottom like a
 * conversation: question, picture, what it means, then the next direction. */
.pui.threads { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-16); align-items: start; }
.pui .threads-list { position: sticky; top: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.pui .threads-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pui .threads-list li { display: flex; align-items: flex-start; gap: var(--space-4); border-radius: var(--radius-sm); }
.pui .threads-list li.active { background: var(--accent-soft); }
.pui .threads-list li > button:first-child { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: var(--space-6) var(--space-8); }
.pui .threads-list .t { color: var(--ink); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pui .threads-list .del { padding: var(--space-6); opacity: .5; }
.pui .threads-list .del:hover { opacity: 1; color: var(--err); }
.pui .threads-main { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.pui .threads-head h2 { margin: 0; }
.pui .threads-setup .row { flex-wrap: wrap; }
.pui .turn h3 { margin: 0; font-size: var(--text-md); }
.pui .turn-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--text-xs); margin-right: var(--space-4); }
.pui .turn-chart { margin: var(--space-8) 0; }
.pui .turn .big { font-size: var(--text-2xl); font-weight: 600; margin: var(--space-8) 0; color: var(--ink); }
.pui .turn .narrative { border-left: 3px solid var(--accent-line); padding-left: var(--space-10); white-space: pre-wrap; color: var(--ink); }
.pui .turn .disclose { margin: var(--space-4) 0; padding-left: var(--space-16); }
.pui .turn-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pui .turn-table table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.pui .turn-table th, .pui .turn-table td { padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--line); text-align: left; }
.pui .turn-table td { font-variant-numeric: tabular-nums; }
.pui .turn .sql { max-height: 240px; overflow: auto; font-size: var(--text-2xs); white-space: pre-wrap; background: var(--panel-2); padding: var(--space-8); border-radius: var(--radius-sm); }
.pui .threads-compose { position: sticky; bottom: 0; display: flex; gap: var(--space-8); align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-8); }
.pui .threads-compose textarea { flex: 1; resize: vertical; }
/* AT PHONE WIDTH THE QUESTION TAKES THE ROW (wow W4 r4, C1 at 360): beside "Ask" and "Break it
   down" the textarea was a ~93 px sliver with its placeholder cut. It wraps to its own row; the
   buttons sit on the row below, from the start. Two rows tall, it no longer sticks to the
   window's bottom edge either: stuck there at 360 it covered the answer box above it (wow 07
   D20), so on a narrow window it sits in the flow, under the answer. */
@media (max-width: 820px) {
  .pui .threads-compose { position: static; flex-wrap: wrap; justify-content: flex-start; }
  .pui .threads-compose textarea { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 760px) { .pui.threads { grid-template-columns: 1fr; } .pui .threads-list { position: static; } }
.pui .turn.brief { border-color: var(--accent-line); background: var(--accent-soft); }
/* ---------------------------------------------------------------- the analytics workbench
 *
 * ADR-0036. Tabs across the top, the sources rail on the left, the thread of steps in the
 * middle with the composer under it. Tokens only; the segmented control is its own `.wb-seg`
 * because the base `.segmented` rule lives in the desktop's own stylesheet, and a global rule
 * there must not reach shared markup (shared-ui-baseline-ratchets.test.ts). */
.pui .wb { display: flex; flex-direction: column; gap: var(--space-10); min-width: 0; }
.pui .wb-seg {
  display: inline-flex; gap: 2px; padding: 3px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-md);
}
.pui .wb-seg button {
  border: 0; background: none; color: var(--ink-2); padding: 4px 12px;
  border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer;
}
.pui .wb-seg button.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.pui .wb-tabs {
  display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--line);
  overflow-x: auto; min-height: 36px;
}
.pui .wb-tab {
  display: flex; align-items: center; gap: 2px; border: 1px solid transparent;
  border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--panel-2);
  max-width: 240px; flex: 0 0 auto;
}
.pui .wb-tab[data-active] { background: var(--panel); border-color: var(--line); margin-bottom: -1px; }
.pui .wb-tab-btn {
  display: flex; align-items: center; gap: var(--space-6); border: 0; background: none;
  color: var(--ink-2); font-size: var(--text-sm); padding: 6px 4px 6px 10px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px;
}
.pui .wb-tab[data-active] .wb-tab-btn { color: var(--ink); font-weight: var(--weight-medium); }
.pui .wb-tab-close, .pui .wb-tab-new {
  border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 4px 8px;
  font-size: var(--text-md); border-radius: var(--radius-xs);
}
.pui .wb-tab-close:hover, .pui .wb-tab-new:hover { background: var(--panel-2); color: var(--ink); }
.pui .wb-tab-rename { font-size: var(--text-sm); padding: 2px 6px; margin: 4px; width: 180px; }
.pui .wb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.pui .wb-tab[data-state="running"] .wb-dot { background: var(--warn); }
.pui .wb-tab[data-state="done"] .wb-dot { background: var(--ok); }
.pui .wb-tab[data-state="failed"] .wb-dot { background: var(--err); }
.pui .wb-tabs-fill { flex: 1 1 auto; }
.pui .wb-tray { position: relative; align-self: center; font-size: var(--text-sm); color: var(--ink-2); }
.pui .wb-tray summary { cursor: pointer; padding: 4px 8px; list-style: none; display: flex; gap: 6px; align-items: center; }
.pui .wb-tray ul {
  position: absolute; right: 0; top: 100%; z-index: var(--z-dropdown); margin: 4px 0 0; padding: 6px;
  list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 260px; max-height: 320px; overflow: auto;
}
.pui .wb-tray li { display: flex; justify-content: space-between; gap: var(--space-8); padding: 4px 6px; }
.pui .wb-banner {
  display: flex; justify-content: space-between; gap: var(--space-8); padding: var(--space-8) var(--space-12);
  border: 1px solid var(--err-line); background: var(--err-soft); color: var(--err-strong);
  border-radius: var(--radius-md); font-size: var(--text-sm);
}
.pui .wb-body { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: var(--space-16); }
@media (max-width: 900px) { .pui .wb-body { grid-template-columns: minmax(0, 1fr); } }
.pui .wb-rail {
  border-right: 1px solid var(--line); padding-right: var(--space-12); font-size: var(--text-sm);
  max-height: calc(100vh - 220px); overflow: auto;
}
.pui .wb-rail h3 { font-size: var(--text-xs); color: var(--ink-2); font-weight: var(--weight-medium); margin: var(--space-12) 0 var(--space-4); }
.pui .wb-rail ul { list-style: none; margin: 0; padding: 0; }
.pui .wb-rail ul ul { padding-left: var(--space-12); }
.pui .wb-rail-row { display: flex; align-items: center; }
.pui .wb-rail-item, .pui .wb-rail-toggle {
  border: 0; background: none; color: var(--ink); text-align: left; padding: 3px 4px; cursor: pointer;
  font-size: var(--text-sm); border-radius: var(--radius-xs); width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pui .wb-rail-toggle { width: auto; color: var(--ink-2); padding: 3px 2px; }
.pui .wb-rail-item:hover { background: var(--panel-2); }
.pui .wb-rail-sub { color: var(--ink-2); font-size: var(--text-2xs); margin-left: 4px; }
.pui .wb-rail-static { padding: 3px 4px; }
.pui .wb-cols .wb-rail-item { font-family: var(--font-mono); font-size: var(--text-xs); }
.pui .wb-main { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.pui .wb-thread { display: flex; flex-direction: column; gap: var(--space-10); }
.pui .wb-empty { padding: var(--space-24); border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; }
.pui .wb-empty p { color: var(--ink-2); max-width: 520px; margin: var(--space-8) auto var(--space-16); }
.pui .wb-step {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel);
  padding: var(--space-10) var(--space-12); display: flex; flex-direction: column; gap: var(--space-8);
}
.pui .wb-step[data-status="running"] { border-color: var(--info-line); }
.pui .wb-step[data-status="failed"], .pui .wb-step[data-status="interrupted"] { border-color: var(--err-line); }
.pui .wb-step-head { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.pui .wb-step-no {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--panel-2); color: var(--ink-2); font-size: var(--text-2xs);
}
.pui .wb-step-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-medium); }
.pui .wb-step-meta { display: flex; align-items: center; gap: var(--space-8); color: var(--ink-2); font-size: var(--text-xs); flex: 0 0 auto; }
.pui .wb-source { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pui .wb-sql-view, .pui .wb-json {
  margin: 0; padding: var(--space-8) var(--space-10); background: var(--panel-2); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-xs); white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto;
}
.pui .wb-how summary { cursor: pointer; color: var(--ink-2); font-size: var(--text-sm); }
.pui .wb-how h4 { font-size: var(--text-xs); color: var(--ink-2); margin: var(--space-8) 0 var(--space-4); font-weight: var(--weight-medium); }
.pui .wb-note { color: var(--ink-2); font-size: var(--text-sm); margin: 0; }
.pui .wb-follows { color: var(--ink-2); font-size: var(--text-sm); margin: 0; display: flex; gap: var(--space-8); align-items: center; }
.pui .wb-error { color: var(--err-strong); background: var(--err-soft); border-radius: var(--radius-sm); padding: var(--space-6) var(--space-10); font-size: var(--text-sm); margin: 0; }
.pui .wb-code { font-family: var(--font-mono); font-size: var(--text-xs); }
.pui .wb-running { display: flex; align-items: center; gap: var(--space-8); color: var(--ink-2); font-size: var(--text-sm); }
.pui .wb-spinner {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent);
  animation: wb-spin 0.8s linear infinite; display: inline-block; flex: 0 0 auto;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pui .wb-spinner { animation: none; border-top-color: var(--warn); } }
.pui .wb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.pui .wb-remove { margin-left: auto; color: var(--err); }
.pui .wb-result { display: flex; flex-direction: column; gap: var(--space-6); }
.pui .wb-result-bar { display: flex; align-items: center; gap: var(--space-10); }
.pui .wb-meta { color: var(--ink-2); font-size: var(--text-xs); }
.pui .wb-table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pui .wb-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.pui .wb-table th, .pui .wb-table td { padding: 4px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pui .wb-table th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.pui .wb-table [data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.pui .wb-table td[data-null] { color: var(--ink-2); }
.pui .wb-th { border: 0; background: none; color: var(--ink-2); font-weight: var(--weight-medium); cursor: pointer; padding: 0; font-size: var(--text-xs); }
.pui .wb-more { margin: var(--space-6); }
.pui .wb-kpi { display: flex; flex-direction: column; gap: 2px; padding: var(--space-12) var(--space-16); background: var(--panel-2); border-radius: var(--radius-md); align-self: flex-start; }
.pui .wb-kpi-label { color: var(--ink-2); font-size: var(--text-xs); }
.pui .wb-kpi-value { font-size: var(--text-2xl); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.pui .wb-chart { margin: 0; }
.pui .wb-chart svg { width: 100%; height: auto; max-height: 260px; }
.pui .wb-axis { stroke: var(--line); }
.pui .wb-tick { fill: var(--ink-2); font-size: var(--text-2xs); }
.pui .wb-chart rect.wb-s0 { fill: var(--accent); }
.pui .wb-chart rect.wb-s1 { fill: var(--ok); }
.pui .wb-chart rect.wb-s2 { fill: var(--warn); }
.pui .wb-line { fill: none; stroke-width: 2; }
.pui .wb-line.wb-s0 { stroke: var(--accent); }
.pui .wb-line.wb-s1 { stroke: var(--ok); }
.pui .wb-line.wb-s2 { stroke: var(--warn); }
.pui .wb-legend { display: flex; gap: var(--space-12); font-size: var(--text-xs); color: var(--ink-2); }
.pui .wb-swatch { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-xs); margin-right: 4px; vertical-align: -1px; }
.pui .wb-swatch.wb-s0 { background: var(--accent); }
.pui .wb-swatch.wb-s1 { background: var(--ok); }
.pui .wb-swatch.wb-s2 { background: var(--warn); }
/* NOT STICKY. A composer pinned over a long thread covered the step it had just added, and
   the result under it read as if it belonged below the composer (found driving the app). */
.pui .wb-composer {
  background: var(--panel); border: 1px solid var(--accent-line);
  border-radius: var(--radius-md); padding: var(--space-10) var(--space-12); display: flex;
  flex-direction: column; gap: var(--space-8); box-shadow: var(--shadow);
}
.pui .wb-composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
.pui .wb-composer textarea, .pui .wb-edit textarea {
  width: 100%; box-sizing: border-box; resize: vertical; font-size: var(--text-body); padding: var(--space-8);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink);
  font-family: var(--font-sans);
}
.pui .wb-composer textarea.wb-sql, .pui .wb-edit textarea.wb-sql { font-family: var(--font-mono); font-size: var(--text-sm); }
.pui .wb-field { display: inline-flex; align-items: center; gap: var(--space-6); font-size: var(--text-sm); color: var(--ink-2); }
.pui .wb-field select, .pui .wb-field input { font-size: var(--text-sm); padding: 3px 6px; max-width: 240px; }
.pui .wb-company { display: flex; flex-wrap: wrap; gap: var(--space-10); align-items: center; }
.pui .turn-numbers { display: flex; gap: var(--space-16); flex-wrap: wrap; }
.pui .turn-numbers .big { margin-bottom: 0; }

/* ASK THE PM (chair 2026-10-23, PD11; redesigned by F7 2026-10-24): list · brief · chat.
   Tokens only, so light and dark follow. Every column is minmax(0, …): no column can push the
   page wider than the window (the chat was cut off at 1670 px). The list and the chat are
   sticky and scroll inside themselves; the verdict bar is sticky at the foot of the brief. */
.pui .pmdesk { min-width: 0; }
.pui .pmdesk-cols { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
.pui .pmdesk-list { display: flex; flex-direction: column; min-width: 0; }
.pui .pmdesk-list .pmdesk-rows li { margin-bottom: 0; }
.pui .pmdesk-cols .pmdesk-verdict { position: static; }
.pui .pmdesk-rows { display: flex; flex-direction: column; min-height: 0; }
.pui .pmdesk-rows ul { list-style: none; margin: 0 0 var(--space-10); padding: 0 var(--space-4) 0 0; overflow: auto; min-height: 0; }
.pui .pmdesk-find { display: flex; gap: var(--space-6); margin-bottom: var(--space-10); }
.pui .pmdesk-find input[type="search"] { flex: 1; min-width: 0; }
.pui .pmdesk-rows li { margin-bottom: var(--space-6); }
.pui .pmdesk-rows li button { width: 100%; text-align: left; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-10); font-size: var(--text-sm); cursor: pointer; display: flex; flex-direction: column; gap: var(--space-4); transition: border-color .12s, background .12s, transform .12s; }
.pui .pmdesk-rows li button:hover, .pui .pmdesk-rows li button.kb { border-color: var(--accent-line); background: var(--accent-soft); }
.pui .pmdesk-rows li button.kb { transform: translateX(2px); }
.pui .pmdesk-rows li button:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pui .pmdesk-rows li button.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.pui .pmdesk-row-top { display: flex; align-items: center; gap: var(--space-6); }
.pui .pmdesk-id { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pui .pmdesk-status { background: var(--panel-2); border-radius: var(--radius-pill); padding: 0 var(--space-6); font-size: var(--text-sm); color: var(--ink-2); }
.pui .pmdesk-open { margin-left: auto; color: var(--accent-ink); font-weight: 600; opacity: 0; transition: opacity .12s; }
.pui .pmdesk-rows li button:hover .pmdesk-open, .pui .pmdesk-rows li button.on .pmdesk-open, .pui .pmdesk-rows li button.kb .pmdesk-open, .pui .pmdesk-rows li button:focus-visible .pmdesk-open { opacity: 1; }
.pui .pmdesk-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pui .pmdesk-keys kbd { margin: 0 2px; }
/* The task page's jump box: the rows float under it. */
.pui .pmdesk-jump { position: relative; max-width: 420px; }
.pui .pmdesk-jump .pmdesk-find { margin-bottom: 0; }
.pui .pmdesk-jump .pmdesk-rows { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + var(--space-4)); max-height: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-xl); padding: var(--space-8); }
.pui .pmdesk-brief, .pui .pmdesk-chat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-16); min-width: 0; }
.pui .pmdesk-brief { display: flex; flex-direction: column; gap: var(--space-10); }
.pui .pmdesk-brief h2 { margin: 0; overflow-wrap: anywhere; }
.pui .pmdesk-brief-head p { margin: var(--space-4) 0 0; }
.pui .pmdesk-changed { font-size: var(--text-md); }
.pui .pmdesk-empty { min-height: 200px; justify-content: center; text-align: center; }
.pui .pmdesk-tabs { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pui .pmdesk-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-2); padding: var(--space-8) var(--space-12); font-weight: 600; cursor: pointer; display: inline-flex; gap: var(--space-6); align-items: center; margin-bottom: -1px; }
.pui .pmdesk-tabs button:hover { color: var(--ink); }
.pui .pmdesk-tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.pui .pmdesk-badge { background: var(--panel-2); color: var(--ink-2); border-radius: var(--radius-pill); padding: 0 var(--space-6); font-size: var(--text-sm); font-weight: 500; }
.pui .pmdesk-pane { min-height: 160px; animation: pui-fade-in .15s ease-out; }
.pui .pmdesk-progress { appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: var(--radius-pill); background: var(--panel-2); overflow: hidden; }
.pui .pmdesk-progress::-webkit-progress-bar { background: var(--panel-2); } .pui .pmdesk-progress::-webkit-progress-value { background: var(--ok); } .pui .pmdesk-progress::-moz-progress-bar { background: var(--ok); }
.pui .pmdesk-steps { padding-left: var(--space-20); }
.pui .pmdesk-steps li { margin-bottom: var(--space-8); }
.pui .pmdesk-steps label { display: flex; gap: var(--space-8); align-items: flex-start; cursor: pointer; }
.pui .pmdesk-steps li.ticked span { color: var(--ink-2); text-decoration: line-through; }
.pui .pmdesk-complete { list-style: none; padding: 0; margin: 0; }
.pui .pmdesk-complete li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: var(--space-10); padding: var(--space-8) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.pui .pmdesk-complete .pm-state { font-weight: 600; }
.pui .pmdesk-complete .pm-ok .pm-state { color: var(--ok-ink); }
.pui .pmdesk-complete .pm-missing .pm-state { color: var(--err); }
.pui .pmdesk-complete .pm-unknown .pm-state { color: var(--ink-2); }
.pui .pmdesk-video { width: 100%; border-radius: var(--radius-md); background: var(--panel-2); }
/* F3 + F4: the recording — player, steps, photo, full-size view. Tokens only. */
.pui .pmdesk-media { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.pui .pmdesk-media-bar { display: flex; align-items: center; gap: var(--space-12); flex-wrap: wrap; }
.pui .pmdesk-media-tools { display: flex; align-items: center; gap: var(--space-6); }
/* Under the video, beside Delete — the founder's spot (2026-10-25). */
.pui .pmdesk-speed { width: auto; font-size: var(--text-xs); padding: var(--space-2) var(--space-6); }
.pui .pmdesk-step-text { display: grid; gap: var(--space-2); min-width: 0; }
.pui .pmdesk-step-did { margin: 0; padding-left: var(--space-16); font-size: var(--text-xs); color: var(--ink-2); }
.pui .pmdesk-where { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-12); margin-bottom: var(--space-12); display: grid; gap: var(--space-6); }
.pui .pmdesk-where h4 { margin: 0; font-size: var(--text-sm); }
.pui .pmdesk-where-row { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.pui .pmdesk-where-k { flex: 0 0 5.5rem; font-size: var(--text-xs); color: var(--ink-2); }
.pui .pmdesk-where-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.pui .pmdesk-where-warn { margin: 0; font-size: var(--text-xs); color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: var(--space-6); }
.pui .pmdesk-where-ok { margin: 0; font-size: var(--text-xs); color: var(--ok-ink); }
.pui .pmdesk-media-local { font-size: var(--text-xs); color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-6); }
.pui .pmdesk-media-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-12); }
.pui .pmdesk-media-grid.solo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 720px) { .pui .pmdesk-media-grid { grid-template-columns: minmax(0, 1fr); } }
.pui .pmdesk-media-main { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.pui .pmdesk-media-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-8); }
.pui .pmdesk-media-photo { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); cursor: zoom-in; overflow: hidden; }
.pui .pmdesk-media-photo img { display: block; width: 100%; height: auto; }
.pui .pmdesk-media-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.pui .pmdesk-media-steps li { display: flex; align-items: center; gap: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-6); }
.pui .pmdesk-media-steps li.on { border-color: var(--accent-line); background: var(--accent-soft); }
.pui .pmdesk-media-step { flex: 1; min-width: 0; display: flex; gap: var(--space-8); text-align: left; background: none; border: 0; color: var(--ink); cursor: pointer; padding: var(--space-4); }
.pui .pmdesk-media-at { flex: 0 0 auto; font-family: var(--font-mono); color: var(--ink-2); font-size: var(--text-xs); }
.pui .pmdesk-media-del { font-size: var(--text-xs); padding: var(--space-2) var(--space-6); }
.pui .pmdesk-media-full { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-12); padding: var(--space-16); }
.pui .pmdesk-media-full img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-md); box-shadow: var(--shadow-xl); background: var(--panel); }
.pui .pmdesk-evidence { margin: 0; padding-left: var(--space-16); font-size: var(--text-sm); overflow-wrap: anywhere; }
.pui .pmdesk-verdict { position: sticky; bottom: 0; display: flex; gap: var(--space-10); align-items: center; flex-wrap: wrap; margin: 0 calc(-1 * var(--space-16)) calc(-1 * var(--space-16)); padding: var(--space-12) var(--space-16); background: var(--panel); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.pui .pmdesk-verdict input { flex: 1; min-width: 160px; }
.pui .pmdesk-skel { display: flex; flex-direction: column; gap: var(--space-10); }
.pui .pmdesk-skel div { height: 14px; border-radius: var(--radius-sm); background: var(--panel-2); animation: cpulse 1.4s ease-in-out infinite; }
.pui .pmdesk-skel .w60 { width: 60%; height: 22px; } .pui .pmdesk-skel .w30 { width: 30%; } .pui .pmdesk-skel .w80 { width: 80%; }
.pui .pmdesk-skel .bar { height: 36px; margin: var(--space-6) 0; }
.pui .pmdesk-chat { display: flex; flex-direction: column; gap: var(--space-8); }
.pui .pmdesk-chat.compact { position: static; max-height: 520px; }
.pui .pmdesk-chat-head { display: flex; align-items: center; justify-content: space-between; }
.pui .pmdesk-chips { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.pui .pmdesk-chips .chip { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 4px 10px; font-size: var(--text-sm); cursor: pointer; }
.pui .pmdesk-chips .chip:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
.pui .pmdesk-turns { list-style: none; padding: 0; margin: 0; flex: 1; min-height: 120px; overflow: auto; }
.pui .pmdesk-turns li { padding: var(--space-8) var(--space-10); border-radius: var(--radius-md); margin-bottom: var(--space-6); white-space: pre-wrap; overflow-wrap: anywhere; animation: pui-fade-in .15s ease-out; }
.pui .pmdesk-turns li p { margin: 0 0 var(--space-4); }
.pui .pmdesk-turns .turn-founder { background: var(--accent-soft); margin-left: var(--space-24); }
.pui .pmdesk-turns .turn-pm { background: var(--panel-2); margin-right: var(--space-24); }
.pui .pmdesk-turns .pmdesk-turns-empty, .pui .pmdesk-turns .pmdesk-turns-end { background: none; padding: 0; margin: 0; }
.pui .pmdesk-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.pui .pmdesk-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: cpulse 1s ease-in-out infinite; }
.pui .pmdesk-dots i:nth-child(2) { animation-delay: .15s; } .pui .pmdesk-dots i:nth-child(3) { animation-delay: .3s; }
.pui .pmdesk-compose { display: flex; gap: var(--space-6); align-items: flex-end; }
.pui .pmdesk-compose textarea { flex: 1; min-width: 0; resize: vertical; }
.pui .pmdesk-taskpm { margin-top: var(--space-16); }
@media (prefers-reduced-motion: reduce) { .pui .pmdesk-skel div, .pui .pmdesk-dots i, .pui .pmdesk-pane, .pui .pmdesk-turns li { animation: none; } }

/* ASK THE PM ON THE PAGE GRAMMAR (wow W4 EN1 sheet). The desk is a Workbench: the queue and the
   brief (list, 7) ‖ the chat (artifact, 5), whose answers sit in the ringed AiArtifact. The queue
   is one quiet card of hairline rows (P5), not a grid of bordered boxes; the brief takes the
   card's geometry (P11); the task page's compact chat (TaskDetail) is left as it was. */
.pui .pmdesk.sv-page .pmdesk-controls { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.pui .pmdesk.sv-page .pmdesk-rows ul { display: flex; flex-direction: column; gap: 0; max-height: 320px; margin: 0; padding: 0; }
.pui .pmdesk.sv-page .pmdesk-rows li + li { border-top: 1px solid var(--line); }
.pui .pmdesk.sv-page .pmdesk-rows li button { border: 0; border-radius: var(--radius-card-tight); background: transparent; padding: var(--space-10) var(--space-8); min-height: 40px; }
.pui .pmdesk.sv-page .pmdesk-rows li button.on { box-shadow: inset 3px 0 0 var(--accent); }
.pui .pmdesk.sv-page .pmdesk-rows .sect { padding-bottom: var(--space-6); }
.pui .pmdesk.sv-page .pmdesk-brief { border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 16px 18px; }
.pui .pmdesk.sv-page .pmdesk-empty { min-height: 0; text-align: left; }
.pui .pmdesk.sv-page .pmdesk-verdict { margin: 0 -18px -16px; padding: var(--space-12) 18px; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.pui .pmdesk.sv-page .pmdesk-chat { background: none; border: 0; padding: 0; }
.pui .pmdesk.sv-page .pmdesk-turns { min-height: 0; max-height: 420px; }
.pui .pmdesk.sv-page :is(.pmdesk-find, .pmdesk-compose, .pmdesk-controls, .pmdesk-verdict) button,
.pui .pmdesk.sv-page .pmdesk-chips .chip { min-height: 36px; border-radius: var(--radius-pill); padding: 0 16px; }
@media (pointer: coarse) {
  .pui .pmdesk.sv-page :is(.pmdesk-find, .pmdesk-compose, .pmdesk-controls, .pmdesk-verdict) button,
  .pui .pmdesk.sv-page .pmdesk-chips .chip, .pui .pmdesk.sv-page .pmdesk-rows li button { min-height: 44px; }
}

/* EN1 ASK FIRST (wow W4 r1 → r2, P4/P9 footnote 2): on an Ask & answer screen the typed AI input and
   its answer slot ARE the artifact, even before the first answer (then a DashEmpty "Your answer appears
   here."), so at ≤ 1000 that column leads, with its TrustNote, above the list (page.css leads only a
   column that already holds a ring). `.en1-ask` marks the page; the Workbench is page.css's. */
@media (max-width: 1000px) {
  .pui .en1-ask .sv-workbench > .sv-wb-art { order: -1; }
}
@container sv-page (max-width: 720px) {
  .pui .en1-ask .sv-workbench > .sv-wb-art { order: -1; }
}

/* ANALYTICS THREADS r2 (P5/P4/P9): the threads are one quiet card of hairline rows; the main column
   is answer slot → input → TrustNote → (before a thread) the quiet "where from" row; an empty status
   line takes no space; at ≤ 1000 the main column (input, answer, trust) leads above the list. */
.pui .threads-page .threads-list > ul:not(:empty) { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: var(--space-6); gap: 0; }
.pui .threads-page .threads-list > ul > li + li { border-top: 1px solid var(--line); border-radius: 0; }
.pui .threads-page .threads-main > p[role="status"]:empty { display: none; }
.pui .threads-page .threads-compose { border-radius: var(--radius-card); }
.pui .threads-page .threads-setup { display: flex; flex-direction: column; gap: var(--space-6); padding: 0 var(--space-4); }
.pui .threads-page .threads-setup .sv-h2 { font-size: var(--text-md); }
@media (max-width: 1000px) {
  .pui .threads-page .pui.threads { grid-template-columns: minmax(0, 1fr); }
  .pui .threads-page .threads-list { position: static; }
  .pui .threads-page .threads-main { order: -1; }
}
@container sv-page (max-width: 720px) {
  .pui .threads-page .pui.threads { grid-template-columns: minmax(0, 1fr); }
  .pui .threads-page .threads-list { position: static; }
  .pui .threads-page .threads-main { order: -1; }
}

/* WORKBENCH r2 (P5/P4): the sources rail is one quiet card of hairline rows (not loose text beside a
   rule); the lone "+" of an empty tab row is hidden (the empty state carries New workbook); stacked,
   the main column (answer slot, input, TrustNote) leads above the rail. */
.pui .wb-page .wb-rail { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--panel); box-shadow: var(--shadow); padding: var(--space-8) var(--space-12); align-self: start; }
.pui .wb-page .wb-rail > ul > li + li { border-top: 1px solid var(--line); }
.pui .wb-page .wb-rail > ul > li > .wb-rail-item, .pui .wb-page .wb-rail > ul > li > .wb-rail-row { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.pui .wb-page .wb-tabs:not(:has(.wb-tab, .wb-tray)) { display: none; }
.pui .wb-page .wb-tabs:not(:has(.wb-tab)) > .wb-tab-new { display: none; }
.pui .wb-page .wb-composer { border-radius: var(--radius-card); }
@media (max-width: 900px) {
  .pui .wb-page .wb-main { order: -1; }
  .pui .wb-page .wb-rail { max-height: none; }
}
@container sv-page (max-width: 720px) {
  .pui .wb-page .wb-body { grid-template-columns: minmax(0, 1fr); }
  .pui .wb-page .wb-main { order: -1; }
}
