/* Shared surface rules. Text may wrap; controls in an action row stretch equally. */
body :is(main,#racMainContent,#racStudioShell,dialog,#menuDrawer) [hidden][hidden][hidden]{display:none!important}
body :is(main,#racStudioShell,dialog) :is(.button-row,.flow-actions,.writer-primary-actions,.writer-plan-actions,.writer-plan-save,.book-simple-step-actions,.wizard-actions,.creative-card-actions,.photo-main-tools,.writer-cover-main-tools,.rac-reference-actions,.pro-row,.studio-layout-actions,.book-preview-actions,.book-library-actions,.studio-import-actions,.studio-create-row,.studio-text-actions,.studio-mode-row,.studio-tabs,.book-dtp-tabs,.trailer-steps){
 align-items:stretch!important;grid-auto-rows:auto;gap:8px!important;
}
body :is(main,#racStudioShell,dialog) :is(.button-row,.flow-actions,.writer-primary-actions,.writer-plan-actions,.writer-plan-save,.book-simple-step-actions,.wizard-actions,.creative-card-actions,.photo-main-tools,.writer-cover-main-tools,.rac-reference-actions,.pro-row,.studio-layout-actions,.book-preview-actions,.book-library-actions,.studio-import-actions,.studio-create-row,.studio-text-actions,.studio-mode-row,.studio-tabs,.book-dtp-tabs,.trailer-steps)>:is(button,.file-label,.rac-action-with-help){
 align-self:stretch!important;height:auto!important;min-height:44px!important;
}
body :is(main,#racStudioShell,#menuDrawer,dialog) :is(button,.file-label)>:is(span,b,strong,small){min-width:0;overflow-wrap:anywhere;white-space:normal}
body :is(main,#racStudioShell,dialog) button:not(.book-dtp-handle):not(.photo-resize-handle):not(.frame-card):not([data-page]):not(.flow-page-card):not(.page-card):not(.book-chapter-card){text-align:center;line-height:1.3!important;overflow-wrap:anywhere!important}
body :is(#racStudioShell,#bookChapterWorkspace,#bookDtpDialog,dialog,#trailerStudio) :is(.pro-main-group,.pro-add,.rac-tool-group,.book-workbench-nav>details,.photo-free-tools details,.book-dtp-tools details,.studio-details)>summary{
 height:auto!important;max-height:none!important;min-height:44px!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;line-height:1.3!important;
}
body #menuDrawer :is(button:not(#closeMenu),summary){box-sizing:border-box!important;width:100%!important;min-height:44px!important;height:auto!important;max-height:none!important;margin:0!important;padding:10px 12px!important;text-align:left!important;justify-content:flex-start!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.3!important}
body #menuDrawer details.rac-menu-phase{display:block!important;margin:0 0 8px!important;border:1px solid #304258;border-radius:8px;background:#101d2c;overflow:clip}
body #menuDrawer details.rac-menu-phase>summary{display:flex!important;align-items:center;gap:12px;list-style:none;font-size:1rem;font-weight:650;color:#eac064;cursor:pointer}
body #menuDrawer details.rac-menu-phase>summary::-webkit-details-marker{display:none}
body #menuDrawer details.rac-menu-phase>summary::after{content:'⌄';margin-left:auto;flex:0 0 16px;text-align:center;color:#aebed0}
body #menuDrawer details.rac-menu-phase[open]>summary::after{content:'⌃'}
body #menuDrawer details.rac-menu-phase[open]>summary{border-bottom:1px solid #304258;background:#192b3d}
body #menuDrawer .rac-menu-phase-body{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:6px}
body #menuDrawer .rac-menu-phase-body>button{min-width:0!important;border:1px solid transparent!important;border-radius:6px!important;min-height:44px!important}
body #menuDrawer .rac-menu-phase-body>button.rac-menu-current{border-color:#eac06455!important;background:#eac06426!important;color:#ffe098!important}
body #menuDrawer .rac-menu-phase-body>button:hover{background:#243b51!important}
body #menuDrawer .rac-menu-phase-body>button:focus-visible,body #menuDrawer summary:focus-visible{outline:2px solid #eac064;outline-offset:-2px}
body #menuDrawer .rac-menu-tasks{margin-top:8px!important;padding-top:8px!important}
body :is(.studio-dock-content,.book-workbench-nav,.book-dtp-tools) button:not(.studio-sfx-presets button){text-align:left!important;justify-content:flex-start!important}
body .studio-mode-row{grid-template-columns:repeat(6,minmax(0,1fr))!important}
body .studio-mode-row>button:nth-child(-n+2){grid-column:span 3}
body .studio-mode-row>button:nth-child(n+3){grid-column:span 2;justify-content:center!important;text-align:center!important}
body .studio-create-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
body .studio-create-row>#studioRecoverTexts{grid-column:1/-1}
body .studio-text-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
body .studio-text-actions>#studioDeleteText{grid-column:1/-1}
body .studio-chip-group>div{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;align-items:stretch!important}
body .studio-chip-group button{width:100%!important;min-width:0!important;height:auto!important;align-self:stretch!important}
body .studio-veto>div{grid-template-columns:minmax(0,1fr)!important}
body.studio-layout-active #studioCanvasFrame>.foundation-layout-tools{display:none!important}
body.studio-layout-active #studioPageActions>#studioEditPage{display:none!important}
body.studio-layout-active #studioDock>#studioPageActions:not([hidden]){grid-template-columns:minmax(0,1fr)!important}
body #bookDtpDialog#bookDtpDialog .book-dtp-page-nav button,body #bookDtpDialog#bookDtpDialog .book-dtp-head button{min-height:44px!important;min-block-size:44px!important}
body #menuDrawer .menu-home{padding-left:12px!important}
body #menuDrawer .menu-accordion-body{gap:0!important}
body #menuDrawer .rac-menu-phase-body button{padding:10px 12px!important}
/* Override the generic 560px dialog cap; size columns from the actual dialog. */
body dialog.writer-cover-dialog{box-sizing:border-box;width:min(calc(100vw - 32px),1120px)!important;max-width:min(calc(100vw - 32px),1120px)!important;max-height:calc(100dvh - 32px)!important;padding:0!important}
body .writer-cover-shell{box-sizing:border-box;max-height:calc(100dvh - 34px)!important;padding:16px!important;overflow-y:auto!important;overflow-x:hidden!important}
body .writer-cover-dialog .writer-cover-workspace{grid-template-columns:minmax(0,1fr) minmax(280px,340px)!important;gap:16px!important;min-height:0!important;align-items:start!important}
body .writer-cover-workspace>*{min-width:0!important;max-width:100%!important}
body .writer-cover-dialog .photo-free-tools{position:static!important;min-width:0!important;width:100%!important;box-sizing:border-box;padding:12px!important;max-height:none!important;overflow:visible!important}
body .writer-cover-dialog .writer-cover-stage{width:100%!important;max-width:650px!important;max-height:none!important;margin:0 auto!important;align-self:start}
body #writerCoverDialog .writer-cover-main-tools{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important}
body #writerCoverDialog .writer-cover-main-tools>:is(#writerCoverDevice,#writerCoverClipboard,#writerCoverLibrary){grid-column:1/-1}
body #writerCoverDialog #writerCoverImage{display:none!important}
body .writer-cover-dialog .writer-cover-main-tools>*,body .writer-cover-dialog .photo-element-tools>*{min-width:0!important;max-width:100%!important}
body .writer-cover-dialog .file-label{position:relative;display:flex!important;align-items:center;justify-content:center;text-align:center;overflow:hidden}
body .writer-cover-dialog .file-label input[type=file]{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:100%!important;opacity:0;cursor:pointer}
body #writerCoverDialog .photo-editor-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto 44px;align-items:stretch!important;gap:8px!important}
body #writerCoverDialog .photo-editor-head>div:first-child{grid-column:1/-1;min-width:0}
body #writerCoverDialog .photo-editor-head>button{width:100%!important;min-width:0!important;align-self:stretch!important}
body #writerCoverDialog #writerCoverClose{width:fit-content!important;max-width:100%!important;justify-self:start}
body .writer-cover-dialog .writer-cover-side-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
@media(max-width:699px){
 body .writer-cover-dialog .writer-cover-workspace{grid-template-columns:minmax(0,1fr)!important}
 body .writer-cover-dialog .writer-cover-stage{width:min(100%,420px)!important}
 body .writer-cover-dialog .photo-free-tools{order:initial!important}
}
@media(max-width:560px){
 body dialog.writer-cover-dialog{width:100vw!important;max-width:100vw!important;max-height:100dvh!important;border-radius:0!important;margin:0!important}
 body .writer-cover-shell{max-height:calc(100dvh - 2px)!important;padding:12px!important}
 body #writerCoverDialog .photo-editor-head{grid-template-columns:minmax(0,1fr) 44px}
 body #writerCoverDialog #writerCoverClose{grid-column:1/-1}
 body .writer-cover-dialog .writer-cover-stage{width:min(100%,360px)!important}
}
