/* One word-processor ribbon. Scroll tools, never scale authored text or the page. */
.fd-toolbar-shell{position:relative;display:flex;flex-direction:column;align-self:flex-start;flex:none;min-width:0;max-width:100%;overflow:visible;background:var(--fd-panel,#fff);color:var(--fd-ink,#322723)}
html body .fd-toolbar-shell>.fd-flex-toolbar{height:auto!important;max-height:80px!important;min-height:44px!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:none;align-self:stretch;display:flex;flex-wrap:nowrap!important;align-items:center;justify-content:flex-start;gap:5px;padding:4px 6px!important;overflow-x:auto;overflow-y:hidden;box-sizing:border-box;touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:thin}
html body .fd-flex-toolbar .toolbar-left{display:contents!important}
html body .fd-flex-toolbar :is(.viewer-text-tools,.page-design-tools,.viewer-font-control,.writer-pen-tools,.writer-align-tools){display:inline-flex;flex:0 0 auto!important;flex-wrap:nowrap!important;min-width:max-content!important;max-width:none!important;width:auto!important;gap:5px;white-space:nowrap;align-items:center}
html body .fd-flex-toolbar .viewer-text-tools{position:static!important;padding:0!important;margin:0!important;border:0!important;box-shadow:none!important;overflow:visible!important}
html body .fd-flex-toolbar>*{flex-shrink:0}
html body .fd-flex-toolbar .viewer-font-control{order:-3}
html body .fd-flex-toolbar .viewer-text-tools{order:-2}
html body .fd-flex-toolbar .viewer-text-tools>.fd-delete-object{order:99}
html body .fd-flex-toolbar .inline-geometry,html body .fd-flex-toolbar .inline-geometry[open]{flex:none!important;flex-basis:auto!important;width:auto!important}
html body .fd-flex-toolbar .inline-geometry summary{white-space:nowrap}
.fd-toolbar-curtain-row{margin-bottom:calc(0px - var(--fd-toolbar-concealed,0px))!important}
.fd-toolbar-controls{position:relative;z-index:4;display:flex;justify-content:space-between;align-items:center;flex:none;min-height:28px;width:100%;background:var(--fd-soft,#f7f2ef);color:var(--fd-ink,#322723);border-bottom:1px solid var(--fd-line,#ddd0c9);gap:2px}
html body .fd-toolbar-controls button{border:0;background:transparent;color:inherit;min-height:28px!important;min-width:28px;padding:3px 6px!important;font:12px system-ui!important;line-height:20px;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}
.fd-toolbar-reveal{cursor:ns-resize;flex:1!important;white-space:nowrap}.fd-toolbar-width{cursor:nwse-resize}.fd-toolbar-reset,.fd-toolbar-scroll{cursor:pointer}.fd-toolbar-controls button:focus-visible{outline:2px solid var(--fd-accent,#a91414);outline-offset:-3px}.fd-toolbar-controls button:hover{background:var(--fd-control,#eaded7)}
html body .fd-property-docked{display:flex;flex:none;align-items:center;gap:8px;max-width:100%;min-width:0;min-height:60px;max-height:90px;padding:5px 8px;overflow:auto;box-sizing:border-box;background:var(--fd-panel,#fff);color:var(--fd-ink,#322723);border-bottom:1px solid var(--fd-line,#ddd0c9);white-space:nowrap;touch-action:pan-x}
.fd-property-docked>*{flex:none}.fd-property-docked label{display:flex;flex-direction:column;gap:3px;font:12px system-ui}.fd-property-docked input{width:64px;min-height:32px;font:inherit}.fd-property-docked small{max-width:160px;white-space:normal}
html body main.workspace{grid-template-rows:minmax(0,1fr)}
html body .document-workspace{min-height:0}
html body .tool-rail{min-height:0;overflow-y:auto}
@media(max-width:850px){html body main.workspace{grid-template-columns:46px minmax(0,1fr);min-width:0}html body .fd-toolbar-shell .fd-font-docked{max-height:150px;max-height:min(22dvh,150px);min-height:0;overflow:auto}html body .fd-toolbar-controls,html body .fd-toolbar-controls button{min-height:40px!important}html body .fd-toolbar-controls button{min-width:36px}}
@media(max-width:650px){html body #fd-demo-banner{font-size:11px!important;padding:4px 8px!important;line-height:1.3!important}}
@media(max-height:500px){
 html[data-fd-appearance] body .app-header{flex-wrap:nowrap;min-height:44px;padding:2px 5px;overflow-x:auto;overflow-y:hidden}
 html[data-fd-appearance] body .app-header .header-actions{display:contents!important}
 html[data-fd-appearance] body .app-header .brand-name,html[data-fd-appearance] body .app-header .document-title,html[data-fd-appearance] body .workspace-nav,html[data-fd-appearance] body .statusbar{display:none}
 html[data-fd-appearance] body .app-header .brand{min-width:28px;flex:none}
 html[data-fd-appearance] body .app-header .brand-logo{width:28px;height:28px}
 html[data-fd-appearance] body .app-header .btn{min-height:40px;padding:4px 8px}
 html body #fd-demo-banner{font-size:0!important;padding:2px 8px!important;line-height:1!important}
 html body #fd-demo-banner:before{content:'Demo · ';font:11px/1.2 system-ui}
 html body #fd-demo-banner a{font:11px/1.2 system-ui}
 html[data-fd-appearance] body .document-tabs-bar{height:32px}
 html body .fd-toolbar-controls,html body .fd-toolbar-controls button{min-height:28px!important}
 html[data-fd-appearance] body .viewer-footer{height:34px;min-height:34px}
}
@media print{.fd-toolbar-controls,.fd-property-docked{display:none!important}}

html body .document-stage{min-height:0;overflow:auto;touch-action:pan-x pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html body .page-shell:is([data-active-tool=text],[data-active-tool=note]) .annotation-canvas{touch-action:pan-x pan-y}

/* Section navigation lives once in the left rail; text formatting stays above the page. */
html body .workspace-nav{display:none!important}
html body main.workspace{grid-template-columns:64px 248px 116px minmax(0,1fr)}
html body main.workspace>.tool-rail{grid-column:1;grid-row:1}
html body main.workspace>.inspector{grid-column:2;grid-row:1;border-left:0;border-right:1px solid var(--fd-line,#ddd0c9)}
html body main.workspace>.thumbnail-pane{grid-column:3;grid-row:1}
html body main.workspace>.document-workspace{grid-column:4;grid-row:1;min-width:0}
html body .inspector-close{display:none}
html body .tool-rail .screenwriter-return{overflow-wrap:anywhere;font-size:10px!important}
@media(min-width:851px) and (max-width:1200px){
 html body main.workspace{grid-template-columns:58px 220px minmax(0,1fr)}
 html body main.workspace>.thumbnail-pane{display:none}
 html body main.workspace>.document-workspace{grid-column:3}
}
@media(max-width:850px){
 html body main.workspace{grid-template-columns:46px minmax(0,1fr);position:relative}
 html body main.workspace>.thumbnail-pane{display:none}
 html body main.workspace>.document-workspace{grid-column:2}
 html body main.workspace>.inspector{display:none;position:absolute;grid-column:auto;grid-row:auto;left:46px;right:auto;top:0;bottom:0;width:min(290px,calc(100% - 46px));height:auto;max-height:none;box-sizing:border-box;border-radius:0;z-index:15;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;box-shadow:5px 0 18px #0003}
 html body main.workspace.show-inspector>.inspector{display:block}
 html body .inspector-close{display:block;position:sticky;top:-14px;margin:-4px 0 10px auto;padding:8px 12px;min-height:40px;border:1px solid var(--fd-line,#ddd0c9);border-radius:6px;background:var(--fd-panel,#fff);color:var(--fd-ink,#322723);z-index:2}
}

/* Let labels use the sidebar width instead of giving the tiny chevron half of it. */
html body .inspector .tool-card>svg{flex:0 0 18px}
html body .inspector .tool-card>span:not(.chev){flex:1 1 auto;min-width:0}
html body .inspector .tool-card>.chev{flex:0 0 auto;width:10px;text-align:right}
html body .inspector .tool-card strong{font-size:calc(13px * var(--fd-ui-scale,1))}
html body .inspector .tool-card small{font-size:calc(11px * var(--fd-ui-scale,1));line-height:1.35}

/* Compact ribbons: use content width, with no spacer groups or oversized docks. */
html body .fd-toolbar-controls{justify-content:flex-start;min-height:28px;gap:2px;padding:0 2px;box-sizing:border-box}
html body .fd-toolbar-reveal{flex:0 0 auto!important}
html body .fd-flex-toolbar :is(.viewer-font-control,.viewer-text-tools,.page-design-tools){gap:3px}
html body .fd-flex-toolbar label{margin:0;gap:3px}
html body .fd-flex-toolbar label[hidden],html body .fd-flex-toolbar [hidden]{display:none!important}
html body .fd-property-docked{min-height:44px;gap:6px;padding:4px 6px}
html body .fd-property-docked>strong{font-size:11px}
html body .writer-ribbon{flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:4px;padding:4px 6px;min-height:0;max-height:none;overflow-x:auto;overflow-y:hidden;touch-action:pan-x}
html body .writer-ribbon>div{flex:0 0 auto;gap:3px;padding-right:5px}
html body .writer-ribbon>div:empty{display:none}
html body .writer-ribbon button{min-height:36px}
