/* Keep legacy title hooks for JS, but remove the redundant visual app bar. */
.app-shell > main > .topbar{display:none}
.app-shell > main{padding-top:16px}
@media(min-width:701px){
 .app-shell,body.writing-focus-active .app-shell{height:var(--app-viewport-height,100dvh);min-height:0;grid-template-columns:clamp(180px,21vw,260px) minmax(0,1fr);overflow:hidden}
 .app-shell>.sidebar,body.writing-focus-active .sidebar{position:static;height:100%;min-height:0;overflow:hidden;padding:16px 14px max(28px,calc(env(safe-area-inset-bottom) + 16px));gap:12px}
 .sidebar .brand-mark{flex-shrink:0;min-height:48px}
 .sidebar .nav-list{display:grid;grid-template-columns:1fr;overflow-y:auto;min-height:0;overscroll-behavior:contain}
 .sidebar .account-menu-wrap{flex-shrink:0}
 .app-shell>main{height:100%;min-height:0;overflow-y:auto;padding:16px 20px max(24px,env(safe-area-inset-bottom))}
 #curriculumView{height:100%;min-height:0}
 #curriculumFrame{height:100%;min-height:0}
 body.writing-focus-active{position:fixed;inset:0; width:100%;height:var(--app-viewport-height,100dvh);overflow:hidden}
 body.writing-focus-active .app-shell>main{padding:0 16px;height:100%;overflow:hidden}
 body.writing-focus-active #writingView,body.writing-focus-active .writing-page,body.writing-focus-active .writing-layout{height:100%;min-height:0;padding:0;gap:0}
 body.writing-focus-active .writing-workspace{position:relative;top:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px;height:100%;min-height:0;padding:12px 0 max(28px,calc(env(safe-area-inset-bottom) + 16px));overflow:hidden}
 body.writing-focus-active .handwriting-session-header{margin:0;min-width:0}
 body.writing-focus-active .writing-guide{grid-template-columns:64px minmax(0,1fr);min-height:0;max-height:100px;overflow-y:auto;margin:0}
 body.writing-focus-active .writing-guide>img{width:64px;height:64px;animation:none}
 body.writing-focus-active .writing-guide>div{padding:8px 12px}
 body.writing-focus-active .writing-guide p{font-size:14px}
 body.writing-focus-active .handwriting-sheet{display:flex;min-height:0;overflow:auto;align-content:normal;overscroll-behavior:contain}
 body.writing-focus-active .handwriting-word-row{display:flex;flex-direction:column;flex:1;min-width:0;min-height:170px;padding:0}
 body.writing-focus-active .handwriting-word-heading{flex-shrink:0}
 body.writing-focus-active .handwriting-repetitions{flex:1;min-height:110px;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:8px;gap:12px}
 body.writing-focus-active .handwriting-repetition{display:flex;flex-direction:column;justify-content:center;min-height:0;gap:6px}
 body.writing-focus-active .handwriting-pad{flex:0 1 auto;min-height:80px;max-height:none;aspect-ratio:1.15;container-type:size}
 body.writing-focus-active .handwriting-pad-character{font-size:clamp(32px,35cqh,112px)}
 body.writing-focus-active .handwriting-sheet-actions{margin:0;min-width:0;gap:8px;flex-wrap:wrap;background:#f7f5ff}
 body.writing-focus-active .handwriting-sheet-actions button{min-height:44px}
}
/* Split-view/phone: allow normal scrolling rather than lock content off-screen. */
@media(max-width:700px){
 body.writing-focus-active{position:static;height:auto;overflow:auto}
 .writing-session-active .writing-workspace{position:static;min-height:0;padding:16px 0}
 .handwriting-sheet-actions{position:sticky;bottom:0;z-index:5;padding:12px 0 max(20px,env(safe-area-inset-bottom));background:#f7f5ff}
 #curriculumFrame{height:var(--app-viewport-height,100dvh);min-height:0}
}
/* Notebook stays inside the workspace and retains its page when switching views. */
#notebookView{height:100%;min-height:0}
#notebookFrame{display:block;width:100%;height:100%;min-height:600px;border:0;border-radius:16px;background:#f7f5fa}
@media(max-width:700px){#notebookFrame{height:var(--app-viewport-height,100dvh)}}
