#app { --shell-margin: 12px; --shell-gap: 12px; --command-height: 48px; background: linear-gradient(180deg, #0d1014, #090b0e); }
[data-theme="light"] #app { background: var(--bg-page); }
#viewportArea { --model-dock-width: var(--model-sidebar-width, 360px); --shell-dock: calc(var(--model-dock-width, 0px) + var(--shell-margin) + var(--shell-gap)); }
#viewportArea, #viewportArea[data-pcb], #viewportArea[data-pcb-view="2d"] { padding-top: 0; }
#commandBar { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-panel); }
#commandBar > :is(#menu,#toolbar,#commandCorner) {
  position: absolute; top: var(--shell-margin); display: flex; align-items: center; gap: 2px; padding: 5px;
  height: var(--command-height); box-sizing: border-box; width: max-content; margin: 0;
  background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: 999px;
  box-shadow: 0 10px 30px #00000040; pointer-events: auto;
}
#commandBar #menu { left: var(--shell-margin); max-width: max(194px, calc((100% - var(--shell-dock)) / 2 - 230px)); flex-wrap: nowrap; }
#commandBar #tabList { order: -2; flex: 1 1 auto; min-width: 70px; max-width: 240px; margin: 0; overflow-x: auto; scrollbar-width: none; }
#commandBar #toolbar { left: var(--shell-center, 50%); transform: translateX(-50%); max-width: none; flex-wrap: nowrap; }
#commandBar #commandCorner { right: var(--shell-margin); }
#commandContext { display: flex; align-items: center; gap: 2px; }
.command-group { display: flex; align-items: center; gap: 2px; }
.command-group + .command-group { border-left: 1px solid var(--hairline); margin-left: 5px; padding-left: 5px; }
#commandBar .tb-btn { width: 36px; min-width: 36px; height: 36px; border-radius: var(--control-radius); padding: 0; color: var(--text-tertiary); border: 1px solid transparent; }
#commandBar .tb-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
#commandBar .tb-btn.active, #commandBar [aria-checked="true"], #commandBar .tb-btn[aria-pressed="true"] { color: var(--accent); background: var(--bg-selected); box-shadow: none; border-color: transparent; }
#commandBar .tb-btn:hover { color: var(--text); background: var(--bg-hover); }
.command-action > .command-label { display: none; }
#commandBar [hidden], .shell-popover[hidden] { display: none !important; }
#commandBar :is(button,summary,select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell-popover, #saveMenu, #viewSelector, #sectionPanel, #panel, #bodies, #ctx, #findBar, #unitMenu, #statusChip {
 background: var(--pane-bg) !important; border: 1px solid var(--hairline) !important; border-radius: var(--pane-radius) !important;
 box-shadow: 0 10px 30px #00000040;
}
.shell-popover { position: fixed; z-index: var(--z-popover); padding: 8px; min-width: 190px; max-height: calc(100vh - 100px); overflow-y: auto; }
.shell-popover .menu-action { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 5px 8px; justify-content: flex-start; border-radius: var(--control-radius); }
.shell-popover .menu-action::after { content: none; }
.shell-popover .command-label { display: inline; }
.shell-popover svg { width: 19px; height: 19px; }
.shell-popover .tb-btn.active { color: var(--accent); }
#bodies { top: calc(var(--shell-margin) + var(--command-height) + var(--shell-gap)); right: var(--shell-margin); bottom: var(--shell-panel-bottom, var(--shell-margin)); width: var(--model-sidebar-width, 360px); height: auto; max-height: none; overflow: hidden; }
#bodies.collapsed { height: var(--command-height); max-height: var(--command-height); }
#statusChip { position: absolute; left: var(--shell-margin); bottom: var(--status-clearance, var(--shell-margin)); max-width: min(620px,calc(100% - var(--shell-dock) - 24px)); padding: 8px 14px; border-radius: 999px !important; z-index: var(--z-panel); font-size: 12px; color: var(--text-tertiary); }
#statusChip:not(:has(#stats:not([style*="display: none"]):not([style*="display:none"]):not(:empty))):not(:has(#rendererStatus:not([hidden]))):not(:has(#geometryDiagnostics:not([hidden]))):not(:has(#renderJobStatus:not([hidden]))):not(:has(#renderCompletion:not([hidden]))) { display: none; }
#statusChip #stats, #statusChip #rendererStatus { position: static; inset: auto; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; max-width: 100%; }
#panel { bottom: 60px; }
#hint { bottom: 16px; left: 16px; }

