/* Python Blocks (/python-blocks). It wears Video Studio's frame (video-studio.css)
   and is laid out like Scratch 3: menus and Save along the top; under them
   the view switch on the left and, over the stage column, Run and
   stop; then the categories, the always-open palette and the blocks, with the
   stage column on the right (the output on top, the Python under it). On a
   phone one of blocks, Python or output shows at a time, picked from the
   tabs along the bottom. */

.pb-work {
  --pb-stage-w: var(--pb-stage-user, clamp(320px, 33vw, 520px));
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
/* Over Blockly's categories (z-index 70) and palette. */
.pb-menu { z-index: 120; max-height: 72vh; overflow-y: auto; }
/* The menus and the bars' buttons in a size to read at a glance. */
.pb-app :is(.vs-menubtn, .vs-name, .vs-menu-item, .pb-run, .pb-stop, .vs-export, .pb-add-files, .pb-layout .seg-btn, .pb-tab, .pb-file-tab, .pb-media-tab) { font-size: 0.9rem; }
.pb-menu-head { margin: 6px 10px 2px; color: var(--accent-strong); font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* The bar: the view switch over the blocks, Run and Stop over the stage. */
.pb-bar { display: grid; grid-template-columns: minmax(0, 1fr) var(--pb-stage-w); align-items: center; min-width: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.pb-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; }
/* The view switch keeps its size: a long message beside it gives way. */
.pb-layout { flex: none; }
.pb-bar-stage { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 4px 8px; border-left: 1px solid var(--border); }
.pb-run, .pb-stop, .pb-add-files { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.pb-stop:disabled { opacity: 0.45; cursor: default; }
.pb-state { margin: 0 0 0 6px; overflow: hidden; color: var(--muted); font-size: 0.78rem; white-space: nowrap; text-overflow: ellipsis; }
/* What the app has to say (app.say), against Run, where the eye is after
   Run: at the right end of the bar's room over the blocks, which is mostly
   free (the view switch only), three lines at most. One cut short shows whole
   on hover, or on a press, over what is under the bar. A warning has a
   button to hide it. Empty, it is still there (no display: none), so a
   screen reader hears each new one. */
.pb-msg-box { display: flex; flex: 0 1 auto; align-items: center; gap: 2px; min-width: 0; margin-left: auto; }
.pb-msg { display: -webkit-box; min-width: 0; margin: 0; overflow: hidden; color: var(--text); font-size: 0.76rem; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
.pb-msg:not(:empty) { padding: 1px 0 1px 8px; border-left: 3px solid var(--muted); }
.pb-msg.is-cut { cursor: pointer; }
/* Whole, it hangs down from the bar (the bar keeps its height). */
.pb-msg-box.is-whole { height: 50px; align-items: flex-start; }
.pb-msg-box.is-whole .pb-msg { position: relative; z-index: 110; display: block; overflow: visible; padding: 4px 10px 6px 8px; background: var(--surface); box-shadow: 0 0 0 1px var(--border), 0 6px 16px rgba(0, 0, 0, 0.4); }
.pb-msg[data-kind="warn"] { border-color: #e8b44f; }
.pb-msg[data-kind="ok"] { border-color: #2ec4b6; }
.pb-msg-x { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; color: var(--muted); background: none; border: 0; border-radius: 0; cursor: pointer; }
.pb-msg-x[hidden] { display: none; }
@media (hover: hover) { .pb-msg-x:hover { color: var(--bg); background: var(--gold); } }
.pb-msg-x:active { color: var(--bg); background: var(--gold); }
.pb-msg-x:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* The body: blocks on the left; output over Python on the right. */
.pb-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pb-stage-w);
  grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "blocks out" "blocks code";
  min-height: 0;
  min-width: 0;
}
.pb-body[data-layout="blocks"] { grid-template-areas: "blocks out" "blocks out"; }
.pb-body[data-layout="blocks"] .pb-code { display: none; }
.pb-body[data-layout="code"] { grid-template-areas: "code out" "code out"; }
.pb-body[data-layout="code"] .pb-blocks { display: none; }
.pb-blocks { grid-area: blocks; position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.pb-ws { position: absolute; inset: 0; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pb-out { grid-area: out; }
.pb-code { grid-area: code; border-top: 1px solid var(--border); }
.pb-body[data-layout="code"] .pb-code { border-top: 0; }
.pb-out, .pb-code { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-left: 1px solid var(--border); }
.pb-body[data-layout="code"] .pb-code { border-left: 0; }
.pb-pane-head { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--border); }
.pb-pane-title { margin: 0; color: var(--muted); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.pb-pane-btns { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pb-pane-btns .vs-ib { width: 34px; height: 34px; }

.pb-src, .pb-editor { flex: 1 1 auto; min-height: 0; margin: 0; padding: 10px 12px; overflow: auto; color: #e9e4f5; background: #14111d; border: 0; font: 0.84rem/1.55 var(--mono); tab-size: 4; white-space: pre; scrollbar-width: thin; }
.pb-editor { resize: none; outline: none; }
.pb-code-err { flex: none; margin: 0; padding: 8px 12px; color: #ffd9a8; background: #3a2414; border-bottom: 1px solid #e8b44f; font-size: 0.8rem; line-height: 1.4; }
.pb-code-err[hidden] { display: none; }
.pb-editor:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.pb-src:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.pb-line { display: inline-block; min-width: 100%; }
.pb-line.is-error { background: rgba(232, 93, 93, 0.22); box-shadow: inset 3px 0 0 #e85d5d; }
/* The selected block's lines; a click on a line selects its block. */
.pb-src .pb-line { cursor: pointer; }
.pb-line.is-current { background: rgba(139, 92, 246, 0.2); box-shadow: inset 3px 0 0 #a78bfa; }
.pb-line.is-current.is-error { background: rgba(232, 93, 93, 0.22); box-shadow: inset 3px 0 0 #e85d5d; }
.pb-k { color: #c792ea; }
.pb-b { color: #82aaff; }
.pb-s { color: #c3e88d; }
.pb-n { color: #f78c6c; }
.pb-c { color: #7d7891; font-style: italic; }

.pb-out-tabs { display: flex; gap: 2px; }
.pb-out-tab { min-height: 32px; padding: 4px 12px; color: var(--muted); background: none; border: 0; border-radius: 0; font: inherit; font-size: 0.78rem; cursor: pointer; }
.pb-out-tab.is-active { color: var(--tint-text); background: var(--tint); }
.pb-out-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pb-console { flex: 1 1 auto; min-height: 0; margin: 0; padding: 10px 12px; overflow: auto; background: #0f0d16; font: 0.84rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; cursor: text; }
.pb-console[hidden] { display: none; }
/* An empty output says what goes there (not while a program runs). */
.pb-app:not([data-run="running"]) .pb-console:empty::before { content: attr(data-empty); color: var(--muted); font-family: var(--body, Inter, system-ui, sans-serif); font-size: 0.8rem; }
.pb-console:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
/* The output and the Python are text to select and copy, on a computer and a phone,
   although the studio frame around them is not (video-studio.css). */
.pb-work :is(.pb-console, .pb-src) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.pb-work :is(.pb-console, .pb-src) * { -webkit-user-select: text; user-select: text; }
.pb-console ::selection, .pb-src ::selection { color: #fff; background: rgba(139, 92, 246, 0.55); }
.pb-out-line { color: #e9e4f5; }
.pb-out-err { color: #ff8b8b; }
.pb-out-answer { color: #9be7c4; }
.pb-out-note { display: block; margin: 4px 0; color: var(--muted); font-family: inherit; font-size: 0.78rem; }
.pb-out-note.is-err { color: #ff8b8b; white-space: pre-wrap; font-family: var(--mono); }
.pb-out-note.is-ok { color: #6fd3a8; }
/* Each run's line, and what runs before printed, dimmed. */
.pb-out-run { display: block; margin: 8px 0 4px; color: var(--muted); font-size: 0.74rem; }
.pb-console > .is-old { opacity: 0.45; }
/* A failed run: where it stopped and what that means, then Python's own message under it. */
.pb-out-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 4px; color: #ffd0d0; font-family: var(--body, Inter, system-ui, sans-serif); font-size: 0.86rem; line-height: 1.4; white-space: normal; }
.pb-out-stop > span { flex: 1 1 16em; min-width: 0; }
.pb-out-stop button { flex: none; min-height: 32px; padding: 0 12px; color: #ffd9d9; background: none; border: 1px solid #ff8a8a; border-radius: 0; font: inherit; font-size: 0.8rem; cursor: pointer; }
.pb-out-stop button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pb-out-trace { margin: 0 0 6px; }
.pb-out-trace summary { width: max-content; color: var(--muted); font-family: var(--body, Inter, system-ui, sans-serif); font-size: 0.76rem; cursor: pointer; }
.pb-out-trace summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pb-out-trace .pb-out-err { padding: 2px 0 0 12px; border-left: 2px solid rgba(255, 139, 139, 0.4); }
.pb-ask { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface-2); border-top: 1px solid var(--border); }
.pb-ask[hidden] { display: none; }
.pb-ask-label { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
/* In the Output, right under the question it answers (the question is its label, for a screen reader: it shows just above). */
.pb-console > .pb-ask { margin: 4px 0 6px; padding: 4px 0; background: none; border: 0; white-space: normal; font-family: var(--body, Inter, system-ui, sans-serif); }
.pb-console > .pb-ask .btn { flex: none; white-space: nowrap; }
.pb-ask-label.is-question { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pb-ask-input { flex: 1 1 auto; min-width: 0; padding: 6px 9px; font: 0.84rem var(--mono); }
.pb-screen { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #ffffff; }
.pb-screen[hidden] { display: none; }

/* Blocks, Python or output, on a phone: a switch beside Run. */
.pb-tabs { display: none; margin-left: auto; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; }
.pb-tab { min-width: 0; min-height: 36px; padding: 0 10px; color: var(--muted); background: none; border: 0; border-radius: 0; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.pb-tab.is-active { color: var(--tint-text); background: var(--tint); }
.pb-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pb-tab:active { color: var(--bg); background: var(--gold); }
.pb-examples { margin-top: 8px; }
/* The example picked stays lit while it opens; the rest fade, as they wait. */
.pb-examples[inert] .vs-maker-btn { opacity: 0.45; }
.pb-examples .vs-maker-btn.is-picked { opacity: 1; border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
/* Asked there, if the program is not saved: the question stands out. */
.pb-examples-note b { color: var(--text); }
/* Help > Getting started: four big numbered steps. */
.pb-intro { display: grid; gap: 14px; }
.pb-intro-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: pb-step; }
.pb-intro-steps li { display: flex; align-items: baseline; gap: 12px; font-size: 1rem; line-height: 1.45; counter-increment: pb-step; }
.pb-intro-steps li::before { content: counter(pb-step); flex: none; width: 1.7em; height: 1.7em; color: var(--bg); background: var(--gold); font-weight: 700; line-height: 1.7em; text-align: center; }
.pb-intro-off { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86rem; cursor: pointer; }
.pb-intro-off input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* An empty workspace says what to do, faintly, in the middle of the blocks
   (right of the palette, --pb-pal-w from main.js). */
.pb-ws-empty { position: absolute; top: 44px; left: var(--pb-pal-w, 0px); right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: center; margin: 0; padding: 24px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; text-align: center; text-wrap: balance; opacity: 0.75; pointer-events: none; }
.pb-ws-empty[hidden] { display: none; }
/* Not under the veil below, which says what to do instead. */
.is-editing .pb-ws-empty { display: none; }
/* While the Python is being edited the blocks are read-only, under a veil
   that says so (main.js setEditing); pressing it is Use as blocks. It is
   over the palette too (over Blockly's categories, z-index 70); the script
   tabs over the blocks stay in reach. */
.pb-ws-lock { position: absolute; top: 44px; left: 0; right: 0; bottom: 0; z-index: 71; display: flex; align-items: center; justify-content: center; margin: 0; padding: 24px; color: var(--text); background: rgba(20, 17, 31, 0.62); border: 0; border-radius: 0; font: inherit; cursor: pointer; }
.pb-ws-lock > span { max-width: 24em; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 3px 3px 0 var(--edge); font-size: 0.92rem; line-height: 1.5; text-align: center; text-wrap: balance; }
.pb-ws-lock b { white-space: nowrap; }
@media (hover: hover) { .pb-ws-lock:hover > span { border-color: var(--gold); } }
.pb-ws-lock:focus-visible { outline: none; }
.pb-ws-lock:focus-visible > span { box-shadow: var(--focus-ring); }
/* Zoom in, out and back to normal, bottom right of the blocks, as in Scratch. */
.pb-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.pb-zoom .vs-ib { width: 40px; height: 40px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; box-shadow: 3px 3px 0 var(--edge); }

/* ---- Blockly, dressed like Scratch: a column of round colour swatches with
   their names, then the palette, always open. ---- */
.pb-blocks .blocklyToolbox {
  width: 84px;
  padding: 4px 0 8px;
  background: #1d1929;
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  scrollbar-width: none;
}
.pb-blocks .blocklyToolboxCategoryContainer { margin: 0; }
.pb-blocks .blocklyToolboxCategory {
  display: flex;
  justify-content: center;
  min-height: 52px;
  margin: 0;
  padding: 6px 2px;
  border-radius: 0;
  background-color: transparent !important;
  cursor: pointer;
  transition: background 140ms ease;
}
.pb-blocks .blocklyTreeRowContentContainer { align-items: center; gap: 3px; }
.pb-blocks .categoryBubble { width: 22px; height: 22px; margin: 0; border: 1px solid rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pb-blocks .blocklyToolboxCategoryLabel {
  max-width: 80px;
  padding: 0;
  color: var(--muted);
  font: 600 0.75rem/1.15 Inter, system-ui, sans-serif;
  text-align: center;
  overflow-wrap: break-word;
  white-space: normal;
}
/* The line in the rail between the core categories and the rest, with More under it (blocks.js). */
.pb-blocks .pb-rail-more { height: auto; margin: 6px 8px 4px; border-bottom: 0; border-top: 1px solid var(--border); }
.pb-blocks .pb-rail-more::after { content: "More"; display: block; padding: 5px 0 1px; color: var(--accent-strong); font: 600 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.pb-blocks .blocklyToolboxCategory.blocklyToolboxSelected { background-color: rgba(139, 92, 246, 0.16) !important; }
.pb-blocks .blocklyToolboxSelected .blocklyToolboxCategoryLabel { color: var(--text); }
.pb-blocks .blocklyToolboxSelected .categoryBubble { box-shadow: 0 0 0 2px var(--accent-strong); }
@media (hover: hover) {
  .pb-blocks .blocklyToolboxCategory:hover { background-color: rgba(232, 180, 79, 0.12) !important; }
  .pb-blocks .blocklyToolboxCategory:hover .blocklyToolboxCategoryLabel { color: var(--gold); }
}
.pb-blocks .blocklyFlyoutBackground { fill: #221d31; fill-opacity: 1; }
/* The palette's category headings, Scratch style: bold, on their own line. */
.pb-blocks .blocklyFlyoutLabelText { fill: #e9e4f5; font-weight: 700; }
.pb-blocks .blocklyFlyoutButtonBackground { fill: #2c2540; stroke: #4a4166; }
.pb-blocks .blocklyFlyoutButton:hover .blocklyFlyoutButtonBackground { fill: #e8b44f; stroke: #e8b44f; }
.pb-blocks .blocklyFlyoutButton:hover .blocklyText { fill: #141120; }
.blocklyToolboxCategoryLabel, .blocklyTreeLabel { font-family: Inter, system-ui, sans-serif; }
.blocklyWidgetDiv .blocklyMenu, .blocklyDropDownDiv { font-family: Inter, system-ui, sans-serif; }
/* No key hints in the right-click menus where there are no keys to press. */
@media (max-width: 760px), (hover: none) { .blocklyContextMenu .blocklyShortcut, .pb-app .vs-menu-item kbd { display: none; } }
/* Several lines of Python: their first line in white, as a block's words are. */
.pb-blocks .blocklyText.pb-lines-text { fill: #fff; }

@media (max-width: 760px) {
  .pb-work { --pb-stage-w: 100%; }
  .pb-bar { grid-template-columns: minmax(0, 1fr); }
  .pb-bar-left { display: none; }
  .pb-bar-stage { border-left: 0; padding: 2px 6px; }
  .pb-body, .pb-body[data-layout] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "main"; }
  .pb-body[data-layout] > * { grid-area: main; border-left: 0; border-top: 0; }
  .pb-body[data-layout] .pb-blocks, .pb-body[data-layout] .pb-code, .pb-body[data-layout] .pb-out { display: none; }
  .pb-body[data-pane="blocks"] .pb-blocks { display: block; }
  .pb-body[data-pane="code"] .pb-code, .pb-body[data-pane="out"] .pb-out { display: flex; }
  .pb-work { grid-template-rows: auto auto minmax(0, 1fr); }
  .pb-tabs { display: flex; }
  .pb-state { display: none; }
  .pb-app[data-run="loading"] .pb-state, .pb-app[data-run="running"] .pb-state { display: block; flex: 1 1 auto; min-width: 0; }
  .pb-work .vs-menubtn { min-height: 36px; }
  .pb-work .vs-menubtn:nth-child(n + 4) { display: inline-block; }
  .pb-work .vs-top { flex-wrap: nowrap; }
  .pb-work .vs-top-btns .vs-ib { width: 36px; height: 36px; }
  .pb-work .vs-export, .pb-work .pb-add-files { min-width: 36px; min-height: 36px; margin-left: 2px; padding: 0 9px; }
  .pb-work .vs-export span, .pb-work .pb-add-files span { display: none; }
  /* Undo and Redo stay; Fill the window (the editor fills a phone's screen already) is under Help. */
  #pb-help, #pb-max { display: none; }
  .pb-pane-btns .vs-ib { width: 40px; height: 40px; }
  .pb-out-tab { min-height: 40px; }
  .pb-blocks .blocklyToolbox { width: 78px; }
  .pb-blocks .blocklyToolboxCategory { min-height: 50px; padding: 5px 1px; }
  .pb-blocks .blocklyToolboxCategoryLabel { max-width: 76px; font-size: 0.75rem; }
  .pb-zoom { right: 10px; bottom: 10px; }
  .pb-ws-empty { top: 48px; font-size: 0.86rem; }
  .pb-ws-lock { top: 48px; }
  .pb-blocks.is-drawer .pb-ws-empty { display: none; }
  /* No room in the bar on a phone: the message shows whole over the foot of
     the pane, clear of the categories, the zoom buttons and the Output
     handle (and of the answer box when the program asks), and lets the taps
     under it through but for its hide button. */
  .pb-msg-box { position: absolute; left: 86px; right: 58px; bottom: 42px; z-index: 100; margin: 0; pointer-events: none; }
  .pb-work:has(.pb-body:not([data-pane="blocks"])) .pb-msg-box { left: 10px; right: 10px; bottom: 12px; }
  .pb-work:has(.pb-ask:not([hidden])) .pb-msg-box { bottom: 70px; }
  .pb-msg-box.is-on { padding: 6px 4px 6px 8px; background: rgba(20, 17, 31, 0.96); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
  .pb-msg { display: block; font-size: 0.8rem; }
  .pb-msg-x { width: 36px; height: 36px; pointer-events: auto; }
}
/* A small phone (375 px, 360, the oldest 320) has no room for every button
   in the bars: Add files goes (File has Add pictures and sounds, and Add a
   script from a file) so Save stays in reach, and Run, Stop and the pane
   tabs are narrower so Output shows whole. On the smallest the menus are
   narrower too. */
@media (max-width: 385px) {
  .pb-work .pb-add-files { display: none; }
  .pb-bar-stage .pb-run, .pb-bar-stage .pb-stop { padding-inline: 8px; }
  .pb-tab { padding-inline: 6px; }
}
@media (max-width: 340px) {
  .pb-work .vs-menubtn { padding: 5px 4px; }
}

/* On a wide screen the site draws the page at 90% (html { zoom: 0.9 } in
   app.css, at the same width). Blockly places its floating layers (the text
   box that edits a field, the right-click menu, dropdowns) with screen
   pixels from getBoundingClientRect, which that zoom shrank toward the top
   left: the text being edited floated up and left of its field. These
   layers undo the zoom, so their positions are screen pixels, and what is
   inside them takes it again, so it is drawn the size of the blocks. */
@media (min-width: 1000px) {
  .blocklyWidgetDiv, .blocklyDropDownDiv { zoom: calc(1 / 0.9); }
  .blocklyWidgetDiv > *, .blocklyDropDownDiv > .blocklyDropDownContent { zoom: 0.9; }
}

/* Blockly's own questions (a new variable's name, renaming one) in the site's dialog dress. */
.blocklyDialog { min-width: min(340px, calc(100vw - 32px)); padding: 18px 20px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: 3px 3px 0 var(--edge); font: 0.95rem/1.4 var(--body, Inter, system-ui, sans-serif); }
.blocklyDialog::backdrop { background: rgba(10, 8, 18, 0.6); }
.blocklyDialogForm { row-gap: 12px; }
.blocklyDialogPrompt { font-weight: 600; }
.blocklyDialogForm input { min-height: 40px; padding: 8px 12px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-size: 16px; outline: none; }
.blocklyDialogForm input:focus-visible { border-color: var(--accent); box-shadow: var(--focus-ring); }
.blocklyDialogButtonRow { gap: 8px; }
.blocklyDialogButtonRow button { min-height: 38px; padding: 0 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-weight: 600; cursor: pointer; }
.blocklyDialogButtonRow .blocklyDialogConfirmButton { color: #fff; background: var(--fill, var(--accent)); border-color: transparent; }
@media (hover: hover) {
  .blocklyDialogButtonRow button:hover { color: var(--bg); background: var(--gold); border-color: var(--gold); }
}
.blocklyDialogButtonRow button:active { color: var(--bg); background: var(--gold); transform: scale(0.94); }
/* The blocks pan by dragging the background or with the wheel: their scroll bars stay hidden (the palette keeps its own). */
.pb-ws .blocklyMainWorkspaceScrollbar { display: none; }
