/* STUDIO: the Studio row and Special tools in the Toolbox, the Studio's library and board header, and the run screen
   (view.js). On the app's :root tokens and the UI kit (ui-kit.css); dark only, no colours of its own. */

/* The Toolbox: the Studio row is a one-row .glist card above Basic tools; Special tools is a second panel
   under Basic tools, in the same .basic-tools look. */
#studioToolsPanel{margin-top:var(--vx-sp-3)}

/* Arabic: JetBrains Mono has no Arabic, and its wide space opened gaps between Arabic words in mono labels (live
   review C15). In an Arabic page the screen's mono labels take the kit's Arabic-first mono stack and no tracking,
   the same swap the row card and chip make. */
#studioScreen:dir(rtl){--mono:var(--font-mono-rtl);--font-mono:var(--font-mono-rtl)}
#studioScreen:dir(rtl) .studio-tile-block{letter-spacing:0;font-variant-caps:normal}
#studioToolsList:empty{display:none}

/* The Studio's screens (cards, buttons, pills, empty states, the composer, the run's text fields) are the kit's (vx-).
   The sheets of the board (a block's settings, Add a block, Request a block) and the run's choice fields keep the old
   kit's parts until the shared sheet moves. */
:is(.studio-set,.studio-row,.studio-field,.studio-try-pane) :is(.verser-input,.verser-textarea),
:is(#studioStepTitle,#studioRequestText,#studioNewToolName){--verser-field-focus-border:var(--field-edge)}

/* ---- The Studio screen: two views on the page background (#studioScreen[data-view]), no frame or sidebar. The
   library: the title, the kit's sticky tab row with counts (the page's menu), the cards (.studio-cards of
   .vx-card.studio-card) and, under Your tools, Build a new one. ---- */
#studioScreen[data-view="library"] #studioBoard,#studioScreen[data-view="board"] #studioLibrary{display:none}
/* New tool is the page's + at the bottom end (the kit's create action), on the library only. */
#studioScreen[data-view="board"]>#studioNewTool{display:none}
/* A count of tools is not news: the badge in the quiet well, not the agent pink. */
.studio-tabs .tab-line .tab-badge{--vx-badge-bg:var(--vx-well);--vx-badge-fg:var(--vx-ink-2);background:var(--vx-badge-bg);color:var(--vx-badge-fg);font-family:var(--vx-font);font-variant-numeric:tabular-nums}
.studio-tabs .tab-badge:empty{display:none}
#studioMessage:empty,#studioComposeMessage:empty{display:none}
#studioMessage{margin:var(--vx-sp-2h) var(--vx-sp-0h) 0}
#studioComposeMessage{margin:0 var(--vx-sp-0h)}
.studio-tab-panel{min-width:0;padding-block-start:var(--vx-sp-4)}
.studio-none{margin-block-start:0}
/* A card is four lines: the name, the strip of blocks, the use line (runs and last edit, a sample's description, or
   who shared it), then the state and the actions. One across on a phone, two from 600px, three on a desktop. */
/* The cards on the kit's one tile size: as many as fit (one on a phone), as Toolbox's tiles. */
.studio-cards{display:grid;gap:var(--vx-sp-3);grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--vx-tile-min)),1fr))}
.studio-card{position:relative;display:grid;gap:var(--vx-sp-2);min-width:0;padding:var(--vx-sp-3) var(--vx-sp-3) var(--vx-sp-2h) var(--vx-sp-3h)}
/* The name is the card's one way in: its button covers the card, under ⋯ and Copy. */
.studio-card-open{display:block;width:100%;min-width:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}
.studio-card-open::after{content:"";position:absolute;inset:0;border-radius:inherit}
.studio-card-open:focus-visible{outline:none}
.studio-card:has(.studio-card-open:focus-visible){outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}
.studio-card-name{display:block;inline-size:fit-content;max-inline-size:100%;overflow:hidden;font-size:var(--font-size-body);font-weight:600;line-height:1.3;white-space:nowrap;text-overflow:ellipsis}
.studio-card-strip{display:flex;align-items:center;gap:3px;min-width:0;height:18px;color:var(--text-2)}
.studio-card-strip .icon{flex:none;width:16px;height:16px}
.studio-card-strip .studio-card-arrow{width:10px;height:10px;color:var(--eyebrow)}
.studio-card-strip:dir(rtl) .studio-card-arrow{transform:scaleX(-1)}
.studio-card-strip.is-empty{font-family:var(--font-sentence);font-size:var(--font-size-small)}
/* The foot (deep review S1): the state pills on the start side (they wrap under each other when the card is narrow),
   Run with ⋯ or Copy on the end side, kept whole. */