#pcbStatus { bottom: 12px; left: 12px; right: var(--shell-dock); border-radius: 999px; background: var(--pane-bg); border: 1px solid var(--hairline); }
#commandBar #pcbWorkspace { position: static; display: flex; background: transparent; padding: 0; margin: 0; border: 0; max-width: none; width: auto; }
#boardMenu { position: relative; }
#boardMenu > summary { list-style: none; display: grid; place-items: center; cursor: pointer; }
#boardMenu > summary::-webkit-details-marker { display: none; }
#boardMenu > summary svg { width: 19px; height: 19px; }
#boardMenuContent { position: absolute; top: 48px; left: 0; width: 240px; max-height: calc(100vh - 100px); overflow: auto; padding: 12px; background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: var(--pane-radius); box-shadow: 0 10px 30px #00000040; }
#boardMenu:not([open]) > #boardMenuContent { display: none; }
#boardMenuContent .pcb-tools { display: grid; gap: 4px; }
#commandBar:has(details[open]) { z-index: var(--z-popover); }
#commandMore > summary { display: grid; place-items: center; cursor: pointer; list-style: none; }
#commandMoreContent { position: absolute; top: 54px; left: 0; padding: 10px; background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: var(--pane-radius); }
#commandMore:not([open]) > #commandMoreContent { display: none; }
#commandBar[data-chrome="pending"] :is(button,summary,select):not(#tbHelp), #commandBar[data-chrome="failed"] :is(button,summary,select):not(#tbHelp) { opacity: .45; pointer-events: none; }
.command-chrome-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width:639px) {
 #commandBar #commandCorner { top: 12px; right: 12px; }
 #commandBar #toolbar { top: 70px; left: 12px; transform: none; }
 #commandBar #menu { max-width: calc(100% - 24px); }
 #bodies:not(.collapsed) { inset: auto 0 28px; width: 100%; height: min(42vh,360px); max-height: calc(100vh - 140px); }
 #viewportArea:has(#bodies:not(.hidden):not(.collapsed)) { --model-dock-width: 0px; }
}
#commandBar #tbSave::after { content: none; }
#commandBar .tab-scroll { width: 22px; min-width: 22px; }
#commandBar #tabScrollPrevious { order: -3; }
#commandBar #tabScrollNext { order: -1; }
#commandBar #tabList .tab-item { max-width: min(160px, 100%); }
#commandBar #tabList .tab-item:only-child { max-width: 100%; flex-shrink: 1; }
#ctxMenu { background: var(--pane-bg); border-color: var(--hairline); border-radius: var(--pane-radius); }


#viewportArea[data-pcb] #bodies { height: auto; max-height: none; }
#saveMenu #tbZip { gap: 6px; white-space: nowrap; font-size: 12px; }
#saveMenu #tbZip svg { width: 19px; height: 19px; flex: 0 0 19px; }
#viewportArea[data-pcb] #statusChip { bottom: max(52px, var(--status-clearance, 12px)); }

#viewportArea[data-project-split] .pane::after { top: 72px; }

#statusChip .geometry-diagnostics-status { border-top: 0; }
#statusChip .geometry-diagnostics-status > summary { padding: 3px 0; }

#commandMore > summary svg { width: 19px; height: 19px; }
.help-backdrop .help-panel { top: 12px; right: 12px; height: calc(100% - 24px); box-sizing: border-box; background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: var(--pane-radius); overflow: hidden; }
dialog.settings-dialog { background: var(--pane-bg); border-color: var(--hairline); border-radius: var(--pane-radius); }

#optionsStrip { position: absolute; bottom: var(--shell-margin); left: var(--shell-strip-center, 50%); transform: translateX(-50%); width: max-content; max-width: var(--shell-strip-width, calc(100% - 24px)); padding: 8px; background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: var(--pane-radius); box-shadow: 0 10px 30px #00000040; z-index: var(--z-panel); }
#optionsStrip[hidden] { display: none; }
#displayStrip, #stripLighting { display: flex !important; align-items: center; gap: 4px; }
#displayStrip[style*="none"] { display: none !important; }
#optionsStrip .tb-btn { width: 36px; height: 36px; min-width: 36px; padding: 6px; border-radius: var(--control-radius); }
#optionsStrip svg { width: 19px; height: 19px; }
#optionsStrip .command-label { display: none; }
#stripLighting { border-inline: 1px solid var(--hairline); padding-inline: 8px; margin-inline: 4px; }
#stripLighting .ctx-label { font-size: 11px; color: var(--text-tertiary); }
#optionsStrip #sectionPanel { position: static; transform: none; width: auto; max-width: 100%; padding: 0; background: transparent !important; border: 0 !important; box-shadow: none; }

.measurement-result { display: flex; align-items: center; gap: 8px; }
.measurement-result output { flex: 1; min-width: 0; }
#measurementPanel #tbUnit { flex: 0 0 auto; width: auto; min-width: 36px; height: 30px; }

