 .app-loading{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px;text-align:center;color:var(--muted);font-size:14px}.app-loading img{max-width:70%;height:auto}
/* Shared mobile ergonomics; desktop layout stays in the section stylesheets. */
.assignment-conditions{margin:16px 0}
.assignment-conditions summary{cursor:pointer;font-size:14px;font-weight:550;padding:12px 0;color:var(--muted)}
.assignment-conditions[open] summary{color:var(--ink)}
@media(max-width:760px){
 html{scroll-padding-top:20px;scroll-padding-bottom:100px;-webkit-text-size-adjust:100%}
 .shell{min-height:100dvh}
 .content{padding:22px max(16px,env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
 .content,.panel,.form-section,.lesson-layout>*,.hw-attempt-grid>*,.admin-content{min-width:0}
 h1{font-size:26px;line-height:1.25;letter-spacing:-.7px}
 .btn,.btn.small,.chip,.hw-number,.chat-emoji,.chat-actions button{min-height:44px}
 .btn{white-space:normal;text-align:center;line-height:1.4}
 .btn.small,.hw-number,.chat-emoji{min-width:44px}
 input:not([type=checkbox]):not([type=radio]),select,textarea,
 .field input,.field select,.field textarea,.search input,.task-filters select,.chat-mode select{font-size:16px!important}
 input:not([type=checkbox]):not([type=radio]),select{min-height:44px}
 .search{padding:0 12px;min-height:46px}
 .search input{min-height:44px}
 .field{margin-top:18px;gap:8px}
 .field-note,.subline{line-height:1.6}
 input,select,textarea{scroll-margin-block:100px}
 .bottom-nav{box-shadow:0 -4px 20px #19243c06;padding-left:max(8px,env(safe-area-inset-left))!important;padding-right:max(8px,env(safe-area-inset-right))!important}
 .bottom-nav button{min-height:52px;border-radius:12px}
 #toast{bottom:calc(86px + env(safe-area-inset-bottom));width:max-content;max-width:calc(100% - 32px);font-size:14px;pointer-events:none}
 dialog{width:calc(100% - 16px);max-width:580px;max-height:calc(100dvh - 24px);padding:20px;border-radius:22px;overscroll-behavior:contain}
 .modal-head{position:sticky;top:-20px;background:var(--card);z-index:2;padding:12px 0;margin-top:-12px;align-items:center}
 .modal-head h2{font-size:19px;min-width:0;overflow-wrap:anywhere}
 .modal-head [data-close]{flex-shrink:0;min-width:44px}
 /* Actions are stacked on mobile: a flex basis here controls height, not width. */
 .modal-actions{display:flex;flex-wrap:nowrap;gap:10px;align-items:stretch}
 .modal-actions .btn{flex:0 0 auto;min-height:46px;padding:11px 16px;width:100%}
 dialog:has(.more-menu){margin:auto auto 0;width:100%;max-width:none;border-radius:24px 24px 0 0;padding-bottom:calc(20px + env(safe-area-inset-bottom))}
 .more-menu{gap:8px;margin-top:12px}
 .more-menu button{min-height:56px}
 .more-menu+.profile-entry{width:100%;margin-top:16px;padding:16px 8px;border-top:1px solid var(--line)}
 .assignment-layout{display:flex;flex-direction:column;gap:16px}
 .assignment-layout>.lesson-aside{order:-1;position:static;width:100%;display:flex;flex-direction:column;padding:18px}
 .assignment-layout>.lesson-aside h2{font-size:18px}
 .assignment-deadline{margin-top:8px}
 .assignment-layout>.lesson-aside #start-assignment{order:1;width:100%;margin-top:14px;min-height:48px}
 .assignment-layout>.lesson-aside .field-note{order:2}
 .assignment-layout>.lesson-aside .assignment-conditions{order:3;margin:8px 0 0}
 .assignment-conditions summary{min-height:44px;display:list-item}
 .assignment-layout .lesson-task{margin-top:16px}
 .lesson-text{padding:20px;font-size:16px;line-height:1.7}
 .lesson-aside dl{overflow-wrap:anywhere}
 .hw-answer-nav{padding:12px 14px}
 .hw-answer-nav>div{gap:10px}
 .hw-number{height:44px}
 .hw-submit-bar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:16px 0}
 .hw-submit-bar>.btn{width:100%;min-height:48px}
 .hw-submit-bar>span{grid-column:1/-1}
 .hw-attempt-actions{gap:12px}
 .hw-attempt-actions .btn{flex:1}
 .hw-tabs{overflow-x:auto;gap:18px}
 .hw-tabs button{flex-shrink:0;min-height:48px}
 .editor-fields,.form-section{padding:20px}
 .editor-head{padding-top:max(10px,env(safe-area-inset-top));gap:8px}
 .editor-order{width:100%;display:flex;flex-wrap:wrap}
 .editor-order .btn{flex-grow:1}
 .notice-actions{gap:8px}
 .notice-actions select{max-width:100%;min-width:0}
 .chat-messages{height:clamp(200px,36dvh,320px)}
 .chat-head{padding:16px}.chat-compose{padding:14px}
 .chat-compose textarea{min-height:88px;max-height:220px}
 .chat-send .btn{min-height:46px;flex:1}
 .chat-emojis{gap:4px}.chat-emoji{padding:6px;flex:1}
 .chat-message header{flex-wrap:wrap;gap:4px 10px}
 .chat-mode{flex-wrap:wrap;padding:0 16px 14px}
 .chat-mode select{width:100%;flex-basis:100%}
 .material-row{min-width:0}.material-row>span{min-width:0}.material-row strong{overflow-wrap:anywhere}
 .login-primary{min-height:54px}
 .login-page{padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(24px,env(safe-area-inset-bottom))}
}
@media(max-width:360px){
 .content{padding-left:12px;padding-right:12px}
 h1{font-size:24px}
 .dash-counts{gap:6px}.dash-counts button{padding:14px 9px}.dash-counts span{font-size:12px}
 .more-menu{grid-template-columns:1fr}
 .course-list-facts{gap:14px}
}

/* App content should not enter selection/save-image mode after a long press. */
body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
img{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
input,textarea,[contenteditable="true"],[contenteditable="plaintext-only"],[contenteditable="true"] *,[contenteditable="plaintext-only"] *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
