/* © 2026 Cromulent, Inc. All Rights Reserved.
   workbench.css - the workbench frame (DECISION (Maestro), 2026-12-04, "Build it as shown"): spawn's bar over three
   columns that fill the screen, the board and its setup on the left, the blocks in the middle, the board running on the
   right, the build tool a tab on the right edge. A phone shows one column at a time under a tab bar.
   The usability bar it holds: one spacing scale (4 8 12 16 24 32 48), every control at least 40px (44 on a phone), one
   orchid action per column, nothing that works only on hover. */

/* ---- the page: the bar, then the workbench filling the rest; the page itself never scrolls ---- */
body.wb-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.wbar { flex: none; margin: 0; padding: 12px 24px; border-bottom: 1px solid var(--line); gap: 24px; }
.wbar .line { justify-content: flex-start; }
/* a page one link from Pick (the boards, the lesson book, every run) keeps its own width under the bar, and a gap */
body:not(.wb-page):not(.pick-page) .wbar { margin-bottom: 32px; }
.wbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex: none; }
.wbar-help { font: 500 15px/1.2 var(--body); color: var(--ink-2); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.wbar-help:hover { color: var(--ink); }
.wbar-help:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; }
.bar-stop { min-height: 40px; }

/* ---- the three columns ---- */
.wb { --left: 320px; --right: 400px; flex: 1 1 auto; min-height: 0; position: relative;
  display: grid; grid-template-columns: var(--left) minmax(0, 1fr) var(--right) 44px; }
