/* v10.44 — mobile usability, contrast, navigation and safe learning viewports */
.mobile-menu-toggle,.mobile-menu-backdrop{display:none}

@media(max-width:900px){
  html,body{max-width:100%;overflow-x:hidden}
  body{background:#f3f7f9!important;color:#082b4b!important}
  body.dark{background:#071321!important;color:#f3f8fc!important}
  .main-content{padding:76px 14px 28px!important;width:100%;overflow:visible}
  .topbar{position:relative;height:auto;min-height:68px;align-items:flex-start;gap:8px;margin-bottom:8px;padding:8px 0}
  .topbar>div:first-child{min-width:0;padding-top:3px}.topbar h1{font-size:clamp(18px,5vw,23px);overflow-wrap:anywhere}
  .top-actions{gap:6px;flex-wrap:wrap;justify-content:flex-end}.top-actions>*{flex:none}
  .top-actions .rank-chip-global span,.top-actions .mobile-logout span{display:none}
  .top-actions .rank-chip-global,.top-actions .notification-chip,.top-actions .icon-btn,.top-actions .mobile-logout{width:42px;height:42px;padding:0;display:grid;place-items:center;border-radius:13px}
  .mobile-menu-toggle{position:fixed;display:flex;align-items:center;gap:8px;z-index:1002;top:max(10px,env(safe-area-inset-top));inset-inline-start:12px;height:48px;padding:0 15px;border:1px solid #c9dce6;border-radius:15px;background:#fff;color:#082d4b;box-shadow:0 9px 24px #061e3430;font:900 13px/1 inherit}
  .mobile-menu-toggle svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  body.dark .mobile-menu-toggle{background:#12304a;color:#fff;border-color:#31546d}
  .sidebar{display:flex!important;z-index:1100;width:min(86vw,330px);transform:translateX(calc(-110% * var(--drawer-direction,1)));transition:transform .26s ease;box-shadow:0 0 0 transparent}
  [dir=rtl] .sidebar{--drawer-direction:-1}
  body.mobile-menu-open{overflow:hidden}.mobile-menu-open .sidebar{transform:translateX(0);box-shadow:0 0 60px #020b14a8}
  .mobile-menu-backdrop{position:fixed;display:block;z-index:1090;inset:0;border:0;background:#03111db8;opacity:0;visibility:hidden;transition:.22s;backdrop-filter:blur(3px)}
  .mobile-menu-open .mobile-menu-backdrop{opacity:1;visibility:visible}
  .sidebar .brand{padding-top:max(8px,env(safe-area-inset-top))}.side-nav{padding-bottom:20px}.sidebar-foot{padding-bottom:max(18px,env(safe-area-inset-bottom))}
  .bottom-nav{display:none!important}
  .card,.planner-today,.planner-all,.subscription-state,.side-widget{color:#082b4b;background:#fff;border-color:#d5e3ea}
  .card h1,.card h2,.card h3,.planner-today h2,.planner-all h2,.subscription-state b{color:#082b4b!important}
  .card p,.card small,.planner-today p,.planner-all p{color:#536b7d!important}
  body.dark .card,body.dark .planner-today,body.dark .planner-all,body.dark .subscription-state,body.dark .side-widget{color:#edf7fc;background:#10263a;border-color:#29465c}
  body.dark .card h1,body.dark .card h2,body.dark .card h3,body.dark .planner-today h2,body.dark .planner-all h2,body.dark .subscription-state b{color:#f5fbff!important}
  body.dark .card p,body.dark .card small,body.dark .planner-today p,body.dark .planner-all p{color:#c3d4df!important}
  .broadcast-bar{display:grid;grid-template-columns:1fr auto;gap:7px 10px;padding:15px!important;border-radius:18px}.broadcast-bar b{font-size:14px}.broadcast-bar span{grid-column:1/-1;font-size:12px;line-height:1.65;max-height:3.3em;overflow:hidden}.broadcast-bar strong{grid-column:2;grid-row:1}
  .subscription-state{display:grid!important;grid-template-columns:1fr;padding:15px!important;border-radius:20px!important}.subscription-state-message{padding-inline:0!important}.subscription-state-message p{font-size:12px;line-height:1.55}
  .lesson-hero,.planner-hero,.progress-hero{padding:20px!important;border-radius:22px!important}.lesson-hero h2,.planner-hero h2,.progress-hero h2{font-size:clamp(23px,7vw,31px)!important;line-height:1.3}.lesson-hero p,.planner-hero p,.progress-hero p{font-size:13px;line-height:1.65}
}

@media(max-width:700px){
  html:has(body.homework-focus-page),body.homework-focus-page{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto;background:#f3f7f9!important;touch-action:pan-y!important}
  .embed-page .mobile-menu-toggle,.embed-page .mobile-menu-backdrop{display:none!important}
  .homework-focus-page .app-shell,.homework-focus-page .main-content,.homework-focus-page .main-content>.section{display:block!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;contain:none!important}
  .homework-focus-page .main-content{padding:8px!important}
  .homework-focus-page:not(.embed-page) .main-content{padding-top:70px!important}
  .homework-focus-page #homeworkApp,.homework-focus-page .hw-app{display:block!important;height:auto!important;min-height:calc(100dvh - 16px)!important;max-height:none!important;padding:8px 8px max(34px,env(safe-area-inset-bottom))!important;overflow:visible!important;touch-action:pan-y!important}
  .homework-focus-page .hw-app-head{position:relative!important;top:auto!important;z-index:5!important;grid-template-columns:1fr!important;padding:10px!important;border-radius:15px!important}
  .homework-focus-page .hw-app-head>div:first-child{min-width:0}.homework-focus-page .hw-app-head h3{font-size:16px;line-height:1.35}
  .homework-focus-page .hw-submit-top{grid-column:auto!important;position:relative!important;width:100%!important;color:#032a30!important;font-size:15px!important}
  .homework-focus-page .hw-question-nav{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr));overflow:visible!important;gap:5px;padding:7px 0 9px}
  .homework-focus-page .hw-question-nav button{min-width:0;width:100%;height:34px;font-size:11px}
  .homework-focus-page .hw-question{display:block!important;height:auto!important;min-height:0!important;max-height:none!important;padding:16px 2px 10px!important;overflow:visible!important;touch-action:pan-y!important}
  .homework-focus-page .hw-question h2{margin:12px 0;font-size:17px!important;line-height:1.6}
  .homework-focus-page .hw-options,.homework-focus-page .hw-options.two{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .homework-focus-page .hw-options button{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;width:100%!important;min-height:58px!important;text-align:start!important;touch-action:manipulation!important}
  .homework-focus-page .hw-options span{padding:13px!important;font-size:14px;line-height:1.55;color:#082b4b!important;background:#fff!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important}
  .homework-focus-page .hw-options input:checked+span{color:#063f3b!important;background:#dff8f3!important;border-color:#16a99f!important}
  .homework-focus-page .hw-essay{display:block;width:100%;min-height:180px;font-size:16px;line-height:1.6;color:#082b4b;background:#fff}
  .homework-focus-page .hw-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;position:relative!important;margin:8px 0 0!important;padding:10px 0 0!important}
  .homework-focus-page .hw-actions button{min-height:46px}.homework-focus-page .hw-actions [data-save-now],.homework-focus-page .hw-actions [data-submit]{grid-column:1/-1!important;color:#062f38!important;font-weight:900!important}
  .learning-modal iframe{display:block;width:100%;height:calc(100dvh - 58px);min-height:0;border:0;overflow:auto!important}.learning-modal{overflow:hidden!important}.learning-modal-bar{height:58px}
}

/* V146: two distinct student exits: visible header control and sidebar control. */
body:has(.bpf-va) .student-exit-top{display:inline-flex!important;align-items:center!important;gap:6px!important;position:relative;z-index:1800;color:#a92525;background:#fff1f0;border:1px solid #edbeb8;border-radius:12px;padding:9px 12px;font-weight:900;text-decoration:none}body:has(.bpf-va) .student-exit-top span{display:inline!important}body:has(.bpf-va) .sidebar .logout-link{display:block;position:relative;z-index:1800;padding:11px 14px;border-radius:12px;background:#fff1f0;color:#a92525;font-weight:900;text-align:center}@media(max-width:900px){body:has(.bpf-va) .student-exit-top{width:auto!important;height:auto!important;min-height:42px;padding:8px 10px!important}body:has(.bpf-va) .top-actions .student-exit-top span{display:inline!important}}