#commandBar #pcbWorkspace .pcb-views .tb-btn { width: 30px; min-width: 30px; border: 0; background: transparent; }
#commandBar #pcbWorkspace .pcb-views .command-label { display: none; }
#commandBar #pcbWorkspace .pcb-views [aria-pressed="true"] { background: var(--bg-selected); color: var(--accent); }
#boardMenuContent .pcb-tools button { width: 100%; height: auto; min-height: 34px; padding: 6px 10px; text-align: left; justify-content: flex-start; white-space: normal; }
#boardMenuContent .command-label { display: inline; }
#boardMenuContent .feature-badge { margin-left: auto; }
#pcbStatus { right: auto; max-width: calc(100% - var(--shell-dock) - 24px); box-sizing: border-box; height: auto; }
#toolPanel { position: absolute; left: var(--shell-margin); top: calc(var(--shell-margin) + var(--command-height) + var(--shell-gap)); bottom: var(--shell-panel-bottom, var(--shell-margin)); width: 300px; box-sizing: border-box; max-width: calc(100% - var(--shell-dock) - 24px); background: var(--pane-bg); border: 1px solid var(--hairline); border-radius: var(--pane-radius); box-shadow: 0 10px 30px #00000040; z-index: var(--z-panel); display: flex; flex-direction: column; overflow: hidden; }
#toolPanel[hidden] { display: none; }
#toolPanel > header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--hairline); }
#toolPanel h2 { margin: 0; font-size: 13px; }
#toolPanel > header button { width: 30px; height: 30px; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.tool-panel-content { overflow: auto; min-height: 0; flex: 1; }
#viewportArea:has(#toolPanel:not([hidden])) #panel { left: 324px; max-width: calc(100% - var(--shell-dock) - 336px); }

