/* Scroll ownership belongs to the transcript and the selected preview, not the shell. */
html:has(#app-view.chat-active:not([hidden])),body:has(#app-view.chat-active:not([hidden])){height:100%;overflow:hidden}
.chat-active .main-content{min-height:0;max-height:100%;overscroll-behavior:contain}
.chat-active .chat-view{min-height:0;max-height:100%}
.chat-active #messages{min-height:0;overflow:auto;overscroll-behavior:contain}
.artifact-panel:has(>#artifact-tabs:empty){grid-template-rows:40px minmax(0,1fr)}
.artifact-panel>#artifact-tabs:empty{display:none}
.artifact-panel:has(>#artifact-tabs:empty)>#artifact-body{grid-row:2}
@media(min-width:1001px){
 #app-view.chat-active:not([hidden]){position:fixed;inset:0;height:100dvh;min-height:0;max-height:100dvh;overflow:hidden}
 body.artifact-open .chat-active .main-content{min-height:0;max-height:100%}
}
/* Workbook chrome stays still; only its grid and sheet strip scroll. */
.office-preview.workbook-preview{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;min-width:0;padding:0;overflow:hidden;background:#fff}
.unified-file-content:has(>.workbook-preview),.file-viewer-content:has(>.workbook-preview){overflow:hidden}
.workbook-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid #deded7;background:#fafaf7;min-width:0}
.workbook-toolbar strong{font-size:13px;font-weight:600;color:#292c28;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workbook-info{flex:none;color:#62675e;font-size:11px;font-variant-numeric:tabular-nums}
.worksheet-preview{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;background:#fff;font:12px/1.6 var(--font-ui,system-ui)}
.worksheet-preview table{min-width:100%;border-collapse:separate;border-spacing:0}
.worksheet-preview td,.worksheet-preview th{min-width:96px;padding:9px 12px;border:0;border-right:1px solid #e6e8e2;border-bottom:1px solid #e6e8e2;font-variant-numeric:tabular-nums;white-space:nowrap;color:#31382e}
.worksheet-preview tr:first-child td,.worksheet-preview tr:first-child th{position:sticky;top:0;background:#f1f4ee;font-weight:600;color:#29412e;z-index:1}
.worksheet-preview tr:nth-child(even):not(:first-child){background:#fbfcf9}
.worksheet-tabs{display:flex;align-items:center;gap:6px;padding:8px 12px;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;border-top:1px solid #dce1d7;background:#f3f5ef}
.worksheet-tab{flex:none;max-width:240px;min-height:36px;padding:7px 14px;border:1px solid transparent;border-radius:7px;background:transparent;color:#505b4b;font:500 12px/1.4 var(--font-ui,system-ui);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;touch-action:manipulation}
.worksheet-tab:hover{background:#e7ecdf;color:#263d29}
.worksheet-tab[aria-selected=true]{background:#fff;border-color:#c6d2bc;box-shadow:0 1px 2px #25331c0c,inset 0 -2px #497543;color:#234d28;font-weight:600}
.worksheet-tab:focus-visible,.worksheet-preview:focus-visible{outline:2px solid #59794e;outline-offset:-3px}
@media(max-width:600px){.workbook-toolbar{align-items:flex-start;flex-direction:column;gap:4px;padding:10px 12px}.worksheet-tab{min-height:44px;max-width:180px}.worksheet-tabs{padding:6px 8px}.workbook-toolbar strong{max-width:100%}}