.wb-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--void); position: relative; }
.wb-left { border-right: 1px solid var(--line); }
.wb-right { border-left: 1px solid var(--line); }
.wb-head { flex: none; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wb-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.wb-foot { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.wb-foot[hidden] { display: none; }
.wb-grow { flex: 1 1 auto; }
.wb-say { flex: 1 1 140px; min-width: 0; font-size: 13px; color: var(--ink-dim); line-height: 1.4; }
.wb-eyebrow { display: block; font: 400 10px/1.2 var(--pixel); text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.wb-title { display: block; font: 600 16px/1.2 var(--body); color: var(--ink); }
.wb-head .learn-state { margin-left: auto; }
.wb-presence { margin-left: auto; font: 11px/1 var(--mono); color: var(--ink-faint); text-transform: lowercase; white-space: nowrap; }
.wb-presence.live { color: var(--good); }
.wb-presence:empty { display: none; }
.wb-left .ctx { flex: 1 1 auto; min-width: 0; }
.wb-left .ctx-btn { width: 100%; max-width: none; min-height: 40px; align-items: center; }

/* a two-way switch (Blocks / Python, Ship it / Running): the pressed one reads as chosen without colour alone */
.wb-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.wb-seg button { min-height: 36px; min-width: 72px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: 600 14px/1 var(--body); color: var(--ink-dim); }
.wb-seg button:hover { color: var(--ink); }
.wb-seg button[aria-pressed="true"], .wb-seg button[aria-selected="true"] { color: var(--ink); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--orchid); }
.wb-seg button:focus-visible { outline: 2px solid var(--orchid); outline-offset: 1px; }
.wb-head .btn { min-height: 40px; padding: 8px 16px; font-size: 14px; font-weight: 500; }

/* ---- the middle: the blocks fill it, or the Python does ---- */
.wb-mid { background: var(--panel); }
.wb-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wb-view[hidden] { display: none; }
.wb-mid .program { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; }
.wb-mid .program[hidden] { display: none; }
.wb-mid .code-col { overflow-y: auto; padding: 16px; gap: 16px; }
.wb-mid .code-col .code { flex: 1 0 360px; display: flex; flex-direction: column; margin: 0; }
.wb-mid .story { flex: none; margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); }
.wb-mid .story:empty { display: none; }

/* ---- the right: the board running, its console, and Ship ---- */
.wb-run > * { margin: 0; }
.wb-run .sim { border-radius: var(--radius); }
.wb-more { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.wb-more > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 16px;
  font: 500 14px/1.2 var(--body); color: var(--ink-dim); }
.wb-more > summary::-webkit-details-marker { display: none; }
.wb-more > summary::after { content: "+"; margin-left: auto; font: 400 14px/1 var(--mono); color: var(--ink-faint); }
.wb-more[open] > summary::after { content: "\2212"; }
.wb-more > summary:hover { color: var(--ink); }
.wb-more > summary:focus-visible { outline: 2px solid var(--orchid); outline-offset: -2px; border-radius: var(--radius); }
.wb-more > .sim { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.wb-right .wb-foot .estop { flex: none; }
.wb-right .wb-foot .estop-btn { height: 44px; }
.wb-right .wb-foot .estop[data-note="1"] { flex: 1 1 100%; }
.wb-right .wb-foot .btn.primary { margin-left: auto; min-height: 44px; }

/* Ship and Running: a sheet over the board column, with its own way back */
.wb-sheet { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--void); }
.wb-sheet[hidden] { display: none; }
.wb-sheet .wb-head .btn { margin-left: auto; }
.wb-sheet .loop-panel[hidden] { display: none; }

/* ---- the build tool: its own narrow rail on the right edge, a tab that opens a drawer over the board column ---- */
.wb-p2 { min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.wb-p2-tab { display: block; width: 100%; min-height: 140px; margin-top: 80px; padding: 16px 0;
  writing-mode: vertical-rl; transform: rotate(180deg); border: 0; border-right: 2px solid var(--blue);
  background: transparent; color: var(--blue-lt); cursor: pointer; font: 400 11px/1 var(--pixel); text-transform: uppercase; }
.wb-p2-tab:hover, .wb-p2[data-open="1"] .wb-p2-tab { background: color-mix(in srgb, var(--blue) 12%, var(--panel)); }
.wb-p2-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.wb-p2-drawer { position: absolute; z-index: 40; top: 0; bottom: 0; right: 44px; width: min(420px, calc(100vw - 44px)); overflow-y: auto; padding: 16px;
  background: var(--void); border-left: 1px solid color-mix(in srgb, var(--blue) 40%, var(--line)); box-shadow: -24px 0 48px -24px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateX(16px); visibility: hidden;
  transition: opacity var(--fast, .15s) var(--ease), transform var(--fast, .15s) var(--ease), visibility 0s linear var(--fast, .15s); }
.wb-p2[data-open="1"] .wb-p2-drawer { opacity: 1; transform: none; visibility: visible; transition: opacity var(--fast, .15s) var(--ease), transform var(--fast, .15s) var(--ease); }
.wb-p2-drawer .p2 { margin: 0; }
@media (prefers-reduced-motion: reduce) { .wb-p2-drawer, .wb-p2[data-open="1"] .wb-p2-drawer { transition: none; } }

/* 02 plan: what it should do and the call, in the sheet; the call and its verdict above the running board */
.wb-plan-title[hidden], .wb-sheet .wb-seg[hidden] { display: none; }
.plan-form { display: flex; flex-direction: column; gap: 24px; }
.plan-field { display: flex; flex-direction: column; gap: 8px; }
.plan-q { font: 600 16px/1.3 var(--body); color: var(--ink); }
.plan-field input, .plan-field textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; min-height: 44px; box-sizing: border-box; width: 100%; resize: vertical; }
.plan-field input:focus-visible, .plan-field textarea:focus-visible { outline: 2px solid var(--orchid); outline-offset: 1px; }
.plan-judge { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); background: var(--panel); }
.plan-judge[hidden] { display: none; }
.plan-judge-said { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.45; }
.plan-judge-q { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.plan-judge .btn { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.plan-misses[hidden] { display: none; }
.plan-misses { margin-top: 8px; }
.plan-misses .p2-note { flex: 1 1 100%; margin: 0; }

/* a halted program reads as stopped */
.wb.halted .program, .wb.halted .code { opacity: .5; }

/* the phone's tab bar: hidden until a phone */
.wb-tabs { display: none; }

/* ---- a laptop: the columns narrow before anything moves ---- */
@media (max-width: 1280px) { .wb { --left: 280px; --right: 340px; } }

/* ---- a tablet or a phone: one column at a time, a tab bar at the bottom where the thumb is ---- */
@media (max-width: 880px) {
  .wbar { padding: 8px 16px; gap: 12px; flex-wrap: wrap; }
  .wbar .line { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .wbar-help { display: none; }
  .wb { display: flex; flex-direction: column; }
  .wb-col { flex: 1 1 auto; border: 0; }
  .wb[data-pane="board"] > .wb-col:not(.wb-left),
  .wb[data-pane="build"] > .wb-col:not(.wb-mid),
  .wb[data-pane="run"] > .wb-col:not(.wb-right) { display: none; }
  .wb-tabs { display: grid; flex: none; border-top: 1px solid var(--line); background: var(--panel); }
  .wb-tabs button { min-height: 52px; border: 0; background: transparent; cursor: pointer; font: 600 14px/1 var(--body); color: var(--ink-dim); }
  .wb-tabs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--orchid); }
  .wb-tabs button:focus-visible { outline: 2px solid var(--orchid); outline-offset: -2px; }
  .wb-head { min-height: 56px; }
  .wb-seg button { min-height: 40px; }
  /* the build tool is the tab bar's fourth tab here, its drawer a sheet over the column above the bar */
  .wb-p2 { display: contents; }
  .wb-p2-tab { display: none; }
  .wb-p2-drawer { position: fixed; top: auto; bottom: 52px; right: 0; width: 100vw; height: 72vh; border-left: 0;
    border-top: 1px solid color-mix(in srgb, var(--blue) 40%, var(--line)); transform: translateY(16px); }
  .wb-tabs { grid-template-columns: repeat(4, 1fr); padding-left: 44px; }
  .wb-tabs .wb-tabs-p2 { color: var(--blue-lt); }
  .wb-tabs .wb-tabs-p2[aria-expanded="true"] { box-shadow: inset 0 3px 0 var(--blue); }
  .wb-right .wb-foot .wb-say { display: none; }
}
@media (max-width: 560px) {
  .wb-head .btn { padding-left: 12px; padding-right: 12px; }
  .wb-seg button { min-width: 0; padding: 0 12px; }
}
