/* Python Blocks: resize.js. The handles between the parts: a wide grab
   area with a thin line in it, shown on hover (gold, under the pointer)
   or keyboard focus (purple). The palette's sits on its right edge, over
   Blockly's categories (z-index 70). On a phone the one handle is the
   Output tab at the foot of the blocks, which pulls the output up under them. */
.pb-body { position: relative; grid-template-rows: minmax(0, var(--pb-out-fr, 1.15fr)) minmax(0, var(--pb-code-fr, 1fr)); }
.pb-split { position: absolute; z-index: 9; touch-action: none; outline: none; -webkit-user-select: none; user-select: none; }
.pb-split[hidden] { display: none; }
/* Placed on the whole body, never in a grid area (a phone puts every child of the body in one). */
.pb-body[data-layout] > .pb-split { grid-area: auto; }
.pb-split::before { content: ""; position: absolute; background: transparent; border-radius: 0; transition: background 160ms ease; }
.pb-split-stage, .pb-split-palette { top: 0; bottom: 0; width: 12px; cursor: col-resize; }
.pb-split-stage { right: var(--pb-stage-w); transform: translateX(50%); }
.pb-split-palette { top: 44px; z-index: 72; transform: translateX(-50%); }
.pb-split-stage::before, .pb-split-palette::before { top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%); }
.pb-split-split { right: 0; width: var(--pb-stage-w); height: 12px; top: calc(var(--pb-split, 0.5349) * 100%); transform: translateY(-50%); cursor: row-resize; }
.pb-split-split::before { left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); }
.pb-split-grip { position: absolute; top: 50%; left: 50%; display: block; width: 4px; height: 32px; background: var(--border); border-radius: 0; opacity: 0; transform: translate(-50%, -50%); transition: opacity 160ms ease, background 160ms ease; }
.pb-split-split .pb-split-grip { width: 32px; height: 4px; }
.pb-split:focus-visible::before { background: var(--accent); }
.pb-split:focus-visible .pb-split-grip { opacity: 1; background: var(--accent-strong); }
@media (hover: hover) {
  .pb-split:hover::before { background: var(--gold); }
  .pb-split:hover .pb-split-grip { opacity: 1; background: var(--gold); }
}
.pb-split.is-dragging::before { background: var(--gold); }
.pb-split.is-dragging .pb-split-grip { opacity: 1; background: var(--gold); }
body.pb-resizing-x, body.pb-resizing-x * { cursor: col-resize !important; -webkit-user-select: none !important; user-select: none !important; }
body.pb-resizing-y, body.pb-resizing-y * { cursor: row-resize !important; -webkit-user-select: none !important; user-select: none !important; }
/* Only where the parts it sits between both show. */
.pb-body:not([data-layout="both"]) .pb-split-split, .pb-body.is-media .pb-split-split { display: none; }
.pb-body[data-layout="code"] .pb-split-palette, .pb-body.is-media .pb-split-palette { display: none; }
.pb-split-dock { display: none; }

@media (max-width: 760px) {
  .pb-split-stage, .pb-split-split, .pb-split-palette { display: none; }
  .pb-split-dock { bottom: var(--pb-dock-h, 0px); left: 50%; display: flex; align-items: center; justify-content: center; gap: 6px; width: 112px; height: 30px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; border-radius: 0; font: 600 0.72rem var(--body); transform: translateX(-50%); cursor: row-resize; }
  .pb-split-dock::before { display: none; }
  .pb-split-dock .pb-split-grip { position: static; width: 20px; height: 4px; opacity: 1; background: var(--muted); transform: none; }
  .pb-split-dock:focus-visible { box-shadow: var(--focus-ring); }
  .pb-split-dock:active, .pb-split-dock.is-dragging { color: var(--bg); background: var(--gold); border-color: var(--gold); }
  .pb-split-dock:active .pb-split-grip, .pb-split-dock.is-dragging .pb-split-grip { background: var(--bg); }
  .pb-body:not([data-pane="blocks"]) .pb-split-dock, .pb-body.is-media .pb-split-dock { display: none; }
  /* Pulled up: the output under the blocks, as tall as the handle left it. */
  .pb-body.has-dock[data-pane="blocks"]:not(.is-media) { grid-template-rows: minmax(0, 1fr) var(--pb-dock-h, 40%); grid-template-areas: "main" "dock"; }
  .pb-body.has-dock[data-pane="blocks"]:not(.is-media) .pb-out { display: flex; grid-area: dock; border-top: 1px solid var(--border); }
  /* The zoom buttons stay clear of the tab. */
  .pb-body.has-dock[data-pane="blocks"] .pb-zoom { bottom: 14px; }
}