#displayStrip { flex-wrap: wrap; }
@media (max-width: 639px) { #toolPanel { top: 130px; } }

#optionsStrip[data-owner="section"] { padding: 5px; height: 48px; box-sizing: border-box; border-radius: 999px; }
#optionsStrip #sectionPanel { max-width: none; }
#sectionRow, #sectionPanel .section-group, #sectionPanel .section-chip { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; }
#sectionRow { height: 36px; white-space: nowrap; }
#sectionRow.section-scroll { overflow-x: auto; scrollbar-width: none; }
#sectionRow.section-scroll :focus-visible { outline-offset: -2px; }
#sectionPanel [hidden] { display: none !important; position: absolute !important; pointer-events: none; }
#sectionPanel .tb-btn { flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; padding: 0; border: 1px solid transparent; background: transparent; border-radius: var(--control-radius); color: var(--text-tertiary); cursor: pointer; }
#sectionPanel .tb-btn:hover { color: var(--text); background: var(--bg-hover); }
#sectionPanel .tb-btn[aria-pressed="true"], #sectionPanel .section-chip.active { color: var(--accent); background: var(--bg-selected); border-radius: var(--control-radius); }
#sectionPanel .section-chip .tb-btn { min-width: 28px; width: 28px; flex-basis: 28px; color: inherit; }
#sectionPanel .section-chip button + button { min-width: 18px; width: 18px; flex-basis: 18px; }
#sectionPanel .section-chip button + button svg { width: 12px; }
#sectionPanel .section-plane-off > button:first-child { text-decoration: line-through; opacity: .6; }
#sectionPanel .section-group { flex: 0 0 auto; }
#sectionPanel #sectionOffsetGroup { margin: 0 6px; gap: 3px; }
#sectionPanel input[type="range"] { accent-color: var(--accent); width: 72px; min-width: 24px; margin: 0; }
#sectionPanel #secOffset { width: clamp(24px, 8vw, 100px); }
#sectionPanel input[type="number"] { box-sizing: border-box; font: inherit; color: var(--text); background: var(--bg-page); border: 1px solid var(--hairline); border-radius: var(--control-radius); height: 30px; width: 48px; padding: 2px 4px; }
#sectionPanel #secOffsetNum { width: 65px; }
#sectionOffsetUnit { color: var(--text-tertiary); font-size: 11px; }
#sectionPanel :is(button, input):disabled { opacity: .45; cursor: default; }
#sectionPanel :is(button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#sectionPanel .section-popover { position: absolute; bottom: 56px; right: 0; padding: 8px; border: 1px solid var(--hairline); background: var(--pane-bg); border-radius: var(--pane-radius); box-shadow: 0 10px 30px #00000040; max-width: min(360px, calc(100vw - 40px)); max-height: min(320px, calc(100vh - 180px)); overflow: auto; }
#sectionPanel #sectionOverflowPanel { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
#sectionPanel #sectionCapStatus { font-size: 12px; white-space: pre-wrap; width: max-content; }
#sectionTiltFields { gap: 3px; }
#sectionTiltFields #secPitchNum, #sectionTiltFields #secYawNum { width: 43px; }
#sectionPanel #sectionTiltFields::before { content: "↶"; color: var(--text-tertiary); }
#sectionPanel #sectionTiltFields::after { content: "°"; color: var(--text-tertiary); }
@media (prefers-reduced-motion: no-preference) {
  #sectionPanel :is(.section-group, .section-popover, .tb-btn) { transition: opacity 160ms ease-out, display 160ms allow-discrete, background-color 160ms, color 160ms; }
  #sectionPanel [hidden] { opacity: 0; }
  @starting-style { #sectionPanel :is(.section-group, .section-popover, .tb-btn) { opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  #sectionPanel * { animation: none !important; transition: none !important; }
}
@media (max-width: 900px) {
  #sectionPanel .tb-btn { width: 30px; min-width: 30px; flex-basis: 30px; }
  #sectionPanel #sectionOffsetGroup { margin: 0 2px; }
  #sectionPanel #secOffset { width: 36px; }
}
#sectionPanel .section-compact { gap: 1px; }
#sectionPanel .section-compact .tb-btn { width: 26px; min-width: 26px; flex-basis: 26px; }
#sectionPanel .section-compact .section-chip .tb-btn { width: 20px; min-width: 20px; flex-basis: 20px; }
#sectionPanel .section-compact .section-chip button + button { width: 14px; min-width: 14px; flex-basis: 14px; }
#sectionPanel .section-compact #secOffset { width: 24px; }
#sectionPanel .section-compact #secOffsetNum { width: 56px; }
#sectionPanel .section-compact #sectionOffsetGroup { margin: 0 1px; gap: 2px; }
@media (max-width: 639px) {
  #viewportArea #optionsStrip[data-owner="section"] { left: 50%; max-width: calc(100% - 24px); }
}


@media (max-width:639px) {
 #commandBar #tabList { min-width: 36px; }
 #bodies.collapsed { top: 70px; }
}
@media (min-width:640px) and (max-width:1399px) {
 #commandBar .tb-btn { width: 32px; min-width: 32px; }
 #commandBar .tab-scroll { width: 22px; min-width: 22px; }
}

#viewportArea[data-pcb-view="2d"] .board2d-readout { position: fixed; left: 12px; bottom: calc(var(--board-footer-height, 28px) + 24px); max-width: min(300px, calc(100% - var(--shell-dock) - 24px)); box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; }
#viewportArea[data-pcb-view="2d"] #toolPanel { bottom: max(calc(var(--tool-clearance, 48px) + 12px), calc(var(--board-footer-height, 28px) + 72px)); }
#viewportArea[data-pcb-view="2d"] #panel { bottom: calc(var(--board-footer-height, 28px) + 72px); }
#viewportArea[data-pcb-view="2d"] #statusChip { bottom: max(var(--status-clearance, 12px), calc(var(--board-footer-height, 28px) + 72px)); }

body.render-mode #toolbar > :not(.render-mode-tools) { display: none !important; }
.render-mode-tools, .render-mode-tools .render-output-tabs { display: flex; align-items: center; gap: 3px; padding: 0; }
#commandBar .render-mode-tools :is(#render-exit,#renderOutputImage,#renderOutputVideo,#renderDownload,#renderCancel) { width: auto; padding: 0 9px; }
#commandBar .render-mode-tools :is(#render-exit,#renderOutputImage,#renderOutputVideo,#renderDownload,#renderCancel) .command-label { display: inline; white-space: nowrap; }
#commandBar .render-mode-tools :is(#renderOutputImage,#renderOutputVideo) svg { display: none; }
#commandBar .render-mode-tools [aria-selected=true] { color: var(--accent); background: var(--bg-selected); }

body.render-mode #toolPanel { width: 380px; }
body.render-mode #statusChip { display: block; max-width: calc(100% - var(--shell-dock) - 40px); }
#renderStatus { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
#renderProgress { width: 100%; height: 4px; display: block; accent-color: var(--accent); }
.render-workspace[hidden], .render-workspace [hidden], #renderOutputFrame[hidden], #renderLivePreviewImage[hidden], .render-composer-pane[hidden] { display: none !important; }
.render-workspace { min-width: 0; color: var(--text); }
.render-workspace .render-content { overflow: visible; padding: 12px; }
.render-workspace :is(input,select,textarea) { max-width: 100%; min-width: 0; box-sizing: border-box; }
.render-workspace :is(button,input,select,textarea) { font: inherit; }
.render-workspace button, .render-result button { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--bg-hover); cursor: pointer; overflow-wrap: anywhere; }
.render-workspace button:disabled { opacity: .5; cursor: default; }
.render-workspace .render-live-preview-toggle { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.render-workspace .render-live-preview-toggle input { width: auto; margin: 0; }
.render-workspace fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.render-workspace legend { max-width: 100%; }
.render-workspace .render-extensions { padding: 0; }
.render-workspace .render-preview-frame { min-height: 100px; max-height: 180px; }
.render-workspace .render-preview-frame img { max-height: 180px; }
.render-workspace .render-recipe-editor { grid-template-columns: minmax(0,1fr); }
.render-workspace .render-recipe-queue-row > div { flex-wrap: wrap; }
.render-composer-launch { width: 100%; margin-top: 12px; }
.render-composer-launch .command-label { display: inline; }
.render-composer-launch svg { display: none; }
#renderOutputFrame { position: fixed; pointer-events: none; z-index: 1; box-sizing: border-box; }
.render-frame-label { position: absolute; top: 6px; left: 8px; padding: 3px 6px; background: #10141bcc; color: #fff; font-size: 11px; border-radius: 4px; }
.render-result { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-page); }
.render-result[hidden] { display: none; }
.render-result img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.render-result > div { position: fixed; top: 84px; right: calc(var(--shell-dock) + 12px); display: flex; gap: 8px; pointer-events: auto; }
.render-composer-pane { position: fixed; left: 12px; top: 72px; right: calc(var(--shell-dock) + 12px); bottom: 64px; z-index: var(--z-popover); overflow: auto; padding: 12px; border: 1px solid var(--hairline); border-radius: var(--pane-radius); background: var(--pane-bg); box-shadow: 0 10px 30px #0006; }
.render-composer-close { display: block; margin-left: auto; }
.render-composer-pane .render-composer { margin: 8px 0 0; }
.render-composer-pane .render-preview-frame { max-height: none; width: min(100%, calc(180px * var(--composer-aspect, 1.5))); margin-inline: auto; }
.render-composer-pane .render-preview-frame img { max-height: none; position: absolute; inset: 0; }
@media(max-width: 1279px) {  body.render-mode #toolPanel { width: 340px; } .render-composer-body { grid-template-columns: 120px minmax(200px,1fr) minmax(190px,1fr); } }


.render-result .command-label { display: inline; }
.render-result svg { display: none; }
.render-workspace .render-animation-row { flex-wrap: wrap; }
.render-workspace .render-animation-row > * { flex: 1 1 110px; }
.render-result .command-action { width: auto; height: auto; min-height: 36px; padding: 8px 12px; white-space: nowrap; }
.render-composer-pane .render-composer-body { max-height: 360px; overflow: auto; }
.render-composer-pane .render-composer-inspector { max-height: 340px; }
.render-composer-pane .render-timeline { max-height: 360px; overflow: auto; }
.render-composer-pane [data-composer-inspector="assembly-transition-editor"] { max-height: 480px; overflow: auto; }
body.render-mode #viewportArea:has(#toolPanel:not([hidden])) #panel { left: 404px; max-width: calc(100% - var(--shell-dock) - 416px); }
body.render-mode:has(.render-result:not([hidden])) #panel { display: none; }
@media(max-width: 1279px) { body.render-mode #viewportArea:has(#toolPanel:not([hidden])) #panel { left: 364px; max-width: calc(100% - var(--shell-dock) - 376px); } }
.render-workspace :is(input:not([type=checkbox]):not([type=range]):not([type=color]), select, textarea) { width: 100%; padding: 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-input, var(--bg-page)); color: var(--text); }
.render-background { margin: 12px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.render-background legend { color: var(--text); padding: 0 4px; }
.render-background label, [data-photo="floor"] label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.render-background input[type="color"], [data-photo="floor"] input[type="color"] { width: 100%; height: 32px; padding: 3px; }
.render-background input[type="file"] { max-width: 100%; box-sizing: border-box; }
.render-background p { color: var(--text-secondary); margin: 8px 0 0; }
.render-material-library { margin: 12px 0; border-top: 1px solid var(--border); padding-top: 10px; }
.render-material-library h3 { margin: 0 0 6px; font-size: 14px; }
.render-material-library p { font-size: 12px; line-height: 1.4; margin: 6px 0; }
.render-material-library label { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.render-material-library summary { cursor: pointer; padding: 6px 0; }
.render-material-library input[type="color"] { width: 100%; height: 30px; }
.render-material-library [data-material="assignments"] { margin: 10px 0; font-size: 12px; }
.render-material-assignment { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; padding: 8px 0; border-top: 1px solid var(--border); }
.render-material-assignment > span { overflow-wrap: anywhere; }
.render-material-assignment > div { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.render-material-chip { width: 12px; height: 12px; border: 1px solid var(--border); border-radius: 50%; margin-top: 2px; }
.render-workspace label.render-ground-toggle { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; }
.render-workspace label.render-ground-toggle input { flex: 0 0 auto; width: auto; margin: 0; }


body.render-mode #lightBall,
body.render-mode #lightBallRay,
body.render-mode #lightBallLabel,
body.render-mode #fillBall,
body.render-mode #fillBallLabel,
body.render-mode #ambientGlow,
body.render-mode #ambientReadout,
body.render-mode #lightTarget {
  display: none !important;
}
.render-light-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.render-light-row button {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  text-align: left;
}
.render-light-row button[aria-pressed="true"] {
  border-color: #ffce65;
  color: #ffce65;
}
.render-light-chip {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid #888;
}
.render-scene-lights > label:has([data-scene-light="show"]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.render-scene-lights h4 { margin: 12px 0 6px; }
.render-scene-lights [data-scene-light="editor"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.render-scene-lights label:has([data-scene-light="name"]) { grid-column: span 2; }
.render-scene-lights [data-scene-light="color"] { width: 100%; height: 32px; }
.render-scene-lights [data-scene-light="status"] { font-size: 11px; line-height: 1.5; }

body.render-mode #statusChip { box-sizing: border-box; width: 368px; max-width: 368px; }
body.render-mode #statusChip :is(#renderStatus,#rendererStatus,summary) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.render-mode #toolPanel { bottom: var(--shell-panel-bottom, var(--shell-margin)); max-height: none; }
body.render-mode .tool-panel-content:has(.render-workspace) { overflow: hidden; display: flex; }
.render-workspace { --render-inset: 8px; position: relative; padding-left: 40px; min-height: 0; width: 100%; box-sizing: border-box; display: flex; }
.render-rail { position: absolute; inset: 0 auto 0 0; width: 40px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); padding: 6px 2px; overflow-y: auto; }
.render-workspace .render-rail button { padding: 7px; width: 32px; height: 34px; flex-shrink: 0; background: transparent; border-color: transparent; }
.render-rail svg, .render-section summary svg, .render-actions svg, .render-menu svg { width: 18px; height: 18px; }
.render-rail button[aria-selected=true] { color: var(--accent); background: var(--bg-selected); box-shadow: inset 2px 0 var(--accent); }
.render-workspace .render-content { padding: var(--render-inset); border: 0; overflow: auto; min-width: 0; width: 100%; scrollbar-gutter: stable; }
.render-workspace .render-layout, .render-workspace .render-controls, .render-workspace .render-extensions { display: block; }
.render-workspace .render-section, .render-workspace [data-render-extension], .render-workspace #renderBackgroundGroup { border: 0; border-radius: 0; padding: 0; margin: 0 0 8px; }
.render-section > summary, .render-workspace legend { box-sizing: border-box; width: 100%; min-height: 30px; color: var(--text-title); font-size: 12px; font-weight: 600; padding: 6px var(--render-inset); background: var(--bg-hover); cursor: pointer; }
.render-section > summary button { float: right; padding: 0; height: 18px; min-height: 18px; border: 0; background: transparent; }
.render-workspace label.render-field { min-width: 0; max-width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px; align-items: center; min-height: 30px; margin: 6px 0; padding-inline: var(--render-inset); font-size: 11px; }
.render-field > span:first-child { text-align: right; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.render-room-primary > label:has([data-stage="roomSizePreset"]) { grid-template-columns: minmax(0, 1fr); }
.render-room-primary > label:has([data-stage="roomSizePreset"]) > span:first-child { text-align: left; }
.render-room-hint { display: block; margin: 8px var(--render-inset); color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.render-workspace label.render-number { grid-template-columns: 84px minmax(0, 1fr) 62px; }
.render-workspace .render-field :is(select,input:not([type=range]):not([type=checkbox])) { padding: 3px 5px; height: 25px; border-radius: 4px; }
.render-workspace .render-field input[type=checkbox] { justify-self: start; width: auto; margin: 0; }
.render-workspace .render-field input[type=range] { width: 100%; padding: 0; height: 3px; accent-color: var(--accent); }
.render-workspace .render-field input[type=number] { text-align: right; -moz-appearance: textfield; }
.render-field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.render-number > input[type=number], .render-number-display { grid-column: 3; grid-row: 1; }
.render-workspace label.render-number > input[data-render-number]:not(:focus):has(+ .render-number-display:not(:empty)) { color: transparent; }
.render-number-display { position: relative; z-index: 1; text-align: right; pointer-events: none; padding-right: 6px; font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.render-workspace label.render-number > input[data-render-number]:focus + .render-number-display { visibility: hidden; }
.render-colour { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 6px; min-width: 0; }
.render-workspace .render-colour input[type=color] { appearance: none; width: 28px; height: 25px; padding: 3px; border: 1px solid #7b8798; box-shadow: inset 0 0 0 2px #ffffff80; cursor: pointer; }
.render-colour input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.render-colour input[type=color]::-webkit-color-swatch { border: 0; border-radius: 1px; }
.render-colour input[type=text] { width: 100%; font-variant-numeric: tabular-nums; }
.render-workspace :is(input,button,select,textarea,summary):focus-visible, #renderQuickBar :focus-visible, .render-menu-content :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.render-surfaces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 8px 0; }
.render-workspace .render-surfaces label.render-field { display: flex; flex-direction: column; gap: 4px; }
.render-surfaces label span { font-size: 10px; }
#renderQuickBar { position: fixed; left: var(--shell-strip-center, 50%); bottom: var(--shell-margin); transform: translateX(-50%); max-width: var(--shell-strip-width, calc(100% - 24px)); display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; height: 48px; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--pane-bg); box-shadow: 0 6px 20px #0004; z-index: var(--z-panel); }
body:not(.render-mode) #renderQuickBar { display: none; }
#renderQuickBar > * { flex: 0 0 auto; }
#renderQuickBar select[hidden] { display: none !important; }
#renderQuickBar button, :is(#renderJobStatus, #renderCompletion) button, .render-menu-content button { min-height: 28px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); background: var(--bg-hover); padding: 4px 8px; font: inherit; font-size: 11px; cursor: pointer; }
#renderScenePresets { display: flex; align-items: center; gap: 4px; }
#renderScenePresets button { position: relative; padding: 0; width: 44px; height: 30px; overflow: hidden; border: 1px solid #8592a6; box-shadow: 0 0 0 1px var(--pane-bg), inset 0 0 0 1px #ffffff40; border-radius: 4px; background: #171e2c; }
#renderScenePresets :is(canvas,img) { width: 44px; height: 30px; display: block; object-fit: cover; }
#renderScenePresets button[aria-pressed=true] { outline: 2px solid var(--accent); outline-offset: 1px; }
#renderScenePresets button[aria-pressed=true]::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 5px; height: 5px; background: var(--accent); border: 1px solid #fff; border-radius: 50%; }
#renderScenePresets button[data-modified=true] { border-style: dashed; }
.render-segments { display: flex; flex-wrap: nowrap; gap: 2px; padding: 2px; background: var(--bg-input, var(--bg-page)); border-radius: 4px; }
.render-workspace .render-segments button { padding: 5px 7px; font-size: 11px; border: 0; white-space: nowrap; background: transparent; }
.render-segments button[aria-pressed=true], .render-menu-content button[aria-pressed=true] { color: var(--accent); background: var(--bg-selected); }

body.render-mode :is(#guideTransport,#sectionBar,#assemblyTransport) { display: none !important; }
body.render-mode:has(.render-composer-pane:not([hidden])) #renderQuickBar { display: none; }
.render-unavailable { opacity: .5; }
.render-workspace .render-scene-lights { padding: 0; border: 0; }
.render-workspace .render-light-row { display: flex; gap: 6px; align-items: center; height: 30px; margin: 0; }
.render-workspace .render-light-row button { flex: 1; padding: 4px 6px; text-align: left; min-width: 0; height: 28px; }
.render-workspace .render-light-row button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: var(--bg-selected); }
.render-workspace .render-scene-lights [data-scene-light=editor] { display: block; border: 0; padding: 0; margin: 8px 0 0; }
.render-workspace .render-animation-row { display: block; }
.render-workspace .render-animation-row > button { margin: 4px 4px 4px 0; }
.render-workspace .render-animation-row > .render-menu { display: inline-block; vertical-align: middle; }
.render-workspace .render-assigned-row, .render-saved-row { display: flex; align-items: center; gap: 6px; min-height: 30px; font-size: 12px; }
.render-assigned-row > span:nth-child(2), .render-saved-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.render-assigned-row button { padding: 2px 5px; }
.render-workspace .photo-controls, .render-workspace .render-state-controls { display: none !important; }
#renderOutputFrame::after { content: ""; position: absolute; inset: 0; border: 1px solid #8e9caf; pointer-events: none; z-index: 5; }
body.render-mode #viewportArea:has(#optionsStrip:not([hidden])) #renderQuickBar { display: none; }
#renderPresetTooltip { width: max-content; max-width: min(260px, calc(100vw - 16px)); box-sizing: border-box; overflow-wrap: anywhere; position: fixed; z-index: var(--z-popover); pointer-events: none; padding: 5px 8px; color: var(--text); background: var(--pane-bg); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; }
#renderPresetTooltip[hidden] { display: none; }
[data-scene-light=list], .render-assigned-list { max-height: 120px; overflow-y: auto; }
.render-workspace .render-content p { display: none !important; }
.render-workspace .render-lighting-gate, .render-workspace [data-studio-ground-fields] { padding: 0; border: 0; }
.render-workspace [data-scene-light=editor]:disabled { opacity: .5; }
body.render-mode #viewportArea #ocs { bottom: 12px; }
.render-actions, .render-workspace .render-recipe-actions { display: flex; align-items: center; gap: 8px; margin: 12px 0; padding-inline: var(--render-inset); flex-wrap: wrap; }
.render-actions button { min-height: 28px; padding: 4px 8px; }
.render-actions svg { display: block; }
.render-light-actions { justify-content: flex-end; margin: 4px 0; }
.render-menu { display: inline-block; }
.render-menu > button { display: flex; align-items: center; justify-content: center; height: 28px; padding: 4px 6px; }
.render-menu-content { position: fixed; inset: auto; box-sizing: border-box; width: 260px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; margin: 0; padding: 8px; color: var(--text); background: var(--pane-bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px #0006; }
.render-menu-content button { display: block; width: 100%; text-align: left; margin: 2px 0; }
.render-menu-content #renderScenePresets { display: grid; grid-template-columns: repeat(4, 44px); justify-content: space-between; gap: 8px; padding: 4px 2px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.render-menu-content #renderScenePresets button { width: 44px; }
.render-workspace button:hover:not(:disabled), #renderQuickBar button:hover:not(:disabled), :is(#renderJobStatus, #renderCompletion) button:hover:not(:disabled), .render-menu-content button:hover:not(:disabled) { background-color: var(--bg-selected); border-color: var(--accent); }
.render-workspace button:active:not(:disabled), #renderQuickBar button:active:not(:disabled), :is(#renderJobStatus, #renderCompletion) button:active:not(:disabled), .render-menu-content button:active:not(:disabled) { color: var(--accent); }
.render-menu-content button:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: no-preference) {
  .render-workspace :is(button,input,select), #renderQuickBar button, .render-menu-content button { transition: border-color 120ms, background-color 120ms, color 120ms; }
  [data-render-group]:not([hidden]) { animation: render-group-enter 140ms ease-out; }
  .render-section[open] > :not(summary) { animation: render-group-enter 140ms ease-out; }
  .render-section { interpolate-size: allow-keywords; }
  .render-section::details-content { transition: content-visibility 140ms allow-discrete, block-size 140ms ease-out; block-size: 0; overflow: clip; }
  .render-section[open]::details-content { block-size: auto; }
}
@keyframes render-group-enter { from { opacity: .6; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .render-workspace *, #renderQuickBar *, .render-menu-content * { animation: none !important; transition: none !important; } }
@media(max-width: 1279px) { body.render-mode #statusChip { width: 328px; max-width: 328px; } }

#renderQuickBar > #renderPresetMenu > button { gap: 6px; white-space: nowrap; }
.render-workspace label.render-number > input[data-render-number]:not(:focus):has(+ .render-number-display:not(:empty)) { -webkit-text-fill-color: transparent; }
.render-workspace .render-field > * { min-width: 0; box-sizing: border-box; }
.render-workspace .render-content { min-height: 0; }
.render-scene-fade { position: fixed; pointer-events: none; z-index: 2; }

.render-workspace button { border-radius: 4px; max-width: 100%; min-height: 28px; padding: 4px 8px; font-size: 11px; }
.render-workspace .render-animation-row > button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media(max-width: 767px) { body.render-mode #statusChip { width: calc(50vw - 60px); max-width: calc(50vw - 60px); } }

.render-workspace .render-animation-grid { gap: 6px; margin-top: 0; }


.render-workspace .render-field :is(input,select,textarea):hover:not(:disabled):not([readonly]) { border-color: var(--accent); }

.render-workspace canvas { max-width: 100%; box-sizing: border-box; }
.render-workspace .render-field select:is([multiple],[size]):not([size="1"]):not([size="0"]) { height: auto; min-height: 84px; max-height: 120px; }

.render-comparison { position: absolute; z-index: 2; overflow: hidden; pointer-events: none; --comparison-position: 50%; }
.render-comparison[hidden], .render-comparison-toggle[hidden] { display: none !important; }
.render-comparison > img { background: var(--bg-page); position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 calc(100% - var(--comparison-position)) 0 0); }
.render-comparison-divider { position: absolute; left: var(--comparison-position); top: 0; bottom: 0; width: 28px; transform: translateX(-50%); pointer-events: auto; cursor: ew-resize; touch-action: none; outline: none; }
.render-comparison-divider::before { content: ""; position: absolute; left: 13px; width: 2px; top: 0; bottom: 0; background: var(--text); box-shadow: 0 0 2px #0008; }
.render-comparison-handle { position: absolute; top: 50%; left: 0; width: 28px; height: 28px; transform: translateY(-50%); display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-page); color: var(--text); }
.render-comparison-divider:focus-visible .render-comparison-handle { outline: 2px solid var(--accent); outline-offset: 2px; }
.render-comparison-tag { position: absolute; top: 8px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-page); color: var(--text); font-size: 11px; }
.render-comparison-before { left: 8px; }
.render-comparison-after { right: 8px; }
.render-result:not([hidden]) ~ .render-comparison .render-comparison-tag { top: 32px; }
.render-result .render-comparison-toggle { width: 36px; padding: 7px; }
.render-result .render-comparison-toggle svg { display: block; }
.render-result .render-comparison-toggle .command-label { display: none; }

#modelDockResize { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; z-index: 1; cursor: ew-resize; touch-action: none; }
#modelDockResize:hover, #modelDockResize:focus-visible { background: var(--bg-selected); }
#bodies.collapsed #modelDockResize { display: none; }
.body-row { padding-right: var(--shell-gap); }
.body-name:has(.body-name-start) { display: flex; min-width: 0; text-overflow: clip; }
.body-name-start { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.body-name-end { display: flex; justify-content: flex-end; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.body-name-end > span { flex: 0 0 auto; }
.body-count { flex: 0 0 8ch; width: 8ch; text-align: right; font-variant-numeric: tabular-nums; }

#statusChip:has(#renderJobStatus:not([hidden])), #statusChip:has(#renderCompletion:not([hidden])) { display: block; }
#renderJobStatus, #renderCompletion { display: flex; gap: 8px; align-items: center; }
:is(#renderJobStatus, #renderCompletion) > span { min-width: 0; overflow-wrap: anywhere; }
:is(#renderJobStatus, #renderCompletion) > button { flex-shrink: 0; }
#renderJobStatus[hidden], #renderCompletion[hidden] { display: none; }
.render-image-only::before { content: ""; position: absolute; inset: 0; background: var(--bg-page); z-index: 1; pointer-events: none; }
.render-image-only .pane { opacity: 0; }
.render-orbiting #renderLivePreviewImage { visibility: hidden; }

.render-image-only #ocs { visibility: hidden; }

#statusChip:has(#renderJobStatus:not([hidden])), #statusChip:has(#renderCompletion:not([hidden])) { z-index: calc(var(--z-modal) + 1); }
#statusChip.status-in-modal { position: fixed; left: 12px; bottom: 12px; width: 368px; max-width: calc(100vw - 24px); }

.render-style-group { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
