/* Keep the stage open; disclose the supporting content on demand. */
:root { --sheet-width: 500px; }
body[data-panel-kind="support"] { --sheet-width:390px; }
.jab-pill { min-height:44px; padding:0 18px; border:1px solid var(--line); border-radius:28px; background:transparent; font-size:13px; font-weight:600; transition:background .15s, color .15s; }
.jab-pill:hover { background:var(--ink); color:var(--paper); }
.jab-bottom-left { position:fixed; z-index:2; left:max(12px,env(safe-area-inset-left)); bottom:max(12px,env(safe-area-inset-bottom)); display:flex; align-items:center; gap:10px; pointer-events:none; }
.jab-bottom-left p { margin:0; max-width:300px; font-size:12px; line-height:1.4; color:var(--ink); }
.voice-hint-phone { display:none; }
.help-button { position:relative; isolation:isolate; display:grid; place-items:center; pointer-events:auto; flex-shrink:0; width:44px; height:44px; padding:0; border-radius:50%; font-size:18px; color:var(--paper); background:transparent; text-shadow:none; transition:color .15s; }
.help-button::before { content:''; position:absolute; z-index:-1; inset:4.4px; border-radius:50%; border:1px solid var(--ink); background:var(--ink); transition:background .15s; }
.help-button:hover { color:var(--ink); }
.help-button:hover::before { background:var(--paper); }
.jab-history { position:fixed; inset:0; z-index:2; pointer-events:none; }
.history-button { position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px; padding:8px; border-radius:50%; font-size:20px; background:transparent; pointer-events:auto; color:var(--ink); transition:background .15s,color .15s; }
.history-button:hover:not(:disabled) { background:var(--ink); color:var(--paper); }
#history-prev { left:8px; } #history-next { right:8px; }
.history-button:disabled { opacity:.22; cursor:default; }
.chrome { z-index:2; }
#keys-toggle, #edit-toggle { display:none; }
/* Preserve keyboard access to the canvas controls without extra visible buttons. */
#live-toggle:focus-visible, #cam-toggle:focus-visible { position:fixed; width:auto; height:44px; clip:auto; overflow:visible; bottom:68px; right:16px; padding:10px; background:var(--paper); }
.jab-sheet { position:fixed; z-index:3; left:10px; right:10px; top:max(10px,env(safe-area-inset-top)); bottom:max(64px,env(safe-area-inset-bottom)); max-height:none; display:flex; flex-direction:column; background:var(--paper); border:1px solid var(--ink); border-radius:24px; box-shadow:0 12px 42px color-mix(in srgb,var(--ink) 15%,transparent); overflow:hidden; animation:sheet-in .2s ease-out; }
.jab-sheet[hidden], .sheet-tabs[hidden] { display:none; }
.sheet-header { flex-shrink:0; display:flex; align-items:center; justify-content:space-between; padding:10px 16px 10px 24px; }
.sheet-header h2 { margin:0; font-size:20px; letter-spacing:-.04em; }
.sheet-header button { width:44px; height:44px; border-radius:50%; font-size:26px; }
.sheet-header button:hover { background:var(--ink); color:var(--paper); }
.sheet-tabs { flex-shrink:0; display:flex; gap:20px; padding:0 24px; border-bottom:1px solid var(--line); }
.sheet-tabs button { position:relative; min-height:44px; padding:0 4px; font-size:14px; color:var(--ui); }
.sheet-tabs button[aria-selected="true"] { color:var(--ink); font-weight:700; }
.sheet-tabs button[aria-selected="true"]::after { content:''; position:absolute; bottom:0; left:0; right:0; height:2px; background:var(--ink); }
.sheet-content { min-height:0; overflow-y:auto; padding:24px; font-size:16px; line-height:1.5; overscroll-behavior:contain; }
.sheet-content p { margin:0 0 20px; }
.sheet-content a { color:inherit; text-underline-offset:4px; }
.sheet-content h3 { font-size:28px; letter-spacing:-.04em; line-height:1.15; margin:12px 0 20px; }
.sheet-content small { font-size:12px; color:var(--ui); }
.project-row { display:grid; grid-template-columns:minmax(0, 40%) minmax(0,1fr) 20px; gap:20px; width:100%; text-align:left; align-items:center; padding:20px 0; border-bottom:1px solid var(--line); }
.project-row:first-child { padding-top:0; }
.project-row img { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:8px; }
.project-row b { display:block; font-size:20px; line-height:1.15; margin-bottom:6px; letter-spacing:-.03em; }
.project-row:hover b { text-decoration:underline; text-underline-offset:4px; }
.project-image { width:100%; display:block; border-radius:12px; margin:14px 0 20px; }
.project-actions { display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.project-actions a { font-size:14px; }
.project-video { width:100%; aspect-ratio:16/9; border:0; border-radius:12px; margin:16px 0; }
.help-step { display:grid; grid-template-columns:32px 1fr; gap:10px; margin-bottom:20px; }
.help-step b { font-size:20px; } .help-step p { margin:0; }
.sheet-back { display:block; margin-bottom:8px; font-size:13px; text-decoration:underline; text-underline-offset:4px; min-height:44px; }
a:focus-visible, button:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
#live-status:empty { display:none; }
#live-status:not(:empty) { position:fixed; bottom:76px; left:16px; max-width:360px; padding:8px 12px; background:var(--paper); }
@keyframes sheet-in { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@media (min-width:850px) {
 :root { --sheet-width:500px; }
 .jab-sheet { top:18px; right:18px; left:auto; bottom:76px; width:var(--sheet-width); max-height:none; }
 body[data-panel-open="true"] #history-next { right:calc(var(--sheet-width) + 36px); }
}
@media (max-width:600px) {
 .jab-bottom-left { gap:4px; }
 .jab-bottom-left p { max-width:clamp(72px,calc(100vw - 206px),205px); font-size:11px; }
 #voice-idle-hint { font-size:10px; }
 .voice-hint-desktop { display:none; }
 .voice-hint-phone { display:inline; }
 .sheet-content { padding:20px; }
 .project-row { grid-template-columns:minmax(0,40%) minmax(0,1fr) 12px; gap:12px; }
 .project-row b { font-size:17px; }
 .project-row small { font-size:11px; }
}
@media (prefers-reduced-motion:reduce) { .jab-sheet { animation:none; } button { transition:none !important; } }

/* A thin paper-coloured edge keeps transparent controls readable over the letters. */
.help-button:hover { text-shadow:none; }

#boost-button { position:fixed; z-index:2; isolation:isolate; right:max(12px,env(safe-area-inset-right)); bottom:max(12px,env(safe-area-inset-bottom)); display:grid; place-items:center; min-width:122px; height:44px; padding:0; border:0; border-radius:24px; color:var(--paper); background:transparent; font-size:18px; font-weight:600; transition:color .15s; }
#boost-button::before { content:''; position:absolute; z-index:-1; inset:4.4px 0; border-radius:24px; border:1px solid var(--ink); background:var(--ink); transition:background .15s; }
#boost-button:hover { color:var(--ink); }
#boost-button:hover::before { background:var(--paper); }

#brain-open { display:none; }


/* The compact Play tab replaces the inherited public editor. */
#editor { display:none !important; }
.sheet-tabs button[hidden] { display:none; }
/* Compact control desk: shared columns, dense rows and a fixed toy bar. */
.jab-sheet[data-section=play] .sheet-content { padding:12px 20px 16px; min-height:0; }
.play-heading { font-size:11px !important; font-weight:700; text-transform:uppercase; letter-spacing:.1em !important; color:var(--ui); line-height:1.4 !important; margin:0 0 8px !important; }
.play-palettes { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px; }
.palette-button { width:44px; height:44px; border-radius:50%; padding:3px; border:2px solid transparent; background:linear-gradient(135deg,var(--palette-paper) 0 34%,var(--palette-you) 34% 66%,var(--palette-ink) 66%); background-clip:content-box; }
.palette-button[aria-pressed=true] { border-color:currentColor; }
.jab-sheet[data-section=play] .palette-button { width:36px; height:36px; padding:2px; }
.play-field { display:grid; grid-template-columns:112px minmax(0,1fr); align-items:center; gap:12px; min-height:36px; margin:0; font-size:14px; line-height:1.25; }
.play-field>span { color:var(--ui); }
.play-field select { min-height:34px; width:100%; min-width:0; border:1px solid var(--line); background:var(--paper); color:var(--ink); border-radius:7px; padding:5px 10px; font:inherit; margin:2px 0; }
.play-field input[type=range] { width:100%; min-width:0; min-height:32px; accent-color:var(--ink); margin:0; }
.play-field input[type=checkbox] { width:20px; height:20px; accent-color:var(--ink); margin:0; justify-self:start; }
.play-section-title { border-top:1px solid var(--line); padding-top:14px; margin-top:14px !important; }
.play-gravity { display:flex; align-items:center; gap:10px; width:100%; min-width:0; }
.play-gravity input[type=range] { flex:1; width:0; min-width:0; }
.play-gravity input[type=checkbox] { flex:0 0 20px; }
.play-directions { display:flex; gap:6px; width:100%; }
.play-directions button { flex:1; min-width:0; min-height:32px; padding:2px; border:1px solid var(--line); border-radius:7px; font-size:18px; }
.play-directions [aria-pressed=true] { background:var(--ink); color:var(--paper); }
.sheet-actions { flex-shrink:0; padding:10px 20px; border-top:1px solid var(--line); background:var(--paper); }
.sheet-actions[hidden] { display:none; }
.play-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:0; }
.play-actions .jab-pill { padding:0 6px; min-height:36px; font-size:12px; }
.sheet-tabs button { border-radius:4px 4px 0 0; }
.sheet-tabs button:focus-visible { outline-offset:-2px; }
@media(max-width:600px) {
 .play-field { grid-template-columns:92px minmax(0,1fr); min-height:44px; gap:10px; }
 .play-field select { min-height:40px; font-size:16px; }
 .play-field input[type=range] { min-height:44px; }
 .play-directions button { min-height:44px; min-width:44px; }
 .play-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .play-actions .jab-pill { min-height:44px; font-size:13px; }
 .sheet-actions { padding:8px 16px; }
 .jab-sheet[data-section=play] .sheet-content { padding:10px 16px 14px; }
}
@media(max-width:380px) {
 .play-field:has(.play-directions) { grid-template-columns:1fr; gap:4px; padding:4px 0; }
}
@media(pointer:coarse) { .jab-sheet[data-section=play] .palette-button { width:44px; height:44px; } }
html[data-studio-preview=true] #boost-button, html[data-studio-preview=true] .jab-bottom-left, html[data-studio-preview=true] .jab-history, html[data-studio-preview=true] .chrome, html[data-studio-preview=true] #reference-panel { display:none !important; }

.jab-sheet[data-section=play] .sheet-header,
.jab-sheet[data-section=play] .sheet-tabs { flex-shrink:0; }

.about-portrait { display:block; width:min(100%,240px); height:auto; aspect-ratio:1; object-fit:cover; border-radius:12px; margin:0 0 24px; }
.about-contact { display:flex; flex-wrap:wrap; gap:24px; border-top:1px solid var(--line); margin-top:28px; padding-top:28px; }
.about-message,.about-contact-details { flex:1 1 180px; min-width:0; }
.about-contact-details { overflow-wrap:anywhere; }
.about-contact-details h3 { display:flex; align-items:center; min-height:44px; font-size:20px; margin:0 0 8px; letter-spacing:-.02em; }
.about-contact p { margin:12px 0 0; }
.sheet-content .message-hint { display:block; max-width:30ch; margin-top:12px; font-size:.6875rem; line-height:1.5; }
.help-disclaimer { border-top:1px solid var(--line); padding-top:16px; }
.help-disclaimer h3 { font-size:.875rem; margin:0 0 8px; letter-spacing:normal; }
.help-disclaimer p { font-size:.8125rem; color:var(--ui); margin:0 0 8px; }
.help-disclaimer p:last-child { margin-bottom:0; }

/* Project images open at a useful size while keeping their original proportions. */
.project-row { grid-template-columns:minmax(0,40%) minmax(0,1fr); }
.project-thumbnail-button,.project-image-button { display:block; width:100%; padding:0; border:0; border-radius:12px; background:transparent; overflow:hidden; cursor:pointer; }
.project-image-button { margin:14px 0 20px; cursor:zoom-in; }
.project-image-button img { display:block; width:100%; height:auto; border-radius:12px; }
.project-thumbnail-button:hover img,.project-image-button:hover img { opacity:.88; }
.project-details-button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:64px; padding:0; text-align:left; }
.project-details-button>span:first-child { min-width:0; }
.project-lightbox { width:min(1400px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); padding:16px; border:1px solid var(--ink); border-radius:20px; background:var(--paper); color:var(--ink); overflow:auto; }
.project-lightbox::backdrop { background:rgba(0,0,0,.82); }
.project-lightbox header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:12px; }
.project-lightbox h2 { margin:0; font-size:18px; line-height:1.2; }
.project-lightbox header button { flex-shrink:0; width:44px; height:44px; border-radius:50%; font-size:28px; }
.project-lightbox header button:hover { background:var(--ink); color:var(--paper); }
.project-lightbox>img { display:block; width:100%; max-height:calc(100dvh - 130px); object-fit:contain; border-radius:8px; }
.lightbox-video { display:block; width:100%; aspect-ratio:16/9; max-height:calc(100dvh - 130px); border:0; border-radius:8px; background:#000; }
@media(max-width:600px) { .project-lightbox { width:calc(100vw - 16px); padding:10px; border-radius:14px; } .project-row { grid-template-columns:minmax(0,40%) minmax(0,1fr); } }

/* Keep the mobile entry point away from the microphone and browser toolbar. */
@media (max-width:849px) {
 #boost-button { top:max(10px,env(safe-area-inset-top)); bottom:auto; }
 .jab-sheet { top:calc(max(10px,env(safe-area-inset-top)) + 52px); }
 .jab-bottom-left p { max-width:calc(100vw - 80px); }
}

@media (max-width:849px) {
 body[data-panel-kind="boost"] .jab-sheet { bottom:max(10px,env(safe-area-inset-bottom)); }
}

.film-conversation-note { margin:12px 0 0; color:var(--ui); font-size:13px; line-height:1.4; }
