/* playground.css — the floating playground (playground.js), on every Python lesson page. */
.pgf-tools { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.pgf-b { height: 28px; min-width: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
  color: inherit; font: 700 12.5px/1 system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.pgf-b:hover { background: rgba(255,255,255,.18); }
.pgf-b[aria-pressed="true"] { background: rgba(255,255,255,.28); }
.pgf-b[hidden] { display: none; }
.pgf-min, .pgf-max { display: none; }             /* only while floating */
.pgf-resize { display: none; }

/* floating: a window over the lesson (left / top / width / height set by playground.js) */
.pgf.px-panel, .pgf.rx-panel, .pgf.pg-panel {
  position: fixed !important; right: auto !important; bottom: auto !important; transform: none !important;
  max-width: none !important; border-radius: 14px; overflow: hidden; z-index: 1450;
  box-shadow: 0 24px 60px -18px rgba(10, 20, 30, .45), 0 0 0 1px rgba(0,0,0,.08);
  transition: opacity .18s ease, box-shadow .18s ease;
}
/* a floating playground that is closed is not there at all */
.pgf.px-panel:not(.is-open), .pgf.rx-panel:not(.is-open), body:not(.pg-open) .pgf.pg-panel { display: none !important; }
.pgf .pgf-min, .pgf .pgf-max { display: inline-block; }
.pgf.pgf--max { border-radius: 12px; }
.pgf.pgf--max .pgf-head { cursor: default; }
.pgf.pgf--max .pgf-resize { display: none; }
.pgf .pgf-head { cursor: grab; user-select: none; }
.pgf.pgf--moving .pgf-head { cursor: grabbing; }
.pgf.pgf--moving { transition: none; }
.pgf.pgf--moving * { user-select: none; }
.pgf .pgf-resize { display: block; position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize; z-index: 3;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.28) 50%, rgba(0,0,0,.28) 58%, transparent 58%, transparent 70%, rgba(0,0,0,.28) 70%, rgba(0,0,0,.28) 78%, transparent 78%); }
.pgf.pg-panel .pg-panel__resizer { display: none; }         /* BitSize Python's own width handle: the corner does it */
/* folded to its title bar */
.pgf.pgf--min { height: auto !important; }
.pgf.pgf--min > :not(.pgf-head) { display: none !important; }
/* the lesson keeps its full width while the playground floats */
body.pgf-floating.px-panel-open, body.pgf-floating.rx-panel-open, body.pgf-floating.pg-open { padding-right: 0 !important; }
@media (prefers-reduced-motion: reduce) { .pgf { transition: none; } }

/* ── The playground kit (playground.js kit / sender): a tool row under the title, ↗ send from the lesson ── */
.pgk { --pgk-fs: 14px; }
.pgk .CodeMirror { font-size: var(--pgk-fs); line-height: 1.6; }
.pgk-tools { display: flex; align-items: center; gap: 3px; flex: none; padding: 5px 10px; background: #F6F7F8; border-bottom: 1px solid rgba(0,0,0,.08);
  font: 600 12.5px/1 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.pgk-b { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; padding: 0 9px; border: 0; border-radius: 8px;
  background: transparent; color: #4B5563; font: inherit; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.pgk-b:hover { background: rgba(0,0,0,.07); color: #111; }
.pgk-b[hidden] { display: none; }
.pgk-b small { font-size: 10px; margin-left: 1px; }
.pgk-i { width: 30px; padding: 0; }
.pgk-b--undo { color: #047857; }
.pgk-b[aria-pressed="true"] { background: rgba(5,150,105,.12); color: #047857; }
.pgk-msg { flex: 1 1 auto; min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 11.5px;
  color: #047857; opacity: 0; transition: opacity .2s; }
.pgk-msg.is-on { opacity: 1; }
.pgk-font { display: inline-flex; align-items: center; margin-right: 3px; border-radius: 9px; border: 1px solid rgba(0,0,0,.1); }
.pgk-font .pgk-b { height: 26px; width: 26px; }
.pgk-font__v { min-width: 20px; text-align: center; font: 600 11.5px ui-monospace, 'JetBrains Mono', monospace; color: #6B7280; }
/* wider (docked only; a floating playground sizes itself from its corner) */
.px-panel.pgk--wide, .rx-panel.pgk--wide { width: min(62vw, 980px); }
@media (min-width: 1240px) { body.pgk-wide.px-panel-open { padding-right: min(62vw, 980px); } }
@media (min-width: 1180px) { body.pgk-wide.rx-panel-open { padding-right: min(62vw, 980px); } }
body.pgf-floating.pgk-wide { padding-right: 0 !important; }
.pgf .pgk-wide { display: none; }
@media (max-width: 900px) { .pgk-wide { display: none; } .px-panel.pgk--wide, .rx-panel.pgk--wide { width: 100%; } }
.pgk--got { animation: pgkGot .7s ease; }
@keyframes pgkGot { 30% { box-shadow: -14px 0 44px rgba(0,0,0,.14), inset 0 0 0 2px #34D399; } }
/* ↗ in each code block's top-right corner (playground.js sender): it scrolls with the code. Desktop: shown on hover or
   keyboard focus of the block; touch screens: always there. .pgk-host = a <pre>'s parent made the button's frame. */
.pgk-host { position: relative; }
.pgk-send { position: absolute; z-index: 9; margin: 0 !important; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(30,34,38,.88); color: #E5E7EB; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.pgk-send--in { top: 6px; right: 6px; }
.CodeMirror:hover > .pgk-send, .CodeMirror-focused > .pgk-send, :hover + .pgk-send, :focus-visible + .pgk-send,
.pgk-send:hover, .pgk-send:focus-visible { opacity: 1; }
.pgk-send:hover { background: #059669; color: #fff; border-color: transparent; }
.pgk-send:focus-visible { outline: 3px solid #34D399; outline-offset: 2px; background: #059669; color: #fff; }
:empty + .pgk-send { display: none; }
@media (hover: none) { .pgk-send { opacity: .92; } }
@media (pointer: coarse) { .pgk-send { width: 40px; height: 40px; border-radius: 10px; } }
/* code shown as text can take keyboard focus (so its ↗ can be reached) */
pre[tabindex="0"]:focus-visible, [data-pg-send][tabindex="0"]:focus-visible { outline: 2px solid #34D399; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pgk--got, .pgk-msg { animation: none; transition: none; } }

/* ── Room (Nov 2026): the editor is one dark box, and the output takes the height left ── */
/* the editor's scroll area is as tall as its box (it was 90px in a 220px box: a pale band showed under short code) */
.px-panel.pgk .px-editor .CodeMirror-scroll { min-height: 220px; }
.px-panel.pgk .px-panel__body { display: flex; flex-direction: column; }
.px-panel.pgk .px-panel__body > * { flex: none; }
.px-panel.pgk .px-panel__body > .px-out, .px-panel.pgk .px-panel__body > .sq-results { flex: 1 0 auto; min-height: 120px; }
.px-panel.pgk .px-panel__body > .px-out { display: flex; flex-direction: column; }
.px-panel.pgk .px-panel__body > .px-out > pre { flex: 1 0 auto; }
/* a floating window that fills the screen (⤢) gives the editor the room: more lines before it scrolls */
.px-panel.pgk.pgf--max .px-editor .CodeMirror, .px-panel.pgk.pgf--max .px-editor .CodeMirror-scroll { min-height: 46vh; }