.studio-card-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--vx-sp-2);width:100%;min-width:0;margin-block-start:var(--vx-sp-0h)}
.studio-card-state{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-1h);min-width:0}
.studio-card-actions{display:flex;flex:none;align-items:center;gap:var(--vx-sp-1h)}
/* The use line may take two lines on a narrow card (runs, then the edit), never past its edge. */
.studio-card-meta{display:-webkit-box;align-self:stretch;min-width:0;max-width:100%;overflow:hidden;color:var(--text-2);font-family:var(--mono);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums;line-height:1.45;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:break-word}
.studio-card-note{display:flex;align-self:stretch;min-width:0}
.studio-card-note .studio-card-changed{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio-card-more,.studio-card-copy,.studio-card-run{position:relative;z-index:1;flex:none}
.studio-card{transition:transform var(--vx-dur-quick) var(--vx-ease)}
.studio-card:has(.studio-card-open:active){transform:scale(.985)}
.studio-card.is-fresh{animation:studio-ring calc(var(--vx-dur-grow) * 4.5) var(--vx-ease) var(--vx-dur-tap) both}
/* Admin's lists (.vx-card.vx-rows of .vx-row; the kit draws the hairline between rows). */
.studio-admin-row{gap:var(--vx-sp-2);min-height:52px;padding-inline:var(--vx-sp-3)}
.studio-admin-text{display:grid;flex:1 1 auto;min-width:0}
.studio-admin-head{margin-block:var(--vx-sp-4) var(--vx-sp-2)}
.studio-tab-panel>.studio-admin-head:first-child{margin-block-start:0}
.studio-admin-name{overflow-wrap:anywhere}
.studio-admin-meta{white-space:normal;overflow-wrap:anywhere}
.studio-admin-row button{flex:none}
/* Under the cards, the screen ends clear of the agent bubble on a phone (bottom left, its top nav+148 up), so Send and
   the buttons under the box are never behind it. */
body:not(.desk).agent-fab-on .phone:has(#studioScreen.active){padding-bottom:var(--verser-fab-reserve)}

/* ---- Build a new one: the kit's eyebrow head, the composer (one bar: the words, growing with them, then attach and
   send inside it; the sample chip over the words once a file is attached), the starters on one row, then Start from a
   block and Request a block. ---- */
.studio-build-new{display:grid;gap:var(--vx-sp-2h);margin-top:var(--vx-sp-3)}
.studio-build-new[hidden]{display:none}
.studio-build-new>h3{margin-top:var(--vx-sp-2)}
/* The bar is the kit's composer (ui/components/composer): the sample chip in its file row. */
.studio-composer{display:grid;gap:var(--vx-sp-2)}
.studio-composer-file:not(:has(.studio-sample-chip:not(.hidden))){display:none}
/* Nothing typed and no sample attached: Send is quiet and takes no tap, as before the kit. With a sample chip a tap goes
   through, to send it or say what is missing. */
.studio-composer:not(:has(.studio-sample-chip:not(.hidden))):has(#studioPrompt:placeholder-shown) .studio-send{opacity:.45;pointer-events:none}
/* In right to left Send's arrow points up, as the composer's Send (ui/components/composer: a mirrored arrow pointing
   left read as a Back button, the lead's 29 Oct rule). */
.studio-send:dir(rtl) svg{transform:rotate(-90deg)}
.studio-bar{align-items:flex-end;padding-block:var(--vx-sp-1h)}
.studio-bar>textarea{min-block-size:0;max-block-size:30vh;align-self:center;padding-block:var(--vx-sp-1h);resize:none;field-sizing:content;line-height:1.45}
/* Attach and Send are the kit field's actions slot (.vx-field-actions): inside the bar's edge, on its last line. */
.studio-sample-chip{display:inline-flex;align-items:center;gap:var(--vx-sp-1h);min-width:0;max-width:100%;min-height:34px;padding-block:0;padding-inline:var(--vx-sp-2h) var(--vx-sp-1);border:1px solid var(--line);border-radius:var(--r-pill);background:var(--fill-1);font-size:var(--font-size-small)}
.studio-sample-chip .icon{flex:none;width:15px;height:15px}
.studio-sample-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.studio-sample-state{flex:none;color:var(--text-2)}
.studio-sample-chip.is-reading .studio-sample-state{animation:studio-cook-pulse calc(var(--vx-dur-grow) * 3.5) ease-in-out infinite}
.studio-sample-x{display:grid;place-items:center;flex:none;width:30px;height:30px;padding:0;border:0;border-radius:var(--radius-round);background:none;color:var(--text-2);cursor:pointer}
.studio-sample-x:focus-visible{outline:var(--ring-width) solid var(--ring);outline-offset:0}
@keyframes studio-cook-pulse{50%{opacity:.45;box-shadow:0 0 0 2px var(--ring-glow-soft)}}
@keyframes studio-ring{0%,100%{box-shadow:none}20%,60%{box-shadow:0 0 0 2px var(--selected-edge)}}
.studio-examples{display:flex;flex-wrap:nowrap;gap:var(--vx-sp-2);overflow-x:auto;scrollbar-width:none;padding-block:1px}
.studio-examples::-webkit-scrollbar{display:none}
/* A desktop: the starters that fit on one row, no sideways scroll (studioExamplesFit leaves the others out). */
body.desk .studio-examples{flex-wrap:wrap;overflow:visible;-webkit-mask-image:none;mask-image:none;animation:none}
/* The examples are kit chips (vx-chip): their look, size and picked state are the kit's. */
.studio-example{flex:none}
/* A starter the row leaves out (studioExamplesFit sets hidden) takes no room: the chip's own display would keep it. */
.studio-example[hidden]{display:none}
.studio-prompt-foot{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-1) var(--vx-sp-4)}

/* ---- The board's header (the tiles are builder.css): ‹ Studio / icon, name, ▾ and the state on one line,
   Try it's progress line, then the buttons; a tool open read only. ---- */
.studio-board{display:grid;gap:var(--vx-sp-3);min-width:0}
/* The board's Back (the kit's, without the app's back-btn: it would add a history step, and the phone's Back must leave the Studio as before). */
.studio-crumb{justify-self:start}
.studio-board-head{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-2h) var(--vx-sp-3);min-width:0}
.studio-board-name{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-1) var(--vx-sp-2);flex:1 1 320px;min-width:0}
.studio-board-name .studio-name{flex:1 1 160px;min-width:0}
.studio-switch{flex:none}
.studio-builder-status{color:var(--text-2);font-size:var(--font-size-small)}
.studio-builder-status:not(:empty)::before{content:"· "}
.studio-try-line{display:flex;align-items:center;gap:var(--vx-sp-2h);flex-basis:100%;margin:0;font-family:var(--mono);font-size:var(--font-size-meta);color:var(--text-2)}
.studio-try-line.hidden{display:none}
.studio-board-tools{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-2);min-width:0}
#studioBuilderMessage:empty{display:none}
.studio-board[data-mode="view"] .studio-edit-only,.studio-board[data-mode="edit"] .studio-view-only{display:none!important}
.studio-view-note{margin:0}
.studio-view-note:empty{display:none}
.studio-steps{min-width:0}
.studio-tile.is-view{display:grid;gap:var(--vx-sp-1);min-width:0;padding:var(--vx-sp-3) var(--vx-sp-3h);border:1px solid var(--line);border-radius:var(--r-compact);background:var(--fill-1)}
.studio-tile-block{display:inline-flex;align-items:center;gap:var(--vx-sp-1h);color:var(--eyebrow);font-family:var(--mono);font-size:var(--font-size-meta);font-weight:500}
.studio-tile-block .icon{width:14px;height:14px}
.studio-tile-title{font-size:var(--font-size-body);font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.studio-tile-line{color:var(--text-2);font-size:var(--font-size-small);line-height:1.4;overflow-wrap:anywhere}

/* A sample or a colleague's tool with no steps, read only on the board (view.js studioViewSteps). */
.studio-detail-none{margin:0}
/* ---- The run: a progress rail of the steps (done, now, to come), what the waiting step asks for in a glass panel,
   then the results as cards. ---- */
.studio-run{display:grid;gap:var(--vx-sp-3h);margin-top:var(--vx-sp-3)}
/* The run's step rail is the kit's stages (done, now, to come, skipped, stopped by data-state): the names wrap between words and
   the rail scrolls rather than breaking one, so no word is cut. */
.studio-stages{grid-auto-columns:minmax(min-content,1fr);gap:var(--vx-sp-1);padding-block:var(--vx-sp-1);overflow-x:auto;scrollbar-width:none}
.studio-stages::-webkit-scrollbar{display:none}
/* Each column is at least as wide as its longest word, so four steps fill the width where their words fit and the rail scrolls where they do not
   (view.js puts the current step in the middle); a word is never cut, and only a word wider than the rail itself would break (break-word does not narrow min-content). */
.studio-stages>li>span[dir]{overflow:visible;white-space:normal;overflow-wrap:break-word;line-height:1.3}
.studio-stages>li[data-state="skipped"]{opacity:.6}
.studio-stages>li[data-state="skipped"]>span[dir]{text-decoration:line-through}
.studio-stages>li[data-state="stopped"]{color:var(--vx-danger-text)}
.studio-stages>li[data-state="stopped"]::before{background:var(--vx-danger)}
.studio-run-input:empty,.studio-run-result:empty{display:none}
/* A long tool name on the run screen wraps between words, on the page-title scale as every other page head. */
#studioRunScreen .title h2{overflow-wrap:break-word;hyphens:auto}
/* What the step asks for: a glass panel. */
/* (The kit's glass panel, .verser-card data-variant="panel": 18px above, 16px at the sides and below; the page's type.) */
.studio-run-input{gap:var(--vx-sp-1h);font-family:inherit;font-size:inherit;line-height:inherit}
.studio-ask{margin:0 0 var(--vx-sp-1);font-size:var(--font-size-body);font-weight:600;line-height:1.45;overflow-wrap:anywhere}
.studio-form{display:grid;gap:var(--vx-sp-0h)}
.studio-field{display:grid}
.studio-field .field-label small{color:var(--text-2);font-weight:400}
.studio-help{margin:-2px var(--vx-sp-0h) var(--vx-sp-1h);color:var(--text-2);font-size:var(--font-size-meta);line-height:1.4}
.studio-field .seg{margin-top:0}
.studio-field .checks{margin:0}
.studio-field.is-missing :is(.studio-input,select){border-color:var(--vx-warn)}
.studio-review-tag{margin:-2px var(--vx-sp-0h) var(--vx-sp-1h)}
.studio-run-actions{justify-content:flex-end;gap:var(--vx-sp-2);margin-top:var(--vx-sp-2)}
.studio-run-actions button{min-inline-size:120px}
.studio-pick{margin-top:var(--vx-sp-2h);border-style:dashed}
.studio-people .tool-row input{flex:none;width:22px;height:22px}
/* The results: one card per step, its name as the card's head. */
.studio-run-result{display:grid;gap:var(--vx-sp-2h)}
.studio-result{gap:var(--vx-sp-2)}
.studio-result>.k{display:flex;align-items:center;gap:var(--vx-sp-2);margin:0 0 var(--vx-sp-0h);color:var(--text);font-family:var(--font);font-size:var(--font-size-body);font-weight:600;letter-spacing:0;text-transform:none}
.studio-result>.k::before{content:"";width:8px;height:8px;border-radius:var(--radius-round);background:var(--green);flex:none}
.studio-result>.studio-tag{justify-self:start}
.studio-summary{margin:0;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.studio-values{display:grid;gap:0;margin:0}
.studio-values>div{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:var(--vx-sp-2h);padding:var(--vx-sp-2) 0;border-top:1px solid var(--hairline)}
.studio-values>div:first-child{border-top:0}
.studio-values dt{color:var(--text-2);font-size:var(--font-size-small)}
.studio-values dd{margin:0;font-weight:600;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.studio-checks{display:grid;gap:var(--vx-sp-1h);margin:0;padding:0;list-style:none}
.studio-checks li{display:flex;gap:var(--vx-sp-2);line-height:1.4}
.studio-checks .is-ok{color:var(--green)}
.studio-checks .is-failed{color:var(--danger-text)}
.studio-table-wrap{max-width:100%;overflow-x:auto;border:1px solid var(--hairline);border-radius:var(--r-inner)}
.studio-table-wrap:focus-visible{outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}
.studio-grid{width:max-content;min-width:100%;border-collapse:collapse;font-size:var(--font-size-small);font-variant-numeric:tabular-nums}
.studio-grid th,.studio-grid td{padding:7px var(--vx-sp-2h);border-bottom:1px solid var(--hairline);text-align:start;white-space:nowrap}
.studio-grid thead th{color:var(--text-2);font-weight:600}
.studio-grid tbody tr:last-child>*{border-bottom:0}
.studio-run-again{justify-content:flex-end;margin-top:var(--vx-sp-3h)}
.studio-history-row{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:var(--vx-sp-1)}
.studio-history-row .task-body small{display:block;margin-top:var(--vx-sp-0h);color:var(--text-2)}
/* A confirm step is the kit's action card (view.js drawInput), flush in the step's panel. */
.studio-run-input>.studio-confirm{--verser-action-border:transparent;--verser-action-fill:transparent;--verser-action-padding:0;margin:0}

/* The button under the agent's reply that opens the tool it named (index.html attachStudioLink). */
.tool-confirm .tool-open-studio{max-width:100%;overflow-wrap:anywhere}

/* Files the agent brought from the chat (studio_open): listed before Start with ✕, and named on the step that uses one. */
.studio-chat-files{display:flex;flex-wrap:wrap;gap:var(--vx-sp-1h);align-items:center}
.studio-chat-files .note{flex-basis:100%;margin:0}
.studio-chat-used{margin:0}
.studio-swap{align-self:flex-start}

/* One run per file (view.js studioBatch*): "3 of 12 done", then each file with its result or reason. */
.studio-batch{display:grid;gap:var(--vx-sp-2);margin-top:var(--vx-sp-3)}
.studio-batch-count{margin:0;font-weight:600;font-variant-numeric:tabular-nums}
.studio-batch-rows{display:grid;margin:0;padding:0;list-style:none}
.studio-batch-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:var(--vx-sp-0h) var(--vx-sp-2h);padding:var(--vx-sp-2) 0;border-top:1px solid var(--hairline)}
.studio-batch-row:first-child{border-top:0}
.studio-batch-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.studio-batch-state{grid-column:1;color:var(--text-2);font-size:var(--font-size-small);overflow-wrap:anywhere}
.studio-batch-row.is-done .studio-batch-state{color:var(--green)}
.studio-batch-row.is-stopped .studio-batch-state{color:var(--danger-text)}
.studio-batch-open{grid-column:2;grid-row:1 / span 2}
.studio-batch-all{justify-self:start}
.studio-drive-saved{margin:0;overflow-wrap:anywhere}

@media (prefers-reduced-motion:reduce){
  .studio-example{transition:none}
  .studio-card:has(.studio-card-open:active){transform:none}
  .studio-sample-chip.is-reading .studio-sample-state,.studio-card.is-fresh{animation:none}
}
/* ---- Desktop (body.desk): the Studio takes the normal column (desktop.css). ---- */
.studio-board-name .studio-name{min-height:48px;margin:0;padding:0 var(--vx-sp-3);border:0;background:none;color:var(--vx-ink);font-family:var(--display);font-size:var(--vx-fs-14);font-weight:600;letter-spacing:-.01em}
/* A finger gets the kit's full control height on what the compact buttons carry (kit-ux touch-target). */
@media (pointer:coarse){
  .studio-example,.studio-card-run,.studio-card-copy,.studio-card-more,.studio-admin-row button,.studio-swap,.studio-batch-all,.studio-batch-open,.studio-batch-others{min-block-size:var(--vx-h)}
  .studio-card-more{min-inline-size:var(--vx-h)}
}

/* ==== The board (was views/studio/builder.css, the stylesheet linked right after this one; "builder.css" in the
   notes above means this part). Same cascade order as before. ==== */
/* STUDIO BOARD (builder.js): the compact tiles, Try it on them (the sheet, the results card), the sheets. On
   the app's :root tokens, the UI kit and the Studio's own rules (view.css, which draws the library and the board's
   header); dark only. */

/* The board's header. On a desktop one row: ‹ Studio / icon, name ▾ and the state on the left, the name cut with an
   ellipsis (the whole of it in its title); Undo, Try it and Add to Toolbox at the right end (during Try it, its line and
   Stop in place of Undo and Try it). Outside the desktop layout the name row takes a line of its own, the crumb a line
   above it (the / turned into the break), and the buttons wrap under it. */
#studioBoard .studio-board-name{flex:1 1 100%;flex-wrap:nowrap}
#studioBoard .studio-board-name>*{flex:none}
#studioBoard .studio-board-name .studio-name{flex:1 1 auto;width:0;min-width:64px;text-overflow:ellipsis}
@supports (field-sizing:content){body.desk #studioBoard .studio-board-name .studio-name{flex:0 1 auto;width:auto;field-sizing:content}}
#studioBoard .studio-builder-status{white-space:nowrap}
body:not(.desk) #studioBoard .studio-board-name{flex-wrap:wrap}
body.desk #studioBoard .studio-board-head{position:relative;flex-wrap:nowrap;gap:var(--vx-sp-2)}
body.desk #studioBoard .studio-board-name{flex:1 1 0;gap:var(--vx-sp-1);container:sbname/inline-size}
body.desk #studioBoard .studio-board-name .studio-name{min-width:140px;min-height:var(--vx-btn-h-sm);padding:0 var(--vx-sp-1h);font-size:var(--vx-fs-title)}
body.desk #studioBoard .studio-icon-btn{width:var(--vx-btn-h-sm);height:var(--vx-btn-h-sm)}
body.desk #studioBoard .studio-icon-btn .icon{width:var(--vx-btn-icon);height:var(--vx-btn-icon)}
body.desk #studioBoard .studio-switch{width:24px;min-width:24px;border-color:transparent;background:none}
/* The save line ("Saved") sits under the row, so it never squeezes the name. */
body.desk #studioBoard .studio-builder-status{position:absolute;top:100%;inset-inline-start:0;font-size:var(--font-size-meta)}
body.desk #studioBoard .studio-builder-status:not(:empty)::before{content:none}
body.desk #studioBoard .studio-board-tools{flex:none;flex-wrap:nowrap;gap:var(--vx-sp-1h);margin-inline-start:auto}

body.desk #studioBoard .studio-try-line{gap:var(--vx-sp-1h);font-family:var(--font);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums}
/* The left group is what the buttons leave (a 1280 screen with the dock open leaves little), so its width says what
   fits beside a name of at least 140px: first the crumb keeps to ‹ (its label says Back to Studio), then the state pill
   keeps to its dot (the word stays for screen readers and in its title). The widths are the crumb's word (44px), the
   pills (draft 68, Shared 75, In Toolbox 102) and the rest (‹, icon, 140px name, ▾ and gaps: 230px). */
@container sbname (max-width:299px){body.desk #studioBoard .studio-state[data-state="draft"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
@container sbname (max-width:306px){body.desk #studioBoard .studio-state[data-state="shared"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
@container sbname (max-width:334px){body.desk #studioBoard .studio-state[data-state="toolbox"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
/* Phone and tablet: the crumb has a line of its own and the name row is the icon (48px), the name, ▾ (40px) and the
   pill, 8px apart. The pill keeps to its dot where the full one would leave the name under 150px (a phone's In Toolbox),
   and the save line goes under the row, so the name keeps its room. */
body:not(.desk) #studioBoard .studio-board-name{container:sbname/inline-size}
body:not(.desk) #studioBoard .studio-builder-status{flex:1 0 100%;font-size:var(--font-size-meta)}
body:not(.desk) #studioBoard .studio-builder-status:not(:empty)::before{content:none}
body:not(.desk) #studioBoard .studio-builder-status:empty{display:none}
@container sbname (max-width:329px){body:not(.desk) #studioBoard .studio-state[data-state="draft"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
@container sbname (max-width:336px){body:not(.desk) #studioBoard .studio-state[data-state="shared"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
@container sbname (max-width:363px){body:not(.desk) #studioBoard .studio-state[data-state="toolbox"]>span{width:24px;padding:0;gap:0;justify-content:center;font-size:0}}
/* During Try it the run's line and Stop stand where Undo, Share and Try it were; Add to Toolbox waits, off. */
#studioBoard.is-trying :is(#studioUndo,#studioShare,#studioTry){display:none}
#studioBoard .studio-try-line{flex-basis:auto;white-space:nowrap}
/* The tool's icon button in the board's header. */
.studio-icon-btn{display:grid;flex:none;place-items:center;width:48px;height:48px;padding:0;border-color:var(--icon-edge);border-radius:var(--r-avatar);background:var(--icon-fill)}
.studio-icon-btn .icon{width:24px;height:24px}
#studioBuilderMessage:empty{display:none}

/* What the builder assumed, and the problems the validator found: glass notes over the steps. */
.studio-problems-note{margin-top:var(--vx-sp-3)}
.studio-problems,.studio-step-problems{display:grid;gap:var(--vx-sp-1);margin:0;padding-inline-start:var(--vx-sp-4h);color:var(--danger-text);font-size:var(--font-size-small);line-height:1.4}
.studio-problems{padding-inline-start:0;list-style:none}
.studio-step-problems:empty{display:none}
.studio-assumptions{margin-top:var(--vx-sp-3)}
.studio-assumptions ul{display:grid;gap:var(--vx-sp-1);margin:0;padding-inline-start:var(--vx-sp-4h);font-size:var(--font-size-small);line-height:1.5}
.studio-assumptions button{justify-self:end}

/* ---- The board: the steps as compact tiles joined by connectors. A phone reads them top to bottom; once the board is
   420px wide they run in rows that wrap (no sideways scroll), in the page's reading direction. The connector into a step
   carries its + and, for a step that runs only if, the condition. ---- */
.studio-steps{container:sboard/inline-size;display:flex;flex-wrap:wrap;align-items:stretch;gap:0;min-width:0;margin:0;padding:0;list-style:none}
.studio-tile{position:relative;display:grid;grid-template-columns:minmax(0,1fr);flex:1 1 100%;min-width:0;margin:0}
.studio-link{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:var(--vx-sp-2h);min-height:56px}
.studio-link-line{position:absolute;top:0;bottom:0;inset-inline-start:50%;width:2px;margin-inline-start:-1px;border-radius:var(--radius-6xs);background:var(--track);opacity:.6}
.studio-tile .studio-tile-add{border-radius:var(--vx-r-round);position:relative;z-index:1;grid-column:2;border:1.5px dashed var(--vx-hair-2);background:var(--vx-card-solid);color:var(--vx-ink-3);transition:border-color var(--vx-dur-fast) var(--vx-ease),color var(--vx-dur-fast) var(--vx-ease),transform var(--vx-dur-fast) var(--vx-ease)}
.studio-tile-add .icon{width:16px;height:16px}
.studio-tile-add:active{transform:scale(.94)}
@media (hover:hover) and (pointer:fine){.studio-tile .studio-tile-add:hover{border-color:var(--vx-hair-2);color:var(--text)}}
/* The + between tiles shows with a mouse over its tile or on keyboard focus; on touch there is only Add a block at the
   end, and the connector is a short line. */
@media (hover:hover) and (pointer:fine){
  .studio-tile .studio-tile-add{opacity:0;transition:opacity var(--vx-dur-fast) var(--vx-ease),border-color var(--vx-dur-fast) var(--vx-ease),color var(--vx-dur-fast) var(--vx-ease),transform var(--vx-dur-fast) var(--vx-ease)}
  .studio-tile:hover .studio-tile-add,.studio-tile .studio-tile-add:focus-visible{opacity:1}
}
@media (hover:none),(pointer:coarse){
  .studio-tile .studio-tile-add{display:none}
  .studio-link{min-height:20px}
}
.studio-link-cond{grid-column:3;justify-self:start;max-width:100%;block-size:auto;min-block-size:var(--vx-pill-h);padding-block:var(--vx-sp-1);white-space:normal;line-height:1.35;overflow-wrap:anywhere}
/* A step's card is the kit's glass panel (.verser-card data-variant="panel"): 8px 10px 10px inside, the hairline rim, the
   compact radius; the type stays the board's (the kit card's 14/1.45 is not a token). */
.studio-step-card{align-content:start;gap:var(--vx-sp-1h);min-width:0;padding:var(--vx-sp-2) var(--vx-sp-2h) var(--vx-sp-2h);transition:border-color var(--vx-dur-quick) var(--vx-ease),background-color var(--vx-dur-quick) var(--vx-ease),box-shadow var(--vx-dur-quick) var(--vx-ease)}
@media (hover:hover) and (pointer:fine){.studio-step-card:hover{border-color:var(--line)}}
.studio-step.is-selected .studio-step-card{border-color:var(--a);box-shadow:var(--shadow),0 0 0 1px var(--a) inset}
.studio-step:has(.studio-step-problems li) .studio-step-card{border-color:color-mix(in srgb,var(--bad) 45%,transparent)}
/* The top row: the block's icon and name (small caps), the moves at the end. */
.studio-step-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--vx-sp-2)}
.studio-step-head:has(.studio-step-pick){grid-template-columns:auto auto minmax(0,1fr) auto}
.studio-step-pick{display:grid;place-items:center;width:32px;height:40px}
.studio-step-icon{display:grid;place-items:center;flex:none;width:28px;height:28px;border:1px solid var(--icon-edge);border-radius:var(--r-avatar);background:var(--icon-fill)}
.studio-step-icon .icon{width:15px;height:15px}
.studio-tile-block{min-width:0;overflow:hidden;color:var(--text-2);font-size:var(--font-size-meta);font-weight:600;font-variant-caps:all-small-caps;letter-spacing:.04em;line-height:1.25;white-space:nowrap;text-overflow:ellipsis}
.studio-step-open{display:block;min-width:0;min-height:44px;padding:var(--vx-sp-0h) 0;border:0;border-radius:var(--r-inner);background:none;color:var(--text);font:inherit;text-align:start;cursor:pointer;transition:transform var(--vx-dur-quick) var(--vx-ease)}
.studio-step-open:active{transform:scale(.98)}
.studio-step-open:focus-visible{outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}
.studio-step-text{display:grid;gap:var(--vx-sp-0h);min-width:0}
.studio-step-text b{font-size:var(--font-size-body);line-height:1.3;overflow-wrap:anywhere}
/* One line of fields (or what the step is set to do); the whole of it in the title. */
.studio-step-summary{display:flex;flex-wrap:wrap;height:1.4em;overflow:hidden;color:var(--text-2);font-size:var(--font-size-small);line-height:1.4}
/* Each field is a part in the line's own direction: its dot first, so the dot always faces the field before it, then
   the words in their own direction (dir="auto"), cut with an ellipsis at their own end. */
.studio-step-part{display:flex;max-width:100%;min-width:0}
.studio-step-part>[dir]{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.studio-step-sep{flex:none}
.studio-step-sep::before{content:"·";margin:0 .4em}
/* Up and down are one capsule, ⋯ beside it. With a mouse they show on hover and on focus (Tab reaches them); on touch
   ⋯ alone shows, and has the moves. */
.studio-step-moves{display:flex;align-items:center;gap:var(--vx-sp-1)}
.studio-step-order{display:flex;overflow:hidden;border:1px solid var(--vx-hair);border-radius:var(--vx-r-pill);background:var(--vx-well)}
.studio-step-order button{border-radius:0}
.studio-step-order button+button{border-inline-start:1px solid var(--vx-hair)}
.studio-step-moves button:disabled{opacity:.35}
.studio-up .icon{transform:rotate(-90deg)}
.studio-down .icon{transform:rotate(90deg)}
@media (hover:hover) and (pointer:fine){
  /* Over the head's end while shown, so the block's name has the row to itself. */
  .studio-step-card{position:relative}
  .studio-step-moves{position:absolute;top:var(--vx-sp-1h);inset-inline-end:var(--vx-sp-2);padding:var(--vx-sp-0h);border-radius:var(--r-btn);background:var(--glass-solid);opacity:0;transition:opacity var(--vx-dur-fast) var(--vx-ease)}
  .studio-step-head{grid-template-columns:auto minmax(0,1fr)}
  .studio-step-head:has(.studio-step-pick){grid-template-columns:auto auto minmax(0,1fr)}
  .studio-step-card:is(:hover,:focus-within) .studio-step-moves,.studio-step-moves:has([aria-expanded="true"]){opacity:1}
}
@media (hover:none),(pointer:coarse){.studio-step-order{display:none}}
.studio-tile-status:empty{display:none}
.studio-tile-status{display:grid;gap:var(--vx-sp-1);margin:0;font-size:var(--font-size-small);line-height:1.4}
/* Try it on the tiles: the state as a small pill; the person's turn and a flag mark the card's edge. */
.studio-tile-state{justify-self:start}
.studio-tile-flag{color:var(--warn-text)}
.studio-tile.is-flagged .studio-step-card{border-color:color-mix(in srgb,var(--warn) 50%,transparent)}
.studio-tile.is-yours .studio-step-card{border-color:var(--a);box-shadow:var(--shadow),0 0 0 1px var(--a) inset}
.studio-tile.is-running .studio-tile-state{animation:sb-running calc(var(--vx-dur-grow) * 3) ease-in-out infinite alternate}
.studio-tile:is(.is-waiting,.is-skipped) .studio-step-card{opacity:.72}
@keyframes sb-running{from{opacity:1}to{opacity:.45}}
@media (prefers-reduced-motion:reduce){.studio-tile.is-running .studio-tile-state{animation:none}}
/* Try it's run in its sheet: the run's own strip of steps and its results are left out (the tiles show where it is;
   the results card after the last tile shows what it gave). */
.studio-try{display:grid;gap:var(--vx-sp-2)}
.studio-try .studio-run{margin-top:0}
.studio-try .studio-stages,.studio-try .studio-run-result{display:none}
.studio-try .studio-run-input{padding:0;border:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
.studio-sample-used{display:flex;flex-wrap:wrap;align-items:center;gap:var(--vx-sp-2);margin:0}
.studio-sample-used button{flex:none}
.studio-step-out:empty{display:none}
.studio-step-out{display:grid;gap:var(--vx-sp-1);padding-top:var(--vx-sp-2);border-top:1px solid var(--hairline);font-size:var(--font-size-small)}
.studio-step-out dl{margin:0}
.studio-step-out .studio-values>div{gap:var(--vx-sp-2);padding:3px 0;border-top:0}
.studio-step-out .studio-values dt{font-size:var(--font-size-meta)}
.studio-step-out .studio-values dd{font-size:var(--font-size-small)}
.studio-step-out .studio-tag{justify-self:start}
/* In rows the tiles are equal: --sb-n cards a row (as many as keep a card at least 180px wide), the connector (--sb-link)
   in front of every card but a row's first, so each row's cards line up in the same columns and the last row does not
   stretch. */
@container sboard (min-width:420px){.studio-tile{--sb-n:2}}
@container sboard (min-width:620px){.studio-tile{--sb-n:3}}
@container sboard (min-width:840px){.studio-tile{--sb-n:4}}
@container sboard (min-width:1060px){.studio-tile{--sb-n:5}}
@container sboard (min-width:420px){
  .studio-tile{--sb-link:calc(var(--vx-sp-8) + var(--vx-sp-2));--sb-card:calc((100% - (var(--sb-n) - 1) * var(--sb-link)) / var(--sb-n));grid-template-columns:var(--sb-link) minmax(0,1fr);flex:0 1 calc(var(--sb-card) + var(--sb-link));min-width:0;max-width:none;padding-block:var(--vx-sp-3)}
  .studio-tile:first-child{grid-template-columns:minmax(0,1fr);flex-basis:var(--sb-card)}
  .studio-link{position:static;display:flex;align-items:center;justify-content:center;min-height:0}
  .studio-link-line{top:50%;bottom:auto;inset-inline-start:0;width:var(--sb-link);height:2px;margin:-1px 0 0}
  .studio-tile .studio-tile-add{inline-size:32px;block-size:32px}
  /* The condition sits on the card's edge where the connector meets it. */
  .studio-link-cond{position:absolute;grid-column:auto;top:3px;inset-inline-start:52px;z-index:2;justify-self:auto;width:max-content;max-width:calc(100% - 64px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--font-size-meta)}
  .studio-link.has-cond+.studio-step-card{padding-top:var(--vx-sp-4)}
  .studio-tile.is-row-start .studio-link-line{display:none}
  /* Every row starts at the same edge: a tile that starts a row has no connector column, its + over its edge. */
  .studio-tile.is-row-start{grid-template-columns:minmax(0,1fr);flex-basis:var(--sb-card)}
  .studio-tile.is-row-start .studio-link{display:contents}
  .studio-tile.is-row-start .studio-tile-add{position:absolute;top:50%;inset-inline-start:-16px;z-index:3;margin-top:-16px}
  /* Earlier and later point along the row. */
  .studio-up .icon{transform:rotate(180deg)}
  .studio-down .icon{transform:none}
  .studio-step-order button,.studio-step-moves .studio-more{inline-size:32px;block-size:32px}
}
@container sboard (min-width:420px){.studio-steps:dir(rtl) .studio-up .icon{transform:none}.studio-steps:dir(rtl) .studio-down .icon{transform:rotate(180deg)}}
/* A tool open read only (a sample, a colleague's tool; view.js studioViewSteps): the same tiles without the
   moves, the connector or the +. */
.studio-steps:has(.studio-tile.is-view){gap:var(--vx-sp-3)}
.studio-tile.is-view,
.studio-steps .studio-tile.is-view{align-content:start;gap:var(--vx-sp-1h);padding:var(--vx-sp-3) var(--vx-sp-3h);border:1px solid var(--hairline);border-radius:var(--r-compact);background:var(--gloss),var(--fog),var(--glass-panel);background-origin:border-box;-webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur);box-shadow:var(--shadow)}
.studio-tile.is-view .studio-tile-block{display:flex;align-items:center;gap:var(--vx-sp-2)}
.studio-tile.is-view .studio-tile-block .icon{flex:none;width:16px;height:16px}
.studio-tile.is-view .studio-tile-block span{overflow:hidden;text-overflow:ellipsis}
.studio-tile-title{font-size:var(--font-size-body);line-height:1.3;overflow-wrap:anywhere}
.studio-tile-line{color:var(--text-2);font-size:var(--font-size-small);line-height:1.4;overflow-wrap:anywhere}
/* A step's name and line in the other script than the page's start on the tile's start edge with the others, still in
   their own direction (dir="auto"): each box hugs its words. */
:is(.studio-tile-title,.studio-tile-line,.studio-step-text>b,.studio-step-summary){inline-size:fit-content;max-inline-size:100%}
/* Read only, in rows: the kit's tile grid (as the library's cards), every tile one column wide. */
@container sboard (min-width:420px){.studio-steps .studio-tile.is-view{grid-template-columns:minmax(0,1fr);padding:var(--vx-sp-3) var(--vx-sp-3h)}}
.studio-steps:has(.studio-tile.is-view){display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--vx-tile-min)),1fr))}
/* No steps yet: the kit's empty state. */
.studio-steps-empty{flex:1 1 100%;border:1px dashed var(--vx-hair-2)}
/* Add a block: a dashed bar under the board. */
.studio-add-skill{position:relative;display:flex;align-items:center;justify-content:center;gap:var(--vx-sp-3);width:100%;min-height:52px;margin:var(--vx-sp-4) 0 0;padding:0 var(--vx-sp-4);border:1.5px dashed var(--vx-hair-2);border-radius:var(--vx-r-lg);background:var(--vx-well);color:var(--vx-ink);font:inherit;font-size:var(--font-size-body);font-weight:600;text-align:start;cursor:pointer;transition:background-color var(--vx-dur-fast) var(--vx-ease),border-color var(--vx-dur-fast) var(--vx-ease),transform var(--vx-dur-quick) var(--vx-ease)}
.studio-add-skill:active{transform:scale(.98)}
.studio-add-skill:focus-visible{outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}
@media (hover:hover) and (pointer:fine){.studio-add-skill:hover{border-color:var(--vx-ink-3);background:var(--vx-off)}}
.studio-add-mark{display:grid;place-items:center;width:28px;height:28px;border:1.5px dashed var(--vx-hair-2);border-radius:var(--vx-r-round);background:var(--vx-card-solid)}
.studio-add-mark .icon{width:14px;height:14px}
.studio-select-bar[data-inline]{position:sticky;inset-block-end:var(--vx-sp-4);z-index:5;justify-content:flex-end;margin-block-start:var(--vx-sp-3);margin-inline-start:auto}

/* Try it's form on the board (SB_PANE): a compact glass sheet, about 380px, beside the first tile in its row, the tiles
   after it going on under; on a tablet's column, a row of its own under the first tile. The first tile keeps its own
   height beside it. */
.studio-try-pane{flex:1 1 340px;min-width:320px;max-width:380px;align-self:flex-start;margin-inline-start:var(--vx-sp-3);padding-block:var(--vx-sp-3)}
.studio-tile:has(+.studio-try-pane){align-self:flex-start}
.studio-try-pane.is-under{flex-basis:100%;max-width:none;margin-inline-start:0;padding-block:var(--vx-sp-3) 0}
.studio-try-pane-box{display:grid;gap:var(--vx-sp-2)}
.studio-try-pane-head{display:flex;align-items:center;justify-content:space-between;gap:var(--vx-sp-2);min-width:0}
.studio-try-pane-head b{min-width:0;overflow:hidden;font-size:var(--font-size-body);font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.studio-try-pane-close{flex:none}
.studio-try-pane .studio-run-actions button{min-width:0}

/* Try it's results: a card after the last tile. */
.studio-result-card{display:grid;gap:var(--vx-sp-2h);margin-top:var(--vx-sp-4)}
.studio-result-head{display:flex;align-items:center;justify-content:space-between;gap:var(--vx-sp-2)}
.studio-result-title{display:flex;align-items:center;gap:var(--vx-sp-2);font-size:var(--font-size-body)}
.studio-result-title .icon{width:18px;height:18px}
.studio-result-head button{flex:none}

/* A change from the agent dock: the tiles it changed are outlined for 1.6 s, with a brief glow where motion is welcome. */
.studio-tile.is-changed .studio-step-card{outline:2px solid var(--b);outline-offset:2px}
@media (prefers-reduced-motion:no-preference){.studio-tile.is-changed .studio-step-card{animation:sb-changed calc(var(--vx-dur-grow) * 4) var(--vx-ease)}}
@keyframes sb-changed{from{box-shadow:var(--shadow),0 0 0 6px color-mix(in srgb,var(--b) 35%,transparent)}to{box-shadow:var(--shadow),0 0 0 0 transparent}}

/* Sheets: the icon grid, menus, the add list, settings. */
.studio-icons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:var(--vx-sp-2)}
.studio-icon-pick{display:grid;justify-items:center;gap:var(--vx-sp-1);padding:var(--vx-sp-2h) var(--vx-sp-1);border:1px solid var(--line);border-radius:var(--r-inner);color:var(--text-2);cursor:pointer}
.studio-icon-pick .icon{width:22px;height:22px;color:var(--text)}
.studio-icon-pick:has(input:checked){border-color:var(--primary);color:var(--text)}
.studio-icon-pick:has(input:focus-visible){outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}
.studio-add .glist{margin-bottom:var(--vx-sp-2)}
.studio-add .studio-request{margin-top:var(--vx-sp-3)}
.studio-set{display:grid;gap:var(--vx-sp-1h)}
.studio-set .field{margin:0}
.studio-set>.field-label{margin-top:var(--vx-sp-2)}
.studio-rows{display:grid;gap:var(--vx-sp-2h)}
.studio-row{display:grid;gap:var(--vx-sp-1h);padding:var(--vx-sp-2h);border:1px solid var(--line);border-radius:var(--r-inner)}
.studio-row-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--vx-sp-1h);align-items:center}
.studio-row-line.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.studio-row .checks{margin:0}
.studio-row .checks label{min-height:36px;padding:var(--vx-sp-1h) 0}
.studio-row-remove{justify-self:end}
.studio-insert{justify-self:start;min-height:36px;padding:0 var(--vx-sp-3);font-size:var(--font-size-small)}
.studio-picker{display:grid;gap:var(--vx-sp-1);max-height:220px;overflow:auto;padding:var(--vx-sp-1h);border:1px solid var(--line);border-radius:var(--r-inner)}
.studio-picker button{justify-content:flex-start;min-height:40px;text-align:start}
.studio-ref-preview{color:var(--text-2);font-size:var(--font-size-meta);line-height:1.7;overflow-wrap:anywhere}
.studio-ref-preview:empty{display:none}
.studio-ref-preview .studio-tag{margin:0 var(--vx-sp-0h)}
.studio-share-note{margin-top:var(--vx-sp-2h)}
@media (pointer:coarse){
  .studio-board-tools button,.studio-assumptions button,.studio-step-moves button,.studio-try-pane-close,.studio-result-head button,.studio-sample-used button{min-block-size:var(--vx-h)}
  .studio-step-moves button,.studio-try-pane-close{min-inline-size:var(--vx-h)}
}
/* On a phone the bar clears the agent bubble, which sits bottom left. */
body:not(.desk).agent-fab-on .studio-select-bar[data-inline]{inset-block-end:var(--verser-fab-reserve)}
