/* V304: STAGING V406 avatar crop UI; restored unchanged layout, adapted to safe-height phones. */
html.avatar-crop-open,html.avatar-crop-open body{overflow:hidden!important}
.avatar-crop-modal[hidden]{display:none!important}
.avatar-crop-modal{position:fixed!important;inset:0!important;z-index:12000!important;display:grid!important;place-items:center!important;padding:20px!important;background:rgba(0,4,9,.78)!important;backdrop-filter:blur(5px)!important;-webkit-backdrop-filter:blur(5px)!important}
.avatar-crop-dialog{width:min(540px,calc(100vw - 32px))!important;max-height:calc(100vh - 32px)!important;overflow:auto!important;padding:20px 22px 18px!important;border:1px solid rgba(148,163,184,.16)!important;border-radius:22px!important;background:color-mix(in srgb,var(--card) 94%,#07111c)!important;box-shadow:0 28px 80px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.05)!important}
.avatar-crop-head{display:flex;align-items:center;justify-content:center;position:relative;margin-bottom:14px;min-height:36px}
.avatar-crop-head h2{margin:0!important;font-size:1.05rem!important;line-height:1.2!important;text-align:center!important}
.avatar-crop-close{position:absolute;right:-4px;top:-4px;width:34px;height:34px;border:0;border-radius:50%;background:rgba(148,163,184,.12);color:var(--text);font-size:24px;line-height:1;display:grid;place-items:center;cursor:pointer;transition:.16s ease}
.avatar-crop-close:hover{background:rgba(148,163,184,.22);transform:rotate(5deg)}
.avatar-crop-viewport{position:relative!important;width:min(460px,calc(100vw - 76px))!important;aspect-ratio:1/1!important;margin:0 auto!important;overflow:hidden!important;touch-action:none!important;cursor:grab!important;background:#0b1220!important;border:1px solid rgba(255,255,255,.86)!important;border-radius:10px!important;box-shadow:0 0 0 1px rgba(15,23,42,.8),0 14px 36px rgba(0,0,0,.32)!important}
.avatar-crop-viewport:active{cursor:grabbing!important}
.avatar-crop-viewport>img{position:absolute!important;max-width:none!important;max-height:none!important;user-select:none!important;-webkit-user-drag:none!important;pointer-events:none!important;will-change:left,top,width,height}
.avatar-crop-mask{position:absolute;inset:0;z-index:2;pointer-events:none;background:radial-gradient(circle at center,transparent 0 49.4%,rgba(3,7,14,.58) 49.8% 100%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.avatar-crop-mask::after{content:"";position:absolute;inset:0;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(255,255,255,.92),0 0 0 1px rgba(0,0,0,.28)}
.avatar-crop-handle{position:absolute;z-index:3;width:9px;height:9px;background:#f8fafc;border:1px solid #94a3b8;box-shadow:0 1px 4px rgba(0,0,0,.35);pointer-events:none}
.avatar-crop-handle-tl{left:-1px;top:-1px}.avatar-crop-handle-tr{right:-1px;top:-1px}.avatar-crop-handle-bl{left:-1px;bottom:-1px}.avatar-crop-handle-br{right:-1px;bottom:-1px}
.avatar-crop-zoom{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important}
.avatar-crop-actions{display:flex!important;justify-content:center!important;gap:10px!important;margin-top:16px!important}
.avatar-crop-actions .btn{min-width:110px}
@media(max-width:620px){.avatar-crop-modal{padding:10px!important}.avatar-crop-dialog{width:min(520px,calc(100vw - 18px))!important;padding:16px!important;border-radius:18px!important}.avatar-crop-viewport{width:min(440px,calc(100vw - 50px))!important}.avatar-crop-actions .btn{min-width:96px}}


/* A tall phone MUST keep the crop/confirm controls inside the viewport. */
.avatar-crop-modal:not([hidden]) {display:grid!important;position:fixed!important;inset:0!important;z-index:53000!important;overflow-y:auto!important;overscroll-behavior:contain!important;align-items:center!important;justify-items:center!important;padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom))!important}
.avatar-crop-modal:not([hidden]) .avatar-crop-dialog {box-sizing:border-box!important;max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;overflow-y:auto!important;overscroll-behavior:contain!important;min-height:0!important}
.avatar-crop-modal:not([hidden]) .avatar-crop-viewport {width:min(400px,calc(100vw - 70px),calc(100dvh - 168px))!important;max-width:100%!important}
.avatar-crop-modal:not([hidden]) .avatar-crop-actions {position:sticky!important;bottom:0!important;z-index:6!important;background:var(--card,#111a2b)!important;padding:10px 0 max(4px,env(safe-area-inset-bottom))!important}
@media(max-height:560px){.avatar-crop-modal:not([hidden]) .avatar-crop-viewport{width:min(250px,calc(100dvh - 138px),calc(100vw - 70px))!important}}

/* V304: one-row toolbar — title, help and rotation belong to the SAME control group. */
@media(max-width:900px){
 body.journal-mobile-v379:not(.journal-v383-landscape-shell) .mobile-journal-head-v379 {display:grid!important;grid-template-columns:minmax(0,1fr) 40px 40px!important;align-items:center!important;gap:8px!important}
 body.journal-mobile-v379:not(.journal-v383-landscape-shell) .mobile-journal-head-v379>.mobile-journal-landscape-back-v381 {display:none!important}
 body.journal-mobile-v379 .mobile-journal-head-v379>.mobile-journal-help-oct15,
 body.journal-mobile-v379 .mobile-journal-head-v379>.mobile-journal-rotate-v382 {position:static!important;display:grid!important;place-items:center!important;width:40px!important;height:40px!important;min-width:40px!important;margin:0!important;padding:0!important;border-radius:12px!important;align-self:center!important;justify-self:center!important}
 body.journal-mobile-v379 .mobile-journal-head-v379>div:nth-child(2) {min-width:0!important;overflow:hidden!important}
 body.journal-mobile-v379 .mobile-journal-head-v379>div:nth-child(2)>b {display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
}

/* V304: STAGING focused single journal in landscape, never the desktop navbar above the table.
   Apply on explicit JS class, not only media (orientation:landscape): Android fullscreen
   and browser chrome can change reported width/orientation asynchronously. */
html.journal-v383-landscape-shell,html.journal-v383-landscape-shell body {
 box-sizing:border-box!important;width:100%!important;height:100%!important;min-height:0!important;overflow:hidden!important;margin:0!important;padding:0!important;overscroll-behavior:none!important;background:#06101f!important
}
body.journal-v383-landscape-shell>.navbar,
body.journal-v383-landscape-shell>.site-footer,
body.journal-v383-landscape-shell>.academic-mobile-nav,
body.journal-v383-landscape-shell>.admin-mobile-nav,
body.journal-v383-landscape-shell>.developer-impersonation-bar,
body.journal-v383-landscape-shell>.v2-sidebar,
body.journal-v383-landscape-shell>.v2-topbar,
body.journal-v383-landscape-shell>.v2-mobile-nav,
body.journal-v383-landscape-shell>.help-fab,
body.journal-v383-landscape-shell>.season-particles,
body.journal-v383-landscape-shell>#halloween-stage-canvas {display:none!important}
body.journal-v383-landscape-shell .journal-sticky-dates-overlay {display:none!important}
body.journal-v383-landscape-shell .lab2-main {position:fixed!important;inset:0!important;box-sizing:border-box!important;width:100vw!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;background:#06101f!important;display:block!important;z-index:130!important}
body.journal-v383-landscape-shell .lab2-main>*:not(.mobile-journal-v379):not(.paper-gradebook-wrap) {display:none!important}
body.journal-v383-landscape-shell .mobile-journal-v379 {display:block!important;position:absolute!important;inset:0 0 auto!important;box-sizing:border-box!important;width:100%!important;height:48px!important;min-height:48px!important;margin:0!important;padding:4px 8px!important;border:0!important;border-bottom:1px solid rgba(148,163,184,.18)!important;border-radius:0!important;background:#06101f!important;overflow:hidden!important;z-index:140!important}
body.journal-v383-landscape-shell .mobile-journal-head-v379 {display:grid!important;grid-template-columns:36px minmax(0,1fr) 34px 34px!important;width:100%!important;height:40px!important;min-height:40px!important;align-items:center!important;gap:6px!important;margin:0!important}
body.journal-v383-landscape-shell .mobile-journal-landscape-back-v381 {display:grid!important;place-items:center!important;min-width:34px!important;width:34px!important;height:34px!important;margin:0!important}
body.journal-v383-landscape-shell .mobile-journal-head-v379>div:nth-child(2) {min-width:0!important;max-width:100%!important;overflow:hidden!important}
body.journal-v383-landscape-shell .mobile-journal-head-v379>div:nth-child(2)>b {overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:.86rem!important}
body.journal-v383-landscape-shell .mobile-journal-head-v379>.mobile-journal-help-oct15,
body.journal-v383-landscape-shell .mobile-journal-head-v379>.mobile-journal-rotate-v382 {position:static!important;display:grid!important;place-items:center!important;width:34px!important;height:34px!important;min-width:34px!important;max-width:34px!important;margin:0!important;padding:0!important}
body.journal-v383-landscape-shell.journal-v379-table .paper-gradebook-wrap {position:absolute!important;inset:48px 0 0!important;box-sizing:border-box!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:auto!important;background:#081426!important;z-index:1!important}
body.journal-v383-landscape-shell .teacher-grade-journal.compact-paper-journal {margin:0!important;padding:0!important;transform:none!important}
body.journal-v383-landscape-shell .journal-top-scroll-row,
body.journal-v383-landscape-shell .journal-top-scroll {display:none!important;height:0!important}
body.journal-v383-landscape-shell .compact-paper-journal thead .journal-month-row th {top:0!important}
body.journal-v383-landscape-shell .compact-paper-journal thead .journal-date-row th {top:26px!important}

.journal-rotation-tour-v388 .journal-rotation-tour-tip-v388 [data-tour-dismiss]{pointer-events:auto!important;cursor:pointer!important;min-height:34px!important;border-radius:9px!important;border:1px solid rgba(251,191,36,.4)!important;background:#1d2940!important;color:#f8fafc!important;padding:5px 9px!important;text-align:center!important}
.journal-rotation-tour-v388 .journal-rotation-tour-tip-v388 {pointer-events:auto!important}
