/* © 2026 William C. Chesher. All Rights Reserved.
   studio.css - the workbench surface. Reads only the tokens; reuses the landing's block / code /
   mirror / pill components (bench.css) and adds the studio layout, the step list, the emergency
   stop, and the player-two panel. */

/* ---- THE LOOP (design/ux-model.md): the four steps in order, and stop beside them, always in reach ---- */
.loop-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 22px; flex-wrap: wrap; margin: 0 0 22px; }
.loop { display: flex; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.loop-step { font-family: var(--mono); font-size: 13px; letter-spacing: .03em; color: var(--ink-dim); background: transparent; border: 0; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: color var(--fast) var(--ease), background var(--fast) var(--ease); }
.loop-step:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.loop-step .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; border: 1px solid var(--line); color: var(--ink-faint); }
.loop-step[aria-selected="true"] { color: var(--orange-ink); font-weight: 600; background: linear-gradient(100deg, var(--orange), var(--orange-lt)); box-shadow: 0 0 22px -8px var(--orange); }
.loop-step[aria-selected="true"] .n { border-color: rgba(26, 18, 0, .35); color: var(--orange-ink); }
.loop-step:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.loop-count { font-size: 11px; color: var(--mint); }
.loop-count:empty { display: none; }
.loop-step[aria-selected="true"] .loop-count { color: var(--orange-ink); }
.loop-bar .estop { padding: 8px 14px 8px 10px; gap: 12px; flex: 0 1 380px; }
.loop-bar .estop-btn { width: 38px; height: 38px; }
.loop-panel { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 560px) {
  .loop { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loop-step { justify-content: center; padding: 8px 4px; font-size: 12px; gap: 5px; white-space: nowrap; }
  .loop-step .n { display: none; }
  .loop-bar .estop { flex: 1 1 100%; }
}

/* ---- the workbench: the blocks and the code side by side, the same height, one split between them ----
   The studio takes the width of the screen (the other pages keep --maxw): the blocks need room for their palette AND
   the program, and the code needs room to be read. The split is a column the student can drag (studio.js split);
   --split is the blocks' share. Under 880px the two stack, blocks first. */
.studio-wrap { max-width: 1680px; }
.studio { --split: 52%; display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.device-row .field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0; }
.device-row .flabel { margin: 0; }
.device-row .mirror { margin: 0; padding: 6px 14px; gap: 12px; min-height: 40px; }
.device-row .mirror .note { font-size: 12.5px; color: var(--ink-faint); }
.device-row .mirror .px { width: 16px; height: 16px; }
.device-row .mirror .screen { font-size: 13px; padding: 4px 10px; }

.split { display: grid; grid-template-columns: minmax(0, var(--split)) 14px minmax(0, 1fr);
  height: clamp(520px, calc(100vh - 210px), 980px); }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane > .program:not([hidden]), .pane > .code { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.split-handle { position: relative; cursor: col-resize; touch-action: none; border-radius: 6px; }
.split-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px;
  background: var(--line); transition: background var(--fast) var(--ease); }
.split-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 6px; height: 44px; margin: -22px 0 0 -3px; border-radius: 3px;
  background: var(--ink-faint); opacity: .6; transition: background var(--fast) var(--ease), opacity var(--fast) var(--ease); }
.split-handle:hover::before, .split-handle:focus-visible::before, .split.dragging .split-handle::before { background: var(--orange); }
.split-handle:hover::after, .split-handle:focus-visible::after, .split.dragging .split-handle::after { background: var(--orange); opacity: 1; }
.split-handle:focus-visible { outline: none; }
.split.dragging { cursor: col-resize; user-select: none; }
.split.dragging .blocks-host { pointer-events: none; }
@media (max-width: 880px) {
  .split { display: flex; flex-direction: column; gap: 16px; height: auto; }
  .split-handle { display: none; }
  .pane.build-col { height: 480px; }
  .pane.code-col { min-height: 360px; }
}

/* under the workbench: the open loop step under the blocks, player two under the code, on the same split */
.below { display: grid; grid-template-columns: minmax(0, var(--split)) 14px minmax(0, 1fr); align-items: start; }
.below > .p2 { grid-column: 3; }
.below-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 880px) { .below { grid-template-columns: 1fr; gap: 16px; } .below > .p2 { grid-column: 1; } }

/* ---- the program: the block editor (Blockly, blocks.js) in bench's skin ----
   The landing's block look, carried onto Blockly: each block a clear tint of its colour under a bright
   edge, its words lit, amber for a `when`, orange for a `do`. The colour rides in as --neon (blocks.js,
   the glow), as spawn's code room and automate do it, since CSS cannot read a block's own colour. */
