/* Shared controls inside the worksheet/editor task pane. */
#source-controls{display:flex;flex-direction:column;align-items:center;gap:12px}
#toggle-preview{display:none}
.camera-stage{aspect-ratio:var(--camera-aspect,16/9);flex:none;min-height:0}
.camera-stage video{object-fit:contain}
.camera-stage>#overlay{object-fit:fill}
#theme-surface{position:fixed;inset:0;z-index:0;overflow:hidden;background:var(--surface)}
.sheet-chrome,.ide-menu,.sheet-tabs,.ide-status{display:none}
.bench-status{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;height:29px;background:var(--bar);border-top:1px solid var(--line);font-size:11px;color:var(--muted);padding:0 15px}
.bench-right{margin-left:auto}
body:not([data-theme=default]) .app-shell{position:relative;width:100%;margin:0;pointer-events:none}
body:not([data-theme=default]) .app-header,body:not([data-theme=default]) .workspace{pointer-events:auto}
body:not([data-theme=default]) .app-header{position:fixed;inset:0 0 auto;height:42px;border:0;margin:0;padding:0 18px;z-index:5}
body:not([data-theme=default]) .brand{font-size:13px;font-weight:400;letter-spacing:0}
body:not([data-theme=default]) .theme-picker{font-family:'Segoe UI','Malgun Gothic',sans-serif;font-size:11px;gap:8px}
body:not([data-theme=default]) .theme-picker select{height:26px;min-height:26px;padding:2px 5px;width:116px;font-size:11px}
body:not([data-theme=default]) .workspace{position:absolute;right:0;width:274px;display:flex;flex-direction:column;border-radius:0;border:0;border-left:1px solid var(--line);border-bottom:1px solid var(--line);overflow:visible;background:var(--surface)}
body:not([data-theme=default]) .camera-panel{flex:none;width:100%}
body:not([data-theme=default]) .panel-top{height:34px;padding:0 12px;border-top:0;font-size:11px}
body:not([data-theme=default]) #source-label{max-width:120px}
body:not([data-theme=default]) #toggle-preview{display:grid}
body:not([data-theme=default]):not(.preview-open) .camera-stage{display:none}
body:not([data-theme=default]) .camera-stage{flex:none;min-height:0;height:152px;aspect-ratio:16/9}
body:not([data-theme=default]) .camera-status{height:27px;padding:0 12px;font-size:10px}
body:not([data-theme=default]) .camera-actions{display:grid;grid-template-columns:1fr 1fr;padding:9px 12px;gap:7px}
body:not([data-theme=default]) #source-controls{grid-column:1/-1;flex-direction:row;justify-content:flex-start;gap:7px}
body:not([data-theme=default]) .button{font-size:11px;min-height:28px;padding:5px 9px}
body:not([data-theme=default]) .text-button{font-size:11px;color:var(--muted)}
body:not([data-theme=default]) .settings-panel{border-left:0;border-top:1px solid var(--line);padding:14px 12px;gap:6px}
body:not([data-theme=default]) .settings-panel>label,body:not([data-theme=default]) .label-line,body:not([data-theme=default]) .action-row,body:not([data-theme=default]) .cooldown-field{font-size:11px}
body:not([data-theme=default]) .settings-panel>label:not(:first-child),body:not([data-theme=default]) .label-line{margin-top:4px}
body:not([data-theme=default]) .settings-panel select{font-size:11px;min-height:28px;padding:3px 7px}
body:not([data-theme=default]) .action-row{min-height:28px}
body:not([data-theme=default]) .action-settings{margin-top:6px;padding-top:5px}
body:not([data-theme=default]) .cooldown-field{margin-top:4px}
/* Spreadsheet: ribbon, formula bar, row/column headers, editable cells. */
body[data-theme=sheet]{font-family:Aptos,Calibri,'Segoe UI','Malgun Gothic',sans-serif;--line:#d5d9d6;--bar:#f4f5f4;background:#fff}
body[data-theme=sheet] .brand span{color:white}
body[data-theme=sheet] .sheet-chrome{display:block;position:absolute;top:42px;left:0;right:0;height:120px;background:#fafafa;border-bottom:1px solid #c6cbc7}
.sheet-menu{height:32px;display:flex;align-items:center;gap:26px;padding:0 20px;border-bottom:1px solid #e3e5e3;font-size:12px;color:#333;white-space:nowrap}
.sheet-menu span.active{height:32px;border-bottom:3px solid #217346;color:#217346;padding-top:7px;font-weight:600}
.sheet-ribbon{display:flex;align-items:stretch;height:88px;padding:8px 15px 5px;gap:15px;color:#303633;font-size:11px;overflow:hidden;white-space:nowrap}
.ribbon-group{position:relative;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:7px;padding:0 18px 16px 3px;border-right:1px solid #dfe2df;flex-shrink:0}
.ribbon-group small{position:absolute;bottom:0;color:#737873;font-size:10px}.paste-icon{font-size:25px;color:#578869;line-height:1}.ribbon-format{display:flex;gap:15px;align-items:center;font-size:14px}.ribbon-input{background:white;border:1px solid #c9cdca;min-width:130px;padding:3px 7px;display:flex;justify-content:space-between;gap:20px}.ribbon-format b,.ribbon-format i,.ribbon-format u{font-family:Calibri,'Malgun Gothic',sans-serif}
body[data-theme=sheet] #theme-document{position:absolute;top:162px;left:0;right:0;bottom:29px;overflow:auto;background:white}
body[data-theme=sheet] #theme-document .sheet-formula{height:29px;padding:6px 14px;gap:20px;font-family:Calibri,'Malgun Gothic',sans-serif;font-size:12px;position:sticky;top:0;z-index:1}
body[data-theme=sheet] #theme-document .spreadsheet{min-width:1500px;font-family:Calibri,'Malgun Gothic',sans-serif;font-size:12px}
body[data-theme=sheet] #theme-document .spreadsheet td,body[data-theme=sheet] #theme-document .spreadsheet th{height:27px;border-color:#dce0dd;padding:4px 9px}
body[data-theme=sheet] #theme-document .spreadsheet td.sheet-title{height:58px;font-family:Calibri,'Malgun Gothic',sans-serif;font-size:22px}
body[data-theme=sheet] #theme-document .spreadsheet td.sheet-subtitle{height:32px}
body[data-theme=sheet] #theme-document .spreadsheet td[contenteditable]:focus{outline:2px solid #217346;outline-offset:-2px}
body[data-theme=sheet] .workspace{top:191px;max-height:calc(100dvh - 220px);overflow-y:auto;--input:#fff;box-shadow:-2px 0 5px #00000005}
body[data-theme=sheet] .settings-panel{background-image:linear-gradient(transparent calc(100% - 1px),#e6eae7 0);background-size:100% 28px}
body[data-theme=sheet] .settings-panel select,body[data-theme=sheet] .direction-options button{border-radius:0}
body[data-theme=sheet] .sheet-tabs{display:flex;align-items:center;height:100%;gap:0;margin-left:20px}
.sheet-tabs span{height:100%;padding:6px 20px;border-right:1px solid #d5ded7}.sheet-tabs .active{background:white;color:#217346;border-bottom:2px solid #217346;font-weight:600}
/* Editor: explorer, file tab, syntax colours, line numbers, status bar. */
body[data-theme^=ide]{font-family:'Segoe UI','Malgun Gothic',sans-serif;--code-bg:var(--surface);--code-bar:var(--bar);--code-text:var(--text);--code-line:var(--line)}
body[data-theme^=ide] .app-header{padding:0 16px;border-bottom:1px solid var(--line);background:var(--bar)}
body[data-theme^=ide] .brand{font-family:'Segoe UI',sans-serif;font-size:12px}
body[data-theme^=ide] .brand span{color:var(--text)}
body[data-theme^=ide] .ide-menu{position:absolute;top:42px;left:0;right:0;height:30px;display:flex;align-items:center;padding:0 16px;gap:22px;background:var(--bar);border-bottom:1px solid var(--line);font:11px 'Segoe UI','Malgun Gothic',sans-serif;color:var(--text)}
body[data-theme^=ide] #theme-document{position:absolute;top:72px;left:44px;right:0;bottom:29px;background:var(--surface);overflow:hidden}
body[data-theme^=ide] #theme-document::before{content:'▣\A⌕\A⑂\A▷\A⊞';white-space:pre;position:fixed;top:72px;left:0;width:44px;bottom:29px;padding-top:14px;text-align:center;line-height:58px;font-size:24px;color:var(--muted);background:var(--bar);border-right:1px solid var(--line)}
body[data-theme^=ide] #theme-document .ide-workspace{height:100%;min-height:0;grid-template-columns:180px minmax(0,1fr)}
body[data-theme^=ide] #theme-document .ide-files{font-family:'Segoe UI','Malgun Gothic',sans-serif;font-size:12px;padding:16px 14px;line-height:2.25}
body[data-theme^=ide] #theme-document .ide-files strong{font-size:10px;font-weight:400;margin-bottom:12px;letter-spacing:.5px}
body[data-theme^=ide] #theme-document .ide-editor{font-family:Consolas,'Cascadia Code',monospace;overflow:auto;padding-bottom:100px;background:var(--surface)}
body[data-theme^=ide] #theme-document .ide-tab{height:36px;padding:9px 18px;font-size:12px;background:var(--bar);border-top:1px solid var(--accent);position:sticky;top:0;z-index:1}
body[data-theme^=ide] #theme-document .code-lines{font-family:Consolas,'Cascadia Code',monospace;font-size:14px;line-height:1.75;padding:24px 15px;min-width:800px}
body[data-theme^=ide] .workspace{top:108px;max-height:calc(100dvh - 137px);overflow-y:auto;border-top:1px solid var(--line);font-family:'Segoe UI','Malgun Gothic',sans-serif}
body[data-theme^=ide] .settings-panel{background:var(--bar)}
body[data-theme^=ide] .bench-status{background:#007acc;color:#fff;border-color:#007acc;height:29px}
body[data-theme^=ide] .ide-status{display:block}.ide-status+.bench-right{font-family:Consolas,monospace}
body[data-theme=ide-light] #theme-document .token-key{color:#0000ff}body[data-theme=ide-light] #theme-document .token-string{color:#a31515}body[data-theme=ide-light] #theme-document .token-comment{color:#008000}body[data-theme=ide-light] #theme-document .token-number{color:#098658}
.work-screen[data-style=sheet]{font-family:Aptos,Calibri,'Malgun Gothic',sans-serif}.work-screen[data-style=sheet] .work-header{background:#217346;color:white;border:0}.work-screen[data-style=sheet] .work-header p{color:#e6f2e9}.work-screen[data-style=sheet] .work-file-icon{background:#ffffff20}.work-screen[data-style=sheet] .work-header h2{font-size:16px}.work-screen[data-style=sheet] .spreadsheet{font-family:Calibri,'Malgun Gothic',sans-serif}
@media(max-width:760px){body[data-theme^=ide] #theme-document .ide-files{display:block}}
body:not([data-theme=default]) .camera-stage,body.preview-open:not([data-theme=default]) .camera-stage{height:auto;aspect-ratio:var(--camera-aspect,16/9)}
@media(max-width:760px){body:not([data-theme=default]) .workspace{width:238px}body:not([data-theme=default]) .settings-panel{padding:10px}body[data-theme^=ide] #theme-document{left:32px}body[data-theme^=ide] #theme-document::before{width:32px;font-size:20px}body[data-theme^=ide] #theme-document .ide-workspace{grid-template-columns:110px minmax(0,1fr)}body[data-theme^=ide] #theme-document .ide-files{padding:12px 8px;font-size:10px}body[data-theme^=ide] #theme-document .code-lines{padding-left:0;font-size:12px}.sheet-menu{gap:18px;padding:0 12px}.sheet-ribbon{gap:8px}.ribbon-group{padding-right:10px}.font-group{display:none}.sheet-tabs span{padding:6px 10px}body[data-theme=sheet] .theme-picker{gap:4px}body:not([data-theme=default]) .theme-picker select{width:105px}body:not([data-theme=default]) .app-header{padding:0 10px}body:not([data-theme=default]) .brand{font-size:11px}body[data-theme=sheet] .workspace{top:191px;max-height:calc(100dvh - 230px);overflow-y:auto}body[data-theme^=ide] .workspace{max-height:calc(100dvh - 138px);overflow-y:auto}body.preview-open:not([data-theme=default]) .camera-stage{height:132px}.bench-right{padding-left:5px}.ide-status{font-size:10px}}
