#comicStudioToolbar[hidden],#comicSidebar[hidden],#comicSpread[hidden]{display:none!important}
#comicPausedNotice[hidden]{display:none!important}
#comicPausedNotice{padding:6px;background:#fff1cd;border-left:4px solid #a77a22;font:12px/1.4 Arial,sans-serif}
#comicPausedNotice button{font-size:12px;min-height:30px;padding:4px 8px;margin-left:6px}
#comicStudioToolbar{font:12px/1.4 Arial,sans-serif;padding:5px 0}
.comic-toolbar-row{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:3px 0}
.comic-toolbar-row button,.comic-toolbar-row select{font:600 12px/1.3 Arial,sans-serif;min-height:31px;padding:5px 7px;width:auto}
.comic-toolbar-row button[aria-pressed=true]{background:#49347d;color:white;box-shadow:inset 0 0 0 2px #d2c2f7}
#comicSelectionLabel{margin-right:6px}
#comicStudioStatus{margin:4px 0;min-height:1.4em}
#comicClearArtwork,#comicRemoveFrame{margin-left:8px}
#comicSidebar{box-sizing:border-box;background:#f8f5ef;border:1px solid #d2cbd8;border-radius:7px;padding:8px;font:12px/1.4 Arial,sans-serif;overflow:auto;min-width:0;align-self:stretch;max-height:100%;scrollbar-width:auto}
#comicSidebar h3{font-size:13px;margin:5px 0}
#comicSidebar p{font-size:11px;margin:4px 0}
#comicSidebar button{font:600 11px/1.35 Arial,sans-serif;padding:5px 6px;min-height:30px;min-width:0;white-space:normal}
.comic-unplaced{padding:6px;background:#f1eaf7;border:1px dashed #9a86ad;border-radius:5px;margin-bottom:10px;min-height:70px}
.comic-scene-row{display:grid;grid-template-columns:24px minmax(0,1fr);gap:3px;margin:5px 0;padding:4px;border:1px solid #c5b9d0;background:white;border-radius:5px}
.comic-scene-row canvas{width:100%;height:60px;object-fit:contain;grid-column:2}
.comic-scene-row button:last-child{grid-column:2}
.comic-scene-row.picked{outline:3px solid #855bb3}
.comic-grip{cursor:grab;touch-action:none;min-width:24px!important;font-size:19px!important;padding:0!important;color:#53466a;background:#e8e3ef}
.comic-page-row{border:1px solid #c8c0d0;border-radius:5px;margin:5px 0;padding:4px;background:white}
.comic-page-row.selected{border:2px solid #6b4b94;background:#f4effa}
.comic-page-pick{display:flex;align-items:stretch;gap:4px}
.comic-page-label{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;background:#eee9f6;color:#30243e}
.comic-page-label canvas{width:70px;max-width:100%;height:90px;object-fit:contain;pointer-events:none}
.comic-layer-row{display:flex;gap:3px;padding:3px 2px;margin-top:3px;width:100%;box-sizing:border-box}
.comic-layer-row button:last-child{flex:1}
.comic-layer-row.selected{outline:2px solid #9670bf;background:#eee4f8}
.comic-page-actions{display:flex;flex-wrap:wrap;gap:4px;margin:7px 0}
.comic-page-actions #comicAddPage,.comic-page-actions #comicDeletePage{font-size:18px;font-weight:bold;min-width:34px}
.comic-layout-thumbs{display:grid;grid-template-columns:1fr 1fr;gap:4px;max-height:250px;overflow:auto;margin-top:5px}
.comic-layout-thumbs button{display:flex;flex-direction:column;align-items:center;gap:3px;background:white;color:#222;border:1px solid #aaa}
.comic-layout-thumbs img{width:100%;height:65px;object-fit:contain;pointer-events:none}
#studentPaint #canvasStage.comic-stage{display:block!important;overflow:auto!important;background:#d9d6d1!important;padding:12px!important;box-sizing:border-box;min-height:260px}
#comicSpread{display:flex;gap:12px;align-items:flex-start;justify-content:flex-start;width:max-content;margin:0 auto;min-height:100%}
.comic-sheet{flex:0 0 auto;position:relative}
.comic-page-content,.comic-empty-page{position:relative;width:100%;height:var(--comic-page-height);background:white;box-shadow:0 2px 7px #0003;isolation:isolate}
.comic-empty-page{font:600 16px Arial,sans-serif;color:#5b4aa8;cursor:pointer;border:2px dashed #b7a7ca}
.comic-wall-preview,.comic-frame-view,.comic-frame-preview,.comic-frame-hit,.comic-editor-clip{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;border:0;border-radius:0;box-sizing:border-box}
.comic-wall-preview{z-index:0;pointer-events:none}
.comic-frame-view{pointer-events:none}
.comic-frame-preview{pointer-events:none;z-index:1000;background:transparent!important}
.comic-frame-hit{overflow:visible;z-index:2000;pointer-events:none}
.comic-frame-hit polygon{fill:transparent;stroke:none;cursor:pointer;touch-action:none}
.comic-frame-view.selected .comic-frame-hit polygon{stroke:#8054a8;stroke-width:2}
.comic-frame-hit polygon.comic-drop-target{fill:#84b9ea88;stroke:#2869a2;stroke-width:4}
.comic-editor-clip{pointer-events:none;overflow:hidden;z-index:1}
.comic-wall-editor{z-index:1}
#studentPaint.comic-studio-open #canvasWrap{border-radius:0!important;background:transparent!important;min-width:0!important;min-height:0!important;flex:none!important}
#studentPaint.comic-studio-open #canvasWrap #paint{border-radius:0!important}
.comic-bottom-label{display:block;width:100%;text-align:center;border-radius:0 0 5px 5px;font:600 12px Arial,sans-serif;min-height:28px;padding:4px;margin-top:3px;background:#eee8f5;color:#352644}
.comic-bottom-label.selected{background:#5b4aa8;color:white}
#comicCornerHandles{position:absolute;inset:0;z-index:100000;pointer-events:none}
.comic-corner{position:absolute;width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;padding:0!important;background:#2872be;border:2px solid white;border-radius:50%;box-shadow:0 0 0 1px #183e7c;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;cursor:move}
#comicDragGhost{position:fixed;z-index:1000000;pointer-events:none;padding:9px 12px;border-radius:6px;background:#513e83ee;color:white;box-shadow:0 3px 10px #0005;font:600 13px Arial,sans-serif}
.comic-drop-before{border-top:4px solid #8353bd!important}
.comic-drop-after{border-bottom:4px solid #8353bd!important}
.comic-dialog{box-sizing:border-box;width:min(94vw,600px);max-height:90dvh;overflow:auto;background:#fffdf8;border:3px solid #6c4a94;border-radius:10px;padding:20px;color:#30243c;font:15px/1.45 Arial,sans-serif}
.comic-dialog::backdrop{background:#23193299}
.comic-dialog h2{font-size:20px;margin:0 0 15px}
.comic-dialog>button{padding:10px 14px;min-height:42px;margin:5px;font:600 14px Arial,sans-serif}
.comic-layout-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.comic-layout-picker button{padding:5px;background:white;border:2px solid #bbb;border-radius:6px;color:#24202a;display:flex;flex-direction:column;align-items:center;gap:5px}
.comic-layout-picker img{width:100%;height:120px;object-fit:contain;pointer-events:none}
.comic-frames-inactive{opacity:.5}
@media(min-width:1001px){#studentPaint.comic-studio-open #paintSidebar{min-width:0!important;max-width:none!important;width:100%!important}#studentPaint.panel.comic-studio-open{height:auto!important;grid-template-rows:auto min(560px,100dvh - 120px)!important;grid-template-columns:242px 174px minmax(0,1fr) 94px 205px!important}#studentPaint.comic-studio-open #comicSidebar{grid-column:5!important;grid-row:2!important}#studentPaint.comic-studio-open #canvasStage{grid-column:3!important;grid-row:2!important}#studentPaint.comic-studio-open #paintActions{grid-column:4!important;grid-row:2!important}}
@media(max-width:1000px){#studentPaint.comic-studio-open #comicSidebar{grid-column:1/-1!important;grid-row:7!important;height:340px;max-height:340px}#comicPageRows{display:flex;align-items:flex-start;gap:5px;overflow:auto}.comic-page-row{min-width:145px}.comic-layout-thumbs{grid-template-columns:repeat(4,minmax(0,1fr))}#comicUnplaced{max-height:150px;overflow:auto}.comic-toolbar-row button,.comic-toolbar-row select{min-height:35px}.comic-layout-picker{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Keep the book readable on smaller laptops, with tools and colors stacked at left. */
@media(min-width:1001px) and (max-width:1199px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:242px minmax(0,1fr) 86px 180px!important;grid-template-rows:auto 260px 300px!important}
 #studentPaint.comic-studio-open #paintSidebar{grid-column:1!important;grid-row:2!important;min-width:0!important;max-width:none!important;height:260px!important;max-height:260px!important}
 #studentPaint.comic-studio-open #paintInspectorScrollBox{grid-column:1!important;grid-row:3!important;height:300px!important;max-height:300px!important;--paint-column-room:300px}
 #studentPaint.comic-studio-open #paintInspectorScrollBox>#paintInspector{height:100%!important;max-height:100%!important;overflow-y:auto!important}
 #studentPaint.comic-studio-open #canvasStage{grid-column:2!important;grid-row:2/4!important}
 #studentPaint.comic-studio-open #paintActions{grid-column:3!important;grid-row:2/4!important}
 #studentPaint.comic-studio-open #comicSidebar{grid-column:4!important;grid-row:2/4!important}
}

@media(max-width:600px) and (orientation:portrait){#studentPaint.comic-studio-open #canvasStage.comic-stage{min-height:min(560px,70dvh)!important}}

@media(orientation:landscape) and (max-width:1000px) and (max-height:600px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:minmax(0,1fr) 242px!important;grid-template-rows:auto max(260px,100dvh - 40px) auto auto auto auto auto!important}
 #studentPaint.comic-studio-open #canvasStage.comic-stage{height:max(260px,100dvh - 40px)!important;min-height:260px!important}
 #studentPaint.comic-studio-open #paintSidebar{width:242px!important;min-width:242px!important;max-width:242px!important}
}


/* v188: book-first workspace, persistent Select/Move and grouped controls. */
#studentPaint.panel.comic-studio-open{position:fixed!important;inset:0!important;z-index:5000;margin:0!important;border:0!important;border-radius:0!important;box-sizing:border-box!important;width:100vw!important;max-width:none!important;height:100dvh!important;min-height:0!important;padding:8px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 152px!important;grid-template-rows:auto minmax(0,1fr)!important;gap:6px!important;overflow:hidden!important;background:#fbf9f5}
body:has(#studentPaint.comic-studio-open:not(.hidden)){overflow:hidden}
body:has(#studentPaint.comic-studio-open:not(.hidden)) #pageScrollRail{display:none!important}
#studentPaint.comic-studio-open #paintWorkspaceHeading{grid-column:1/-1!important;grid-row:1!important;display:block!important;min-width:0}
#studentPaint.comic-studio-open #paintWorkspaceHeading>:not(#comicStudioToolbar):not(#comicDialogueControls){display:none!important}
#studentPaint.comic-studio-open #paintActions,#studentPaint.comic-studio-open #mobilePaintBar{display:none!important}
#studentPaint.comic-studio-open #canvasStage.comic-stage{grid-column:1!important;grid-row:2!important;min-height:0!important;height:100%!important;max-height:none!important;overflow:auto!important;padding:12px!important;align-self:stretch!important}
#studentPaint.comic-studio-open #comicSidebar{grid-column:2!important;grid-row:2!important;min-height:0!important;max-height:100%!important;height:100%!important;overflow:auto!important;padding:5px!important;border-radius:7px;font-size:11px}
#comicStudioToolbar{padding:0!important;font:12px/1.35 Arial,sans-serif}
#comicStudioToolbar .comic-toolbar-row{gap:5px;margin:0 0 5px}
#comicStudioToolbar .comic-main-row{align-items:center}
#comicStudioToolbar button,#comicStudioToolbar select,#comicStudioToolbar summary{font:600 12px/1.3 Arial,sans-serif;min-height:34px;padding:6px 9px;white-space:normal;box-sizing:border-box}
#comicSelectMode{background:#f1eafd;color:#38215e;border:2px solid #6e4b9c;font-size:14px!important;min-height:40px!important;min-width:142px}
#comicSelectMode[aria-pressed=true]{background:#5d398c!important;color:#fff!important;box-shadow:inset 0 0 0 1px white}
#comicDrawMode[aria-pressed=true]{background:#5d398c;color:white}
#comicSelectMode:focus-visible,#comicStudioToolbar :focus-visible{outline:3px solid #c18d13;outline-offset:2px}
#comicFileActions,#comicUndoActions{display:flex;gap:5px;align-items:center}
#comicFileActions{margin-left:auto}
#comicFileActions button{width:auto!important;min-width:96px!important;min-height:40px!important;margin:0!important;font-size:12px!important;padding:5px 9px!important}
#comicFileActions small{display:none}
#comicStudioToolbar #paintUndoControls{display:flex!important;gap:3px!important;width:auto!important;margin:0!important}
#comicStudioToolbar #paintUndoControls button{width:auto!important;min-width:44px!important;min-height:32px!important;padding:4px 6px!important;font-size:11px!important}
#comicCloseStudio{background:#f1e9e3;color:#4f2923;border:1px solid #95695c;min-height:40px!important}
#comicModeHint{font-size:11px;color:#493b57;margin:0 0 3px}
#comicZoomLabel{min-width:35px;text-align:center}
#comicSelectionLabel{margin-left:auto;font-size:11px}
.comic-menu{position:relative;flex:none}
.comic-menu>summary{display:flex;align-items:center;gap:8px;cursor:pointer;color:#30243e;border:1px solid #b7a8c8;background:#f5f0fa;border-radius:6px;list-style:none}
.comic-menu>summary::after{content:'▾';font-size:10px}
.comic-menu[open]>summary{background:#e6dbf3}
.comic-menu-body{position:absolute;z-index:100000;top:calc(100% + 5px);left:0;width:min(300px,90vw);max-height:min(65dvh,520px);overflow:auto;padding:10px;box-sizing:border-box;background:#fffdf9;border:1px solid #a28eb9;border-radius:8px;box-shadow:0 6px 22px #0003;display:flex;flex-direction:column;gap:7px}
.comic-menu-body>button{width:100%;text-align:left}
#comicLayoutOptions>button{width:100%}
#comicBookMenu .comic-menu-body{width:min(360px,90vw)}
#comicCoverDetails{padding:6px!important;display:flex;flex-direction:column;align-items:stretch}
#comicCoverDetails label{display:flex;flex-direction:column;align-items:stretch}
#comicCoverDetails input{width:100%!important;min-width:0!important;box-sizing:border-box}
#comicSidebar button{min-height:28px;font-size:10px;padding:4px}
#comicSidebar .comic-page-label{flex-direction:row;justify-content:flex-start;gap:5px;text-align:left;font-size:11px}
#comicSidebar .comic-page-label canvas{width:34px;height:47px;flex:none}
#comicSidebar .comic-page-pick .comic-grip{min-width:22px!important;width:22px;font-size:16px!important}
#comicSidebar .comic-page-row{padding:3px;margin:4px 0}
#comicSidebar .comic-layer-row{padding:2px;margin-top:2px}
#comicSidebar .comic-layer-row button{font-size:10px;min-height:26px}
#comicSidebar .comic-page-actions{gap:3px;margin:5px 0}
#comicSidebar .comic-page-actions button{min-width:0;flex:1}
#comicSidebar .comic-unplaced{padding:4px;min-height:0;margin-bottom:6px}
#comicSidebar .comic-tray-empty p{display:none}
#comicSidebar .comic-tray-empty h3{font-size:10px;margin:2px}
#comicContextControls .comic-lock-row{display:flex;flex-wrap:wrap;gap:3px}
#comicContextControls .comic-lock-row button{flex:1;min-width:55px}
#comicSelectionOptions{margin:5px 0}
#comicSelectionOptions>summary{cursor:pointer;font-weight:bold;padding:6px 0}
.comic-context-options{display:flex;flex-wrap:wrap;gap:4px;padding:5px 0}
.comic-context-options button,.comic-context-options select{max-width:100%;width:100%;font-size:11px;min-height:30px}
#comicAnimationHint{font-size:10px!important;color:#62546d;margin:4px 0}
#comicStudioStatus{font-size:10px!important;margin:4px 0;overflow-wrap:anywhere}
#comicToolDock[hidden]{display:none!important}
#comicToolDock{grid-column:1!important;grid-row:2!important;min-width:0;min-height:0;overflow:auto;box-sizing:border-box;background:#f7f3ee;border:1px solid #cbbdd6;border-radius:7px;padding:5px;z-index:3}
.comic-tool-dock-head{display:flex;align-items:center;justify-content:space-between;gap:4px;font:bold 12px Arial,sans-serif;margin-bottom:5px;position:sticky;top:0;z-index:4;background:#f7f3ee}
.comic-tool-dock-head button{font-size:11px;min-height:32px;padding:5px}
#studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:280px minmax(0,1fr) 152px!important}
#studentPaint.comic-studio-open.comic-tools-open #canvasStage.comic-stage{grid-column:2!important}
#studentPaint.comic-studio-open.comic-tools-open #comicSidebar{grid-column:3!important}
#studentPaint.comic-studio-open #comicToolDock #paintSidebar{display:block!important;position:static!important;width:100%!important;min-width:0!important;max-width:none!important;height:285px!important;min-height:0!important;max-height:285px!important;margin:0 0 6px!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox{position:static!important;display:grid!important;width:100%!important;height:430px!important;max-height:430px!important;--paint-column-room:430px;grid-template-columns:minmax(0,1fr) 20px!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspector{height:100%!important;max-height:100%!important;overflow:auto!important}
#studentPaint.comic-studio-open #comicCreationLauncher{display:none!important}
#studentPaint.comic-studio-open #comicToolDock #paintCategoryLayout{height:100%}
@media(max-width:900px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:minmax(0,1fr) 132px!important;padding:5px!important;gap:4px!important}
 #studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:minmax(0,1fr) 132px!important}
 #studentPaint.comic-studio-open.comic-tools-open #canvasStage.comic-stage{grid-column:1!important}
 #studentPaint.comic-studio-open.comic-tools-open #comicSidebar{grid-column:2!important}
 #studentPaint.comic-studio-open #comicToolDock{position:absolute;left:5px;top:var(--comic-header-height,140px);bottom:5px;width:min(280px,80vw);height:auto;z-index:1000;box-shadow:4px 0 15px #0004}
 #comicStudioToolbar .comic-main-row{gap:4px}
 #comicSelectMode{min-width:125px;font-size:13px!important}
 #comicStudioToolbar button,#comicStudioToolbar summary{padding:5px 7px;font-size:11px}
 #comicFileActions{margin-left:0}
 #comicFileActions button{min-width:80px!important}
 #comicModeHint{font-size:10px}
 #comicSidebar .comic-page-label canvas{width:26px;height:38px}
}
@media(max-width:600px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:minmax(0,1fr) 98px!important}
 #studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:minmax(0,1fr) 98px!important}
 #comicSidebar .comic-page-label{flex-direction:column;font-size:10px}
 #comicSidebar .comic-page-label canvas{width:24px;height:34px}
 #comicStudioToolbar .comic-view-row{gap:3px}
 #comicPageView{display:none}
 #comicSelectionLabel{display:none}
 #comicModeHint{max-height:2.7em;overflow:auto}
 #comicSidebar .comic-lock-row{flex-direction:column}
 .comic-menu-body{position:fixed;top:110px;left:8px;max-width:calc(100vw - 16px)}
}

#comicSidebar .comic-page-actions #comicAddPage,#comicSidebar .comic-page-actions #comicDeletePage{flex:0 0 29px;min-width:29px}
#comicSidebar .comic-page-actions #comicDuplicatePage{flex:1 1 52px}
#comicSidebar .comic-page-actions #comicPageEarlier,#comicSidebar .comic-page-actions #comicPageLater{flex:1 1 calc(50% - 3px)}
#studentPaint.comic-studio-open #canvasWrap{pointer-events:auto!important}

#studentPaint.panel.comic-studio-open.hidden{display:none!important}
#comicSubmissionActions{display:flex;gap:3px;align-items:center}
#comicSubmissionActions .hidden{display:none!important}
#comicActivityInfo .class-activity-guide{padding:6px;margin:0;font-size:11px}
#comicActivityInfo .class-activity-guide p{font-size:11px}

/* v190: direct scene sizing, frame geometry tools and compact help. */
#comicEditTools[hidden],#comicFrameTools[hidden],#comicArtworkTools[hidden],#comicPointTools[hidden]{display:none!important}
#comicEditTools{padding:3px 0;border-top:1px solid #ddd3e6}
#comicEditTools>span,#comicPointTools{display:inline-flex;gap:4px;flex-wrap:wrap;align-items:center}
#comicEditTools button[aria-pressed=true]{background:#5d398c;color:white}
#comicCornerHandles .comic-transform-outline{position:absolute;border:1px dashed #2864ad;box-sizing:border-box;pointer-events:none}
#comicCornerHandles .comic-art-outline{border-color:#9b4c15}
.comic-transform-handle,.comic-point-add{position:absolute;width:15px!important;height:15px!important;min-width:15px!important;min-height:15px!important;padding:0!important;transform:translate(-50%,-50%);border:2px solid white!important;box-shadow:0 0 0 1px #235589;pointer-events:auto;touch-action:none;background:#2872be!important;border-radius:2px!important;cursor:nwse-resize;z-index:2}
.comic-art-handle{background:#ac5922!important;box-shadow:0 0 0 1px #844016}
.comic-point-add{width:21px!important;height:21px!important;min-width:21px!important;min-height:21px!important;border-radius:50%!important;background:#34734c!important;color:white!important;font:bold 15px/17px Arial!important;cursor:copy}
.comic-point-selected{box-shadow:0 0 0 3px #e2a323}
#comicStudioToolbar .comic-help{position:relative;margin:0 0 0 4px}
#comicStudioToolbar .comic-help>summary{width:23px;height:23px;min-height:23px;padding:0;border:0;border-radius:50%;background:#5b4aa8;color:white;display:flex;justify-content:center;align-items:center;font:bold 13px Arial;cursor:pointer}
.comic-help-body{position:absolute;z-index:100001;top:30px;right:0;width:min(320px,85vw);max-height:55dvh;overflow:auto;background:#fffdf9;border:1px solid #b7a8c8;border-radius:7px;padding:10px;box-shadow:0 5px 20px #0003;font:12px/1.45 Arial;color:#372d42}
#comicModeHint,#comicAnimationHint{font:12px/1.45 Arial!important;margin:0 0 8px!important;max-height:none!important}
#comicStudioStatus:empty{display:none}
#comicResizeScene{flex:1 0 100%!important}
#studentPaint.comic-studio-open #comicToolDock{display:flex;flex-direction:column;gap:5px;overflow:hidden}
#studentPaint.comic-studio-open #comicToolDock[hidden]{display:none!important}
#comicToolDock .comic-tool-dock-head{flex:none;margin:0}
#comicToolBrushes{flex:0 1 260px;min-height:110px;overflow:hidden}
#comicToolProperties{flex:1 1 300px;min-height:100px;overflow:hidden}
#studentPaint.comic-studio-open #comicToolDock #paintSidebar{height:100%!important;max-height:100%!important;margin:0!important;--paint-column-room:100%!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox{height:100%!important;max-height:100%!important;--paint-column-room:100%!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspector{height:100%!important;max-height:100%!important;overflow:auto!important;overscroll-behavior:contain;padding-bottom:24px!important;scroll-padding-bottom:24px}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox>.visible-scroll-rail{height:100%;min-height:0}
#studentPaint.panel.painter-maximized:not(.comic-studio-open):not(.hidden){position:fixed!important;inset:0!important;z-index:4900;box-sizing:border-box;margin:0!important;border:0!important;border-radius:0!important;padding:8px!important;width:100vw!important;max-width:none!important;height:100dvh!important;min-height:0!important;grid-template-rows:auto minmax(0,1fr)!important;overflow:hidden!important}
body:has(#studentView:not(.hidden) #studentPaint.painter-maximized:not(.hidden)){overflow:hidden}
body:has(#studentView:not(.hidden) #studentPaint.painter-maximized:not(.hidden)) #pageScrollRail{display:none!important}
#studentPaint.painter-maximized:not(.comic-studio-open) #canvasStage{height:100%!important;min-height:0!important;max-height:none!important;grid-row:2!important}
#painterExitMaximized{float:right;font-size:12px;min-height:30px;margin-left:5px}
@media(max-width:600px),(max-height:550px){#studentPaint.panel.painter-maximized:not(.comic-studio-open):not(.hidden){overflow:auto!important;grid-template-rows:auto minmax(200px,55dvh) auto auto auto!important}#studentPaint.painter-maximized:not(.comic-studio-open) #canvasStage{grid-column:1/-1!important;grid-row:2!important}}
#comicSidebar .comic-delete-actions{display:flex;gap:3px;margin:5px 0}
#comicSidebar .comic-delete-actions button{flex:1;min-width:0;font-size:10px;white-space:normal}
#comicSidebar .comic-unplaced details[open] p{display:block}

@media(max-width:600px){.comic-help-body{position:fixed;left:8px;right:auto;top:100px;width:calc(100vw - 16px);max-height:55dvh}}

#studentPaint.painter-maximized:not(.comic-studio-open) #canvasStage{overflow:auto!important;isolation:isolate;min-width:0!important}

/* v191 review: restore full-screen Painter's side-by-side category/inspector model. */
#studentPaint.panel.comic-studio-open{
 grid-template-columns: minmax(0,1fr) 172px!important;
 grid-template-rows:auto minmax(0,1fr) 39px!important;
}
#studentPaint.comic-studio-open.comic-tools-open{
 grid-template-columns: minmax(0,336px) minmax(0,1fr) 172px!important;
}
#studentPaint.comic-studio-open #canvasStage.comic-stage{grid-row:2!important;grid-column:1!important}
#studentPaint.comic-studio-open.comic-tools-open #canvasStage.comic-stage{grid-column:2!important}
#studentPaint.comic-studio-open #comicSidebar{grid-column:2!important;grid-row:2/4!important;
 overflow-y:auto!important;overscroll-behavior:contain;padding:0 5px 5px!important}
#studentPaint.comic-studio-open.comic-tools-open #comicSidebar{grid-column:3!important}
#comicSidebarHeader{position:sticky;top:0;z-index:6;display:flex;flex-direction:column;gap:4px;
 padding:5px 0 7px;background:#fbf9f5;border-bottom:1px solid #d6ccdc}
#comicFileActions{display:flex;flex-direction:column;gap:4px;width:100%;margin:0!important}
#comicFileActions button{width:100%!important;min-width:0!important;min-height:32px!important;font-size:10px!important;
 padding:5px 3px!important;white-space:normal!important}
#comicEditingTarget{font:10px/1.35 Arial,sans-serif;color:#594e66;overflow-wrap:anywhere}
#comicPageNavigation{display:none;grid-row:3;grid-column:1;align-items:center;justify-content:center;
 gap:10px;padding:3px;min-height:0;border:1px solid #ded6e6;border-radius:6px;background:#f7f2fc}
#studentPaint.comic-studio-open #comicPageNavigation{display:flex}
#studentPaint.comic-studio-open.comic-tools-open #comicPageNavigation{grid-column:2}
#comicPageNavigation button{font:700 15px Arial,sans-serif;width:42px;min-height:29px;padding:3px;
 background:#5d5075;color:white;border:0;border-radius:6px}
#comicPageNavLabel{font:700 11px Arial,sans-serif;text-align:center;min-width:85px}
#comicToolDock{display:grid!important;grid-template-columns:160px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);
 gap:6px;grid-row:2/4!important;grid-column:1!important;overflow:hidden!important;min-height:0;padding:5px!important}
#comicToolDock[hidden]{display:none!important}
#comicToolDock .comic-tool-dock-head{grid-column:1/-1;grid-row:1;display:flex;flex-wrap:wrap;
 align-items:center;position:relative;gap:5px;min-height:0;margin:0!important}
#comicUndoActions{order:3;flex:1 1 100%;display:flex!important;gap:4px}
#comicUndoActions #paintUndoControls{display:flex!important;width:100%!important;gap:4px!important;margin:0!important}
#comicUndoActions #paintUndoControls button{flex:1 1 0;width:auto!important;min-height:30px!important;font-size:11px!important}
#comicToolBrushes,#comicToolProperties{min-height:0!important;max-height:none!important;overflow:hidden!important;flex:none!important}
#comicToolBrushes{grid-column:1;grid-row:2}
#comicToolProperties{grid-column:2;grid-row:2}
#studentPaint.comic-studio-open #comicToolDock #paintSidebar{
 display:block!important;width:100%!important;min-width:0!important;max-width:none!important;
 height:100%!important;max-height:100%!important;min-height:0!important;margin:0!important;
 overflow:hidden!important}
#studentPaint.comic-studio-open #comicToolDock #paintToolScroll{overflow-y:auto!important;height:100%!important;
 max-height:100%!important;overscroll-behavior:contain}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox{
 display:grid!important;grid-template-columns:minmax(0,1fr) 18px!important;
 width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspector{
 width:100%!important;height:100%!important;min-height:0!important;
 max-height:100%!important;overflow-y:auto!important;overscroll-behavior:contain;
 padding-bottom:14px!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox>.visible-scroll-rail{height:100%!important}
#comicSelectMode,#comicDrawMode,#comicSceneMode,#comicFrameMode,#comicArtworkMode{display:none!important}
#comicEditTools{display:flex;flex-direction:column;gap:4px;width:100%;box-sizing:border-box}
#comicEditTools[hidden]{display:none!important}
#comicEditTools>span,#comicPointTools{display:flex;flex-direction:column;width:100%;align-items:stretch;gap:4px}
#comicSelectionOptions #comicStopTransform{width:100%;background:#6958a9;color:white}
#comicSelectionOptions .comic-context-options{display:flex;flex-direction:column;gap:5px;padding:5px 0}
#comicSelectionOptions .comic-delete-actions{display:flex;gap:4px}
#comicSidebar .comic-layer-row{display:flex;gap:2px;align-items:center;width:100%;padding:2px 0}
#comicSidebar .comic-layer-row .comic-layer-name{flex:1 1 auto;min-width:35px;line-height:1.2;text-align:left}
#comicSidebar .comic-layer-row .comic-layer-lock{flex:0 0 23px;min-width:23px!important;font-size:12px!important;padding:2px!important}
#comicSidebar .comic-layer-row .comic-layer-minus{flex:0 0 20px;min-width:20px!important;font-size:15px!important;padding:2px!important;background:#f3e9e6;color:#7a3d31}
#comicSidebar .comic-page-actions #comicAddPage{flex:2 1 74px;font-size:10px;min-width:65px!important}
#comicSidebar .comic-page-actions #comicDeletePage{flex:1 1 56px;font-size:10px;min-width:52px!important}
.comic-select-layout{position:absolute;z-index:2500;top:46%;left:50%;transform:translate(-50%,-50%);
 width:min(80%,170px);font:700 15px Arial,sans-serif;min-height:48px;
 background:#6651a5;color:white;border:2px solid #fff;border-radius:8px;box-shadow:0 3px 12px #0003}
.comic-select-layout:focus-visible{outline:3px solid #c18d13;outline-offset:3px}
@media(max-width:900px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:minmax(0,1fr) 132px!important;
  grid-template-rows:auto minmax(0,1fr) 36px!important}
 #studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:minmax(0,1fr) 132px!important}
 #studentPaint.comic-studio-open.comic-tools-open #canvasStage.comic-stage{grid-column:1!important}
 #studentPaint.comic-studio-open.comic-tools-open #comicSidebar{grid-column:2!important}
 #studentPaint.comic-studio-open #comicPageNavigation{grid-column:1!important}
 #studentPaint.comic-studio-open #comicToolDock{position:absolute;left:5px;top:var(--comic-header-height,90px);
  bottom:42px;height:auto;width:min(335px,89vw);grid-template-columns:minmax(125px,1fr) minmax(125px,1fr);
  z-index:1000;box-shadow:3px 0 12px #0003}
 #comicStudioToolbar button,#comicStudioToolbar summary{min-height:30px;padding:4px 6px}
}
@media(max-width:600px){
 #studentPaint.panel.comic-studio-open{grid-template-columns:minmax(0,1fr) 96px!important}
 #studentPaint.comic-studio-open #comicToolDock{width:min(290px,94vw);grid-template-columns:minmax(122px,1fr) minmax(122px,1fr)}
 #comicSidebarHeader{gap:3px}
 #comicFileActions button{min-height:29px!important}
}

/* Override the v190 flex dock at equal CSS specificity. */
#studentPaint.comic-studio-open #comicToolDock{display:grid!important;grid-template-columns:160px minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important}
@media(max-width:900px){#studentPaint.comic-studio-open #comicToolDock{grid-template-columns:minmax(125px,1fr) minmax(125px,1fr)!important}}
@media(max-width:600px){#studentPaint.comic-studio-open #comicToolDock{grid-template-columns:minmax(122px,1fr) minmax(122px,1fr)!important}}

/* v192: mobile landscape controls must occupy their own rows, never overlap. */
@media(orientation:landscape) and (max-width:1000px) and (max-height:600px){
 #studentPaint.panel.painter-maximized:not(.comic-studio-open):not(.hidden){grid-template-columns:minmax(0,1fr) 204px!important;grid-template-rows:auto minmax(200px,55dvh) auto max-content 320px!important}
 #studentPaint.painter-maximized:not(.comic-studio-open) #canvasStage{grid-column:1!important;grid-row:2!important}
 #studentPaint.painter-maximized:not(.comic-studio-open) #paintSidebar{grid-column:2!important;grid-row:2!important;height:100%!important;max-height:100%!important}
 #studentPaint.painter-maximized:not(.comic-studio-open) #mobilePaintBar{grid-row:3!important}
 #studentPaint.painter-maximized:not(.comic-studio-open) #paintActions{grid-row:4!important}
 #studentPaint.painter-maximized:not(.comic-studio-open) #paintInspectorScrollBox{grid-row:5!important}
}

#comicDrawPrompt{font:11px/1.3 Arial,sans-serif;color:#514763;white-space:nowrap;margin-left:4px}

/* v193: give both tools and helpers usable widths on larger workspaces. */
@media(min-width:1101px){
 #studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:460px minmax(0,1fr) 172px!important}
 #studentPaint.comic-studio-open #comicToolDock{grid-template-columns:220px minmax(200px,1fr)!important}
}
@media(min-width:901px) and (max-width:1100px){
 #studentPaint.comic-studio-open.comic-tools-open{grid-template-columns:420px minmax(0,1fr) 152px!important}
 #studentPaint.comic-studio-open #comicToolDock{grid-template-columns:200px minmax(180px,1fr)!important}
}
@media(max-width:900px){#studentPaint.comic-studio-open #comicToolDock{width:min(460px,94vw)!important;grid-template-columns:minmax(160px,1fr) minmax(180px,1fr)!important}}
#comicRotateNotice{font:11px Arial,sans-serif;background:#fff0b5;border-radius:4px;padding:3px}
#comicRotateNotice[hidden]{display:none!important}
#comicBubbleTypeControls{margin:0 0 0 5px}

#comicFrameLock,#comicEditFrameLock{display:none!important}
.comic-frame-corner-lock{position:absolute;z-index:5500;pointer-events:auto;width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important;padding:1px!important;display:flex;align-items:center;justify-content:center;border-radius:5px;border:1px solid #9b8bb5;background:white;color:#57417d;box-shadow:0 1px 3px #0002}
.comic-frame-corner-lock.locked{background:#fff1be}
.comic-frame-corner-lock:focus-visible{outline:3px solid #6a50b8;outline-offset:2px}
#comicSidebar .comic-page-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
#comicSidebar .comic-page-actions button{width:100%;min-width:0!important;white-space:normal;font-size:10px}
#comicSidebar .comic-page-actions .comic-delete-page{grid-column:1/-1}

#comicUndoActions:empty{display:none!important}
#studentPaint.comic-studio-open #paintInspector #paintUndoControls{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:4px!important;margin:0!important;flex:none}
#studentPaint.comic-studio-open #paintInspector #paintUndoControls button{min-width:0!important;min-height:30px!important;font-size:10px!important;padding:4px!important}
#comicToolDock .comic-tool-dock-head{gap:4px}

/* One complete helper scroller in Comic mode; no squeezed nested settings area. */
#studentPaint.comic-studio-open #comicToolDock #paintInspector{display:flex!important;flex-direction:column;overflow-y:auto!important;overflow-x:hidden!important;min-height:0!important;scroll-padding-bottom:18px}
#studentPaint.comic-studio-open #paintInspector>:not([hidden]){flex-shrink:0!important}
#studentPaint.comic-studio-open #paintInspector #paintControlArea{flex:none!important;height:auto!important;max-height:none!important;overflow:visible!important}
#studentPaint.comic-studio-open #paintInspector #paintControlScroll{height:auto!important;max-height:none!important;overflow:visible!important;flex:none!important}
#studentPaint.comic-studio-open #paintInspector #paintColorsPanel{height:auto!important;max-height:none!important;overflow:visible!important;flex:none!important}
#studentPaint.comic-studio-open #paintInspector #paintUndoControls{position:sticky!important;top:0;z-index:150;background:#fffdf9;padding:2px 0!important}
#studentPaint.comic-studio-open #paintCategoryLayout{min-height:0!important;height:100%!important}
#studentPaint.comic-studio-open #paintCategoryContent,#studentPaint.comic-studio-open #paintCategoryRail{overflow-y:auto!important;min-height:0!important;overscroll-behavior:contain;scroll-padding-bottom:12px}

/* v194: inspector, tool list and book sidebar have independent reachable scroll. */
#studentPaint.comic-studio-open{min-height:0!important;max-height:calc(100dvh - 95px)!important}
#studentPaint.comic-studio-open #comicToolDock{min-height:0!important;max-height:100%!important}
#studentPaint.comic-studio-open #comicToolBrushes,
#studentPaint.comic-studio-open #comicToolProperties{min-height:0!important;max-height:100%!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspectorScrollBox,
#studentPaint.comic-studio-open #comicToolDock #paintSidebar{min-height:0!important;max-height:100%!important}
#studentPaint.comic-studio-open #comicToolDock #paintInspector,
#studentPaint.comic-studio-open #comicToolDock #paintToolScroll{overflow-y:auto!important;overscroll-behavior:contain;padding-bottom:35px!important;scroll-padding-bottom:35px!important;box-sizing:border-box!important}
#studentPaint.comic-studio-open #comicSidebar{min-height:0!important;max-height:100%!important;overflow-y:auto!important;padding-bottom:40px!important;scroll-padding-bottom:40px!important;box-sizing:border-box!important}
#comicPagesDetails{display:block;margin:3px 0;border:1px solid #d9d0e2;border-radius:6px;padding:5px;background:#fbf9ff}
#comicPagesDetails>summary{cursor:pointer;font-weight:700;padding:5px 2px;color:#5b4aa8}
#comicPagesDetails:not([open]){padding-bottom:5px}

/* v194: keep the top and bottom of both inspectors reachable on shorter laptops. */
@media(min-width:901px){
 #studentPaint.comic-studio-open{min-height:0!important;max-height:calc(100dvh - 90px)!important}
 #studentPaint.comic-studio-open #comicToolDock,#studentPaint.comic-studio-open #comicSidebar{min-height:0!important;overflow:hidden!important}
 #studentPaint.comic-studio-open #comicSidebar{overflow-y:auto!important;overscroll-behavior:contain!important;padding-bottom:54px!important}
 #studentPaint.comic-studio-open #comicToolDock #paintInspector,#studentPaint.comic-studio-open #comicToolDock #paintToolScroll{overflow-y:auto!important;scroll-padding-bottom:60px!important;padding-bottom:60px!important;min-height:0!important}
}

/* v197: full-height book layout. Previous v194 max-height(100dvh - 90px)
   unintentionally clipped the fixed fullscreen Comic workspace. A viewport
   grid with minmax(0,1fr) keeps the independent tool/sidebar scrollers usable. */
#studentPaint.panel.comic-studio-open:not(.hidden){
 height:100dvh!important;
 max-height:100dvh!important;
 min-height:0!important;
 grid-template-rows:auto minmax(0,1fr) 39px!important;
 overflow:hidden!important;
}
#studentPaint.comic-studio-open #comicToolDock,
#studentPaint.comic-studio-open #comicToolBrushes,
#studentPaint.comic-studio-open #comicToolProperties,
#studentPaint.comic-studio-open #comicSidebar,
#studentPaint.comic-studio-open #canvasStage.comic-stage{
 min-height:0!important;
 box-sizing:border-box!important;
}
#studentPaint.comic-studio-open #comicToolDock #paintInspector,
#studentPaint.comic-studio-open #comicToolDock #paintToolScroll,
#studentPaint.comic-studio-open #comicSidebar{
 overscroll-behavior:contain!important;
 scrollbar-width:auto;
}

/* v198: preview canvases omit the active scene, so the live editor must be above them. */
#studentPaint.comic-studio-open .comic-frame-view.selected > .comic-editor-clip{z-index:1100!important}

/* Visible scene/frame actions share one selected state and one set of subtools. */
#comicContextControls .comic-context-options > button[aria-pressed=true]{background:#5d398c!important;color:#fff!important;box-shadow:inset 0 0 0 2px #d2c2f7}
#comicInteractionHint{padding:8px;border-radius:6px;background:#fff0a3;color:#493b24;font-size:12px;line-height:1.4}
#comicSidebar .comic-layer-row.comic-drop-target{outline:3px solid #2869a2;background:#d9edff}
#comicSidebar .comic-moving-source{outline:2px dashed #7750ad;background:#eee5fb}
#comicSidebar .comic-moving-source .comic-grip{background:#5d398c;color:white}

/* Page objects share the scene stack, outside each scene's clipping window. */
.comic-page-content > .comic-object-preview{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.comic-object-editor{position:absolute;pointer-events:none;overflow:visible}
.comic-object-editor.is-editable :is(.clip-art-object,.text-object){pointer-events:auto}
.comic-object-editor .clip-art-object.selected[data-comic-bubble=true] .clip-art-handle{display:block!important;pointer-events:auto!important;touch-action:none;z-index:105}
.comic-page-layer-heading{font-size:10px;color:#625475;padding:4px 2px}
#comicSidebar .comic-page-object-row .comic-layer-name{background:#e9e1f4;color:#483269}
#comicSidebar .comic-layer-order{width:22px;min-width:22px!important;min-height:26px!important;padding:2px!important;background:#e8e0ef;color:#49346f}

.comic-object-editor:not(.is-editable) :is(.clip-art-object,.text-object,button){pointer-events:none!important}
.comic-object-editor:not(.is-editable) :is(.clip-art-handle,.clip-art-rotate,.clip-art-flip,.clip-art-lock,.comic-write-bubble,.comic-bubble-more,.comic-bubble-quick,.text-object-handle,.text-object-rotate){display:none!important}

.comic-page-content{isolation:isolate}
.comic-page-content .comic-frame-corner-lock{z-index:1000000}
.comic-page-content #comicCornerHandles{z-index:1100000}

.comic-object-editor.is-editable .clip-art-lock{display:block;pointer-events:auto}

/* Overlay canvases contain transparent pixels, not a sheet of white paper.
   Native canvas display:block otherwise also overrides the HTML hidden state. */
.comic-page-content > .comic-object-preview{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.comic-page-content canvas[hidden]{display:none!important}

/* Invisible object pick targets follow the existing page stack. */
.comic-page-content .comic-bubble-pick{position:absolute;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;cursor:move;touch-action:none;color:transparent!important}
.comic-page-content .comic-bubble-pick[hidden]{display:none!important}
.comic-page-content .comic-bubble-pick:focus-visible{outline:2px dashed #7050ad!important;outline-offset:2px}
