/* Workspace layout follows the pinned XUUI composition and density contracts. */
body:has(.playground-page) { display:flex; flex-direction:column; height:100vh; height:100dvh; min-height:0; overflow:hidden; }
body:has(.playground-page) .header-bar { flex-shrink:0; }
body:has(.playground-page) .header-inner { max-width:none; }
body:has(.playground-page) > footer.site { display:none; }
main.home.playground-page {
  --play-surface:var(--xu-surface);
  --play-editor:var(--xu-canvas);
  --play-muted:var(--xu-muted);
  --play-accent:var(--xu-brand);
  display:flex; flex-direction:column; flex:1; width:100%; max-width:none;
  min-width:0; min-height:0; margin:0; padding:var(--xu-space-6); gap:var(--xu-space-4);
  overflow:auto; overscroll-behavior:contain; color:var(--xu-text); background:var(--xu-canvas);
  font:var(--xu-text-sm)/var(--xu-leading-body) var(--xu-font-sans);
}
.play-heading { display:flex; flex-wrap:wrap; align-items:center; flex-shrink:0; gap:var(--xu-space-4) var(--xu-space-6); }
.play-heading h1 { margin:0; font:600 var(--xu-text-xl)/1.15 var(--xu-font-sans); letter-spacing:normal; }
.play-heading > p { margin:0; color:var(--xu-text); font-size:var(--xu-text-sm); line-height:1.5; }
.play-heading > p span { color:var(--play-muted); }
.play-heading > a { margin-left:auto; display:inline-flex; align-items:center; gap:var(--xu-space-2); min-height:var(--xu-control-md); color:var(--play-muted); font-size:var(--xu-text-sm); }
.play-workbench { display:flex; flex-direction:column; flex:1 0 44rem; min-width:0; min-height:44rem; overflow:hidden; border:1px solid var(--xu-border); border-radius:var(--xu-radius-lg); background:var(--play-surface); }
.play-workbench button, .play-workbench select, .play-workbench input, .play-library button, .play-library input { font:inherit; }
.play-workbench button, .play-library button { cursor:pointer; }
.play-workbench :focus-visible, .play-library :focus-visible, .playground-guide summary:focus-visible { outline:2px solid var(--xu-focus); outline-offset:-2px; }
.play-workbench button:disabled, .play-library button:disabled { cursor:default; }
.play-toolbar { display:flex; flex-wrap:wrap; align-items:center; flex-shrink:0; gap:var(--xu-space-4); padding:var(--xu-space-3) var(--xu-space-4); border-bottom:1px solid var(--xu-border); }
.play-toolbar > label { display:flex; align-items:center; gap:var(--xu-space-3); min-width:0; color:var(--play-muted); }
.play-toolbar select { max-width:100%; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); }
.play-browser-label { margin-left:auto; display:inline-flex; align-items:center; gap:var(--xu-space-2); color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-status-dot { width:8px; height:8px; flex-shrink:0; border-radius:var(--xu-radius-full); background:var(--xu-success); }
.play-workbench #xu-play-run, .play-library .play-template-open { display:inline-flex; align-items:center; justify-content:center; gap:var(--xu-space-2); min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-4); border:1px solid var(--xu-brand); border-radius:var(--xu-radius-md); background:var(--xu-brand); color:var(--xu-on-brand); box-shadow:none; font:600 var(--xu-text-sm)/1.2 var(--xu-font-sans); }
.play-workbench #xu-play-run:hover:not(:disabled), .play-library .play-template-open:hover:not(:disabled) { background:var(--xu-brand-hover); border-color:var(--xu-brand-hover); }
.play-workbench #xu-play-run:active:not(:disabled), .play-library .play-template-open:active:not(:disabled) { background:var(--xu-brand-pressed); border-color:var(--xu-brand-pressed); }
.play-workbench #xu-play-run:disabled, .play-template-open:disabled { opacity:.5; }
.play-panes { display:grid; flex:1; min-width:0; min-height:0; grid-template-columns:minmax(0,1fr) minmax(0,.95fr); }
.play-source-pane { display:grid; grid-template-columns:clamp(10rem,15vw,13.5rem) minmax(0,1fr); min-width:0; min-height:0; }
.play-explorer { display:flex; flex-direction:column; min-width:0; min-height:0; border-right:1px solid var(--xu-border); background:var(--xu-surface); }
.play-panel-heading, .play-output-heading { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; min-height:56px; padding:var(--xu-space-1) var(--xu-space-2) var(--xu-space-1) var(--xu-space-4); color:var(--xu-text); font:600 var(--xu-text-sm)/1.4 var(--xu-font-sans); }
.play-icon-button { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:var(--xu-target-min); height:var(--xu-target-min); padding:0; border:1px solid transparent; border-radius:var(--xu-radius-md); background:transparent; color:var(--play-muted); }
.play-icon-button .xi { font-size:var(--xu-icon-md); }
.play-icon-button:hover:not(:disabled) { background:var(--xu-elevated); color:var(--xu-text); }
.play-icon-button:active:not(:disabled) { background:var(--xu-control-pressed); }
.play-file-tree { flex:1; min-height:0; overflow:auto; padding:var(--xu-space-1) var(--xu-space-2); font:var(--xu-text-sm)/1.5 var(--xu-font-mono); }
.play-file-tree ul { list-style:none; margin:0; padding:0; }
.play-file-tree li { font-size:inherit; line-height:inherit; }
.play-file-tree details > ul { margin-left:var(--xu-space-3); padding-left:var(--xu-space-2); border-left:1px solid var(--xu-border); }
.play-file-tree summary { display:flex; align-items:center; gap:var(--xu-space-2); min-height:var(--xu-control-md); padding:var(--xu-space-1); list-style:none; cursor:pointer; color:var(--play-muted); }
.play-file-tree summary::-webkit-details-marker { display:none; }
.play-file-tree summary::before { content:'›'; width:var(--xu-space-3); font:20px/1 var(--xu-font-mono); text-align:center; }
.play-file-tree details[open] > summary::before { transform:rotate(90deg); }
.play-file-tree .play-project-root { font:600 var(--xu-text-xs)/1.5 var(--xu-font-sans); }
.play-file-tree button { display:flex; align-items:center; gap:var(--xu-space-2); width:100%; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid transparent; border-radius:var(--xu-radius-md); background:transparent; color:var(--play-muted); text-align:left; }
.play-file-tree button > span, .play-file-tree summary > span { overflow-wrap:anywhere; }
.play-file-tree button:hover { background:var(--xu-elevated); color:var(--xu-text); }
.play-file-tree button[aria-current="true"] { border-color:var(--xu-brand); background:var(--xu-brand-soft); color:var(--xu-brand); font-weight:600; }
.play-file-tree .xi { flex-shrink:0; font-size:var(--xu-icon-sm); }
.play-tree-empty { padding:var(--xu-space-2) var(--xu-space-3); color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-explorer-note { display:flex; flex-shrink:0; gap:var(--xu-space-2); margin-top:auto; padding:var(--xu-space-4); color:var(--play-muted); font-size:var(--xu-text-xs); line-height:1.5; }
.play-explorer-note .xi { margin-top:var(--xu-space-1); font-size:var(--xu-icon-sm); }
.play-new-file { flex-shrink:0; max-height:60%; overflow:auto; padding:var(--xu-space-3); border-block:1px solid var(--xu-border); }
.play-new-file label { display:block; margin-bottom:var(--xu-space-2); font-weight:600; }
.play-new-file input { width:100%; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); font-family:var(--xu-font-mono); }
.play-new-file > div { display:flex; flex-wrap:wrap; gap:var(--xu-space-2); margin-top:var(--xu-space-2); }
.play-new-file button, .play-library-empty button { min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); }
.play-new-file p { margin:var(--xu-space-2) 0 0; color:var(--xu-danger); overflow-wrap:anywhere; }
.play-new-file p:empty { display:none; }
.play-editor { display:flex; flex-direction:column; min-width:0; min-height:0; background:var(--play-editor); }
.play-file-tabs { display:flex; flex-shrink:0; min-height:48px; overflow:auto; background:var(--xu-surface); border-bottom:1px solid var(--xu-border); }
.play-file-tabs button { display:flex; align-items:center; gap:var(--xu-space-2); flex-shrink:0; max-width:20rem; min-height:48px; padding:var(--xu-space-2) var(--xu-space-4); border:0; border-bottom:2px solid transparent; background:transparent; color:var(--play-muted); font:var(--xu-text-sm)/1.5 var(--xu-font-mono); }
.play-file-tabs button > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.play-file-tabs button[aria-selected="true"] { border-bottom-color:var(--xu-brand); background:var(--play-editor); color:var(--xu-text); }
.play-file-tabs .xi { color:var(--xu-brand); font-size:var(--xu-icon-sm); }
.play-editor-location { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:var(--xu-space-3); min-height:56px; padding:var(--xu-space-1) var(--xu-space-2) var(--xu-space-1) var(--xu-space-4); color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-file-actions { display:flex; align-items:center; gap:var(--xu-space-1); white-space:nowrap; }
.play-file-actions button:disabled { opacity:.4; }
#xu-play-file-name { min-width:0; overflow-wrap:anywhere; }
.play-code-area { display:flex; flex:1; min-height:0; overflow:hidden; }
.play-line-numbers { flex-shrink:0; width:64px; margin:0; padding:var(--xu-space-2) var(--xu-space-3); text-align:right; white-space:pre; color:var(--play-muted); user-select:none; font:var(--xu-text-sm)/1.65 var(--xu-font-mono); }
.play-code-viewport { position:relative; flex:1; min-width:0; overflow:hidden; }
.play-workbench #xu-play-src, .play-highlight { width:100%; height:100%; min-height:0; margin:0; padding:var(--xu-space-2) var(--xu-space-4) var(--xu-space-8) 0; border:0; border-radius:0; font:var(--xu-text-sm)/1.65 var(--xu-font-mono); tab-size:4; letter-spacing:0; }
.play-workbench #xu-play-src { position:relative; display:block; resize:none; background:transparent; color:var(--xu-code-text); caret-color:var(--xu-text); overflow:auto; outline-offset:-2px; }
.play-highlight { position:absolute; inset:0; overflow:hidden; pointer-events:none; color:var(--xu-code-text); white-space:pre; }
.play-highlight > div { width:max-content; min-width:100%; }
.has-highlight #xu-play-src { color:transparent; }
.play-highlight .syn-comment { color:var(--xu-syn-cmt); }
.play-highlight .syn-string { color:var(--xu-syn-str); }
.play-highlight .syn-keyword { color:var(--xu-syn-kw); }
.play-highlight .syn-number { color:var(--xu-syn-num); }
.play-highlight .syn-type { color:var(--xu-syn-type); }
.play-editor-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--xu-space-2); padding:var(--xu-space-2) var(--xu-space-3); border-top:1px solid var(--xu-border); color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-editor-footer button { min-height:var(--xu-control-sm); padding:0 var(--xu-space-2); border:0; border-radius:var(--xu-radius-sm); background:transparent; color:var(--xu-brand); font:inherit; text-decoration:underline; }
.play-results { display:grid; grid-template-rows:minmax(24rem,1fr) minmax(9rem,.3fr); min-width:0; min-height:0; overflow:hidden; border-left:1px solid var(--xu-border); background:var(--play-surface); }
.play-result-tabs { display:none; }
.play-soon { padding:var(--xu-space-1); border:1px solid var(--xu-border); border-radius:var(--xu-radius-sm); color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-preview-panel { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; border-bottom:1px solid var(--xu-border); background:var(--xu-canvas); color:var(--xu-text); }
.play-preview-heading { flex-wrap:wrap; justify-content:space-between; gap:var(--xu-space-2); min-height:56px; padding:var(--xu-space-2) var(--xu-space-4); border-bottom:1px solid var(--xu-border); background:var(--xu-surface); }
.play-preview-heading > span { display:inline-flex; align-items:center; gap:var(--xu-space-2); }
.play-preview-heading .xi { font-size:var(--xu-icon-md); }
.play-preview-actions { display:flex; flex-wrap:wrap; gap:var(--xu-space-2); }
.play-preview-actions button { display:inline-flex; align-items:center; justify-content:center; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); font:600 var(--xu-text-sm)/1.2 var(--xu-font-sans); }
.play-preview-actions button:hover { background:var(--xu-elevated); }
.play-preview-actions button:active { background:var(--xu-control-pressed); }
.play-preview-actions button[aria-pressed="true"] { background:var(--xu-brand-soft); border-color:var(--xu-brand); color:var(--xu-brand); }
.play-preview-actions #xu-play-preview-expand { border-color:transparent; background:transparent; }
.play-preview-actions #xu-play-preview-expand:hover { background:var(--xu-elevated); }
.play-preview-panel :focus-visible { outline:2px solid var(--xu-focus); outline-offset:-2px; }
/* Xu widgets paint their own focused boundary inside the canvas. */
.play-preview-panel #xu-play-canvas[data-widget-input="true"]:focus { outline:0; }
.play-preview-body { display:flex; flex-direction:column; flex:1; min-width:0; min-height:0; overflow:hidden; }
.play-preview-body .xu-play-ui { display:flex; flex-direction:column; flex:1; min-width:0; min-height:0; margin:0; padding:var(--xu-space-4); gap:var(--xu-space-2); border:0; background:transparent; box-sizing:border-box; overflow:hidden; }
.play-preview-viewport { display:flex; align-items:safe center; justify-content:safe center; flex:1; min-width:0; min-height:0; overflow:auto; padding:var(--xu-space-2); border:1px solid var(--xu-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); container-type:size; }
.play-preview-body #xu-play-canvas { display:block; width:100%; max-width:640px; height:auto; max-height:none; aspect-ratio:16/9; border:0; border-radius:var(--xu-radius-sm); background:var(--xu-canvas); margin:auto; }
@supports (width:1cqh) { .play-preview-panel[data-preview-size="fit"] #xu-play-canvas { width:min(100cqw,calc(100cqh * 16 / 9),640px); } }
.play-preview-panel[data-preview-size="actual"] #xu-play-canvas { width:640px; min-width:640px; max-width:none; height:360px; }
.play-preview-body .play-preview-dimensions { flex-shrink:0; margin:0; color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-preview-body #xu-play-ui-status { flex-shrink:0; margin:0; color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-sans); overflow-wrap:anywhere; }
.play-preview-idle { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; gap:var(--xu-space-3); padding:var(--xu-space-6); text-align:center; color:var(--play-muted); }
.play-preview-idle-icon { font-size:var(--xu-icon-xl); }
.play-preview-idle h2 { margin:0; padding:0; border:0; color:var(--xu-text); font:600 var(--xu-text-lg)/1.3 var(--xu-font-sans); letter-spacing:normal; }
.play-preview-idle p { margin:0; max-width:34ch; color:var(--play-muted); font:var(--xu-text-sm)/1.5 var(--xu-font-sans); }
.play-preview-body .xu-play-ui:not([hidden]) ~ .play-preview-idle { display:none !important; }
.play-console-panel { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; background:var(--play-surface); }
.play-panes.is-preview-expanded { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.play-panes.is-preview-expanded .play-source-pane { display:none; }
.play-panes.is-preview-expanded .play-results { border-left:0; }
.play-workbench .xu-play-out { flex:1; min-height:0; max-height:none; margin:0; padding:var(--xu-space-3) var(--xu-space-4); border:0; border-radius:0; background:var(--xu-canvas); box-shadow:none; color:var(--xu-text); white-space:pre-wrap; overflow:auto; overflow-wrap:anywhere; word-break:normal; font:var(--xu-text-sm)/1.65 var(--xu-font-mono); }
.play-workbench .xu-play-out.is-err { color:var(--xu-danger); }
.play-output-heading { border-bottom:1px solid var(--xu-border); }
.play-output-heading span { display:inline-flex; align-items:center; gap:var(--xu-space-2); }
.play-runtime-note { flex-shrink:0; margin:0; padding:var(--xu-space-2) var(--xu-space-4); color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-sans); border-top:1px solid var(--xu-border); }
.play-statusbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; flex-shrink:0; gap:var(--xu-space-2) var(--xu-space-4); min-height:40px; padding:var(--xu-space-2) var(--xu-space-4); border-top:1px solid var(--xu-border); background:var(--xu-surface); color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-statusbar .xu-play-meta { width:auto; text-align:left; font:inherit; color:inherit; }
.play-shortcut { margin-left:auto; }
.play-shortcut kbd { font:inherit; }
.playground-page #xu-play-help { flex-shrink:0; margin:0; padding:0; border:0; background:transparent; color:var(--play-muted); font-size:var(--xu-text-sm); line-height:1.5; overflow-wrap:anywhere; }
.playground-guide { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; flex-shrink:0; gap:var(--xu-space-4); padding-top:var(--xu-space-4); border-top:1px solid var(--xu-border); font-size:var(--xu-text-sm); }
.playground-guide > details { flex:1 1 32rem; max-width:70ch; }
.playground-guide summary { display:inline-flex; align-items:center; gap:var(--xu-space-2); min-height:var(--xu-control-md); color:var(--play-muted); cursor:pointer; list-style:none; }
.playground-guide summary::-webkit-details-marker { display:none; }
.playground-guide details[open] summary > i { transform:rotate(180deg); }
.playground-guide p { color:var(--play-muted); line-height:var(--xu-leading-body); }
.playground-guide > a { display:inline-flex; align-items:center; gap:var(--xu-space-2); min-height:var(--xu-control-md); }
.play-workbench [hidden], .play-library [hidden] { display:none !important; }
.play-toolbar .play-project-switch { display:inline-flex; align-items:center; gap:var(--xu-space-2); flex:0 1 32rem; min-width:0; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); text-align:left; }
.play-project-switch:hover:not(:disabled) { background:var(--xu-elevated); }
.play-project-switch:active:not(:disabled) { background:var(--xu-control-pressed); }
.play-project-switch:disabled { opacity:.6; cursor:wait; }
#xu-play-project-title { flex:1; min-width:0; overflow-wrap:anywhere; white-space:normal; font-weight:600; }
.play-switcher-label { flex-shrink:0; color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-project-switch > .xi { flex-shrink:0; color:var(--xu-brand); font-size:var(--xu-icon-md); }
.play-visually-hidden { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.play-library { --play-muted:var(--xu-muted); --play-editor:var(--xu-canvas); --play-surface:var(--xu-surface); width:min(64rem,calc(100vw - 48px)); height:min(46rem,calc(100vh - 48px)); height:min(46rem,calc(100dvh - 48px)); max-width:none; max-height:none; padding:0; border:1px solid var(--xu-border); border-radius:var(--xu-radius-lg); background:var(--xu-surface); color:var(--xu-text); font:var(--xu-text-sm)/1.5 var(--xu-font-sans); }
.play-library[open] { display:flex; flex-direction:column; }
.play-library::backdrop { background:var(--xu-overlay); }
.play-library-heading { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:var(--xu-space-4); padding:var(--xu-space-4) var(--xu-space-6); }
.play-library-heading h2 { margin:0 0 var(--xu-space-2); padding:0; border:0; font:600 var(--xu-text-lg)/1.3 var(--xu-font-sans); letter-spacing:normal; }
.play-library-heading p { margin:0; color:var(--play-muted); font-size:var(--xu-text-sm); }
.play-library-search { display:flex; flex-wrap:wrap; align-items:center; flex-shrink:0; gap:var(--xu-space-3); padding:var(--xu-space-3) var(--xu-space-6); border-block:1px solid var(--xu-border); background:var(--xu-canvas); }
.play-library-search > .xi { color:var(--play-muted); font-size:var(--xu-icon-md); }
.play-library-search input { flex:1; width:100%; min-width:0; min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid var(--xu-control-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); }
.play-library-search input::placeholder { color:var(--play-muted); }
#xu-play-library-count { color:var(--play-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-library-body { display:grid; flex:1; min-width:0; min-height:0; overflow:hidden; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.play-library-browser { display:flex; flex-direction:column; min-width:0; min-height:0; border-right:1px solid var(--xu-border); }
.play-library-groups { display:flex; flex-wrap:wrap; flex-shrink:0; gap:var(--xu-space-2); padding:var(--xu-space-3) var(--xu-space-4); }
.play-library-groups button { min-height:var(--xu-control-md); padding:var(--xu-space-2) var(--xu-space-3); border:1px solid transparent; border-radius:var(--xu-radius-md); background:transparent; color:var(--play-muted); white-space:normal; }
.play-library-groups button:hover { background:var(--xu-elevated); }
.play-library-groups button:active { background:var(--xu-control-pressed); }
.play-library-groups button[aria-pressed="true"] { border-color:var(--xu-brand); background:var(--xu-brand-soft); color:var(--xu-brand); }
.play-library-group-help { flex-shrink:0; margin:0; padding:0 var(--xu-space-4) var(--xu-space-3); color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-template-list { flex:1; min-height:0; padding:0 var(--xu-space-3) var(--xu-space-3); overflow:auto; }
.play-template-item { display:block; width:100%; min-height:48px; padding:var(--xu-space-3); border:1px solid transparent; border-radius:var(--xu-radius-md); background:transparent; color:var(--xu-text); text-align:left; }
.play-template-item:hover { background:var(--xu-elevated); }
.play-template-item[aria-current="true"] { border-color:var(--xu-brand); background:var(--xu-brand-soft); }
.play-template-item-title { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:var(--xu-space-1) var(--xu-space-3); margin-bottom:var(--xu-space-1); font-size:var(--xu-text-sm); font-weight:600; }
.play-template-item-title small { color:var(--play-muted); font-size:var(--xu-text-xs); font-weight:400; }
.play-template-item-description { display:block; color:var(--play-muted); font-size:var(--xu-text-xs); line-height:1.5; }
.play-template-detail { min-width:0; min-height:0; padding:var(--xu-space-6); overflow:auto; background:var(--xu-canvas); }
.play-template-kicker { margin:0 0 var(--xu-space-2); color:var(--xu-brand); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-template-detail h3 { margin:0 0 var(--xu-space-3); font:600 var(--xu-text-lg)/1.3 var(--xu-font-sans); letter-spacing:normal; }
.play-template-description { margin:0; color:var(--play-muted); font-size:var(--xu-text-sm); line-height:1.5; }
.play-template-detail h4 { margin:var(--xu-space-6) 0 var(--xu-space-2); color:var(--xu-text); font-size:var(--xu-text-sm); font-weight:600; }
.play-template-files { margin:0; padding:0; list-style:none; }
.play-template-files li { display:flex; align-items:center; gap:var(--xu-space-2); min-height:32px; padding-left:var(--xu-space-3); border-left:1px solid var(--xu-border); font:var(--xu-text-xs)/1.5 var(--xu-font-mono); }
.play-template-files .xi { flex-shrink:0; color:var(--xu-brand); font-size:var(--xu-icon-sm); }
.play-template-files span { overflow-wrap:anywhere; }
.play-template-files small { margin-left:auto; color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-template-detail .play-template-expected { margin:0; padding:var(--xu-space-3); border:1px solid var(--xu-border); border-radius:var(--xu-radius-md); background:var(--xu-surface); color:var(--xu-text); box-shadow:none; white-space:pre-wrap; overflow-wrap:anywhere; font:var(--xu-text-sm)/1.65 var(--xu-font-mono); }
.play-template-detail .play-template-expected.is-diagnostic { color:var(--xu-warning); }
.play-template-exercise { margin:0; color:var(--play-muted); font-size:var(--xu-text-sm); line-height:1.5; }
.play-library-empty, .play-library-ui { grid-column:1 / -1; grid-row:1 / -1; align-self:center; min-width:0; padding:var(--xu-space-6); text-align:center; }
.play-library-empty > .xi, .play-library-ui > .xi { color:var(--xu-brand); font-size:var(--xu-icon-xl); }
.play-library-empty h3, .play-library-ui h3 { font-size:var(--xu-text-lg); }
.play-library-empty p, .play-library-ui p, .play-library-ui a { font-size:var(--xu-text-sm); line-height:1.5; }
.play-library-footer { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; gap:var(--xu-space-4); padding:var(--xu-space-4) var(--xu-space-6); border-top:1px solid var(--xu-border); }
.play-library-footer > span { color:var(--play-muted); font-size:var(--xu-text-xs); }
.play-library .play-template-open { flex-shrink:0; }
@media (max-width:1199px) {
  body:has(.playground-page) { height:auto; min-height:100vh; min-height:100dvh; overflow:visible; }
  main.home.playground-page { flex:none; overflow:visible; }
  .play-workbench { flex:none; min-height:0; }
  .play-panes { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; }
  .play-source-pane { height:clamp(28rem,56dvh,36rem); min-height:28rem; }
  .play-results { min-height:42rem; grid-template-rows:minmax(28rem,1fr) minmax(12rem,.3fr); border-left:0; border-top:1px solid var(--xu-border); }
  .play-panes.is-preview-expanded .play-results { min-height:42rem; }
}
@media (max-width:719px) {
  main.home.playground-page { padding:var(--xu-space-4); }
  .play-heading { gap:var(--xu-space-2) var(--xu-space-4); }
  .play-heading > p { flex-basis:100%; order:3; }
  .play-toolbar .play-project-switch { flex-basis:100%; }
  .play-browser-label { margin-left:0; }
  .play-workbench #xu-play-run { margin-left:auto; }
  .play-source-pane { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(26rem,1fr); }
  .play-explorer { max-height:14rem; border-right:0; border-bottom:1px solid var(--xu-border); }
  .play-explorer-note { display:none; }
  .play-file-tree { max-height:10rem; }
  .play-editor { min-height:26rem; }
  .play-preview-heading > span { flex-basis:100%; }
  .play-preview-actions { width:100%; }
  .play-preview-actions button { flex:1; padding-inline:var(--xu-space-2); }
  .play-results { min-height:42rem; grid-template-rows:minmax(27rem,1fr) minmax(13rem,.45fr); }
  .play-editor-location, .play-panel-heading { padding-left:var(--xu-space-3); }
  .play-editor-location { gap:var(--xu-space-2); }
  .play-file-actions { gap:0; }
  .play-statusbar { align-items:flex-start; }
  .play-statusbar .xu-play-meta { flex-basis:100%; }
  .play-shortcut { margin-left:0; }
  .play-library { width:calc(100vw - 32px); height:calc(100vh - 32px); height:calc(100dvh - 32px); }
  .play-library-heading, .play-library-search, .play-library-footer { padding:var(--xu-space-3) var(--xu-space-4); }
  .play-library-heading p { font-size:var(--xu-text-xs); }
  .play-library-body { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,.45fr) minmax(0,.55fr); }
  .play-library-browser { border-right:0; border-bottom:1px solid var(--xu-border); }
  .play-library-groups { flex-wrap:nowrap; overflow-x:auto; padding:var(--xu-space-2); }
  .play-library-groups button { flex-shrink:0; }
  .play-library-group-help { display:none; }
  .play-template-list { padding-inline:var(--xu-space-2); }
  .play-template-detail { padding:var(--xu-space-4); }
  .play-template-detail h4 { margin-top:var(--xu-space-4); }
  .play-library-footer { flex-wrap:wrap; gap:var(--xu-space-2); }
  .play-library-footer > span { flex:1 1 100%; }
  .play-library .play-template-open { width:100%; }
}
@media (max-height:600px) { .play-library-heading p { display:none; } }
@media (pointer:coarse), (max-width:719px), (max-width:959px) and (max-height:500px) {
  .play-workbench button, .play-library button, .play-file-tree summary, .play-workbench select, .play-new-file input, .play-library-search input, .play-heading > a, .playground-guide summary, .playground-guide > a { min-height:var(--xu-target-min); }
  .play-library-search input, .play-new-file input { font-size:1rem; }
}
@media (forced-colors:active) { .has-highlight #xu-play-src { color:CanvasText; } .play-highlight { display:none; } }

/* Progressive mobile navigation keeps every tool reachable without a tall pane stack. */
.play-mobile-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); flex-shrink:0; border-bottom:1px solid var(--xu-border); }
.play-mobile-tabs button { min-height:var(--xu-target-min); padding:var(--xu-space-2); border:0; border-bottom:2px solid transparent; background:var(--xu-surface); color:var(--xu-muted); font:600 var(--xu-text-sm)/1.2 var(--xu-font-sans); }
.play-mobile-tabs button[aria-selected="true"] { border-bottom-color:var(--xu-brand); background:var(--xu-brand-soft); color:var(--xu-brand); }
.play-library-back { display:flex; flex-shrink:0; align-items:center; gap:var(--xu-space-2); min-height:var(--xu-target-min); padding:var(--xu-space-2) var(--xu-space-4); border:0; border-bottom:1px solid var(--xu-border); background:var(--xu-surface); color:var(--xu-brand); text-align:left; }
.play-preview-pan-hint { margin:0; color:var(--xu-muted); font:var(--xu-text-xs)/1.5 var(--xu-font-sans); }
.play-preview-viewport[data-pan="true"] { touch-action:none; cursor:grab; }
.play-preview-viewport[data-pan="true"] #xu-play-canvas { pointer-events:none; }
@media (max-width:719px), (max-width:959px) and (max-height:500px) {
  body:has(#xu-play-workspace[data-mobile-view]) { height:100vh; height:100dvh; overflow:hidden; }
  main.home.playground-page:has([data-mobile-view]) { flex:1; min-height:0; overflow:auto; padding:var(--xu-space-3); padding-bottom:max(var(--xu-space-3),env(safe-area-inset-bottom)); gap:var(--xu-space-3); }
  .playground-page:has([data-mobile-view]) .play-heading > p { display:none; }
  .play-workbench[data-mobile-view] { flex:1 0 24rem; min-height:24rem; }
  .play-workbench[data-mobile-view="preview"] { flex-basis:32rem; min-height:32rem; }
  .play-workbench[data-mobile-view] .play-toolbar { gap:var(--xu-space-2); padding:var(--xu-space-2); }
  .play-workbench[data-mobile-view] .play-toolbar .play-project-switch { flex:1; }
  .play-workbench[data-mobile-view] #xu-play-project-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .play-workbench[data-mobile-view] #xu-play-run { width:auto; margin-left:0; flex:0 0 auto; }
  .play-workbench[data-mobile-view] .play-switcher-label, .play-workbench[data-mobile-view] .play-browser-label { display:none; }
  .play-workbench[data-mobile-view] .play-panes { display:flex; min-height:0; }
  .play-workbench[data-mobile-view] .play-source-pane,
  .play-workbench[data-mobile-view] .play-results { display:flex; flex:1; min-height:0; border:0; }
  .play-workbench[data-mobile-view] .play-source-pane { height:auto; }
  .play-workbench[data-mobile-view] .play-explorer,
  .play-workbench[data-mobile-view] .play-editor,
  .play-workbench[data-mobile-view] .play-preview-panel,
  .play-workbench[data-mobile-view] .play-console-panel { flex:1; min-height:0; max-height:none; border:0; }
  .play-workbench[data-mobile-view] .play-file-tree { max-height:none; }
  .play-workbench[data-mobile-view] .play-editor-location { min-height:48px; }
  .play-workbench[data-mobile-view] .play-line-numbers,
  .play-workbench[data-mobile-view] #xu-play-src,
  .play-workbench[data-mobile-view] .play-highlight { font-size:1rem; line-height:1.65; }
  .play-workbench[data-mobile-view] .play-editor-footer { justify-content:flex-start; gap:var(--xu-space-2) var(--xu-space-4); }
  .play-workbench[data-mobile-view] .play-statusbar { min-height:32px; padding:var(--xu-space-1) var(--xu-space-2); }
  .play-workbench[data-mobile-view] .play-statusbar > span:not(.xu-play-meta) { display:none; }
  .play-workbench[data-mobile-view] .play-preview-heading { padding:var(--xu-space-2); }
  .play-workbench[data-mobile-view] .play-preview-heading > span { flex-basis:auto; }
  .play-workbench[data-mobile-view] #xu-play-preview-expand { display:none; }
  .play-workbench[data-mobile-view] .play-preview-body .xu-play-ui { padding:var(--xu-space-2); }
  .play-workbench[data-mobile-view] .play-preview-dimensions { display:none; }
  .play-library[data-mobile-template] { width:calc(100vw - 32px); height:calc(100vh - 32px); height:calc(100dvh - 32px); }
  .play-library[data-mobile-template] .play-library-groups { flex-wrap:nowrap; flex-shrink:0; overflow-x:auto; padding:var(--xu-space-2); }
  .play-library[data-mobile-template] .play-library-groups button { flex-shrink:0; }
  .play-library[data-mobile-template] .play-library-group-help { display:none; }
  .play-library[data-mobile-template] .play-library-body { display:flex; flex-direction:column; }
  .play-library[data-mobile-template] .play-library-browser { flex:1; border:0; }
  .play-library[data-mobile-template] .play-template-detail { flex:1; }
  .play-library[data-mobile-template] .play-library-body:has(.play-library-empty:not([hidden]), .play-library-ui:not([hidden])) .play-library-browser { flex:0 0 auto; }
  .play-library[data-mobile-template] .play-library-empty, .play-library[data-mobile-template] .play-library-ui { display:flex; flex:1; flex-direction:column; align-self:stretch; align-items:center; justify-content:safe center; min-height:0; overflow:auto; padding:var(--xu-space-4); }
  .play-library[data-mobile-template="list"] .play-template-detail,
  .play-library[data-mobile-template="detail"] .play-library-browser,
  .play-library[data-mobile-template="detail"] .play-library-search { display:none; }
  .play-library[data-mobile-template] .play-library-heading { padding:var(--xu-space-2) var(--xu-space-3); }
  .play-library[data-mobile-template] .play-library-heading p { display:none; }
  .play-library[data-mobile-template] .play-library-footer > span { display:none; }
  .play-library[data-mobile-template] .play-library-footer { padding:var(--xu-space-2) var(--xu-space-3); }
  .play-library[data-mobile-template] .play-template-files li { flex-wrap:wrap; }
}
@media (pointer:coarse), (max-width:719px), (max-width:959px) and (max-height:500px) {
  .play-workbench #xu-play-run, .play-toolbar .play-project-switch, .play-library .play-template-open { min-height:var(--xu-target-min); }
}