.program { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.blocks-host { position: relative; flex: 1 1 auto; min-height: 0; }
.blocks-note { margin: 0; padding: 9px 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; color: var(--caution); background: var(--panel-2); }
.blocks-note:empty { display: none; }

.blocks-host .blocklyMainBackground { stroke: none !important; }
.blocks-host .blocklyPath { fill: color-mix(in srgb, var(--neon, var(--orange)) 16%, var(--panel)) !important; fill-opacity: 1 !important; stroke: var(--neon, var(--orange)) !important; stroke-width: 2px !important; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--neon, var(--orange)) 45%, transparent)); }
.blocks-host .blocklyPathLight, .blocks-host .blocklyPathDark { display: none !important; }
.blocks-host .blocklyDraggable:hover > .blocklyPath { fill: color-mix(in srgb, var(--neon, var(--orange)) 24%, var(--panel)) !important; }
.blocks-host .blocklySelected > .blocklyPath { stroke-width: 2.8px !important; filter: drop-shadow(0 0 10px var(--neon, var(--orange))); }
.blocks-host .blocklyText { fill: color-mix(in srgb, var(--neon, var(--ink)) 55%, white) !important; font-family: var(--disp) !important; font-weight: 600 !important; font-size: 13px !important; }
.blocks-host .blocklyEditableField > rect:not(.bench-swatch), .blocks-host .blocklyEditableText > rect { fill: rgba(255, 255, 255, .08) !important; stroke: var(--line) !important; fill-opacity: 1 !important; }
.blocks-host .blocklyEditableField > .blocklyText, .blocks-host .blocklyEditableText > .blocklyText { fill: var(--ink) !important; font-family: var(--mono) !important; font-weight: 500 !important; }
.blocks-host .blocklyEditableField:hover > rect:not(.bench-swatch) { fill: rgba(255, 255, 255, .14) !important; }
/* greyed (left out of the code): it has to READ as off -- no glow, a dashed grey edge, grey words, see-through. The words
   sit inside field groups, so the text rule is a descendant one. */
.blocks-host .blocklyDisabledPattern > .blocklyPath, .blocks-host .blocklyDisabled > .blocklyPath { fill: var(--panel-2) !important; stroke: var(--ink-faint) !important; stroke-dasharray: 5 4; filter: none !important; }
.blocks-host .blocklyDisabled .blocklyText, .blocks-host .blocklyDisabledPattern .blocklyText { fill: var(--ink-faint) !important; }
.blocks-host .blocklyDisabled { opacity: .6; }
.blocks-host .blocklyFlyoutBackground { fill: var(--void) !important; fill-opacity: 1 !important; }
.blocks-host .blocklyFlyoutLabelText { fill: var(--ink-faint) !important; font-family: var(--mono) !important; font-size: 11px !important; letter-spacing: .14em; text-transform: uppercase; }
.blocks-host .bench-label-when .blocklyFlyoutLabelText { fill: var(--amber) !important; }
.blocks-host .bench-label-do .blocklyFlyoutLabelText { fill: var(--orange) !important; }
.blocks-host .blocklyScrollbarHandle { fill: var(--ink-faint) !important; fill-opacity: .5; }
.blocks-host .blocklyInsertionMarker > .blocklyPath { fill: var(--orange-lt) !important; fill-opacity: .25 !important; stroke: none !important; filter: none; }
.blocklyHtmlInput { font-family: var(--mono) !important; font-size: 13px !important; background: var(--panel-2) !important; color: var(--ink) !important; caret-color: var(--orange); border-radius: 6px; }
.blocklyTooltipDiv { background: var(--panel-2) !important; color: var(--ink-2) !important; border: 1px solid var(--line) !important; border-radius: 8px; padding: 7px 10px !important; font-family: var(--disp) !important; font-size: 12.5px !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .4) !important; }
.blocklyDropDownDiv { border-radius: 12px !important; border-color: color-mix(in srgb, var(--orange) 55%, transparent) !important; }
.blocklyDropDownArrow { border-color: color-mix(in srgb, var(--orange) 55%, transparent) !important; }

