/* Scene controls: a compact dock and an independent contextual action card. */
.scene-bottom-tools{left:12px;bottom:12px;right:auto;max-width:calc(100% - 330px);padding:0;gap:9px;align-items:end}
.scene-bottom-tools>div{gap:3px;padding:4px;background:color-mix(in srgb,var(--surface) 96%,transparent);border-radius:12px;box-shadow:0 4px 16px #0002}
.scene-bottom-tools button,.scene-stage .board-zoom button{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;height:32px;padding:6px;border-radius:7px;font-size:12px;margin:0}
.scene-bottom-tools button svg{width:18px;height:18px;flex:none}.scene-bottom-tools output{font-size:11px;min-width:38px;font-variant-numeric:tabular-nums}
.scene-stage .board-zoom{right:12px!important;bottom:12px!important;gap:3px;padding:4px;border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 16px #0002;background:var(--surface)}
.scene-stage .board-zoom button{padding:6px 8px}.scene-stage .board-zoom button svg{width:16px;height:16px}
.scene-tools-toggle{top:14px;right:14px;width:38px;height:38px;display:flex;align-items:center;justify-content:center;padding:8px;border-radius:11px}
.scene-quick-add{position:absolute;z-index:6;top:14px;left:14px;display:flex;align-items:center;justify-content:center;width:72px;height:72px;min-height:72px;padding:18px;border:1px solid color-mix(in srgb,var(--accent) 75%,var(--surface));border-radius:50%;background:var(--accent);color:var(--onAccent);box-shadow:0 5px 18px #0003;transition:box-shadow .15s,filter .15s}
.scene-quick-add svg{width:34px;height:34px}.scene-quick-add:hover{filter:brightness(1.08);box-shadow:0 6px 22px #0004}
.scene-tools-hidden .board-toolbar,.scene-tools-hidden .board-status-row{display:flex!important}
.board-focused.scene-tools-hidden{padding:16px!important;inset:8px!important}
#connection-stage.scene-stage:fullscreen{position:relative!important;width:100vw!important;height:100dvh!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;border:0!important;border-radius:0!important;margin:0!important;box-sizing:border-box!important}
#connection-stage:fullscreen::backdrop{background:var(--surface)}
.scene-stage.scene-over-element #connection-canvas,.scene-stage.scene-over-element #connection-canvas canvas{cursor:grab!important}
.scene-stage.scene-grabbing #connection-canvas,.scene-stage.scene-grabbing #connection-canvas canvas{cursor:grabbing!important}
.scene-stage.scene-grabbing .connection-balloon{display:none!important}
.scene-tooltip{position:fixed;z-index:20000;max-width:230px;padding:6px 9px;border-radius:7px;background:var(--text);color:var(--surface);font:500 12px/1.35 system-ui;box-shadow:0 3px 12px #0003;pointer-events:none;text-align:center}
.connection-balloon.scene-compact-menu{width:192px!important;padding:10px!important;border-radius:12px;font-size:12px;max-height:calc(100% - 16px);box-shadow:0 7px 26px #0003}
.scene-compact-menu header{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:6px}
.scene-compact-menu header strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.4;margin:0}
.scene-compact-menu button,.scene-compact-menu summary{display:inline-flex;align-items:center;justify-content:center;height:28px;min-height:28px;min-width:26px;padding:4px!important;margin:0!important;border-radius:6px;font-size:12px}
.scene-compact-menu button svg{width:16px;height:16px}.scene-compact-menu header button{border:0;min-width:22px;width:22px;height:22px;min-height:22px;background:transparent}
.scene-record-actions{display:flex;gap:4px;margin-bottom:7px}.scene-transform-actions{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;margin-top:7px}
.scene-compact-menu input.scene-identifier{display:block;width:100%;height:30px;min-height:30px;padding:5px 7px;font-size:12px;margin:0;box-sizing:border-box;border-radius:7px}
.scene-element-metrics{display:block;text-align:center;font-size:10px;color:var(--muted);margin:4px 0 0;font-variant-numeric:tabular-nums}
.scene-compact-menu button[aria-pressed=true]{background:var(--accent);color:var(--onAccent)}
.scene-face-tools{margin-top:6px;padding-top:5px;border-top:1px solid var(--line)}
.scene-face-tools summary{list-style:none;display:flex;gap:5px;cursor:pointer;font-size:19px}.scene-face-tools summary::-webkit-details-marker{display:none}
.scene-face-tools[open]{display:grid;grid-template-columns:1fr 1fr;gap:6px}.scene-face-tools summary{grid-column:1/-1}.scene-face-tools summary span{font-size:12px;color:var(--muted)}
.scene-moods,.scene-gaze{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.scene-moods button{font-size:18px}.scene-gaze button{font-size:18px}
.scene-library-items button{touch-action:none}.scene-stage .board-zoom button:focus-visible,.scene-compact-menu button:focus-visible,.scene-bottom-tools button:focus-visible,.scene-quick-add:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:1100px){.scene-bottom-tools{max-width:calc(100% - 24px);bottom:62px;gap:6px}.scene-stage .board-zoom{bottom:12px!important}}
@media(max-width:600px){.scene-bottom-tools{left:8px;bottom:60px;max-width:calc(100% - 16px);gap:5px}.scene-bottom-tools button{min-width:30px;height:32px;padding:5px}.scene-stage .board-zoom{right:8px!important;bottom:8px!important}.scene-quick-add{left:12px;top:12px}.board-focused.scene-tools-hidden{inset:0!important;padding:8px!important}}
@media(prefers-reduced-motion:reduce){.scene-quick-add{transition:none}}

/* The same controls serve both persistent board types. */
.shared-board-tools .board-zoom{right:12px;bottom:12px;z-index:5;gap:3px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 4px 16px #0002}
.shared-board-tools .board-zoom button{height:32px;min-height:32px;padding:6px 8px;display:inline-flex;align-items:center;justify-content:center}
#connection-stage.shared-board-tools:fullscreen{width:100vw!important;height:100dvh!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;margin:0!important;aspect-ratio:auto!important}
.shared-board-tools.scene-over-element canvas{cursor:grab!important}.shared-board-tools.scene-grabbing canvas{cursor:grabbing!important}
.scene-compact-menu .scene-face-tools{border:0;border-top:1px solid var(--line);padding:5px 0 0;margin:5px 0 0}
.scene-compact-menu .scene-face-tools[open]{display:block}.scene-compact-menu .scene-face-tools[open]>.scene-moods,.scene-compact-menu .scene-face-tools[open]>.scene-gaze{display:inline-grid;vertical-align:top;width:calc(50% - 3px);margin:5px 0 0;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
.scene-compact-menu .scene-face-tools[open]>.scene-gaze{margin-left:6px}.scene-compact-menu .scene-face-tools summary{width:100%;height:28px;padding:3px!important}
.tools-nav{border:0;padding:0;margin:3px 0}.tools-nav>summary{display:flex;align-items:center;gap:10px;list-style:none;min-height:40px;padding:9px 12px;border-radius:8px;cursor:pointer;font-size:var(--text-min,.85rem);font-weight:600;color:inherit}
.tools-nav>summary::-webkit-details-marker{display:none}.tools-nav>summary:after{content:'›';margin-left:auto;transition:transform .15s}.tools-nav[open]>summary:after{transform:rotate(90deg)}.tools-nav>div{padding:5px 0;margin:4px 0 0;border:0;border-radius:10px;background:#ffffff12}.tools-nav>div button{font-size:max(11px,.78rem);padding:9px 8px;background:transparent}.tools-nav>div button:hover,.tools-nav>div button:focus-visible{background:#ffffff12}.tools-nav>summary:hover{background:#ffffff12}.sidebar-collapsed .tools-nav>summary .nav-label{display:none}.sidebar-collapsed .tools-nav>summary:after{content:none}.sidebar-collapsed .tools-nav>div{position:absolute;left:64px;width:215px;margin:0;padding:8px;background:var(--sidebar,#74333d);border-radius:10px;z-index:100;box-shadow:0 6px 20px #0003}.sidebar-collapsed .tools-nav>div .nav-label{display:inline!important}
.studio-field-title,.studio-choice legend,.studio-swatches legend{width:auto!important;display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;float:none!important;padding:0!important;margin:0 0 6px!important}.studio-slider-heading .studio-field-title{margin-bottom:0!important}button.studio-part-random{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 22px!important;width:22px!important;min-width:22px!important;max-width:22px!important;height:22px!important;min-height:22px!important;max-height:22px!important;padding:2px!important;margin:0!important;font-size:13px!important;border-radius:6px!important;line-height:1!important;background:transparent!important;color:var(--muted)!important;border:1px solid transparent!important;box-shadow:none!important;opacity:.75}button.studio-part-random svg{width:13px!important;height:13px!important;flex:none}button.studio-part-random:hover,button.studio-part-random:focus-visible{opacity:1;border-color:color-mix(in srgb,var(--accent) 40%,var(--line))!important;background:var(--accentSoft)!important;color:var(--accent)!important}
.studio-choice>div{display:flex!important;flex-wrap:wrap;gap:6px!important}.studio-choice>div>button{flex:0 0 40px!important;min-width:40px!important;min-height:40px!important;width:40px!important;height:40px!important;padding:6px!important;font-size:20px!important}.studio-choice>div>button svg{width:23px;height:23px;flex:none}.studio-choice>div.pose-preset-grid>button{flex:1 1 calc(33.3% - 6px)!important;width:auto!important;min-width:74px!important;height:34px!important;min-height:34px!important;font-size:12px!important;font-weight:600;padding:4px 8px!important}.studio-tabs>button{font-size:11px!important}.studio-slider-heading{display:flex;align-items:center;justify-content:space-between;gap:6px}.studio-slider-heading label{margin:0;font-weight:600}.studio-footer>button{min-width:36px;min-height:36px}.studio-footer>button.primary{flex:1}.studio-swatches .studio-part-random{background:transparent!important}.studio-choice,.studio-swatches{margin-bottom:10px!important}
.avatar-lab-toolbar{display:flex;align-items:end;justify-content:space-between;gap:18px;padding-bottom:16px;border-bottom:1px solid var(--line);margin-bottom:16px}.avatar-lab-toolbar>label{flex:1;max-width:380px}.avatar-lab-toolbar .actions{flex-wrap:wrap;justify-content:end}.avatar-lab-layout{display:grid;grid-template-columns:minmax(280px,1fr) minmax(270px,var(--studio-width,380px));gap:20px;align-items:stretch}.avatar-lab-layout.is-studio-collapsed{grid-template-columns:1fr}.avatar-lab-stage{position:relative;min-width:0;display:flex;flex-direction:column;justify-content:space-between;background:radial-gradient(ellipse at 50% 42%,color-mix(in srgb,#5b7691 22%,var(--surface)),var(--surface) 76%);border:1px solid var(--line);border-radius:14px;padding:0;overflow:hidden;text-align:center}.avatar-lab-preview{flex:1 1 auto;height:520px;padding:12px;touch-action:none;display:flex;align-items:center;justify-content:center}.avatar-lab-preview>svg{height:100%;width:100%;display:block}.avatar-lab-preview [data-pose-joint],.avatar-lab-preview [data-pose-handle]{cursor:grab}.avatar-lab-preview [data-pose-joint]:active,.avatar-lab-preview [data-pose-handle]:active{cursor:grabbing}.avatar-lab-preview [data-pose-handle] circle{fill:transparent;stroke:transparent;stroke-width:0;opacity:0}.avatar-lab-preview [data-pose-handle]:focus-visible circle{stroke:var(--accent);stroke-width:2;opacity:.6}.avatar-stage-dock{margin-top:auto;width:100%;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:10px 16px;background:var(--surface);border-top:1px solid var(--line);z-index:2}.avatar-stage-dock .actions{justify-content:flex-start;margin:0}.avatar-stage-dock .field-hint{margin:0;font-size:12px}.studio-expand-pill{position:absolute;top:12px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:99px;background:var(--accent);color:var(--onAccent,#fff);border:0;font-weight:650;box-shadow:0 4px 14px #0003}.avatar-lab-customization{position:relative;display:flex;flex-direction:column;gap:0;border:1px solid var(--line);border-radius:12px;max-height:660px;min-width:270px;overflow:hidden;background:var(--surface)}.avatar-lab-customization[hidden]{display:none!important}.avatar-lab-customization .studio-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));flex:none;border-right:0;border-bottom:1px solid var(--line);padding:6px 8px;gap:4px;background:var(--surface2)}.avatar-lab-customization .studio-tabs button{padding:5px 4px;min-height:46px;height:46px}.avatar-lab-customization .studio-controls{padding:12px;min-width:0;flex:1;overflow:auto}.free-avatar-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin:16px 0}.free-avatar-library article{display:flex;flex-direction:column;gap:7px;padding:9px;border:1px solid var(--line);border-radius:12px}.free-avatar-library article>button:first-child{display:flex;flex-direction:column;border:0;padding:6px;min-width:0;background:transparent}.free-avatar-library article>button:first-child span{height:160px;width:100%;display:block}.free-avatar-library article>button:first-child svg{height:100%;width:100%}.free-avatar-library strong{font-size:13px;text-align:center;white-space:normal;overflow-wrap:anywhere}.free-avatar-library article>button:last-child{align-self:center;font-size:12px}.lab-status{font-size:12px;color:var(--muted);margin:0}
@media(max-width:960px),(max-aspect-ratio:1/1){.avatar-lab-layout{grid-template-columns:1fr}.avatar-lab-preview{height:440px}.avatar-lab-customization{max-height:480px}.avatar-lab-customization .studio-resize-handle{display:none}.avatar-lab-toolbar{align-items:stretch;flex-direction:column}.avatar-lab-toolbar>label{max-width:none}.shared-board-tools .scene-bottom-tools{bottom:62px}.shared-board-tools .board-zoom{bottom:10px}}
.scene-stage .board-zoom>.scene-scale-tools{display:flex;align-items:center;gap:3px;padding:4px;background:color-mix(in srgb,var(--surface) 96%,transparent);border-radius:9px}
.scene-stage .board-zoom>.scene-scale-tools button{min-width:32px;min-height:32px;height:32px;padding:6px;border-radius:7px;font-size:12px}
.scene-stage .board-zoom>.scene-scale-tools output{min-width:38px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums}

