/* Chapter controls stay beside the manuscript; floating helpers never enter it. */
.desk-sidebar{position:sticky;top:var(--desk-sidebar-top,72px);max-height:calc(100dvh - var(--desk-sidebar-top,72px) - 14px);overflow:auto;min-width:0;scrollbar-width:thin}
.desk-wrap .desk-sidebar>.sidebar{position:static;padding:18px;margin:0 0 14px;max-width:100%;box-sizing:border-box}
.chapter-sidebar[hidden],.desk-widget[hidden],.coach-bubble[hidden],.chapter-controls-backdrop[hidden]{display:none!important}
.chapter-actions h3{font-size:18px;margin:0 0 8px}.sidebar-chapter-title{font-size:12px;line-height:1.5;margin:0 0 8px;overflow-wrap:anywhere;color:#e2c7ec}
.sidebar-save-state{display:block;margin-bottom:14px}.sidebar-helper-buttons{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 18px}
.chapter-actions .chapter-settings{display:block;margin:12px 0 0}.chapter-actions .field{font-size:12px;margin:0 0 14px;min-width:0}
.chapter-actions select,.chapter-actions input{box-sizing:border-box;width:100%;max-width:100%;padding:10px 7px;font-size:12px;min-height:40px}
.chapter-actions .actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:10px}.chapter-actions button{max-width:100%;font-size:12px;min-height:40px;padding:10px;white-space:normal}
.chapter-help{margin:16px 0 0;font-size:11px;line-height:1.6}.chapter-help summary{cursor:pointer;color:#dfc0e9}.chapter-help .status,.chapter-help .editor-file-hint{font-size:11px;line-height:1.6;margin:10px 0}
.chapter-help .editor-file-hint::before{content:none}.chapter-actions .attachment-controls>div{display:block;font-size:11px}.chapter-actions .attachment-controls button{display:block;margin-top:8px}
#editorToolbar #moreWritingTools{display:block}
#editorToolbar .desk-widget-dock{display:flex;align-items:center;flex-wrap:wrap;gap:6px;border-top:1px solid #64466f;padding-top:6px;min-width:0}
#editorToolbar:not(.tools-expanded) .desk-widget-dock{display:none}
#editorToolbar .desk-widget-dock button{display:flex;align-items:center;gap:5px;min-height:36px}
#editorToolbar #coachDock img{width:25px;height:25px;object-fit:contain;pointer-events:none}
/* Desktop controls share row space even when helpers still need More. */
@container writing-editor (min-width:821px){
 #editorToolbar{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px}
 #editorToolbar .toolbar-main,#editorToolbar .toolbar-secondary,#editorToolbar .tool-group,#editorToolbar .desk-preferences{display:contents}
 #editorToolbar button,#editorToolbar select,#editorToolbar .desk-preferences>label{flex:0 0 auto}
 #editorToolbar .page-draw-tools{display:flex;align-items:center;gap:4px;flex:0 0 auto}
 #editorToolbar .desk-widget-dock{flex-basis:100%}
 #editorToolbar.tools-inline .desk-widget-dock{display:contents}
 #editorToolbar.tools-inline #moreWritingTools{display:none}
 #editorToolbar.tools-inline .desk-widget-dock>button{height:34px;min-height:34px;padding-block:4px;white-space:nowrap}
 #editorToolbar.tools-inline #coachDock img{width:22px;height:22px}
 #editorToolbar .word-suggestion,#editorToolbar .page-ink-tools{flex-basis:100%}
}
.desk-floating-tools{position:relative;z-index:3500}
.desk-widget{position:fixed;box-sizing:border-box;display:flex;flex-direction:column;width:360px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);background:#2c1e36;color:#f1e2f7;border:1px solid #9166a3;border-radius:12px;box-shadow:0 12px 40px #0b041180;overflow:hidden;z-index:2;font:14px/1.5 'DM Sans',sans-serif}
.desk-widget .widget-heading{position:static;display:flex;align-items:center;justify-content:space-between;gap:4px;flex-wrap:nowrap;padding:5px 7px;min-height:54px;flex-shrink:0;background:#392547;border:0;border-bottom:1px solid #71507e}
.widget-grip{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;flex:1;background:transparent;color:inherit;border:0;border-radius:5px;padding:8px;font:600 14px 'DM Sans',sans-serif;text-align:left;cursor:grab;touch-action:none;user-select:none;min-height:44px}
.widget-grip:active{cursor:grabbing}.widget-grip span{font-size:21px;color:#cba5d9}
.widget-minimize{background:transparent;border:1px solid #8b6599;color:inherit;border-radius:6px;font-size:22px;width:44px;height:44px;flex-shrink:0;padding:0}
.widget-body{padding:14px;overflow:auto;min-height:0;flex:1}.widget-corner{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;padding:7px 14px;border-top:1px solid #71507e;flex-shrink:0}
.widget-corner select{width:auto;max-width:185px;padding:7px;font-size:12px;min-height:36px;box-sizing:border-box}
#writingCoachPanel .local-coach{padding:0;margin:0;border:0;background:transparent}.coach-mode{font-size:11px;margin:0;color:#d9b0e9}
#writingCoachPanel .status{font-size:12px;line-height:1.5;margin:8px 0 12px;color:#d3bedf}
#writingCoachPanel .coach-log{max-height:230px;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
#writingCoachPanel .coach-log p{margin:0 0 14px;white-space:pre-wrap}
#writingCoachPanel .coach-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;margin-top:10px}
#writingCoachPanel .coach-form .field{margin:0;font-size:12px;min-width:0}#writingCoachPanel input{box-sizing:border-box;width:100%;min-width:0;font-size:16px;padding:9px;min-height:44px}
#writingCoachPanel .coach-form button{margin:0;min-height:44px;padding:9px;font-size:12px}
.coach-bubble{position:fixed;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;width:72px;height:86px;padding:0;background:#2b1d37ed;color:#f3e1fa;border:1px solid #956caa;border-radius:18px;box-shadow:0 7px 25px #09020f66;touch-action:none;cursor:grab;z-index:1}
.coach-bubble img{width:62px;height:62px;object-fit:contain;pointer-events:none}.coach-bubble span{font-size:11px;line-height:1.3;pointer-events:none}.coach-bubble:active{cursor:grabbing}
.sticky-note-widget{background:#f6e7aa;color:#352b1c;border-color:#c9ad65;box-shadow:0 10px 35px #0b041166}
.sticky-note-widget .widget-heading{background:#e9d38e;color:#352b1c;border-color:#c4a65d}.sticky-note-widget .widget-grip span{color:#725922}.sticky-note-widget .widget-minimize{border-color:#a88d50}
.sticky-note-content{display:flex;flex-direction:column;min-height:100%;height:100%}.sticky-note-content>label{font-size:12px}.sticky-note-content textarea{box-sizing:border-box;display:block;flex:1;width:100%;min-height:70px;padding:10px 0;font:16px/1.6 'DM Sans',sans-serif;resize:none;background:transparent;color:#352b1c;border:0;border-radius:0;margin-top:5px}
.sticky-note-content textarea::placeholder{color:#79673e}.note-save-status,.note-local-hint{font-size:11px;line-height:1.5;color:#66512c;margin:8px 0}
.note-actions{display:flex;gap:8px;flex-wrap:wrap}.note-actions button{font-size:12px;background:#f9edc3;color:#453615;border:1px solid #b49a59;border-radius:5px;min-height:36px;padding:8px}
.sticky-note-widget .widget-corner{border-color:#c4a65d}.sticky-note-widget .widget-corner select{background:#f9edc3;color:#453615;border-color:#b49a59}
.note-size-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 7px 3px 14px;border-top:1px solid #c4a65d;flex-shrink:0}
.note-size-controls label{display:flex;align-items:center;gap:8px;font-size:11px}.note-size-controls select{width:110px;min-height:36px;padding:6px;background:#f9edc3;color:#453615;border-color:#b49a59;font-size:12px}
#resizeStickyNote{width:44px;height:44px;font-size:23px;border:0;border-radius:6px;background:transparent;color:#725922;cursor:nwse-resize;touch-action:none}
/* A maximized scrollport starts at the top edge, without the old inset. */
#editorPane.desk-maximized{padding-top:0}
#editorToolbar #maximizeWriting{white-space:nowrap}
.widgets-suspended>.desk-widget,.widgets-suspended>.coach-bubble{visibility:hidden;pointer-events:none}
.chapter-controls-backdrop{position:fixed;inset:0;display:flex;justify-content:flex-end;background:#100819a6;z-index:20;padding:12px;box-sizing:border-box}
.chapter-controls-backdrop>section{width:340px;max-width:100%;max-height:100%;display:flex;flex-direction:column;background:#2c1e36;border:1px solid #9166a3;color:#f1e2f7;border-radius:12px;box-shadow:0 10px 40px #09021080;overflow:hidden}
.chapter-controls-backdrop header{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#392547;padding:10px 14px;border:0;border-bottom:1px solid #71507e;flex-shrink:0}
.chapter-controls-backdrop header h2{font-size:19px;margin:0}.chapter-controls-backdrop header button{width:44px;height:44px;padding:0;font-size:24px;background:transparent;color:#f1e2f7;border:1px solid #9166a3;border-radius:6px}
.chapter-controls-body{overflow:auto;padding:18px;min-height:0}.chapter-controls-body .chapter-actions>h3{display:none}
@container writing-editor (min-width:821px) and (max-width:1000px){
 #editorToolbar .desk-preferences>label:first-child{font-size:0;gap:0}
 #editorToolbar .desk-preferences select{width:64px}
 #editorToolbar .suggestion-label{font-size:0}
 #editorToolbar .suggestion-label::after{content:'Tab';font-size:11px}
 #editorToolbar #maximizeWriting{width:34px;font-size:0;padding:4px}
 #editorToolbar #maximizeWriting::before{content:'⛶';font-size:20px}
 #editorToolbar #maximizeWriting[aria-expanded=true]::before{content:'↙'}
 #editorToolbar .page-preview-toggle{font-size:0;min-width:48px}
 #editorToolbar .page-preview-toggle::before{content:'Pages';font-size:11px}
}
@container writing-editor (max-width:820px){
 #editorToolbar .page-draw-tools{display:contents}
 #editorToolbar .desk-widget-dock{grid-area:3/1/4/-1}
 #editorToolbar .desk-widget-dock button{min-height:44px;height:auto;font-size:12px}
 #editorToolbar .desk-preferences,#editorToolbar.tools-expanded .desk-preferences{gap:4px}
 #editorToolbar .desk-preferences select{width:60px}
 #editorToolbar #writingNight,#editorToolbar.tools-expanded #writingNight{min-width:44px}
 #editorToolbar .suggestion-label::after{content:'Tab'}
 #editorToolbar #maximizeWriting{width:44px;min-width:44px;font-size:0;padding:4px}
 #editorToolbar #maximizeWriting::before{content:'⛶';font-size:21px}
 #editorToolbar #maximizeWriting[aria-expanded=true]::before{content:'↙'}
}
@media(max-width:900px){.desk-sidebar{position:static;max-height:none;overflow:visible}.desk-wrap .desk-sidebar>.sidebar{margin-bottom:16px}.chapter-controls-body input,.chapter-controls-body select{font-size:16px}.chapter-controls-body button{min-height:44px}}
@media(prefers-reduced-motion:reduce){.desk-widget,.coach-bubble{scroll-behavior:auto}}
/* The page navigator stays in the page view, independent of toolbar wrapping. */
.book-layout{position:relative}.page-view-controls{grid-column:1/-1;position:sticky;z-index:8;height:0;align-self:start;pointer-events:none;min-width:0}
.page-view-controls .page-preview-toggle{position:absolute;left:0;top:0;width:40px;height:40px;min-height:40px;display:grid;place-items:center;padding:7px;pointer-events:auto;background:#25182c99;color:#ebd7f3;border:0;border-radius:6px;backdrop-filter:blur(6px);box-shadow:none}
.page-view-controls .page-preview-toggle:hover{background:#614071d9}.page-view-controls .page-preview-toggle:focus-visible{outline:2px solid #dcaceb;outline-offset:2px}
.book-layout>.page-rail{padding-top:44px}.book-layout.previews-hidden>.book-scroll{padding-top:42px}
.coach-bubble{width:92px;height:100px;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0;padding:0;animation:coach-breathe 6s ease-in-out infinite}
.coach-bubble img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 5px 5px #10071955);transition:transform .25s ease}
.coach-bubble:hover img{transform:rotate(-9deg) scale(1.12)}.coach-bubble:active img{transform:rotate(7deg) scale(.96)}.coach-bubble:focus-visible{outline:2px dashed #e7c5f1;outline-offset:3px}
.coach-bubble.coach-cheer img{animation:coach-nod .8s ease 2}
@keyframes coach-breathe{0%,100%{translate:0 0}50%{translate:0 -4px}}@keyframes coach-nod{0%,100%{rotate:0deg}35%{rotate:-8deg}70%{rotate:6deg}}
.coach-speech{position:fixed;box-sizing:border-box;z-index:3;background:#f5e8d9;color:#382b3b;border:1px solid #bd9dcc;border-radius:16px 16px 3px 16px;padding:16px 32px 16px 16px;box-shadow:0 7px 24px #10071955;font:13px/1.6 'DM Sans',sans-serif;max-height:45dvh;overflow:auto}
.coach-speech[hidden]{display:none}.coach-speech p{margin:0}.coach-speech button{position:absolute;right:3px;top:3px;border:0;background:transparent;color:inherit;padding:4px;font-size:20px;min-height:28px;width:28px}
.widgets-suspended>.coach-speech{visibility:hidden;pointer-events:none}.coach-break-controls{border-bottom:1px solid #795588;padding-bottom:10px;margin-bottom:14px}.coach-break-controls label{display:flex;gap:8px;align-items:center}.coach-break-controls input[type=checkbox]{width:18px!important;min-height:18px!important}.coach-break-controls button{font-size:12px;padding:6px}.coach-break-controls output{font-variant-numeric:tabular-nums}
.ambient-volume{display:block;border-top:1px solid #795588;margin-top:12px;padding-top:12px;font-size:12px}.ambient-volume .status{display:block}.ambient-bars{display:inline-flex;align-items:center;height:16px;gap:2px;vertical-align:middle}.ambient-bars i{width:3px;height:4px;background:currentColor;display:block}.sound-playing .ambient-bars i{animation:ambient-level .9s ease-in-out infinite alternate}.sound-playing .ambient-bars i:nth-child(2){animation-delay:-.3s}.sound-playing .ambient-bars i:nth-child(3){animation-delay:-.7s}.sound-playing .ambient-bars i:nth-child(4){animation-delay:-.5s}@keyframes ambient-level{to{height:16px}}
#modal.writing-styles-open{background:transparent;backdrop-filter:none}#modal.writing-styles-open .modal,#modal.writing-styles-open #modalContent{max-width:740px}#modal.writing-styles-open .modal{box-shadow:0 10px 65px #0009;border:1px solid #ae7dc2}
.writing-style-gallery{text-align:center}.style-eyebrow{font-size:10px;letter-spacing:.14em;color:#dbb5eb}.writing-style-gallery h2{margin:8px 0 18px}.writing-style-gallery>p{line-height:1.6}.handwritten-example{display:block;height:min(48dvh,480px);max-width:100%;object-fit:contain;margin:auto;border-radius:3px}.style-navigation{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px}.style-navigation button{min-height:44px}.style-navigation span{min-width:44px}
.sample-book-page{box-sizing:border-box;max-width:390px;margin:auto;min-height:350px;background:#fffaf1;color:#2c2230;padding:25px 28px;text-align:left;font:16px/1.5 Georgia,serif;box-shadow:0 3px 16px #10071944}.sample-book-page small{font:9px sans-serif;letter-spacing:.08em}.sample-book-page h3{color:#442353;font-size:24px;margin:15px 0}.sample-book-page img{float:right;width:34%;margin:8px 0 10px 12px}.sample-book-page blockquote{color:#743f89;border-left:2px solid #a077b1;padding-left:12px;font-style:italic}.sample-chart{display:flex;flex-direction:column;gap:5px;color:#764d8c;background:#eee0f1;padding:12px}.sample-landscape{text-align:center;background:linear-gradient(#e7d9ec,#b78dba);padding:15px;color:#63426e;font-size:34px}.sample-letter{font-style:italic}
.back-cover-preview .cover-text-overlay{text-align:left}.back-cover-preview h2{font-size:25px}.back-cover-preview #backCoverSubtitle{font-size:15px;white-space:pre-wrap;line-height:1.65}.acknowledgement-builder{padding:16px;border:1px solid #795588;border-radius:8px;margin:20px 0}.acknowledgement-builder textarea{width:100%;box-sizing:border-box}
@container writing-editor (min-width:821px){#editorToolbar #stickyNoteDock{white-space:nowrap}#editorToolbar .toolbar-secondary::before{content:'';flex-basis:100%;height:0}}
@container writing-editor (max-width:820px){#editorToolbar #maximizeWriting{grid-area:1/1;width:44px}#editorToolbar .desk-preferences{display:contents!important}#editorToolbar .desk-preferences>label:first-child{grid-area:2/1/3/3}#editorToolbar #writingNight{grid-area:2/3/3/4}#editorToolbar .desk-preferences>label:has(#wordSuggestions){grid-area:2/4/3/5}#editorToolbar #stickyNoteDock{grid-area:2/5/3/6;width:44px;font-size:0;padding:4px}#editorToolbar #stickyNoteDock::before{content:'▧';font-size:22px}#editorToolbar #moreWritingTools{grid-area:2/6/3/7;width:44px;font-size:0;padding:4px}#editorToolbar #moreWritingTools::before{content:'⋯';font-size:22px}}
@media(prefers-reduced-motion:reduce){.coach-bubble,.coach-bubble img,.sound-playing .ambient-bars i{animation:none!important;transition:none}.coach-bubble:hover img,.coach-bubble:active img{transform:none}}
#modal.writing-styles-open>.modal{width:min(94vw,760px);box-sizing:border-box;padding:26px;max-height:94dvh}.writing-styles-open .handwritten-example{height:min(38dvh,360px)}.style-navigation{position:sticky;bottom:-26px;background:#281b32;padding:12px 0;margin:0 -8px -8px;z-index:2}
@media(max-width:600px){#modal.writing-styles-open>.modal{padding:20px 16px}.writing-style-gallery h2{font-size:23px}.writing-style-gallery>p{font-size:13px}.writing-styles-open .handwritten-example{height:30dvh}.style-navigation{bottom:-20px;gap:5px}.style-navigation button{font-size:12px;padding:8px}.style-navigation span{font-size:12px;min-width:30px}}
.style-navigation button,.coach-break-controls button{background:#493157;color:#f7eafc;border:1px solid #9c73ac;border-radius:6px}.style-navigation button:hover,.coach-break-controls button:hover{background:#654278}.writing-style-gallery a{color:#e0b6ee}.style-image-link{display:inline-block;font-size:12px;margin-top:8px}
/* Fill available toolbar rows; More is only a fallback when controls cannot fit. */
@container writing-editor (min-width:821px){#editorToolbar .toolbar-secondary::before{content:none}#editorToolbar .toolbar-setting{display:flex;align-items:center;gap:5px;font-size:11px}#editorToolbar .toolbar-setting select{width:92px}#editorToolbar.tools-inline .toolbar-setting{flex:0 0 auto}}
.coach-floating-timer{position:fixed;width:96px;text-align:center;font:italic 31px/1 CompassCrimson,Georgia,serif;letter-spacing:.03em;color:#e5c5ec;text-shadow:0 2px 3px #1a0d22;z-index:2;pointer-events:none;font-variant-numeric:tabular-nums;background:none;border:0;box-shadow:none}.coach-floating-timer[hidden]{display:none}.widgets-suspended>.coach-floating-timer{visibility:hidden}
.ambient-options{border-top:1px solid #795588;margin-top:14px;padding-top:12px}.ambient-options label{display:block;font-size:12px;margin:12px 0}.ambient-options select{width:100%;max-width:100%}.ambient-options input[type=range]{min-height:24px!important}.ambient-options h4{margin:0}.ambient-options button{min-height:40px}.ambient-options iframe{width:100%;min-width:200px;height:220px;border:0}.ambient-options #youtubePlayer{overflow:auto}
.desk-typewriter-guide{position:relative;display:flex;justify-content:center;align-items:center;min-height:100px}.desk-typewriter-guide .typewriter-top{margin:0;width:min(100%,540px)}.desk-typewriter-guide #deskGuideButton{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:12px;padding:8px 13px;min-height:36px;background:var(--desk-surface,#281b32);border-color:var(--desk-accent,#bd8fd0)}
.editor-card{position:relative}#accountBtn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 15px}#accountBtn .account-avatar{width:24px;height:24px;object-fit:cover;border-radius:50%;flex-shrink:0}#accountBtn .account-avatar[hidden]{display:none}
.desk-wrap[data-desk-theme]{background:var(--desk-back);color:var(--desk-ink)}.desk-wrap[data-desk-theme] .editor-card,.desk-wrap[data-desk-theme] .sidebar,.desk-wrap[data-desk-theme] #editorToolbar{background:var(--desk-surface);color:var(--desk-ink);border-color:var(--desk-accent)}.desk-wrap[data-desk-theme] .book-layout,.desk-wrap[data-desk-theme] .page-rail{background:var(--desk-back)}.desk-wrap[data-desk-theme] #editorToolbar button,.desk-wrap[data-desk-theme] #editorToolbar select,.desk-wrap[data-desk-theme] .chapter-actions select{background:var(--desk-panel);color:var(--desk-ink);border-color:var(--desk-accent)}.desk-wrap[data-desk-theme] .submission-reminder,.desk-wrap[data-desk-theme] .author-intro{background:var(--desk-panel);border-color:var(--desk-accent);color:var(--desk-ink)}
#editorPane[data-toolbar-dock=bottom] #editorToolbar{position:fixed;top:auto!important;bottom:0;left:var(--desk-pane-left);right:var(--desk-pane-right);margin:0;max-height:42dvh;z-index:30}#editorPane[data-toolbar-dock=bottom] .editor-card{padding-bottom:calc(var(--desk-bottom-tools,130px) + 36px)}
@media(min-width:1000px){#editorPane[data-toolbar-dock=left] .editor-card{padding-left:244px}#editorPane[data-toolbar-dock=right] .editor-card{padding-right:244px}#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar{position:fixed;top:var(--desk-dock-top)!important;bottom:12px;width:224px;max-height:none;overflow:auto;display:flex;flex-wrap:wrap;gap:5px;align-content:flex-start;z-index:30}#editorPane[data-toolbar-dock=left] #editorToolbar{left:var(--desk-pane-left);right:auto}#editorPane[data-toolbar-dock=right] #editorToolbar{right:var(--desk-pane-right);left:auto}#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .toolbar-main,#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .toolbar-secondary,#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .tool-group,#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .desk-preferences,#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .desk-widget-dock{display:contents!important}#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #moreWritingTools{display:none}#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar .toolbar-setting{display:flex;width:100%;justify-content:space-between}#editorPane:is([data-toolbar-dock=left],[data-toolbar-dock=right]) #editorToolbar select{max-width:180px}}
@container writing-editor (max-width:820px){#editorToolbar .toolbar-setting{display:flex;align-items:center;gap:6px}#editorToolbar .toolbar-setting select{width:125px}}
.contributor-terms{white-space:pre-wrap;overflow:auto;max-height:40dvh;border:1px solid #9c73ac;border-radius:6px;padding:16px;background:#1d1425;color:#eee0f4;font:14px/1.65 'DM Sans',sans-serif}.consent-checkbox{display:flex;align-items:flex-start;gap:12px;margin:18px 0;font-size:14px;line-height:1.6}.consent-checkbox input{flex:0 0 auto;width:20px;height:20px;margin-top:3px}.consent-receipt,.editor-portrait-row{border:1px solid #795588;border-radius:7px;padding:14px;margin:12px 0}
.desk-wrap[data-desk-theme] #editorPane{background:var(--desk-back)}.desk-wrap[data-desk-theme] .page-thumbnail{color:var(--desk-ink);border-color:var(--desk-accent)}.desk-wrap[data-desk-theme] .page-thumbnail[aria-current=page]{background:var(--desk-panel)}.desk-floating-tools .coach-widget,.desk-floating-tools .coach-widget .widget-heading{background:var(--desk-surface,#281b32);color:var(--desk-ink,#f2e5f8);border-color:var(--desk-accent,#bd8fd0)}.coach-floating-timer{color:var(--desk-ink,#e5c5ec)}
/* The school sticker replaces the former asterisk brand mark. */
.book-logo{display:inline-block;width:44px;height:44px;object-fit:contain;flex-shrink:0;vertical-align:middle}
.brand>.book-logo{width:44px;height:44px}
footer>.book-logo{width:38px;height:38px}
.paper-note>.book-logo{display:block;width:52px;height:52px;margin:8px auto 0}
.postcard-signature>.book-logo{width:30px;height:30px;margin-left:7px}
.postcard-postmark>.book-logo{width:34px;height:34px;margin:3px 0}
.earned-badge .book-logo,.badge-chips .book-logo{width:27px;height:27px}
.art-star>.book-logo{width:70px;height:70px}
@media(max-width:550px){.brand>.book-logo{width:36px;height:36px}.postcard-postmark>.book-logo{width:22px;height:22px;margin:2px 0}}

/* The single Highlight control opens above clipped or docked toolbars. */
#highlightPalette{display:none;position:fixed;inset:auto;margin:0;padding:12px;width:min(256px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;gap:6px;grid-template-columns:1fr 1fr;border:1px solid var(--desk-accent,#bd8fd0);border-radius:10px;background:var(--desk-surface,#281b32);color:var(--desk-ink,#f2e5f8);box-shadow:0 10px 30px #09020f66;z-index:5000;font:13px 'DM Sans',sans-serif}
#highlightPalette:popover-open,#highlightPalette.is-open{display:grid}
#highlightPalette p{grid-column:1/-1;font-size:12px;margin:0 0 5px;color:inherit}
#editorToolbar #highlightPalette button{display:flex;align-items:center;gap:8px;width:auto;height:auto;min-height:42px;min-width:0;font-size:13px;padding:8px;border:1px solid #886197;border-radius:5px;background:var(--desk-panel,#35223f);color:inherit;grid-column:auto;text-align:left}
#editorToolbar #highlightPalette button::before{content:none}
#editorToolbar #highlightPalette .highlight-remove{grid-column:1/-1;justify-content:center}
.highlight-swatch{display:inline-block;width:20px;height:20px;border-radius:50%;border:1px solid #0003;flex-shrink:0}
.highlight-swatch[data-swatch=yellow]{background:#fff2a8}.highlight-swatch[data-swatch=pink]{background:#ffd1dc}.highlight-swatch[data-swatch=mint]{background:#c8efd4}.highlight-swatch[data-swatch=blue]{background:#cce7ff}.highlight-swatch[data-swatch=lavender]{background:#e7d5ff}.highlight-swatch[data-swatch=orange]{background:#ffdbb5}

/* Sound and YouTube stay in the second desktop row, outside More. */
#editorToolbar .toolbar-access{display:contents}
#editorToolbar #ambientAudio,#editorToolbar #toolbarDeskGuide,#editorToolbar #pageOnlyWriting{white-space:nowrap}
@container writing-editor (min-width:821px){
 #editorToolbar .toolbar-main,#editorToolbar .toolbar-secondary{display:flex!important;flex:1 0 100%;width:100%;flex-wrap:nowrap;gap:4px;overflow-x:auto;scrollbar-width:thin;align-items:center;padding-bottom:2px}
 #editorToolbar .toolbar-secondary .tool-group,#editorToolbar .toolbar-secondary .desk-preferences{display:contents}
 #editorToolbar .toolbar-secondary button,#editorToolbar .toolbar-secondary label{flex-shrink:0}
 #editorToolbar .toolbar-secondary button{font-size:11px;padding-inline:6px}
 #editorToolbar .toolbar-secondary #moreWritingTools{order:8}
 #editorToolbar .toolbar-secondary #maximizeWriting{order:9}
}
@container writing-editor (max-width:820px){
 #editorToolbar .toolbar-access{display:flex;grid-column:1/-1;grid-row:3;gap:4px;justify-content:space-between;min-width:0;overflow-x:auto}
 #editorToolbar .toolbar-access button{flex:1 0 auto;min-height:40px;height:40px;padding:5px;font-size:11px}
 #editorToolbar .desk-widget-dock{grid-area:4/1/5/-1}
}
.desk-typewriter-guide{min-height:132px;padding-bottom:26px}
.desk-typewriter-guide #deskGuideButton{top:76%;font-size:14px;min-height:44px;padding:11px 20px}
.ambient-popover{display:none;position:fixed;inset:auto;margin:0;padding:18px;width:min(380px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;background:var(--desk-surface,#281b32);color:var(--desk-ink,#f2e5f8);border:1px solid var(--desk-accent,#bd8fd0);border-radius:12px;box-shadow:0 12px 40px #12091e66;z-index:5000;font:14px 'DM Sans',sans-serif}
.ambient-popover:popover-open,.ambient-popover.is-open{display:block}
.sound-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.sound-panel-heading h3{font-size:19px;margin:0}
.ambient-popover button{background:var(--desk-panel,#35223f);color:inherit;border:1px solid var(--desk-accent,#bd8fd0);padding:9px;border-radius:6px;font:inherit;min-height:42px}
.ambient-popover #closeSoundOptions{font-size:24px;width:42px;flex-shrink:0;padding:0}
.ambient-scene-list{display:grid;grid-template-columns:1fr;gap:6px;margin:14px 0}
.ambient-scene-list button{text-align:left}.ambient-scene-list [aria-pressed=true]{border-width:2px;background:var(--desk-accent,#bd8fd0);color:#201329}
.ambient-popover .buttons{margin-top:12px;gap:8px}.ambient-popover .status{color:inherit;opacity:.85;font-size:11px;line-height:1.6}
.ambient-popover input,.ambient-popover select{font-size:16px;background:var(--desk-panel,#35223f);color:inherit;border-color:var(--desk-accent,#bd8fd0);margin-top:6px;width:100%;box-sizing:border-box}
.ambient-popover details{border-top:1px solid var(--desk-accent,#bd8fd0);padding-top:15px;margin-top:18px}.ambient-popover summary{cursor:pointer;min-height:30px}
/* Page-only is a view mode. The page's physical dimensions never change. */
body.desk-page-only-open{overflow:hidden}
body.desk-page-only-open>header,body.desk-page-only-open #deskFloatingTools{display:none!important}
#editorPane.desk-page-only{position:fixed!important;inset:var(--page-only-top,0px) 0 auto!important;height:var(--page-only-height,100dvh)!important;width:100vw!important;max-width:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:0!important;margin:0!important;background:var(--desk-back,#1b1223);z-index:4000;overscroll-behavior:contain}
#editorPane.desk-page-only .editor-card{padding:0!important;margin:0!important;border:0!important;border-radius:0;min-height:100%;background:transparent}
#editorPane.desk-page-only .editor-card>:not(.book-layout){display:none!important}
#editorPane.desk-page-only .book-layout{display:block!important;margin:0!important;padding:0 8px!important;border-radius:0;min-height:100%;background:transparent}
#editorPane.desk-page-only .page-rail,#editorPane.desk-page-only .page-view-controls{display:none!important}
#editorPane.desk-page-only .book-scroll{margin:0!important;padding:0!important;max-width:none;overflow:visible!important}
#editorPane.desk-page-only .book-stack{margin:0 auto!important}
.page-only-exit{position:fixed;top:calc(var(--page-only-top,0px) + 8px);right:8px;z-index:4001;min-height:44px;padding:8px 12px;border:1px solid #896d97;border-radius:22px;background:#281b32ed;color:#f6e9fb;box-shadow:0 2px 9px #160c2433;font:600 12px 'DM Sans',sans-serif}
.page-only-exit[hidden]{display:none!important}
.achievement-sticker{display:block;width:80px;height:80px;object-fit:contain;flex-shrink:0}
.earned-badge .achievement-sticker{width:84px;height:84px}.badge-chips .achievement-sticker{display:inline-block;vertical-align:middle;width:30px;height:30px}
.award-sticker-preview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0 28px}
.award-sticker-preview>div{text-align:center;font-size:12px;line-height:1.5}.award-sticker-preview img{width:96px;height:96px;max-width:100%;margin:0 auto 8px}
@media(max-width:550px){.award-sticker-preview{grid-template-columns:repeat(2,minmax(0,1fr))}.intro-fields small{display:block;font-size:11px;line-height:1.5;margin-top:6px}}
.ambient-popover label[hidden]{display:none!important}
/* Keep all second-row shortcuts visible beside the chapter sidebar. */
@container writing-editor (min-width:821px) and (max-width:1150px){
 #editorToolbar .toolbar-secondary .desk-preferences>label:first-child{font-size:0;gap:0}
 #editorToolbar .toolbar-secondary .desk-preferences select{width:64px}
 #editorToolbar .toolbar-secondary #writingNight{font-size:0;min-width:38px}
 #editorToolbar .toolbar-secondary #writingNight::before{content:'☾';font-size:19px}
 #editorToolbar .toolbar-secondary #writingNight[aria-pressed=true]::before{content:'☀'}
 #editorToolbar .toolbar-secondary .suggestion-label{font-size:0}
 #editorToolbar .toolbar-secondary .suggestion-label::after{content:'Tab';font-size:11px}
 #editorToolbar .toolbar-secondary .ambient-label{font-size:0}
 #editorToolbar .toolbar-secondary .ambient-label::after{content:'Sound';font-size:11px}
 #editorToolbar .toolbar-secondary #toolbarDeskGuide{font-size:0}
 #editorToolbar .toolbar-secondary #toolbarDeskGuide::before{content:'Guide';font-size:11px}
 #editorToolbar .toolbar-secondary #maximizeWriting{width:34px;min-width:34px;font-size:0;padding:4px}
 #editorToolbar .toolbar-secondary #maximizeWriting::before{content:'⛶';font-size:20px}
 #editorToolbar .toolbar-secondary #maximizeWriting[aria-expanded=true]::before{content:'↙'}
}

/* A separate, persistent YouTube surface; its controls never cover the video. */
.youtube-mini-player{position:fixed;box-sizing:content-box;z-index:4100;background:var(--desk-surface,#281b32);color:var(--desk-ink,#f2e5f8);border:1px solid var(--desk-accent,#bd8fd0);border-radius:10px;box-shadow:0 10px 30px #10071977;font:13px/1.4 'DM Sans',sans-serif;overflow:hidden;max-width:calc(100vw - 18px)}
.youtube-mini-player[hidden]{display:none!important}
.youtube-window-heading,.youtube-window-footer{display:flex;align-items:center;gap:4px;padding:4px;box-sizing:border-box;min-height:44px}
.youtube-mini-player button,.youtube-mini-player select{background:var(--desk-panel,#35223f);color:inherit;border:1px solid #795588;border-radius:5px;font:inherit;min-height:36px;padding:4px 8px}
.youtube-mini-player button:focus-visible,.youtube-mini-player select:focus-visible{outline:2px solid #f2d4ff;outline-offset:-3px}
.youtube-window-heading #moveYoutube{flex:1;text-align:left;cursor:move;touch-action:none}
.youtube-window-heading #moveYoutube span{float:right}
.youtube-mini-player #youtubePlayer{min-width:200px;min-height:200px}
.youtube-mini-player iframe{display:block;width:100%;height:100%;min-width:200px;min-height:200px;border:0}
.youtube-window-footer{justify-content:space-between}
.youtube-window-footer label{display:flex;align-items:center;gap:8px}
.youtube-mini-player #resizeYoutube{cursor:nwse-resize;touch-action:none;min-width:40px}
@media print{.youtube-mini-player{display:none!important}}

.mark-help-toggle{position:fixed;z-index:5;display:grid;place-items:center;width:32px;height:32px;cursor:pointer}.mark-help-toggle input{position:absolute;inset:0;width:32px;height:32px;margin:0;opacity:0;cursor:pointer}.mark-help-toggle span{display:grid;place-items:center;width:17px;height:17px;border:1px solid #d8b2e1;border-radius:50%;background:#51335f;color:#fff;font:bold 11px sans-serif}.mark-help-toggle input:not(:checked)+span{background:#302738;color:#a99bad;text-decoration:line-through}.mark-help-toggle:has(:focus-visible){outline:2px solid #e7c5f1;border-radius:50%}.mark-praise-preference{display:block;margin-top:10px;font-size:12px}.mark-praise-preference input{width:16px!important;height:16px}.widgets-suspended .mark-help-toggle{display:none}

.youtube-queue{padding-left:20px;max-height:180px;overflow:auto}.youtube-queue li{display:flex;gap:4px;margin:6px 0}.youtube-queue li button:first-child{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.youtube-window-footer{gap:3px}.youtube-window-footer button{padding-inline:6px}.youtube-window-footer label{gap:3px}.youtube-window-footer select{max-width:95px}#inkPencilOnly[aria-pressed=true]{background:#bd8fd0;color:#281b32}

.chapter-recorder{position:fixed;right:16px;bottom:16px;width:min(430px,calc(100vw - 32px));max-height:min(72dvh,560px);display:flex;flex-direction:column;z-index:4200;background:var(--desk-surface,#281b32);color:#f2e5f8;border:1px solid #bd8fd0;border-radius:12px;box-shadow:0 12px 35px #12091e88;font:13px/1.5 'DM Sans',sans-serif;overflow:hidden}.chapter-recorder[hidden]{display:none}.recorder-heading{display:flex;gap:4px;padding:6px;border-bottom:1px solid #735184}.chapter-recorder button,.chapter-recorder select,.chapter-recorder input:not([type=range]){font:inherit;color:inherit;background:#35223f;border:1px solid #795588;border-radius:5px;padding:6px;min-height:36px;box-sizing:border-box}.recorder-grip{flex:1;text-align:left;touch-action:none;cursor:move}.recorder-grip span{float:right}.recorder-body{min-height:0;flex:1;overflow:auto;padding:14px;overscroll-behavior:contain}.recorder-body label{display:block;margin:10px 0}.recorder-body label>input,.recorder-body label>select{display:block;width:100%;margin:4px 0}.recorder-body label[hidden]{display:none}.recorder-body .status{font-size:11px}.recording-preflight summary{font-weight:700;cursor:pointer}.recording-preflight ol{padding-left:18px}.recording-preflight li{margin:7px 0}.audio-preview-notice{padding:10px;border-left:3px solid #bd8fd0;background:#ffffff09;font-size:12px}.recording-transport{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px;border-top:1px solid #735184;flex-shrink:0}.recording-transport output{font-variant-numeric:tabular-nums;font-size:17px}.microphone-meter{height:7px;width:70px;border-radius:6px;background:#141019;overflow:hidden}.microphone-meter i{display:block;height:100%;width:0;background:#b0d5a6}.chapter-recorder>#recordingStatus{margin:0;padding:0 12px 10px;font-size:11px}.chapter-recorder.recorder-minimized .recorder-body{display:none}.chapter-recorder.is-recording{border-color:#eab2be}.chapter-recorder.is-recording #startChapterRecording{color:#f5afc0}.audio-take{border:1px solid #795588;border-radius:7px;padding:12px;margin:12px 0}.audio-take small{display:block;color:#c4b0ce}.audio-take audio{width:100%;height:40px;margin:8px 0}.audio-take .buttons{display:flex;gap:5px;flex-wrap:wrap}.audio-take button{font-size:11px}.audio-take label{display:flex;align-items:center;gap:6px}.audio-take input[data-title]{min-width:0;flex:1}.audio-take input[type=checkbox]{width:18px;flex-shrink:0}.chapter-recorder .buttons button{padding:6px}.chapter-recording-active .coach-speech{display:none!important}.chapter-recorder button:disabled{opacity:.5}#recordChapter{white-space:nowrap}
@media(max-width:600px){.chapter-recorder{right:8px;bottom:8px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.recorder-body{max-height:48dvh}.chapter-recorder button{min-height:40px}.recording-transport{gap:5px}}
/* Wide desks share actual row space rather than reserving entire rows. */
@container writing-editor (min-width:821px){
 #editorToolbar .toolbar-main,#editorToolbar .toolbar-secondary{display:contents!important}
 #editorToolbar{gap:4px;scrollbar-gutter:auto}
 #editorToolbar.tools-inline .desk-widget-dock{display:contents!important}
 #editorToolbar.tools-inline .toolbar-setting{gap:3px;font-size:10px}
 #editorToolbar.tools-inline .toolbar-setting select{max-width:88px}
 #editorToolbar .page-ink-tools{gap:4px;padding-top:4px}
 #editorToolbar .page-ink-tools>label{gap:4px;font-size:10px}
 #editorToolbar .page-ink-tools>button{font-size:11px;padding-inline:6px}
}
.mark-help-hint{display:block;font-size:10px;line-height:1.4;margin-top:8px;color:#68536c}.mark-help-hint[hidden]{display:none}
#inkWidthPanel{display:none;position:fixed;inset:auto;margin:0;box-sizing:border-box;width:min(270px,calc(100vw - 16px));padding:14px;border:1px solid #b68bc8;border-radius:10px;background:var(--desk-surface,#281b32);color:#f2e0f8;box-shadow:0 8px 30px #10071966;z-index:5000;font:12px/1.5 'DM Sans',sans-serif}
#inkWidthPanel.is-open,#inkWidthPanel:popover-open{display:block}#inkWidthPanel label{display:flex;justify-content:space-between}#inkWidthPanel svg{width:100%;height:46px;display:block}.width-ribbon{fill:#c49ed4}.width-live{color:#e4c1ee}#inkWidthPanel input[type=range]{display:block;width:100%;height:32px;min-height:32px;padding:0;accent-color:#d7afe7}#inkWidthPanel small{display:block;font-size:10px}
.page-only-tools{position:fixed;top:var(--page-only-top,0px);left:0;right:0;z-index:4100;pointer-events:none}.page-only-tools[hidden]{display:none}.page-only-curtain{display:block;pointer-events:auto;margin:0 auto;min-height:24px!important;height:24px;padding:2px 24px;border:1px solid #8c699c;border-top:0;border-radius:0 0 12px 12px;background:#281b32df;color:#efdbf6;font:11px 'DM Sans',sans-serif;box-shadow:0 2px 12px #10071933}.page-only-tools-panel{pointer-events:auto;container:writing-editor / inline-size;width:100%;background:var(--desk-surface,#281b32);box-shadow:0 6px 20px #10071966}.page-only-tools-panel[hidden]{display:none!important}
#editorPane.desk-page-only #editorToolbar{position:static!important;inset:auto!important;width:100%!important;max-width:100%!important;margin:0!important;max-height:45dvh!important;border-radius:0;--desk-toolbar-top:0px}
body.desk-page-only-open #deskFloatingTools{display:block!important}
@container writing-editor (min-width:1100px){
 #editorPane.desk-maximized #editorToolbar .page-ink-tools:not([hidden]){display:contents!important}
 #editorPane.desk-maximized #editorToolbar #inkStatus{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
#inkWidthPanel{overflow-x:hidden;overflow-y:auto}#inkWidthPanel input[type=range]{box-sizing:border-box}
@container writing-editor (min-width:1100px){
 #editorPane.desk-maximized #editorToolbar.ink-active{gap:3px}
 #editorPane.desk-maximized #editorToolbar.ink-active button{font-size:11px;min-height:32px;height:32px;padding:4px 5px;min-width:26px}
 #editorPane.desk-maximized #editorToolbar.ink-active select{font-size:11px;min-height:32px;height:32px;padding:4px;max-width:95px}
 #editorPane.desk-maximized #editorToolbar.ink-active #inkPencilOnly{font-size:0}
 #editorPane.desk-maximized #editorToolbar.ink-active #inkPencilOnly::before{content:'✎ Stylus only';font-size:11px}
 #editorPane.desk-maximized #editorToolbar.ink-active .page-ink-tools>label{font-size:0;gap:2px}
 #editorPane.desk-maximized #editorToolbar.ink-active #inkColour{width:34px;height:32px}
 #editorPane.desk-maximized #editorToolbar.ink-active #writingNight{font-size:0}
 #editorPane.desk-maximized #editorToolbar.ink-active #writingNight::before{content:'☾ Night';font-size:11px}
 #editorPane.desk-maximized #editorToolbar.ink-active #writingNight[aria-pressed=true]::before{content:'☀ Day'}
}
.width-track{position:relative;height:46px}.width-track>input[type=range]{position:absolute;inset:0;margin:0!important;width:100%!important;height:46px!important;appearance:none;-webkit-appearance:none;background:transparent!important;border:0!important;cursor:ew-resize}.width-track>input::-webkit-slider-runnable-track{height:20px;background:transparent}.width-track>input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:19px;height:19px;border:3px solid #fff0ff;border-radius:50%;background:#895599;box-shadow:0 1px 5px #10071999}.width-track>input::-moz-range-track{background:transparent}.width-track>input::-moz-range-thumb{width:15px;height:15px;border:3px solid #fff0ff;border-radius:50%;background:#895599}
/* Keep Pencil surfaces nonselectable between words, with explicit touch gestures. */
.drawing-on-page,.drawing-on-page *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}
.drawing-on-page #editor,.drawing-on-page .author-intro-page{pointer-events:none}
.drawing-on-page .page-ink-canvas{pointer-events:auto!important;touch-action:none}
#editorPane.desk-page-only{overflow-x:auto!important}
body.desk-page-only-open #deskFloatingTools{z-index:4150;pointer-events:none}body.desk-page-only-open #deskFloatingTools>:not([hidden]){pointer-events:auto}body.desk-page-only-open #deskFloatingTools .coach-floating-timer{pointer-events:none}
.page-only-curtain[hidden]{display:none!important}.page-only-curtain,.curtain-grip{touch-action:none;cursor:grab}
.page-only-dock-tools{display:flex;align-items:center;gap:3px;flex:0 0 auto}.page-only-dock-tools select{max-width:82px}.page-only-dock-tools .curtain-grip{padding-inline:6px}
.page-only-tools[data-edge=bottom]{top:auto;bottom:0;display:flex;flex-direction:column-reverse}
.page-only-tools[data-edge=left],.page-only-tools[data-edge=right]{top:var(--page-only-top,0px);bottom:0;right:auto;width:auto;display:flex;align-items:center}
.page-only-tools[data-edge=right]{left:auto;right:0;flex-direction:row-reverse}
.page-only-tools:is([data-edge=left],[data-edge=right]) .page-only-curtain{writing-mode:vertical-rl;height:auto!important;padding:20px 4px;margin:0;min-width:28px}
.page-only-tools:is([data-edge=left],[data-edge=right]) .page-only-tools-panel{width:min(300px,84vw);height:100%;overflow:auto;container-type:normal}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar{max-height:none!important;min-height:100%;display:flex!important;flex-wrap:wrap;align-content:flex-start;overflow:visible}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar :is(.toolbar-main,.toolbar-secondary,.tool-group,.desk-preferences,.toolbar-access){display:contents!important}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar :is(button,select){min-height:44px}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar .toolbar-extra{display:contents!important}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar button.toolbar-extra{display:inline-block!important}
@container writing-editor (min-width:821px){#editorToolbar .desk-widget-dock{border:0;padding:0;gap:4px}#editorToolbar .desk-preferences{order:initial}#editorToolbar .desk-preferences>button,#editorToolbar .desk-preferences>label{order:initial}}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar{flex-direction:row!important;align-items:center}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar :is(button,select){width:auto!important;min-width:40px;flex:0 0 auto!important;font-size:12px;padding-inline:8px}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar .toolbar-extra{display:inline-block!important}.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar .tool-group.toolbar-extra,.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar #deskWidgetDock{display:contents!important}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar #moreWritingTools{display:none!important}
@container writing-editor (min-width:821px){#editorToolbar.tools-partial .desk-widget-dock{display:contents!important}#editorToolbar.tools-partial:not(.tools-expanded) .helper-overflow{display:none!important}#editorToolbar.tools-partial .desk-widget-dock>button{height:34px;min-height:34px;padding-block:4px;white-space:nowrap}#editorToolbar.tools-partial .toolbar-setting{display:flex;align-items:center;font-size:10px;gap:3px}#editorToolbar.tools-partial .toolbar-setting select{max-width:88px}}
.page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar .helper-overflow{display:initial!important}
@container writing-editor (min-width:821px){#editorToolbar .toolbar-secondary #moreWritingTools,#editorToolbar .toolbar-secondary #maximizeWriting{order:0}}
.desk-page-only #editorToolbar .toolbar-setting:has(#toolbarDock){display:none!important}
/* Page-only gestures pan the paper; native scrollbars must not cover edge controls. */
#editorPane.desk-page-only{scrollbar-width:none}#editorPane.desk-page-only::-webkit-scrollbar{display:none}
@container writing-editor (max-width:820px){#editorToolbar .toolbar-access>.page-only-dock-tools{display:flex;flex:0 0 auto;gap:2px}#editorToolbar .page-only-dock-tools button{min-width:30px;width:30px;padding:3px}#editorToolbar .page-only-dock-tools select{width:60px;min-height:40px;padding:4px;font-size:11px}#editorPane.desk-page-only #editorToolbar .toolbar-access>button{flex:1 1 auto}}
body.page-only-tools-visible #exitPageOnly{display:none!important}
/* The three tool families have names as well as shades. */
#editorToolbar [data-tool-section=text]{--tool-tint:#c0a3d8}#editorToolbar [data-tool-section=create]{--tool-tint:#a0c9ba}#editorToolbar [data-tool-section=desk]{--tool-tint:#d1bc92}
#editorToolbar button[data-tool-section],#editorToolbar select[data-tool-section],#editorToolbar [data-tool-section]>:is(button,select){background:var(--desk-panel,#35223f);background:color-mix(in srgb,var(--desk-panel,#35223f) 87%,var(--tool-tint) 13%);border-color:color-mix(in srgb,var(--desk-accent,#bd8fd0) 65%,var(--tool-tint) 35%);border-radius:7px}
#editorToolbar button:hover,#editorToolbar select:hover{filter:brightness(1.12)}#editorToolbar button:focus-visible,#editorToolbar select:focus-visible{outline:2px solid var(--desk-ink,#f2e5f8);outline-offset:1px}
.toolbar-categories[hidden]{display:none!important}.toolbar-categories{display:flex;align-items:center;gap:4px;flex:1 0 100%;min-width:0;padding-bottom:5px;border-bottom:1px solid #ffffff20}
#editorToolbar .toolbar-categories>button{flex:1;min-width:0;min-height:36px;height:36px;font:600 11px/1.2 'DM Sans',sans-serif;padding:5px;white-space:nowrap;border-radius:8px}
#editorToolbar .toolbar-categories>[data-tool-group=text]{background:#65507855}#editorToolbar .toolbar-categories>[data-tool-group=create]{background:#41685e55}#editorToolbar .toolbar-categories>[data-tool-group=desk]{background:#75634455}
#editorToolbar .toolbar-categories>[aria-pressed=true]{box-shadow:inset 0 -3px var(--desk-accent,#ddbbe8);border-color:var(--desk-ink,#f2e5f8)}
#editorToolbar.toolbar-palette{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-content:flex-start!important;align-items:center!important;gap:5px!important;padding:7px!important;box-sizing:border-box;max-width:100%;overflow:auto}
#editorToolbar.toolbar-palette :is(.toolbar-main,.toolbar-secondary,.tool-group,.desk-preferences,.toolbar-access,#deskWidgetDock){display:contents!important}
#editorToolbar.toolbar-palette .toolbar-categories{display:flex!important;order:-10}
#editorToolbar.toolbar-palette [data-tool-section]{display:inline-flex!important;flex:0 0 auto!important;align-items:center;gap:4px;grid-area:auto!important;order:0!important;width:auto!important;margin:0!important;max-width:100%}
#editorToolbar.toolbar-palette[data-active-section=text] [data-tool-section]:not([data-tool-section=text]),#editorToolbar.toolbar-palette[data-active-section=create] [data-tool-section]:not([data-tool-section=create]),#editorToolbar.toolbar-palette[data-active-section=desk] [data-tool-section]:not([data-tool-section=desk]){display:none!important}
#editorToolbar.toolbar-palette :is(button,select){grid-area:auto!important;min-height:38px;height:38px;width:auto;max-width:100%;font:12px/1.2 'DM Sans',sans-serif;padding:6px 9px;flex:0 0 auto;white-space:nowrap}
#editorToolbar.toolbar-palette :is(#writingFont,#textStyle){width:112px!important}#editorToolbar.toolbar-palette #writingZoom{width:75px!important}
#editorToolbar.toolbar-palette #moreWritingTools{display:none!important}#editorToolbar.toolbar-palette #coachDock img{width:20px;height:20px}#editorToolbar.toolbar-palette .toolbar-setting{font-size:11px}
#editorToolbar.toolbar-palette #pageInkTools:not([hidden]){display:flex!important;flex:1 0 100%;flex-wrap:wrap;gap:5px;border-top:1px solid #a0c9ba55;padding-top:5px}#editorToolbar.toolbar-palette:not([data-active-section=create]) #pageInkTools{display:none!important}
#editorToolbar.toolbar-palette .page-ink-tools>label{display:flex;align-items:center;gap:3px;font-size:11px}#editorToolbar.toolbar-palette #inkStatus{position:static!important;width:auto!important;height:auto!important;clip-path:none!important;flex-basis:100%;font-size:10px;white-space:normal}
#editorToolbar.toolbar-palette .page-only-dock-tools{display:flex!important;flex:0 0 auto;gap:2px}#editorToolbar.toolbar-palette .page-only-dock-tools .curtain-grip{width:25px!important;min-width:25px;padding:2px}#editorToolbar.toolbar-palette .page-only-dock-tools select{width:58px!important;max-width:58px;min-height:36px;padding:3px;font-size:10px}
#editorToolbar.toolbar-palette #stickyNoteDock,#editorToolbar.toolbar-palette #maximizeWriting,#editorToolbar.toolbar-palette #writingNight{font-size:12px!important;min-width:0!important;width:auto!important;padding:6px 9px}#editorToolbar.toolbar-palette :is(#stickyNoteDock,#maximizeWriting,#writingNight)::before{content:none!important}
#editorToolbar.toolbar-palette .suggestion-label{font-size:11px!important}#editorToolbar.toolbar-palette .suggestion-label::after{content:none!important}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) .page-only-tools-panel{width:min(240px,78vw)}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar{width:100%!important;min-height:0!important;max-height:100%!important}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar [data-tool-section].helper-overflow{display:inline-flex!important}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar[data-active-section=text] [data-tool-section]:not([data-tool-section=text]),#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar[data-active-section=create] [data-tool-section]:not([data-tool-section=create]),#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar[data-active-section=desk] [data-tool-section]:not([data-tool-section=desk]){display:none!important}
#exitPageOnly.page-only-exit{width:36px;height:36px;min-height:36px;padding:0;display:grid;place-items:center;border-radius:50%;font:25px/1 sans-serif;opacity:.85}
.coach-speech .mark-break-restart{position:static!important;display:block;width:auto!important;height:auto!important;border:1px solid #a78a5e!important;border-radius:7px!important;padding:8px!important;margin-top:10px;background:#ece1c4!important;color:#342536!important;font:600 12px/1.4 'DM Sans',sans-serif!important}.coach-speech .mark-break-restart[hidden]{display:none!important}
.coach-quick-questions{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}.coach-quick-questions button{font-size:11px!important;padding:6px!important;min-height:32px}.coach-log p{white-space:pre-wrap;overflow-wrap:anywhere}.coach-log{max-height:330px;overflow:auto}
.chapter-recorder .recording-monitor-choice{display:flex;align-items:center;gap:8px}.chapter-recorder .recording-monitor-choice input{width:18px!important;margin:0!important}.chapter-recorder [data-delete],.chapter-recorder [data-delete-permanently]{border-color:#ba919d}
@media(pointer:coarse){#editorToolbar.toolbar-palette :is(button,select){min-height:44px;height:44px}#editorToolbar.toolbar-palette .toolbar-categories>button{min-height:40px;height:40px}}
#editorPane.desk-page-only #editorToolbar.toolbar-palette:not([data-active-section=create]) #pageInkTools{display:none!important}#editorPane.desk-page-only #editorToolbar.toolbar-palette #pageInkTools:not([hidden]){display:flex!important}#editorPane.desk-page-only #editorToolbar.toolbar-palette:not([data-active-section=create]) #pageInkTools:not([hidden]){display:none!important}
#editorToolbar.toolbar-palette .toolbar-categories>button{flex:1 1 0!important;min-width:0!important;padding:4px;font-size:10px;white-space:normal;line-height:1.15}
#editorPane.desk-page-only #editorToolbar.toolbar-palette .page-only-dock-tools .curtain-grip{width:24px!important;min-width:24px!important;padding:2px}#editorPane.desk-page-only #editorToolbar.toolbar-palette .page-only-dock-tools select{width:52px!important;min-width:0!important;max-width:52px!important}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) .page-only-tools-panel{height:auto;max-height:calc(100dvh - 16px);border-radius:0 12px 12px 0;box-shadow:0 6px 24px #10071977}
#editorPane.desk-page-only .page-only-tools[data-edge=right] .page-only-tools-panel{border-radius:12px 0 0 12px}
#editorPane.desk-page-only .page-only-tools:is([data-edge=left],[data-edge=right]) #editorToolbar{border-radius:inherit;max-height:calc(100dvh - 16px)!important}
#editorToolbar.toolbar-palette #highlightText,#editorToolbar.toolbar-palette #drawSketch,#editorToolbar.toolbar-palette #toolbarDeskGuide{font-size:12px!important;width:auto!important;min-width:0!important}#editorToolbar.toolbar-palette :is(#highlightText,#drawSketch,#toolbarDeskGuide)::before,#editorToolbar.toolbar-palette :is(#highlightText,#drawSketch,#toolbarDeskGuide)::after{content:none!important}
#editorToolbar.toolbar-palette :is(#writingFont,#textStyle){max-width:none!important}
/* Plain colour fallbacks also work in browsers without colour-mix support. */
#editorToolbar [data-tool-section=text]{--tool-face:#493452;--tool-edge:#9f7eb0}#editorToolbar [data-tool-section=create]{--tool-face:#29473f;--tool-edge:#7fa998}#editorToolbar [data-tool-section=desk]{--tool-face:#4d4031;--tool-edge:#af9874}
#editorToolbar button[data-tool-section],#editorToolbar select[data-tool-section],#editorToolbar [data-tool-section]>:is(button,select){background:var(--tool-face)!important;border-color:var(--tool-edge)!important;color:var(--desk-ink,#f2e5f8)}
#editorToolbar button[data-tool-section][aria-pressed=true],#editorToolbar [data-tool-section]>button[aria-pressed=true]{box-shadow:inset 0 -2px var(--tool-edge)}
.page-only-tools[hidden]{display:none!important}
#editorToolbar .page-ink-tools :is(button,select){background:#29473f!important;border-color:#7fa998!important;color:var(--desk-ink,#f2e5f8)}
/* Personal home dashboard: chapter state is account data; active time is local. */
.personal-writing-stats .personal-stat-grid{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:24px;align-items:center}.personal-stat{display:grid;gap:7px}.personal-stat>strong{font:2.5rem Georgia,serif}.personal-stat small,.personal-chapters span{color:var(--muted,#cbb7d6);font-size:.85rem}.writing-week{display:flex;gap:12px;height:112px;align-items:end;justify-content:space-evenly}.writing-week>div{display:grid;justify-items:center;align-items:end;gap:8px}.writing-week>div>span{width:18px;border-radius:4px 4px 0 0;background:#b68cc9}.personal-chapters{list-style:none;padding:0;display:grid;gap:16px}.personal-chapters li>div{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}.personal-chapters meter{width:100%;height:9px;accent-color:#b68cc9}.personal-badges{margin-top:22px}.personal-badges summary{cursor:pointer;font-weight:bold;padding:12px 0}.personal-badges .my-badges{padding:12px 0}.personal-badges h2{font-size:1.5rem}@media(max-width:680px){.personal-writing-stats .personal-stat-grid{grid-template-columns:1fr 1fr;gap:18px}.writing-week{grid-column:1/-1}.personal-chapters li>div{display:grid;gap:4px}.personal-writing-stats .section-head{align-items:start;gap:15px}}
/* Approved B: a single plum face, with common lavender outlines. */
#editorToolbar [data-tool-section=text],#editorToolbar [data-tool-section=create],#editorToolbar [data-tool-section=desk]{--tool-face:#392740;--tool-edge:#8d6ba0}
#editorToolbar .toolbar-categories button[data-tool-group],#editorToolbar .page-ink-tools :is(button,select){background:#392740!important;border-color:#8d6ba0!important;color:#f2e5f8}
#editorToolbar .tool-group,#editorToolbar .desk-preferences,#editorToolbar .toolbar-access,#editorToolbar .page-ink-tools{border-color:#816098!important}
#editorToolbar .toolbar-categories button[aria-pressed=true]{background:#594069!important;box-shadow:inset 0 0 0 1px #c2a4d5}
.narration-studio{border:1px solid #87619b;border-radius:10px;padding:14px;margin:20px 0}.narration-studio summary{cursor:pointer;font-weight:600}.narration-settings{display:flex;align-items:center;flex-wrap:wrap;gap:14px}.narration-settings label{display:flex;align-items:center;gap:8px}.narration-settings input[type=checkbox]{width:18px}.narration-studio audio{max-width:100%;width:100%;margin:12px 0}.narration-studio progress{width:100%}
.personal-chapters meter::-webkit-meter-bar{background:#382842;border:0}.personal-chapters meter::-webkit-meter-optimum-value{background:#b68cc9}.personal-chapters meter::-moz-meter-bar{background:#b68cc9}
.modal:has(.narration-studio){max-width:800px;width:calc(100vw - 32px)}.narration-studio .buttons{gap:8px}.narration-studio button{font-size:13px;min-height:40px}.narration-studio [hidden]{display:none!important}
.ink-colour-control{display:inline-flex;align-items:center}#inkColourButton{display:inline-flex!important;align-items:center;gap:5px}.ink-colour-palette{position:fixed;inset:auto;margin:0;width:240px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:12px;border:1px solid #a982be;border-radius:12px;background:#2b1d36;color:#f7edfb;box-shadow:0 10px 32px #10071999;z-index:5000}.ink-colour-palette.is-open{display:grid!important;gap:10px}.ink-colour-palette[hidden]{display:none!important}.ink-swatches{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.ink-swatches button{display:grid!important;place-items:center;min-width:0!important;min-height:42px!important;padding:5px!important;border:1px solid transparent!important;background:#392740!important}.ink-swatches button[aria-pressed=true]{border-color:#e5c9f7!important;box-shadow:0 0 0 1px #e5c9f7}.ink-colour-palette label{display:grid!important;gap:5px;font:12px system-ui}.ink-colour-palette input{width:100%;box-sizing:border-box;min-height:40px;padding:8px;border-radius:6px;border:1px solid #9975ab;background:#392740;color:#f7edfb}.ink-colour-palette svg{pointer-events:none}
/* Mark's speech may overlap a small screen, but its text must not steal tool taps. */
.coach-speech{pointer-events:none!important}.coach-speech :is(button,a,input){pointer-events:auto}
/* B's group outlines need real boxes: display:contents removed the old borders. */
#editorToolbar:not(.toolbar-palette) .tool-group{display:inline-flex!important;align-items:center;flex:0 0 auto;flex-wrap:nowrap;gap:4px;padding:3px;border:1px solid #87659b!important;border-radius:10px;background:#271c31}
#editorToolbar:not(.toolbar-palette) .toolbar-main,#editorToolbar:not(.toolbar-palette) .toolbar-secondary{display:contents!important}
#editorToolbar:not(.toolbar-palette){row-gap:6px!important;column-gap:7px!important}
#editorToolbar.toolbar-palette{border:1px solid #87659b!important;border-radius:10px}
#editorToolbar.toolbar-palette .toolbar-categories{border-color:#87659b;padding-bottom:7px;margin-bottom:2px}
/* A smaller visible YouTube viewport, with slim controls and precise sizing. */
.youtube-window-heading,.youtube-window-footer{min-height:36px;padding:2px;gap:2px}
.youtube-mini-player button,.youtube-mini-player select{min-height:32px;height:32px;padding:3px 6px;font-size:11px}
.youtube-window-heading #moveYoutube{min-width:0}.youtube-window-footer label{font-size:10px;gap:3px}.youtube-window-footer select{max-width:82px}.youtube-mini-player #resizeYoutube{min-width:32px}
.youtube-sizing{position:fixed;inset:auto;margin:0;width:240px;max-width:calc(100vw - 16px);box-sizing:border-box;max-height:calc(100dvh - 16px);overflow:auto;padding:14px;border:1px solid #a882be;border-radius:12px;background:#2b1d36;color:#f3e7f8;font:13px/1.4 'DM Sans',sans-serif;box-shadow:0 8px 28px #10071988;z-index:4300}.youtube-sizing.is-open{display:grid;gap:10px}.youtube-sizing label{display:flex;align-items:center;justify-content:space-between;gap:8px}.youtube-sizing input,.youtube-sizing select{width:120px;box-sizing:border-box;min-height:36px;background:#392740;color:inherit;border:1px solid #9673a9;border-radius:6px;padding:5px}.youtube-sizing p{font-size:11px;margin:0;color:#cfb9db}
body.desk-page-only-open #youtubeMiniPlayer{display:block;z-index:4130}body.desk-page-only-open #youtubeMiniPlayer[hidden]{display:none!important}
.ink-colour-palette{max-height:calc(100dvh - 16px);overflow:auto}.ink-spectrum{width:100%;height:auto;display:block;border-radius:7px;touch-action:none;cursor:crosshair;outline:1px solid #9673a9}.ink-spectrum:focus-visible{outline:2px solid #ecd1ff;outline-offset:2px}.ink-colour-palette .ink-hue-label{gap:5px}.ink-colour-palette input.ink-hue{appearance:none;-webkit-appearance:none;min-height:0;height:18px;padding:0;border:1px solid #a98abb;border-radius:9px;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);touch-action:none}.ink-hue::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:16px;height:24px;border:2px solid white;border-radius:5px;background:transparent;box-shadow:0 0 0 1px #2b1d36}.ink-hue::-moz-range-thumb{width:12px;height:20px;border:2px solid white;border-radius:5px;background:transparent}.ink-hue::-moz-range-track{background:transparent}
.ink-colour-palette svg.ink-spectrum{pointer-events:auto}
/* An unscaled glass control after the last sheet, reachable with Pencil or touch. */
.add-book-page-row{position:sticky;left:0;display:flex;justify-content:center;align-items:center;width:100%;padding:16px 0 22px;box-sizing:border-box;isolation:isolate}
.add-book-page-row .add-book-page{display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:0;border:1px solid #e3cff578;border-radius:50%;background:linear-gradient(145deg,#eadbf52b,#c39ed50d);color:#f3e8fa;box-shadow:inset 0 1px 0 #ffffff40,0 4px 16px #10071926;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);touch-action:manipulation;-webkit-user-select:none;user-select:none}
.add-book-page-row .add-book-page:hover{background:#b28bca40;border-color:#eee0ffb3}
.add-book-page-row .add-book-page:focus-visible{outline:2px solid #edc5ff;outline-offset:4px}
.add-book-page-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Pencil quick access: real controls, outside the paper's zoom and saved content. */
.stylus-quick-tools{position:fixed;z-index:4180;display:flex;align-items:center;gap:4px;max-width:calc(100vw - 16px);padding:5px;border:1px solid #e6d1ee77;border-radius:14px;background:linear-gradient(145deg,#796087b0,#35223fa6);color:#fff1ff;box-shadow:inset 0 1px 0 #ffffff30,0 6px 25px #10071940;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-sizing:border-box}
.stylus-quick-tools[hidden]{display:none!important}
.stylus-quick-tools>button,.stylus-quick-tools>select{flex:0 1 auto;box-sizing:border-box;min-height:38px;height:38px;min-width:32px;margin:0;padding:4px;border:1px solid #e4ceef33;border-radius:8px;background:#ffffff0c;color:#fff1ff;font-size:11px;line-height:1;touch-action:manipulation}
.stylus-quick-tools>.stylus-strip-grip{width:24px;min-width:24px;border:0;background:none;font-size:24px;cursor:grab;touch-action:none}
.stylus-quick-tools>.stylus-strip-grip:active{cursor:grabbing}
.stylus-quick-tools #inkTool{width:76px;max-width:76px}.stylus-quick-tools #inkTool option{background:#35223f;color:white}
.stylus-quick-tools :is(#inkUndo,#inkRedo,#inkDone,#inkColourButton){font-size:0;width:34px;min-width:34px}
.stylus-quick-tools #inkUndo::before{content:'↶';font-size:23px}.stylus-quick-tools #inkRedo::before{content:'↷';font-size:23px}.stylus-quick-tools #inkDone::before{content:'⌨';font-size:21px}
.stylus-quick-tools #inkWidthButton{width:54px;min-width:54px;white-space:nowrap}.stylus-quick-tools #inkColourButton svg{width:24px;height:24px;display:block}.stylus-quick-tools button:disabled{opacity:.35}.stylus-quick-tools button:focus-visible{outline:2px solid #ffdcf8;outline-offset:2px}
.book-page-actions{position:absolute;inset:0;z-index:6;pointer-events:none}
.book-page-actions .book-page-bin{position:absolute;right:12px;width:38px;height:38px;min-height:38px;display:grid;place-items:center;padding:0;border:1px solid #89708330;border-radius:10px;background:#fdf9ff40;color:#715a73aa;box-shadow:none;pointer-events:auto;touch-action:manipulation;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.book-page-actions .book-page-bin:hover{background:#c5afd166;color:#49324f}.book-page-actions .book-page-bin:focus-visible{outline:2px solid #81598f;outline-offset:2px}
.page-delete-notice{position:fixed;left:50%;bottom:82px;transform:translateX(-50%);z-index:4190;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:8px 12px;border-radius:12px;border:1px solid #c7a7d4;background:#35223fee;color:#fff0fa;font-size:13px;box-shadow:0 5px 24px #12091c55;backdrop-filter:blur(12px)}
.page-delete-notice[hidden]{display:none!important}.page-delete-notice button{min-height:36px;padding:4px 10px;font-size:13px}
[data-desk-theme=pink] #editorToolbar [data-tool-section]{--tool-face:var(--desk-panel);--tool-edge:var(--desk-accent)}
[data-desk-theme=pink] #editorToolbar:not(.toolbar-palette) .tool-group{background:#36202c;border-color:#bd7a9c!important}
[data-desk-theme=pink] .add-book-page{color:#ffe7f3;border-color:#e6a4c578}
.stylus-quick-tools{background:linear-gradient(145deg,color-mix(in srgb,var(--desk-panel,#796087) 75%,transparent),color-mix(in srgb,var(--desk-surface,#35223f) 75%,transparent))}
#pageInkTools>label:not(:has(select)){display:none}
.page-delete-confirm{width:min(360px,calc(100vw - 28px));box-sizing:border-box;padding:22px;border:1px solid #bc98cd;border-radius:16px;background:#2e2038;color:#f6e6fa;box-shadow:0 15px 80px #0c061a99;font:14px/1.5 'DM Sans',sans-serif}
.page-delete-confirm::backdrop{background:#140b20aa;backdrop-filter:blur(4px)}.page-delete-confirm h3{margin-top:0;font-size:21px}.page-delete-confirm .status{font-size:12px;color:#d5bbdf}.page-delete-confirm .buttons{gap:8px}.page-delete-confirm button{min-height:42px;font-size:13px}.page-delete-confirm [data-delete-confirm]{background:#74445c}
#pageInkTools>label:not(:has(select)){display:none!important}

/* Keep Shape next to the pen selector without wrapping the floating strip. */
.stylus-quick-tools #inkShape{width:76px;max-width:76px}.stylus-quick-tools #inkShape option{background:#35223f;color:white}
@media(max-width:430px){.stylus-quick-tools{gap:2px;padding:4px}.stylus-quick-tools #inkTool,.stylus-quick-tools #inkShape{min-width:32px}}

/* Page-only opt-out hides Mark's full footprint, while leaving notes available. */
body.desk-page-only-open.page-only-coach-hidden #deskFloatingTools>:is(#coachBubble,#coachFloatingTimer,#writingCoachPanel,.coach-speech,.mark-help-toggle){display:none!important}
.mark-sticker-visibility{position:fixed;z-index:6;display:grid;place-items:center;width:28px;height:28px;min-height:28px;margin:0;padding:4px;border:1px solid #dfc8e566;border-radius:50%;background:#32223b99;color:#faedff;box-shadow:0 1px 6px #12091d44;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:auto;touch-action:manipulation;opacity:.86}
.mark-sticker-visibility svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.mark-sticker-visibility:hover{opacity:1;background:#614571cc}.mark-sticker-visibility:focus-visible{outline:2px solid #efcbff;outline-offset:2px}.mark-sticker-visibility[hidden]{display:none!important}

/* Local portrait crop preview, above floating writing widgets. */
.portrait-crop-dialog{width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto;padding:20px;border:1px solid #a783b9;border-radius:18px;background:#281b32;color:#f2e5f8;box-shadow:0 20px 80px #0008}
.portrait-crop-dialog::backdrop{background:#110b1bcc;backdrop-filter:blur(4px)}
.portrait-crop-dialog header{position:static;display:flex;align-items:center;justify-content:space-between;gap:12px;background:none;border:0;padding:0;margin:0 0 10px}
.portrait-crop-dialog h2{font-size:26px;margin:0}.portrait-crop-dialog p{font-size:14px;margin:8px 0 14px;color:#d8c6e1}.portrait-crop-dialog .crop-close{font-size:24px;min-width:40px;padding:3px;background:transparent}
.portrait-crop-canvas{display:block;width:min(100%,36dvh);margin-inline:auto;height:auto;aspect-ratio:1;box-sizing:border-box;border:2px solid #d2b2e4;border-radius:50%;touch-action:none;cursor:grab;background:#17101e}.portrait-crop-canvas:active{cursor:grabbing}.portrait-crop-canvas:focus-visible{outline:3px solid #e6c8f5;outline-offset:3px}
.crop-zoom{display:flex;align-items:center;gap:12px;margin:18px 0 8px;font-size:14px}.crop-zoom input{flex:1;min-width:0;accent-color:#c09ad7}.crop-zoom output{min-width:44px;text-align:right;font-variant-numeric:tabular-nums}.crop-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}.portrait-crop-dialog .crop-actions button{padding:10px 13px;font-size:13px}.portrait-crop-dialog .crop-status:empty{display:none}
@media(max-height:650px){.portrait-crop-canvas{width:min(100%,30dvh);margin-inline:auto}.portrait-crop-dialog{padding:14px}.portrait-crop-dialog h2{font-size:22px}}

/* Private attachments share the writing page area without altering manuscript text. */
.document-view-switch{display:flex;gap:10px;align-items:center;margin:16px 0 10px}.document-view-switch[hidden]{display:none}.document-view-switch label{display:flex;gap:9px;align-items:center;font-size:13px}.document-view-switch select{width:min(340px,65vw);max-width:100%;font-size:13px;padding:8px}
.document-preview{min-width:0;max-width:100%;padding:16px;border:1px solid #735483;border-radius:12px;background:#1d1425}.document-preview[hidden]{display:none}.document-preview-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:13px}.document-preview-heading>strong{overflow-wrap:anywhere;max-width:100%}.document-preview-pagination{display:flex;align-items:center;gap:10px}.document-preview-pagination button,.document-preview-heading>button{font-size:12px;padding:7px 11px;min-height:36px}.document-preview-status,.document-preview-note{font-size:12px;color:#cbb4d6;line-height:1.6}.document-preview-status:empty{display:none}.document-preview-paper{width:min(100%,864px);margin:16px auto;min-width:0;overflow:hidden}.document-preview-paper>canvas{display:block;width:100%;height:auto;background:white;box-shadow:0 3px 20px #0004}.word-preview-stage{position:relative;max-width:100%;margin:auto;background:white;overflow:hidden}.auth-bot-check{margin:14px 0;min-height:65px;max-width:100%}
#editorPane.desk-page-only .document-view-switch{margin:8px 10px}#editorPane.desk-page-only .document-preview{border:0;border-radius:0;padding:10px}
@media(max-width:600px){.document-preview{padding:10px}.document-preview-heading{gap:8px}.document-preview-heading>strong{flex-basis:100%}.document-view-switch{padding-inline:4px}.document-preview-note{margin-bottom:0}}

.book-layout[hidden]{display:none!important}

#editorPane.desk-page-only .editor-card>.document-view-switch:not([hidden]){display:flex!important}#editorPane.desk-page-only .editor-card>.document-preview:not([hidden]){display:block!important}
.document-preview button{background:var(--desk-panel,#35223f);color:var(--desk-ink,#f2e5f8);border:1px solid var(--desk-accent,#9770aa);border-radius:8px}.document-preview button:disabled{opacity:.45;cursor:default}