/* compact (phone): the palette folds into two tabs, when and do (blocks.js toolbox) */
.blocks-host .blocklyToolboxDiv { background: var(--void) !important; padding: 8px 0 !important; border-right: 1px solid var(--line); }
.blocks-host .bench-cat { margin: 3px 6px; padding: 8px 12px !important; border-radius: 8px; cursor: pointer; height: auto !important; }
.blocks-host .bench-cat .blocklyTreeIcon { display: none; }
.blocks-host .bench-cat .blocklyToolboxCategoryLabel, .blocks-host .bench-cat .blocklyTreeLabel { font: 600 12px var(--mono) !important; letter-spacing: .12em; text-transform: uppercase; }
.blocks-host .bench-cat-when .blocklyToolboxCategoryLabel, .blocks-host .bench-cat-when .blocklyTreeLabel { color: var(--amber) !important; }
.blocks-host .bench-cat-do .blocklyToolboxCategoryLabel, .blocks-host .bench-cat-do .blocklyTreeLabel { color: var(--orange) !important; }
.blocks-host .bench-cat.blocklyToolboxSelected { background: rgba(255, 255, 255, .06) !important; }
.blocklyWidgetDiv .blocklyMenu, .blocklyDropDownDiv .blocklyMenu { background: var(--panel-2) !important; color: var(--ink) !important; font-family: var(--disp) !important; }
.blocklyMenuItem { color: var(--ink-2) !important; }
.blocklyMenuItemHighlight { background: color-mix(in srgb, var(--orange) 18%, transparent) !important; }
.blocklyMenuItemDisabled { color: var(--ink-faint) !important; }

/* the colour picker a colour swatch opens (blocks.js FieldBenchColour) */
.bench-colour { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.bench-colour-row { display: grid; grid-template-columns: repeat(4, 28px); gap: 8px; }
.bench-colour-chip { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0; }
.bench-colour-chip:hover, .bench-colour-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bench-colour-chip.on { outline: 2px solid var(--orange); outline-offset: 2px; }
.bench-colour-any { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-dim); cursor: pointer; }
.bench-colour-any input { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; }

/* ---- emergency stop: first-class, armed by default ---- */
.estop { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--bad) 14%, transparent), transparent 60%), var(--panel); }
.estop[data-armed="0"] { border-color: color-mix(in srgb, var(--mint) 45%, var(--line)); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--mint) 12%, transparent), transparent 60%), var(--panel); }
.estop-btn { position: relative; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--bad) 70%, white 0%); background: radial-gradient(circle at 35% 30%, #ff8095, var(--bad)); box-shadow: 0 0 20px -4px var(--bad); cursor: pointer; transition: transform .1s var(--ease), box-shadow var(--fast) var(--ease); }
.estop-btn::before { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, .92); }
.estop-btn:hover { box-shadow: 0 0 28px -2px var(--bad); }
.estop-btn:active { transform: scale(.94); }
.estop[data-armed="0"] .estop-btn { border-color: color-mix(in srgb, var(--mint) 70%, transparent); background: radial-gradient(circle at 35% 30%, #6ff0c6, var(--mint)); box-shadow: 0 0 20px -4px var(--mint); }
.estop[data-armed="0"] .estop-btn::before { border-radius: 50%; width: 14px; height: 14px; background: transparent; border: 3px solid rgba(255, 255, 255, .92); border-top-color: transparent; }
.estop-text { display: flex; flex-direction: column; gap: 2px; }
.estop-state { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bad); }
.estop[data-armed="0"] .estop-state { color: var(--mint); }
.estop-sub { font-size: 12.5px; color: var(--ink-dim); }

/* ---- the code (reuse bench.css .code): as tall as the blocks, big enough to read from the back of the room ----
   The code scrolls inside its pane; a line the last block change wrote lights up for a moment (studio.js renderCode). */
.code-col .code { font-size: 14.5px; }
.code-col .code pre { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 0; }
.code-col .code .c { line-height: 1.75; }
.code-col .code .g { min-width: 3ch; }
.code .ln.fresh { animation: fresh 1.6s var(--ease); }
@keyframes fresh { from { background: color-mix(in srgb, var(--orange) 26%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .code .ln.fresh { animation: none; } }
.code-col .taken { flex: 1 1 auto; min-height: 0; }
.code-col .taken textarea { flex: 1 1 auto; min-height: 200px; font-size: 14.5px; resize: none; }
.code-col .take-ask { flex: none; }

/* ---- player two ---- */
.p2 { border-radius: 14px; padding: 18px; border: 1px solid color-mix(in srgb, var(--blue) 36%, transparent); background: radial-gradient(closest-side circle at 100% 0%, rgba(46, 155, 255, .12), transparent), var(--panel); }
.p2-head { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-lt); margin-bottom: 10px; }
.p2-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); animation: pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .p2-dot { animation: none; } }
.p2-body p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.p2-body .why { color: var(--ink-dim); font-size: 13.5px; }
.p2-body b { color: var(--ink); font-weight: 600; }
.p2-body code { font-family: var(--mono); font-size: 12.5px; color: var(--orange-lt); background: rgba(255, 138, 30, .1); padding: 1px 5px; border-radius: 5px; }
.p2-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

