.book-studio-workspace{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start}.book-studio-canvas{min-width:0}.book-studio-tools{position:sticky;top:76px;max-height:calc(100dvh - 90px);overflow:auto;padding:14px;background:#142236;border-radius:12px}.book-studio-tools label{display:block;margin:12px 0}.book-studio-tools button{width:100%;margin:6px 0;min-height:44px}.book-studio-tools textarea,.book-studio-tools input:not([type=checkbox]),.book-studio-tools select{width:100%;box-sizing:border-box}.book-studio-tools details{margin:12px 0}.book-studio-tools summary{font-weight:700;cursor:pointer}.book-template-preview{width:min(100%,550px);height:auto;display:block;margin:20px auto;box-shadow:0 8px 35px #0005}.book-pages-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:18px}.book-pages-grid article{padding:10px;border:1px solid #52627a;border-radius:12px}.book-page-thumb{display:flex;flex-direction:column;width:100%;gap:7px;background:transparent;text-align:center}.book-page-thumb canvas{width:100%;aspect-ratio:148/210;display:block;background:#fffdf8}.book-page-sort{min-height:44px;width:100%;margin-top:8px;cursor:grab}.book-pages-grid .sorting{opacity:.5}.book-pages-grid .drop-target{outline:3px solid #eac064}.book-studio-progress{font-weight:700;color:#eac064}.book-studio-left{display:flex;flex-direction:column;gap:8px;padding:10px;overflow:auto;background:#101b29}.book-studio-left button{text-align:left;min-height:44px}.book-pair{display:flex;gap:8px;align-items:start}.book-pair canvas{width:calc(50% - 4px);height:auto}#bookPairPreview{width:min(1100px,94vw);max-height:92dvh;overflow:auto;background:#142236;color:#fff}#bookMenuGroup[data-book-studio]>button{display:block;width:100%;margin-block:6px}#bookMenuGroup[data-book-studio] details button{width:100%;min-height:44px}
body #bookDtpDialog#bookDtpDialog .book-dtp-workspace{grid-template-columns:210px minmax(0,1fr) 290px!important}body #bookDtpDialog#bookDtpDialog .book-dtp-tools{position:relative!important;inset:auto!important;grid-column:3!important;grid-row:1!important;height:100%!important;width:100%!important;max-height:none!important;overflow:auto!important;transform:none!important}body #bookDtpDialog#bookDtpDialog .book-dtp-canvas-wrap{grid-column:2!important;grid-row:1!important}body #bookDtpDialog#bookDtpDialog #bookDtpNavigation{grid-column:1;grid-row:1}.book-studio-chapters .book-workbench-panes{display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;align-items:start!important}.book-studio-chapters #bookChapterEditor{grid-column:1!important;grid-row:1!important}.book-studio-chapters #bookWorkbenchTools{grid-column:2!important;grid-row:1!important;display:block!important;position:sticky!important;top:70px!important;max-height:calc(100dvh - 85px)!important;overflow:auto!important}.book-studio-chapters #bookChapterOverview{grid-column:1!important}.book-studio-chapters [data-studio-chapter]{display:block;padding:12px;font-weight:700}.book-studio-chapters [data-studio-chapter] select{width:100%;margin-top:8px;min-height:44px}.book-studio-chapters .book-workbench-nav{display:block!important}.book-studio-chapters #bookWorkbenchFocus{display:none}.book-dtp-page .book-creative-frame{z-index:0!important}.book-dtp-page .book-dtp-text{z-index:2!important;position:absolute}.book-element-additions{border:1px solid #52627a;border-radius:10px;padding:10px;margin-top:14px}.book-element-additions label{display:block;margin:10px 0}.book-element-additions button{margin:4px;min-height:40px}.book-dtp-free:has([data-locked-indicator]){outline-style:dashed}
#bookPlan[data-studio-planning-step=idea] #writerIdeaFlow,#bookPlan[data-studio-planning-step=plan] #writerBlueprintFlow,#bookPlan[data-studio-planning-step=manuscript] #writerManuscriptFlow{display:block!important}#bookPlan[data-studio-planning-step=idea] #writerBlueprintFlow,#bookPlan[data-studio-planning-step=idea] #writerManuscriptFlow,#bookPlan[data-studio-planning-step=idea] #writerSerialFlow,#bookPlan[data-studio-planning-step=plan] #writerIdeaFlow,#bookPlan[data-studio-planning-step=plan] #writerManuscriptFlow,#bookPlan[data-studio-planning-step=plan] #writerSerialFlow,#bookPlan[data-studio-planning-step=manuscript] #writerIdeaFlow,#bookPlan[data-studio-planning-step=manuscript] #writerBlueprintFlow,#bookPlan[data-studio-planning-step=manuscript] #writerSerialFlow{display:none!important}
@media(max-width:799px),(max-width:1099px) and (orientation:portrait){.book-studio-workspace{grid-template-columns:1fr}.book-studio-tools{display:none;position:fixed;bottom:0;left:0;right:0;top:auto;max-height:65dvh;z-index:120;border-radius:16px 16px 0 0;box-shadow:0 -8px 35px #0008}.tools-open .book-studio-tools{display:block}.book-studio-chapters .book-workbench-panes{grid-template-columns:1fr!important}.book-studio-chapters #bookWorkbenchTools{grid-column:1!important;grid-row:2!important;position:relative!important;top:auto!important;max-height:none!important}body #bookDtpDialog#bookDtpDialog .book-dtp-workspace{grid-template-columns:minmax(0,1fr)!important}body #bookDtpDialog#bookDtpDialog #bookDtpNavigation{display:none}body #bookDtpDialog#bookDtpDialog .book-dtp-canvas-wrap{grid-column:1!important}body #bookDtpDialog#bookDtpDialog .book-dtp-tools{position:absolute!important;grid-column:auto!important;grid-row:auto!important;left:0!important;right:0!important;bottom:48px!important;width:100%!important;max-height:65dvh!important;height:auto!important;display:none!important;z-index:60}.sheet-open.book-dtp-dialog .book-dtp-tools{display:block!important}body #bookDtpDialog#bookDtpDialog.sheet-open .book-dtp-tools{display:block!important}}
@media(min-width:800px) and (orientation:landscape){.book-studio-workspace{grid-template-columns:minmax(0,1fr) clamp(230px,26vw,300px)}body{--rac-nav-width:200px}body #bookDtpDialog#bookDtpDialog .book-dtp-workspace{grid-template-columns:180px minmax(0,1fr) clamp(230px,27vw,300px)!important}.book-studio-chapters .book-workbench-panes{grid-template-columns:minmax(0,1fr) clamp(230px,27vw,300px)!important}}

#bookMenuGroup[data-book-studio] ~ .book-simple-progress{display:none}body:has(#bookMenuGroup[data-book-studio]) .book-simple-progress{display:none}.book-dtp-running-head,.book-dtp-ornament{color:var(--book-chapter-color,#8b6a3d)}

.book-chapter-tools-toggle{display:none}@media(max-width:799px),(max-width:1099px) and (orientation:portrait){.book-chapter-tools-toggle{display:block}.book-studio-chapters #bookWorkbenchTools{display:none!important}.book-studio-chapters.chapter-tools-open #bookWorkbenchTools{display:block!important;position:fixed!important;left:0;right:0;bottom:0;top:auto!important;z-index:120;max-height:65dvh!important;overflow:auto!important;background:var(--panel,#152238);padding:16px}}
body:has(#bookMenuGroup[data-book-studio]) .bottom-nav[data-workspace="book"]{display:none!important}
@media(max-width:799px),(max-width:1099px) and (orientation:portrait){body #bookDtpDialog#bookDtpDialog .book-dtp-head .book-dtp-mode-buttons,body #bookDtpDialog#bookDtpDialog #bookDtpReflow,body #bookDtpDialog#bookDtpDialog #bookDtpCreativeFrame{display:none!important}body #bookDtpDialog#bookDtpDialog{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;inset:0!important;border-radius:0!important}}

/* v345: shared portrait sheets; working landscape Comic layout remains intact. */
body:not(.rac-side-tools).studio-layout-active .studio-dock:not(.calm-collapsed){display:flex!important;flex-direction:column!important;height:var(--rac-tool-height,56dvh)!important;max-height:var(--rac-tool-height,56dvh)!important;min-height:0!important;overflow:hidden!important}
body:not(.rac-side-tools).studio-layout-active .studio-dock-content{flex:1 1 0!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y!important;padding-bottom:18px!important;-webkit-overflow-scrolling:touch}
body:not(.rac-side-tools).studio-layout-active .studio-dock>.studio-dock-head,body:not(.rac-side-tools).studio-layout-active .studio-dock>.studio-dock-actions{flex:0 0 auto!important}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-tool-tabs[hidden]{display:none!important}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-tools{overflow:hidden!important;display:flex!important;flex-direction:column!important}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-tool-scroll{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;padding:4px}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog #bookDtpTools{overflow:visible!important;max-height:none!important;min-height:0!important;height:auto!important;padding:8px 2px}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-save{flex:0 0 auto!important;position:static!important;padding:8px 2px;border-top:1px solid #36485c}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-sheet-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 2px}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-editor-actions{display:grid!important;grid-template-columns:1fr!important;padding:8px 0}
body #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog #bookDtpHeadTools{display:none!important}
body.rac-side-tools #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-sheet-head{display:none!important}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-tools{display:none!important;position:fixed!important;inset:auto 8px 68px 8px!important;width:auto!important;max-width:none!important;height:min(var(--rac-tool-height,56dvh),600px)!important;max-height:min(var(--rac-tool-height,56dvh),600px)!important;z-index:80!important}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog.sheet-open .book-dtp-tools{display:flex!important}
.book-typeset-line{position:absolute;display:block;white-space:pre;font:inherit;line-height:1.2;overflow:visible}
.book-dtp-page .book-dtp-text>h3{position:absolute;left:0;top:0;width:100%;margin:0!important;font-size:1.65em!important;line-height:1.15!important}
.book-dtp-page .book-dtp-text{overflow:visible!important}
.book-dtp-page .book-dtp-safe-area{display:none!important}
.book-dtp-page.show-safe-area .book-dtp-safe-area{display:block!important;position:absolute;left:var(--dtp-margin-left);right:var(--dtp-margin-right);top:var(--dtp-body-top);bottom:var(--dtp-body-bottom);border:1px dashed #d46d19;pointer-events:none;z-index:90}
body .book-studio-chapters .book-workbench-tools-head{display:flex!important;justify-content:space-between;align-items:center;gap:8px;order:-1;padding:6px!important;flex:0 0 auto}
body .book-studio-chapters .book-workbench-tools{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important;box-sizing:border-box}
body .book-studio-chapters .book-workbench-nav{min-height:0!important;flex:1 1 0!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;padding-bottom:14px}
body .book-studio-chapters [data-studio-chapter]{flex:0 0 auto;margin:6px 0}
body.rac-side-tools .book-studio-chapters .book-workbench-tools{position:sticky!important;top:var(--rac-header-height,58px)!important;height:calc(100dvh - var(--rac-header-height,58px) - 36px)!important;max-height:calc(100dvh - var(--rac-header-height,58px) - 36px)!important;grid-column:2!important;grid-row:1!important}
body.rac-side-tools .book-studio-chapters:not(.book-workbench-focus) .book-workbench-panes{display:grid!important;grid-template-columns:minmax(0,1fr) clamp(240px,27vw,310px)!important;align-items:start!important}
body.rac-side-tools .book-studio-chapters .book-workbench-tools-head{display:none!important}
body.rac-side-tools .rac-chapter-mobile-bar{display:none!important}
body:not(.rac-side-tools) .book-studio-chapters .book-workbench-panes{display:block!important}
body:not(.rac-side-tools) .book-studio-chapters .book-workbench-tools{display:none!important;position:fixed!important;inset:auto 8px 68px 8px!important;height:min(var(--rac-tool-height,56dvh),600px)!important;max-height:min(var(--rac-tool-height,56dvh),600px)!important;width:auto!important;z-index:95!important;background:#152131;border:1px solid #52627a;border-radius:8px;padding:8px}
body:not(.rac-side-tools) .book-studio-chapters.chapter-tools-open .book-workbench-tools{display:flex!important}
body:not(.rac-side-tools) .rac-chapter-mobile-bar{display:flex!important;position:fixed;bottom:0;left:0;right:0;z-index:100;gap:8px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:#101b29;border-top:1px solid #36485c}
body:not(.rac-side-tools) .rac-chapter-mobile-bar button{flex:1}
body:not(.rac-side-tools) .book-studio-chapters{padding-bottom:70px}
body .book-chapter-tools-toggle{display:none!important}

body #bookDtpNavigation button{font-size:14px!important;word-break:normal!important;overflow-wrap:normal!important;white-space:normal!important;}
/* IDs deliberately override earlier chapter layouts still shipped with existing books. */
body .book-studio-chapters #bookWorkbenchTools#bookWorkbenchTools{display:flex!important;flex-direction:column!important;overflow:hidden!important;min-height:0!important}
body.rac-side-tools .book-studio-chapters #bookWorkbenchTools#bookWorkbenchTools{position:sticky!important;top:var(--rac-header-height,58px)!important;height:calc(100dvh - var(--rac-header-height,58px) - 36px)!important;max-height:calc(100dvh - var(--rac-header-height,58px) - 36px)!important;grid-column:2!important;grid-row:1!important}
body:not(.rac-side-tools) .book-studio-chapters #bookWorkbenchTools#bookWorkbenchTools{display:none!important;position:fixed!important;left:8px!important;right:8px!important;top:auto!important;bottom:calc(68px + var(--rac-keyboard-offset,0px))!important;height:min(var(--rac-tool-height,56dvh),600px)!important;max-height:min(var(--rac-tool-height,56dvh),600px)!important;width:auto!important;z-index:95!important;padding:8px!important}
body:not(.rac-side-tools) .book-studio-chapters.chapter-tools-open #bookWorkbenchTools#bookWorkbenchTools{display:flex!important}
body:not(.rac-side-tools) .rac-chapter-mobile-bar{bottom:var(--rac-keyboard-offset,0px)!important}
body:not(.rac-side-tools).studio-layout-active .studio-dock{bottom:var(--rac-keyboard-offset,0px)!important}
body:not(.rac-side-tools).studio-layout-active .studio-dock>:not(.studio-dock-content){flex-shrink:0!important}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-tools{bottom:calc(68px + var(--rac-keyboard-offset,0px))!important}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-mobile-bar{bottom:var(--rac-keyboard-offset,0px)!important}

body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-workspace{grid-template-columns:minmax(0,1fr)!important;}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog #bookDtpNavigation{display:none!important;}
body:not(.rac-side-tools) #bookDtpDialog#bookDtpDialog#bookDtpDialog#bookDtpDialog .book-dtp-mobile-bar{display:flex!important;}
