/* First batch: homepage/workspace, login, homework, calendar and schedule. */
.mb-layout-picker{display:flex;align-items:center;gap:6px;flex:none;font-size:12px;color:#516072}
.mb-layout-picker select{font:inherit;font-size:14px;border:1px solid #d3dae6;background:#fff;color:#1a2433;border-radius:8px;padding:7px 8px;min-height:36px;max-width:116px}
.mb-top .top-searchwrap{min-width:0}
@media(min-width:960px) and (max-width:1200px){.mb-layout-picker>span,.mb-top .top-crumb small{display:none}.mb-top .top-user .who{display:none}}
.mb-mobile-menu,.mb-mobile-close,.mb-mobile-backdrop,.hst-mobile-label,.mb-cell-label,.sch-agenda,.mb-class-swipe-hint{display:none}
.login-layout{position:absolute;top:32px;left:24px}
.login-layout>span{display:none}
html[data-mb-layout="mobile"]{scroll-padding-top:74px}
html[data-mb-layout="mobile"] body{overflow-wrap:anywhere}
html[data-mb-layout="mobile"] .mb-app{grid-template-columns:minmax(0,1fr);animation:none;min-height:100dvh}
html[data-mb-layout="mobile"] .mb-main{width:100%;min-width:0}
html[data-mb-layout="mobile"] .mb-rail{position:fixed;inset:0 auto 0 0;width:min(300px,86vw);height:100dvh;z-index:802;visibility:hidden;transform:translateX(-100%);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);transition:transform .18s ease,visibility .18s}
html[data-mb-layout="mobile"] .mb-menu-open .mb-rail{visibility:visible;transform:translateX(0)}
html[data-mb-layout="mobile"] .mb-mobile-close{display:block;margin:10px 12px 0;align-self:flex-end;border:1px solid #7d8ba3;border-radius:8px;background:transparent;color:#fff;font:inherit;min-height:44px;padding:8px 12px}
html[data-mb-layout="mobile"] .rail-collapse{display:none}
html[data-mb-layout="mobile"] .mb-mobile-backdrop{position:fixed;inset:0;z-index:801;background:rgba(15,23,42,.5)}
html[data-mb-layout="mobile"] .mb-menu-open .mb-mobile-backdrop{display:block}
html[data-mb-layout="mobile"] body.mb-menu-lock{overflow:hidden}
html[data-mb-layout="mobile"] .mb-top{height:auto;min-height:62px;padding:env(safe-area-inset-top) 10px 0;gap:6px}
html[data-mb-layout="mobile"] .mb-mobile-menu{display:grid;place-items:center;flex:0 0 40px;width:40px;height:44px;border:1px solid var(--mb-border);border-radius:9px;background:var(--mb-card);color:var(--mb-ink)}
html[data-mb-layout="mobile"] .mb-mobile-menu svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}
html[data-mb-layout="mobile"] .top-searchwrap,html[data-mb-layout="mobile"] #mbPlus,html[data-mb-layout="mobile"] .top-divider,html[data-mb-layout="mobile"] .top-user .who,html[data-mb-layout="mobile"] .top-user>svg{display:none}
html[data-mb-layout="mobile"] .top-crumb{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:16px;flex:1}
html[data-mb-layout="mobile"] .top-crumb small,html[data-mb-layout="mobile"] .top-sp,html[data-mb-layout="mobile"] .mb-layout-picker>span{display:none}
html[data-mb-layout="mobile"] .mb-layout-picker select{font-size:16px;min-height:44px;width:104px;padding:6px}
html[data-mb-layout="mobile"] .top-user{padding:0;gap:0;flex:none}
html[data-mb-layout="mobile"] .mb-page{padding:18px 12px calc(32px + env(safe-area-inset-bottom));width:100%;max-width:none}
html[data-mb-layout="mobile"] .page-head{flex-wrap:wrap;gap:8px;margin-bottom:16px}
html[data-mb-layout="mobile"] .page-head h1{font-size:23px;line-height:1.4}
html[data-mb-layout="mobile"] .page-head .sub{width:100%;margin:0;white-space:normal}
html[data-mb-layout="mobile"] .page-head .acts{margin-left:0;flex-wrap:wrap;gap:8px;width:100%}
html[data-mb-layout="mobile"] input:not([type="checkbox"]):not([type="radio"]),html[data-mb-layout="mobile"] select,html[data-mb-layout="mobile"] textarea{font-size:16px;max-width:100%}
html[data-mb-layout="mobile"] .btn,html[data-mb-layout="mobile"] select{min-height:44px}
html[data-mb-layout="mobile"] .mb-boot-content{grid-template-columns:1fr;padding:14px}
html[data-mb-layout="mobile"] .mb-modal,html[data-mb-layout="mobile"] .dlg,html[data-mb-layout="mobile"] .hst-dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto}
/* Workspace: one vertical reading flow, with class hierarchy scrolling inside its card. */
html[data-mb-layout="mobile"][data-mb-page="home"] .wgrid{grid-template-columns:minmax(0,1fr);gap:12px}
html[data-mb-layout="mobile"][data-mb-page="home"] .wgrid>.wg{grid-column:1 / -1;min-width:0;container:none}
html[data-mb-layout="mobile"][data-mb-page="home"] .wg-h{flex-wrap:wrap;gap:7px;padding:12px}
html[data-mb-layout="mobile"][data-mb-page="home"] .wg-h b{min-width:0;overflow-wrap:anywhere}
html[data-mb-layout="mobile"][data-mb-page="home"] .wg-b{padding:12px;min-width:0}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-checks,html[data-mb-layout="mobile"][data-mb-page="home"] .ws-week-grid{grid-template-columns:minmax(0,1fr)}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-day{min-height:0}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-day:not(:has(a)){display:flex;align-items:center;gap:12px}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-day:not(:has(a)) h3{margin:0}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-row{flex-wrap:wrap}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-check-column{max-height:none;overflow:visible;padding:0}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-check-column h3{position:static}
html[data-mb-layout="mobile"][data-mb-page="home"] .ws-foot{flex-wrap:wrap}
html[data-mb-layout="mobile"][data-mb-page="home"] .cmill{max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
html[data-mb-layout="mobile"][data-mb-page="home"] .yr-filters{max-width:100%}
html[data-mb-layout="mobile"] .mb-class-swipe-hint{display:block;margin:0 0 8px;color:var(--mb-ink3);font-size:13px}
/* Homework: retain the same row bindings and inputs while turning each student into a card. */
html[data-mb-layout="mobile"] .hc-bar{flex-wrap:wrap;gap:10px}
html[data-mb-layout="mobile"] .hc-bar .sp{margin-left:0;width:100%}
html[data-mb-layout="mobile"] .hc-course-seg{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-mb-layout="mobile"] .hc-course-seg button{min-width:0;min-height:44px;padding:9px 6px;border-bottom:1px solid var(--mb-border)}
html[data-mb-layout="mobile"] .hc-course-seg button:nth-child(2n){border-right:0}
html[data-mb-layout="mobile"] .hc-search{width:100%;min-width:0}
html[data-mb-layout="mobile"] .hc-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-mb-layout="mobile"] .hc-h{flex-wrap:wrap;gap:8px}
html[data-mb-layout="mobile"] .hc-h-main{display:block;flex-basis:100%;min-width:0}
html[data-mb-layout="mobile"] .hc-h .mt{margin-top:5px}
html[data-mb-layout="mobile"] .hc-h .st{width:100%;margin-left:0;justify-content:flex-start;flex-wrap:wrap}
html[data-mb-layout="mobile"] .hc-card-body{padding:12px}
html[data-mb-layout="mobile"] .hc-filter-row{display:block}
html[data-mb-layout="mobile"] .hc-filter-title{display:block;line-height:1.4;margin-bottom:7px}
html[data-mb-layout="mobile"] .hc-weekflow-nodes{grid-template-columns:1fr}
html[data-mb-layout="mobile"] .hc-weekflow-h{display:block}
html[data-mb-layout="mobile"] .hc-weekflow-h span{text-align:left;display:block;margin:4px 0 0}
html[data-mb-layout="mobile"] .hc-step-h{flex-wrap:wrap}
html[data-mb-layout="mobile"] .hc-step-status{width:100%;margin-left:0;text-align:left}
html[data-mb-layout="mobile"] .fr{flex-wrap:wrap;align-items:flex-start}
html[data-mb-layout="mobile"] .fr .rt{margin-left:0;justify-content:flex-start;max-width:100%;flex-wrap:wrap}
html[data-mb-layout="mobile"] .drw{width:100%;max-width:100%;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
html[data-mb-layout="mobile"] .hst-scroll{overflow:visible;border:0;background:transparent}
html[data-mb-layout="mobile"] .hst-table,html[data-mb-layout="mobile"] .hst-table.hst-with-notes{display:block;width:100%;min-width:0;table-layout:auto}
html[data-mb-layout="mobile"] .hst-table thead,html[data-mb-layout="mobile"] table[data-mb-cards] thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-mb-layout="mobile"] .hst-table tbody{display:grid;gap:12px}
html[data-mb-layout="mobile"] .hst-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr);border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-card);overflow:hidden}
html[data-mb-layout="mobile"] .hst-table tbody th,html[data-mb-layout="mobile"] .hst-table tbody td{display:block;width:auto!important;min-width:0;padding:10px 12px;text-align:left;border:0;border-bottom:1px solid var(--mb-border)}
html[data-mb-layout="mobile"] .hst-table tbody th{background:var(--mb-accent-soft);font-size:17px}
html[data-mb-layout="mobile"] .hst-table tbody td:last-child{border-bottom:0}
html[data-mb-layout="mobile"] .hst-mobile-label{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;color:var(--mb-ink2);font-size:14px;font-weight:650;margin-bottom:7px}
html[data-mb-layout="mobile"] .hst-mobile-label .hst-deadline{display:flex;gap:2px;font-size:12px;font-weight:400;margin:0}
html[data-mb-layout="mobile"] .hst-table .hst-field{align-items:flex-start;min-width:0;width:100%;max-width:none}
html[data-mb-layout="mobile"] .hst-table .hst-state{width:100%;max-width:none;text-align:left;text-align-last:left;min-height:44px;font-size:16px}
html[data-mb-layout="mobile"] .hst-table .hst-actions{justify-content:flex-start;flex-wrap:wrap;gap:8px}
html[data-mb-layout="mobile"] .hst-table .hst-link,html[data-mb-layout="mobile"] .hst-table .hst-clear,html[data-mb-layout="mobile"] .hst-table .hst-complete{min-height:44px}
html[data-mb-layout="mobile"] table[data-mb-cards]{display:block;min-width:0;width:100%}
html[data-mb-layout="mobile"] table[data-mb-cards] tbody{display:grid;gap:12px}
html[data-mb-layout="mobile"] table[data-mb-cards] tbody tr{display:block;border:1px solid var(--mb-border);border-radius:10px;padding:8px;background:var(--mb-card)}
html[data-mb-layout="mobile"] table[data-mb-cards] td{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px 10px;white-space:normal;border:0;padding:6px;width:auto!important;min-width:0}
html[data-mb-layout="mobile"] table[data-mb-cards] .sticky1{position:static;box-shadow:none}
html[data-mb-layout="mobile"] .tbwrap:has(table[data-mb-cards]){max-height:none;overflow:visible;padding:8px}
html[data-mb-layout="mobile"] .mb-cell-label{display:block;min-width:76px;color:var(--mb-ink3);font-size:13px}
/* Calendar keeps seven date columns; day details show the full event titles. */
html[data-mb-layout="mobile"] .cal-layout{grid-template-columns:minmax(0,1fr);gap:14px}
html[data-mb-layout="mobile"] .cal-head{flex-wrap:wrap;gap:10px}
html[data-mb-layout="mobile"] .cal-sem{margin-left:0}
html[data-mb-layout="mobile"] .cal-nav button,html[data-mb-layout="mobile"] .cal-seg button,html[data-mb-layout="mobile"] .chip{min-height:44px}
html[data-mb-layout="mobile"] .frow{flex-wrap:wrap}
html[data-mb-layout="mobile"] .mgrid{grid-template-columns:repeat(7,minmax(0,1fr))}
html[data-mb-layout="mobile"] .mgrid>.corner,html[data-mb-layout="mobile"] .mgrid>.wkno{display:none}
html[data-mb-layout="mobile"] .mgrid>.cell{min-height:78px;padding:3px;overflow:hidden}
html[data-mb-layout="mobile"] .mgrid .wh{font-size:12px;padding:7px 0}
html[data-mb-layout="mobile"] .mgrid .dn{font-size:14px}
html[data-mb-layout="mobile"] .mgrid .ev{font-size:10px;line-height:14px;height:14px;padding:0 1px;margin:2px 0;gap:2px}
html[data-mb-layout="mobile"] .mgrid .ev .dot{width:4px;height:4px;flex:none}
html[data-mb-layout="mobile"] .mgrid .ev .cancel-badge{display:none}
html[data-mb-layout="mobile"] .cal-mobile-hint{display:block;color:var(--mb-ink3);font-size:13px;margin:8px 0}
.cal-mobile-hint{display:none}
html[data-mb-layout="mobile"] .sidebody{max-height:none}
html[data-mb-layout="mobile"] .week{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px}
html[data-mb-layout="mobile"] .wev{flex-wrap:wrap;align-items:flex-start}
html[data-mb-layout="mobile"] .wev-title{white-space:normal;overflow:visible}
html[data-mb-layout="mobile"] .day-pop{max-width:calc(100vw - 20px);max-height:calc(100dvh - 90px);overflow:auto;padding:8px}
html[data-mb-layout="mobile"] .day-pop h3{display:flex;align-items:center;gap:10px;justify-content:space-between}
.cal-day-close{border:1px solid var(--mb-border);background:var(--mb-card);color:var(--mb-ink2);border-radius:8px;padding:7px 10px;font:inherit;min-height:40px}
html[data-mb-layout="mobile"] .dlg{min-width:0;width:100%;padding:18px}
/* Schedule: the same lessons, sorted by day and time, without a wide grid. */
html[data-mb-layout="mobile"] .sch-toolbar{flex-wrap:wrap;gap:10px}
html[data-mb-layout="mobile"] .sch-stat{margin-left:0;width:100%;justify-content:flex-start}
html[data-mb-layout="mobile"] .sch-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
html[data-mb-layout="mobile"] .sch-f{display:flex;flex-direction:column;align-items:stretch;min-width:0;gap:4px}
html[data-mb-layout="mobile"] .sch-f select{min-width:0;width:100%;max-width:none}
html[data-mb-layout="mobile"] .sf-note{grid-column:1 / -1}
html[data-mb-layout="mobile"] #schArea:has(.sch-agenda)>.sch-scroll{display:none}
html[data-mb-layout="mobile"] #schArea>.sch-scroll:has(.sch){display:none}
html[data-mb-layout="mobile"] .sch-agenda{display:grid;gap:16px}
.sch-agenda-day{scroll-margin-top:78px;min-width:0}
.sch-agenda-day h2{font-size:17px;margin:0 0 8px;display:flex;align-items:center;gap:8px}
.sch-agenda-day h2 small{font-size:13px;color:var(--mb-ink3);font-weight:500}
.sch-agenda-day.today h2{color:var(--mb-accent)}
.sch-agenda-empty{padding:12px;border:1px dashed var(--mb-border);border-radius:10px;color:var(--mb-ink3);font-size:14px}
html[data-mb-layout="mobile"] .les.sch-agenda-lesson{display:block;position:relative;inset:auto;width:100%;height:auto;min-height:96px;padding:12px;margin:8px 0;border:1px solid var(--mb-border);border-left:4px solid var(--sub);border-radius:10px;background:var(--mb-card);overflow:visible;text-align:left;font:inherit;color:var(--mb-ink);cursor:pointer}
.sch-agenda-lesson .agenda-time{display:block;font-weight:750;font-size:15px;margin-bottom:5px;color:var(--mb-accent)}
html[data-mb-layout="mobile"] .sch-agenda-lesson .ln{font-size:16px;white-space:normal;overflow:visible}
html[data-mb-layout="mobile"] .sch-agenda-lesson .lm,html[data-mb-layout="mobile"] .sch-agenda-lesson .lfoot{display:flex;flex-wrap:wrap;gap:7px;margin-top:5px;white-space:normal;overflow:visible;position:static}
html[data-mb-layout="mobile"] .sch-agenda-lesson .lr,html[data-mb-layout="mobile"] .sch-agenda-lesson .lroom{white-space:normal;overflow:visible}
html[data-mb-layout="mobile"] .sch-legend{flex-wrap:wrap}
html[data-mb-layout="mobile"] .sch-legend .lg{white-space:normal}
/* Login places the form first, with decorative content below it. */
html[data-mb-layout="mobile"][data-mb-page="login"] .page{display:flex;flex-direction:column;min-height:100dvh;overflow:visible}
html[data-mb-layout="mobile"][data-mb-page="login"] .login-side{order:0;min-height:100dvh;padding:86px 22px calc(32px + env(safe-area-inset-bottom))!important;justify-content:flex-start;flex-direction:column}
html[data-mb-layout="mobile"][data-mb-page="login"] .panel{max-width:420px;width:100%}
html[data-mb-layout="mobile"][data-mb-page="login"] .brand{justify-content:flex-start;margin-bottom:26px}
html[data-mb-layout="mobile"][data-mb-page="login"] .brand img{width:50px;height:50px}
html[data-mb-layout="mobile"][data-mb-page="login"] .brand .cn{font-size:23px}
html[data-mb-layout="mobile"][data-mb-page="login"] .brand .en{font-size:10.5px}
html[data-mb-layout="mobile"][data-mb-page="login"] .welcome{text-align:left;margin-bottom:24px}
html[data-mb-layout="mobile"][data-mb-page="login"] .welcome h2{font-size:22px}
html[data-mb-layout="mobile"][data-mb-page="login"] .login-language{left:auto;right:18px;top:calc(16px + env(safe-area-inset-top));gap:5px}
html[data-mb-layout="mobile"][data-mb-page="login"] .login-language label,html[data-mb-layout="mobile"][data-mb-page="login"] .login-language svg{display:none}
html[data-mb-layout="mobile"][data-mb-page="login"] .login-language .lang{min-width:112px;min-height:44px;font-size:16px;padding:6px 8px}
html[data-mb-layout="mobile"][data-mb-page="login"] .login-layout{top:calc(16px + env(safe-area-inset-top));left:18px}
html[data-mb-layout="mobile"][data-mb-page="login"] .field input,html[data-mb-layout="mobile"][data-mb-page="login"] .submit{height:50px}
html[data-mb-layout="mobile"][data-mb-page="login"] .toggle{height:44px;width:44px;top:3px;right:3px}
html[data-mb-layout="mobile"][data-mb-page="login"] .copyright{position:static;margin-top:32px}
html[data-mb-layout="mobile"][data-mb-page="login"] .visual{order:1;min-height:170px;padding:28px 22px;overflow:hidden}
html[data-mb-layout="mobile"][data-mb-page="login"] .visual .art,html[data-mb-layout="mobile"][data-mb-page="login"] .visual .waves{display:none}
html[data-mb-layout="mobile"][data-mb-page="login"] .motto h1{font-size:19px}
@media(prefers-reduced-motion:reduce){.mb-rail{transition:none!important}}