/* ---- halted: the program and code read as stopped ---- */
.studio.halted .program, .studio.halted .code, .studio.halted .mirror { opacity: .5; transition: opacity var(--fast) var(--ease); }
.studio.halted .code { filter: grayscale(.4); }

/* ---- asking player two (Claude): the conversation, the sign-in, the ask box ---- */
.p2-who { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--ink-dim); font-size: 12px; }
.p2-head { display: flex; }
.p2-thread { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; max-height: 420px; overflow-y: auto; }
.p2-thread:empty { display: none; }
.p2-turn { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.p2-turn.you { align-self: flex-end; max-width: 88%; color: var(--ink); background: color-mix(in srgb, var(--orange) 12%, transparent); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.p2-turn.p2 { color: var(--ink-2); background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); }
.p2-turn.p2.wait { color: var(--ink-faint); font-style: italic; }
.p2-turn pre { margin: 8px 0 0; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-family: var(--mono); font-size: 12.5px; color: var(--ink); white-space: pre; overflow-x: auto; }
.p2-turn .p2-label { display: block; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-lt); }
.p2-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p2-signin input, .p2-ask textarea { flex: 1 1 120px; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.p2-ask textarea { display: block; width: 100%; box-sizing: border-box; margin-bottom: 8px; resize: vertical; }
.p2-signin input:focus-visible, .p2-ask textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.btn.p2-quiet { color: var(--ink-dim); background: transparent; border-color: var(--line); font-weight: 500; }
.btn.p2-quiet:hover { color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: progress; }
.p2-err { margin: 6px 0 0; font-size: 13px; color: var(--bad); }
.p2-err:empty { display: none; }

/* ---- player two's answer: the concept it names, its words, and the changes to keep or drop ---- */
.p2-turn.p2 { white-space: normal; }
.p2-said { margin: 0 0 8px; white-space: pre-wrap; }
.p2-said:last-child { margin-bottom: 0; }
.p2-concept { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--blue) 10%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); color: var(--ink-2); }
.p2-concept .p2-label { display: inline; margin: 0 8px 0 0; }
.p2-concept b { color: var(--ink); font-weight: 600; }
.hunks { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.change-lead { margin: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--blue-lt); }
.hunk { border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); overflow: hidden; transition: opacity var(--fast) var(--ease); }
.hunk.dropped { opacity: .55; }
.hunk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.hunk .keep { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); cursor: pointer; }
.hunk .keep input { width: 16px; height: 16px; accent-color: var(--orange); }
.hunk .keep-said { color: var(--ink-faint); }
.hunk-lines { padding: 6px 10px; font-size: 13.5px; line-height: 1.7; }
.hunk-lines .add { color: var(--ink); }
.hunk-lines .del { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.hunk-lines .mark { font-family: var(--mono); color: var(--ink-faint); user-select: none; }
.hunk-lines .add .mark { color: var(--mint); }
.hunk-lines code { font-family: var(--mono); font-size: 12px; color: var(--orange-lt); }
.hunk-lines .sw { display: inline-block; width: 11px; height: 11px; margin: 0 4px 0 2px; border-radius: 3px; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, .25); }
.hunk-label { margin: 4px 0 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.p2-turn pre.hunk-code { margin: 0; }
.hunk-code .add { display: inline-block; width: 100%; background: color-mix(in srgb, var(--mint) 14%, transparent); }
.gate-note { margin: 0; font-size: 13px; color: var(--caution); }
.change-result { margin: 0; font-size: 13px; color: var(--ink-dim); }
.change-actions { margin-top: 2px; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* shipping to a device (studio.js ship*) */
.ship-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); background: var(--panel); }
.ship-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ship-state { font-size: 12.5px; color: var(--ink-dim); }
.ship-form { display: flex; flex-direction: column; gap: 8px; }
.ship-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-dim); }
.ship-row > span:first-child { flex: 0 0 72px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.ship-row input, .ship-row select { flex: 1 1 140px; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; }
.ship-row input[type="number"] { flex: 0 1 90px; }
.ship-row input:focus-visible, .ship-row select:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.ship-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ship-list { display: flex; flex-direction: column; gap: 6px; }
.ship-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13px; }
.ship-item .ship-label { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.ship-item .chip { font-family: var(--mono); font-size: 10.5px; text-transform: lowercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); }
.ship-item .chip.on { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 50%, var(--line)); }
.ship-item .btn { padding: 4px 10px; font-size: 12.5px; }

