/* Folio r9: one neutral visual language for documents, spreadsheets and mini-apps. */
:root{--sheet-selection:#2383e212;--sheet-focus:#2383e2;--sheet-row:30px}
body[data-theme=dark]{--sheet-selection:#529cca20;--sheet-focus:#64a5d9}
.nav-new-label{margin-left:auto;font-size:10px;color:var(--muted);font-weight:400}
.ai-icon svg{width:16px;height:16px}.ai-stream-option{display:flex;align-items:center;gap:7px;font-size:12px;margin:12px 0;color:var(--sub)}.ai-live-text{white-space:pre-wrap;padding-bottom:12px;overflow-wrap:anywhere}.ai-live-text:empty{display:none}.ai-tool-trace{font-size:11px;color:var(--sub);margin:9px 0}.ai-tool-trace summary{cursor:pointer}.ai-tool-trace>div{padding:3px 0}.ai-compose-actions{flex-wrap:wrap}.ai-compose-actions .ux-scope-label{max-width:none;white-space:nowrap}.ai-context-name{line-height:1.7}
/* Database heading stays readable even beside a peek panel. */
.dx-heading{display:flex!important;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap!important;min-width:0}.dx-heading>div:first-child{flex:1 1 200px;min-width:160px;max-width:100%}.dx-heading>div:last-child{display:flex;align-items:center;flex:0 1 auto;gap:4px;flex-wrap:wrap}.dx-db-name{display:flex;align-items:center;gap:7px;min-width:0;max-width:100%;word-break:normal!important;overflow-wrap:normal!important;white-space:normal;text-align:left;font-size:19px!important;line-height:1.35}.dx-db-name svg{flex-shrink:0}.dx-heading .btn{flex-shrink:0;white-space:nowrap}.dx-toolbar{flex-wrap:wrap;min-width:0}.dx-toolbar .dx-search{flex:1 1 180px;min-width:120px}.dx-table-wrap{max-width:100%}.dx-database{min-width:0}.document .editor{min-width:0}.topbar .breadcrumb{flex:1 1 auto}.top-actions{gap:4px}.document:not(.wide){max-width:960px}
/* Database records are documents, not large forms. */
.quick-record-panel .modal-body,.record-center-panel .modal-body{padding:24px clamp(22px,5vw,58px) 30px}.quick-record-panel .modal-header,.record-center-panel .modal-header{padding:12px 20px;border-bottom:0}.quick-record-panel .modal-header h2,.record-center-panel .modal-header h2{font-size:13px!important;color:var(--sub);font-weight:500}.quick-record-panel .dx-row-fields,.record-center-panel .dx-row-fields{border:0;margin:12px 0 22px;padding:0}.quick-record-panel .dx-row-fields>label,.record-center-panel .dx-row-fields>label{grid-template-columns:125px minmax(0,1fr);gap:14px;align-items:start;padding:5px 0!important;min-height:38px;border:0!important}.quick-record-panel .dx-row-fields>label>span,.record-center-panel .dx-row-fields>label>span{font-size:13px;padding:7px 0;font-weight:400;color:var(--sub)}.quick-record-panel .dx-row-fields .input,.record-center-panel .dx-row-fields .input{border-color:transparent;background:transparent;box-shadow:none;padding:6px 8px;min-height:33px;border-radius:4px;font-size:14px}.quick-record-panel .dx-row-fields .input:hover,.record-center-panel .dx-row-fields .input:hover{background:var(--hover)}.quick-record-panel .dx-row-fields .input:focus,.record-center-panel .dx-row-fields .input:focus{border-color:var(--line);background:var(--bg)}.quick-record-panel .dx-row-notes,.record-center-panel .dx-row-notes{height:64px;min-height:42px;resize:vertical}.dx-row-fields>label:has([data-field-input=title]){display:block!important;margin:14px 0 25px!important}.dx-row-fields>label:has([data-field-input=title])>span{display:none!important}.dx-row-fields [data-field-input=title]{font-size:34px!important;font-weight:700!important;line-height:1.25!important;letter-spacing:-.7px;padding:5px 0!important;height:auto}.record-peek-content{border-top:1px solid var(--line);padding:24px 0;min-height:240px}.record-text{padding:4px 0;margin:0 0 6px;min-height:30px;font-size:16px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;outline:none}.record-text:focus{outline:none}.record-text[data-kind=h1]{font-size:30px;font-weight:700;line-height:1.3;margin-top:24px}.record-text[data-kind=h2]{font-size:24px;font-weight:650;line-height:1.4;margin-top:20px}.record-text[data-kind=h3]{font-size:19px;font-weight:600;margin-top:16px}.record-text[data-kind=quote]{padding-left:16px;border-left:3px solid var(--text);margin:15px 0}.record-text[data-kind=bullet],.record-text[data-kind=numbered]{display:list-item;margin-left:22px}.record-text[data-kind=code]{font:13px/1.7 ui-monospace,monospace;background:var(--sidebar);padding:15px;border-radius:5px}.record-text[data-kind=callout]{padding:16px;background:var(--sidebar);border-radius:5px}.record-new:empty:before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}#record-append{min-height:140px;border:0!important;background:transparent;padding:4px 0;box-shadow:none;resize:none}.record-peek-content>small{opacity:.8}.record-optional{border-top:1px solid var(--line);padding-top:10px}.record-peek-tools{border:0;margin-bottom:12px}.quick-record-panel .modal-actions,.record-center-panel .modal-actions{border-top:1px solid var(--line);padding-top:15px}
/* Full-page spreadsheet shell. */
.document.sheet-document{max-width:none!important;padding:28px 32px 80px!important}.sheet-document .page-head{max-width:none}.sheet-document .page-emoji{font-size:28px;width:40px;height:40px;margin:0 0 8px}.sheet-document .page-options{margin:0;height:25px}.sheet-document .page-title{font-size:32px;margin-bottom:24px}.block[data-type=sheet]{display:block;min-width:0;margin:16px 0}.fs-workbook{border:1px solid var(--line);border-radius:7px;background:var(--bg);color:var(--text);font-family:var(--font);min-width:0;overflow:hidden}.fs-toolbar{padding:8px 10px;display:flex;align-items:center;justify-content:space-between;gap:7px;flex-wrap:wrap;border-bottom:1px solid var(--line)}.fs-toolbar-group{display:flex;align-items:center;gap:3px;flex-wrap:wrap}.fs-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:29px;padding:4px 8px;border-radius:4px;font-size:12px;line-height:1.4;color:var(--sub);white-space:nowrap}.fs-button:hover{background:var(--hover);color:var(--text)}.fs-button .icon{height:15px;width:15px}.fs-button.primary{background:var(--blue);color:white}.fs-button.danger{color:#c15448}.fs-toolbar select{font-size:12px;max-width:135px;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:4px;padding:5px}.fs-divider{height:20px;width:1px;background:var(--line);margin:0 4px}.fs-color{display:flex;align-items:center;gap:2px;padding:4px;cursor:pointer}.fs-color input{width:22px;height:22px;padding:1px;border:0;background:transparent;cursor:pointer}.fs-color .icon{width:14px;height:14px}.fs-formula{height:37px;display:flex;align-items:center;gap:9px;border-bottom:1px solid var(--line);font:13px ui-monospace,SFMono-Regular,Consolas,monospace}.fs-formula>span{color:var(--muted);font-style:italic;user-select:none}.fs-formula input{background:transparent;color:var(--text);border:0;height:35px;min-width:0;font:inherit;padding:5px 10px}.fs-formula .fs-namebox{width:108px;border-right:1px solid var(--line);text-align:center;flex-shrink:0}.fs-formula [data-fs-formula]{flex:1}.fs-formula input:focus{outline:1px solid var(--sheet-focus);outline-offset:-1px}.fs-link-banner{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:7px 12px;background:var(--sidebar);font-size:12px;color:var(--sub);border-bottom:1px solid var(--line)}.fs-link-banner .icon{width:14px;height:14px}.fs-link-banner .fs-button:first-of-type{margin-left:auto}.fs-viewbar{display:flex;align-items:center;gap:3px;flex-wrap:wrap;padding:5px 10px;border-bottom:1px solid var(--line)}.fs-viewbar>input{width:150px;min-width:80px;padding:5px 7px;background:transparent;color:var(--text);font-size:12px;border:1px solid transparent;border-radius:4px}.fs-viewbar>input:focus{border-color:var(--line)}.fs-viewhint{margin-left:auto;font-size:10px;color:var(--muted)}.fs-scroll{height:min(56vh,540px);min-height:300px;overflow:auto;position:relative;overscroll-behavior:contain;scrollbar-width:thin}.sheet-document .fs-scroll{height:calc(100dvh - 390px);min-height:340px}.fs-scroll:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--line)}.fs-grid{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:100%;font-size:13px;line-height:1.4;font-variant-numeric:tabular-nums;user-select:none}.fs-grid tr{height:30px}.fs-grid th{font-size:11px;font-weight:400;text-align:center;background:var(--sidebar);color:var(--sub);border-bottom:1px solid var(--line);border-right:1px solid var(--line);height:30px;position:relative}.fs-grid thead th{position:sticky;top:0;z-index:6}.fs-grid .fs-corner{left:0;z-index:8}.fs-grid .fs-row-number{position:sticky;left:0;z-index:4;width:44px;min-width:44px;padding:0 8px}.fs-grid td.fs-cell{height:30px;max-height:30px;padding:5px 8px;border-bottom:1px solid var(--line);border-right:1px solid var(--line);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;vertical-align:middle;cursor:cell;background:var(--bg)}.fs-cell>span{display:block;max-height:20px;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.fs-grid .fs-number{text-align:right}.fs-grid td.fs-selected{background:var(--sheet-selection)}.fs-grid td.fs-active{outline:2px solid var(--sheet-focus);outline-offset:-2px;z-index:2;background:var(--bg)}.fs-grid td.fs-error{color:#b94e43}.fs-grid .fs-frozen td{position:sticky;top:var(--freeze-top);z-index:3;background:var(--bg);border-bottom-color:var(--muted)}.fs-grid .fs-frozen .fs-row-number{top:var(--freeze-top);z-index:7}.fs-cell-editor{position:absolute;inset:0;width:100%;height:100%;border:0;box-shadow:inset 0 0 0 2px var(--sheet-focus);border-radius:0;background:var(--bg);color:var(--text);padding:5px 8px;font:inherit;z-index:9}.fs-cell-editor:focus{outline:none}.fs-resizer{position:absolute;right:-3px;top:0;bottom:0;width:7px;cursor:col-resize;z-index:9;touch-action:none}.fs-resizer:hover{background:var(--sheet-focus);opacity:.5}.fs-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;border-top:1px solid var(--line);padding:3px 9px;background:var(--sidebar);min-height:39px}.fs-tabs{display:flex;align-items:center;gap:3px;overflow-x:auto;min-width:0}.fs-tabs .fs-button{border-radius:3px 3px 0 0;min-height:32px;border-bottom:2px solid transparent}.fs-tabs .fs-button.active{color:var(--text);background:var(--bg);border-bottom-color:var(--blue)}.fs-selection-stats{font-size:10px;white-space:nowrap;color:var(--sub)}.fs-charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:16px;padding:20px;background:var(--sidebar);border-top:1px solid var(--line)}.fs-chart{padding:15px;background:var(--bg);border:1px solid var(--line);border-radius:6px;min-width:0}.fs-chart header{display:flex;align-items:center;justify-content:space-between;gap:10px}.fs-chart h3{font-size:14px;font-weight:600;margin:0}.fs-chart svg{width:100%;height:auto}.fs-chart-legend{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;font-size:10px;color:var(--sub)}.fs-chart-legend span:before{content:"";display:inline-block;width:8px;height:8px;border-radius:2px;background:var(--series);margin-right:5px}.fs-chart details{font-size:11px;margin-top:15px;color:var(--sub)}.fs-chart summary{cursor:pointer}.fs-chart table{border-collapse:collapse;margin-top:10px;width:100%;font-size:11px}.fs-chart td,.fs-chart th{padding:5px;text-align:left;border-bottom:1px solid var(--line)}
/* Dialogs use existing Folio surfaces and spacing. */
.fs-dialog{width:min(680px,calc(100vw - 30px));max-width:680px}.fs-dialog label,.embed-editor label{display:block;font-size:12px;color:var(--sub);margin:12px 0}.fs-dialog label .input,.embed-editor label .input{display:block;width:100%;margin-top:5px}.fs-dialog p,.embed-editor p{font-size:12px;color:var(--sub);line-height:1.7}.fs-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px}.fs-dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}.fs-dialog-actions .fs-button{border:1px solid var(--line);padding:7px 11px}.fs-dialog details{margin:16px 0;border-top:1px solid var(--line);padding-top:12px;font-size:12px}.fs-dialog summary{cursor:pointer}.fs-formula-list{font:12px/1.9 ui-monospace,monospace;overflow-wrap:anywhere}.fs-note{font-size:11px!important;color:var(--muted)!important}.fs-source-choice{display:flex;width:100%;justify-content:flex-start;flex-wrap:wrap;white-space:normal;border:1px solid var(--line);padding:12px;margin:8px 0;text-align:left}.fs-source-choice small{flex-basis:100%;padding-left:21px;color:var(--muted)}.fs-upload{border:1px dashed var(--line);padding:18px;border-radius:6px;margin-top:25px!important}.fs-upload input{display:block;margin-top:10px;width:100%;font-size:12px}.fs-code-editor,.embed-code{width:100%;padding:14px;border:1px solid var(--line);border-radius:6px;background:var(--sidebar);color:var(--text);font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2;resize:vertical;min-height:200px;white-space:pre}.fs-dialog-error,.embed-error{font-size:12px;color:#b94e43}#fs-code-result{font-size:12px;line-height:1.7}#fs-code-result pre{max-height:220px;overflow:auto;font-size:11px;background:var(--sidebar);padding:10px}.embed-dialog{width:min(820px,calc(100vw - 30px));max-width:820px}
/* Interactive embeds are distinct from ordinary sanitized document blocks. */
.block[data-type=html_embed]{margin:20px 0}.folio-embed{border:1px solid var(--line);border-radius:7px;overflow:hidden;background:var(--bg)}.folio-embed>header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:9px 12px;border-bottom:1px solid var(--line)}.folio-embed>header>span{display:flex;align-items:center;gap:7px;min-width:0}.folio-embed>header b{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis}.folio-embed>header small{font-size:10px;color:var(--muted);white-space:nowrap}.folio-embed>header .btn{font-size:11px}.folio-embed>header .icon{width:16px;height:16px;color:var(--sub)}.folio-embed iframe{width:100%;border:0;display:block;background:var(--bg)}.embed-paused{padding:35px 25px;text-align:center;color:var(--sub)}.embed-paused>div .icon{width:28px;height:28px;color:var(--muted)}.embed-paused h3{font-size:16px;font-weight:500;margin:12px 0 7px;color:var(--text)}.embed-paused p{font-size:12px;max-width:390px;line-height:1.7;margin:0 auto 18px}.embed-paused .btn{font-size:12px}
@media(max-width:1100px){.document.sheet-document{padding-left:24px!important;padding-right:24px!important}.fs-toolbar-group{gap:1px}.fs-selection-stats{max-width:180px;overflow:hidden;text-overflow:ellipsis}.fs-footer{gap:8px}.record-peek-open .document{padding-left:32px;padding-right:25px}.record-peek-open .top-actions .save-status,.record-peek-open .top-actions .share-btn{display:none}}
@media(max-width:760px){.document.sheet-document{padding:20px 16px 60px!important}.fs-toolbar{padding:6px;gap:3px}.fs-toolbar-group{flex-wrap:wrap}.fs-button{min-height:34px}.fs-viewhint{display:none}.fs-scroll,.sheet-document .fs-scroll{height:50dvh;min-height:280px}.fs-formula .fs-namebox{width:88px}.fs-selection-stats{display:none}.fs-viewbar>input{width:100%;flex:1 1 100%}.fs-charts{padding:10px;gap:10px}.fs-grid{font-size:14px}.fs-form-grid{grid-template-columns:1fr}.folio-embed>header small{display:none}.record-center-panel .dx-row-fields>label,.quick-record-panel .dx-row-fields>label{grid-template-columns:100px minmax(0,1fr)}.record-peek-open .document{padding-left:24px;padding-right:24px}.fs-toolbar select{min-height:34px}.fs-tabs .fs-button{min-height:38px}}
@media(prefers-reduced-motion:reduce){.fs-workbook *,.folio-embed *{scroll-behavior:auto!important;transition:none!important}}
@media print{.fs-toolbar,.fs-formula,.fs-viewbar,.fs-link-banner,.fs-footer,.fs-button,.folio-embed>header{display:none!important}.fs-scroll{height:auto!important;overflow:visible!important}.fs-charts{display:block}.fs-chart{break-inside:avoid;margin:15px 0}.folio-embed iframe{display:none}.embed-paused{padding:10px}}

.fs-wrap-mode .fs-grid tbody tr{height:60px}.fs-wrap-mode .fs-grid td.fs-cell{height:60px;max-height:60px}.fs-wrap-mode .fs-cell>span{max-height:50px}.fs-wrap-mode .fs-grid thead tr{height:30px}

.ux-code-preview{white-space:pre-wrap;max-height:280px;overflow:auto;font:12px/1.6 ui-monospace,monospace;padding:12px;background:var(--sidebar);border:1px solid var(--line);border-radius:5px}.ai-spark .icon{width:17px;height:17px}.fs-tabs [role=tab]:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}

.fs-toolbar .fs-button[aria-pressed=true]{background:var(--active);color:var(--text)}