/* ---- take the code (rung 3): the code the blocks wrote, now the student's own to edit ---- */
.code .bar { flex-wrap: wrap; }
.code .bar .code-btn { padding: 4px 10px; font-size: 12px; text-transform: none; letter-spacing: .02em; }
.take-ask, .taken { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.taken textarea { width: 100%; min-height: 280px; resize: vertical; box-sizing: border-box; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 4; color: var(--ink); background: #070a12; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; white-space: pre; overflow: auto; }
.taken textarea:focus { border-color: color-mix(in srgb, var(--orange) 60%, var(--line)); }
.taken-row { flex-wrap: wrap; }
.taken-row input { flex: 1 1 120px; min-width: 0; font-family: var(--mono); font-size: 13px; padding: 6px 10px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.code-say-bad { color: var(--bad); }
.code-list { display: flex; flex-direction: column; gap: 6px; padding: 0 14px 12px; }
.code-list:empty { display: none; }
.code-list .ship-item { font-family: inherit; }

/* ---- the simulator (bench-sim.js): footprints, breakpoints, a device face ---- */
.sim { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.sim-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sim-head .flabel { margin: 0; }
.sim-state { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.sim-controls .btn { padding: 6px 12px; font-size: 13px; }
.sim-speed select { font-family: var(--mono); font-size: 12px; padding: 6px 8px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); max-width: 100%; }
.sim-inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sim-inputs .btn { padding: 6px 12px; font-size: 13px; touch-action: none; user-select: none; }
.sim-inputs .btn.held { border-color: var(--orange); color: var(--orange); }
.sim-row { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; font-size: 13px; color: var(--ink-dim); }
.sim-row input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--orange); }
.sim-row output { font-family: var(--mono); color: var(--ink); min-width: 2.5ch; text-align: right; }
.sim-face { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); background: #070a12; border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.sim-face .px { width: 22px; height: 22px; border-radius: 50%; background: #1a1f2b; }
.sim-face .dot { width: 14px; height: 14px; border-radius: 3px; background: #1a1f2b; }
.sim-face .big { width: 40px; height: 40px; border-radius: 50%; background: #1a1f2b; }
.sim-face .ink { padding: 6px 12px; border-radius: 4px; background: #e8e6df; color: #1b1b1b; min-width: 8ch; }
.sim-face .tune { color: var(--blue-lt); }
.sim-trace { margin: 0; padding: 0 0 0 4px; list-style: none; max-height: 168px; overflow-y: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--ink-dim); }
.sim-trace li { display: grid; grid-template-columns: 5ch 1fr; gap: 6px; }
.sim-trace li .at { color: var(--ink-faint); }
.sim-trace li:last-child { color: var(--ink); }
.code .ln.here { background: color-mix(in srgb, var(--orange) 16%, transparent); box-shadow: inset 3px 0 0 var(--orange); }
.code .g { cursor: pointer; }
.code .ln.bp .g { color: var(--bad); font-weight: 700; }
.code .ln.bp .g::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--bad); vertical-align: middle; }

/* ---- sharing with a classmate ---- */
.share-open { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.share-open input { flex: 1 1 140px; min-width: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.share-open .btn { padding: 6px 12px; font-size: 13px; }
.share-open .p2-note { flex: 1 1 100%; margin: 0; }
.share-open .p2-note:empty { display: none; }
.share-code { font-family: var(--mono); letter-spacing: .12em; color: var(--orange); }

/* ---- your code, drawn as blocks (code-blocks.js): the same glow as the when/do blocks, read off --neon ----
   Paused (the text holds something the blocks cannot draw exactly), the drawing dims so the text reads as the truth. */
.code-program .blocklyText { font-family: var(--mono) !important; font-weight: 500 !important; }
.code-program.stale .blocks-host { opacity: .45; filter: grayscale(.5); pointer-events: none; transition: opacity var(--fast) var(--ease); }
.code-program.stale .blocks-note { color: var(--caution); }
.back-ask { border-top: 0; padding: 0 0 4px; }
.back-ask .p2-note { color: var(--caution); }

/* saved code and share codes, under the workbench (their home is /programs) */
.code-open { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.code-open .code-list { padding: 12px 14px 0; }
.code-open .share-open { border-top: 0; padding: 12px 14px; }
.code-open .code-list:not(:empty) + .share-open { border-top: 1px solid var(--line); margin-top: 12px; }
