/* Shared reflow layer, 66.1.1. Content is wrapped, never clipped to hide overflow. */
:where(.portal-body,.android-app){--ui-line:#dce5ee;--ui-muted:#536979;--ui-surface:#fff;--ui-radius:18px}
:where(.portal-body,.android-app) :where(main,section,article,form,fieldset,details,.panel-head,.actions){min-width:0}
:where(.portal-body,.android-app) :where(img,video,canvas){max-width:100%}
:where(.portal-body,.android-app) :where(h1,h2,h3,p,label,dd,code,a){overflow-wrap:anywhere}
:where(.portal-body,.android-app) :where(button,.button,.ll-button){white-space:normal;max-width:100%;line-height:1.4}
:where(.portal-body,.android-app) :where(.actions,.form-actions,.panel-head,.ll-heading-actions){flex-wrap:wrap;gap:10px}
:where(.portal-body,.android-app) :where(input,textarea,select){min-width:0;max-width:100%}
:where(.portal-body,.android-app) :where(pre){white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
:where(.portal-body,.android-app) :where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--brand,#155d89);outline-offset:3px}
:where(.portal-body,.android-app) :where(time,.ui-date){font-variant-numeric:tabular-nums}
.portal-body .portal-main{min-width:0}
.portal-body .panel{border-radius:var(--ui-radius)}
.portal-body .portal-page-head{align-items:flex-start;gap:18px}
.portal-body .portal-page-head p{max-width:72ch;line-height:1.6}
.portal-body .portal-page-head h1{line-height:1.2;letter-spacing:-.025em}
.portal-body .ll-tabs,.android-app .ll-tabs{display:flex;flex-wrap:wrap;overflow:visible;min-width:0;gap:4px}
.portal-body .ll-tabs>a,.android-app .ll-tabs>a{flex:1 1 110px;min-width:0;min-height:48px;white-space:normal;text-align:center;justify-content:center}
.portal-body .table-wrap table[data-ui-reflow],.portal-body .responsive-table table[data-ui-reflow],
.android-app table[data-ui-reflow]{width:100%;min-width:0;max-width:100%;table-layout:fixed}
:where(.portal-body,.android-app) table[data-ui-reflow] :is(th,td){white-space:normal;overflow-wrap:anywhere;min-width:0}
:where(.portal-body,.android-app) table[data-ui-reflow] :is(input,select,textarea){max-width:100%;min-width:0}
:where(.portal-body,.android-app) table[data-ui-reflow] :is(.inline-form,.actions){flex-wrap:wrap;white-space:normal}
.portal-body .ui-table-cards,.android-app .ui-table-cards{overflow:visible;max-width:100%;min-width:0}
/* Keep the original controls, headers, row semantics and submit handlers. */
.portal-body table[data-ui-mode=cards],.android-app table[data-ui-mode=cards]{display:block;border:0;background:transparent}
:where(.portal-body,.android-app) table[data-ui-mode=cards]>colgroup{display:none}
:where(.portal-body,.android-app) table[data-ui-mode=cards]>thead{
  position:absolute!important;width:1px!important;height:1px!important;padding:0!important;
  margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0);clip-path:inset(50%);border:0
}
:where(.portal-body,.android-app) table[data-ui-mode=cards]>:is(tbody,tfoot){display:grid;gap:14px;width:100%}
:where(.portal-body,.android-app) table[data-ui-mode=cards]>:is(tbody,tfoot)>tr{
  display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:14px 16px;
  border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface);max-width:100%;min-width:0
}
.portal-body table[data-ui-mode=cards]>:is(tbody,tfoot)>tr>:is(td,th),
.android-app table[data-ui-mode=cards]>:is(tbody,tfoot)>tr>:is(td,th){
  display:block;width:auto!important;min-width:0!important;max-width:100%;padding:10px 0;
  border:0;border-bottom:1px solid #edf1f5;text-align:start;white-space:normal;vertical-align:top
}
:where(.portal-body,.android-app) table[data-ui-mode=cards]>:is(tbody,tfoot)>tr>:last-child{border-bottom:0}
:where(.portal-body,.android-app) table[data-ui-mode=cards] [data-ui-cell-label]::before{
  content:attr(data-ui-cell-label);display:block;color:var(--ui-muted);font-size:.8125rem;
  font-weight:500;line-height:1.4;margin-bottom:5px;overflow-wrap:anywhere
}
:where(.portal-body,.android-app) table[data-ui-mode=cards] [data-ui-cell-label=""]::before{display:none}
:where(.portal-body,.android-app) table[data-ui-mode=cards] td>:is(.actions,.inline-form){margin-top:4px}
:where(.portal-body,.android-app) table[data-ui-mode=cards] td>:is(button,a.button){margin-block:3px}
/* Tablet cards still use available space; a row stays a single logical record. */
@media(min-width:760px){
  :where(.portal-body,.android-app) table[data-ui-mode=cards]>:is(tbody,tfoot)>tr{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}
  :where(.portal-body,.android-app) table[data-ui-mode=cards] [data-ui-wide]{grid-column:1/-1}
}
@media(max-width:760px){
  .portal-body .portal-page-head{flex-direction:column}
  .portal-body .portal-page-head>.actions{width:100%}
  .portal-body .portal-main :where(.crm-form-grid,.crm-two-columns,.form-grid,.form-grid-2,.form-grid-3){grid-template-columns:minmax(0,1fr)}
  .portal-body :where(button,.button,select,input:not([type=checkbox]):not([type=radio]):not([type=hidden])){min-height:48px}
  .portal-body :where(input,select,textarea){font-size:1rem}
  .portal-body .portal-user{flex:1 1 100%;margin:0;overflow-wrap:anywhere}
  .portal-body .portal-topbar{gap:12px}
  .portal-body .portal-main{padding-inline:16px}
}
/* Android app: one content header, compact primary navigation and no public chrome. */
.android-app{background:#f4f7fb;--mobile-header-height:68px;--mobile-nav-height:80px;--ui-rail-width:112px}
.android-app .portal-main{max-width:1184px;padding:24px 24px calc(var(--mobile-nav-height) + 24px)}
.android-app .mobile-header{gap:12px;padding-inline:24px;background:#fff;backdrop-filter:none}
.android-app .mobile-brand>span{font-size:1rem;letter-spacing:-.015em}
.android-app .mobile-brand small{font-size:.75rem;letter-spacing:0}
.android-app .mobile-avatar{width:44px;height:44px}
.android-app .panel{padding:22px;box-shadow:0 3px 12px #18384d04}
.android-app .mobile-welcome{margin:4px 0 24px}
.android-app .mobile-welcome h1{font-size:clamp(1.65rem,4vw,2.25rem);line-height:1.2;letter-spacing:-.035em;margin:4px 0 10px}
.android-app .mobile-welcome p{font-size:.9375rem;margin:0;color:var(--ui-muted)}
.android-app .mobile-section-title{margin-bottom:12px;flex-wrap:wrap}
.android-app .mobile-section-title h2{font-size:1.0625rem;font-weight:700}
.android-app .mobile-text-button{font-size:.875rem;padding:8px 0}
.android-app .mobile-shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.android-app .mobile-shortcut{min-height:144px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding:18px;gap:16px;box-shadow:none;border-radius:18px}
.android-app .mobile-shortcut strong{font-size:.9375rem;line-height:1.4}
.android-app .mobile-shortcut small{font-size:.75rem;margin:0 0 4px;color:var(--ui-muted)}
.android-app .mobile-shortcut-icon{width:44px;height:44px;border-radius:14px}
.android-app .mobile-shortcut-arrow{display:none}
.android-app .mobile-account-links{margin-top:24px;padding:0 18px;border-radius:18px}
.android-app .mobile-account-links strong{font-size:.9375rem}
.android-app .mobile-account-links small{font-size:.8125rem;line-height:1.45}
.android-app .mobile-account-links>a{min-height:80px;padding-block:18px}
.android-app .mobile-bottom{
  --navigation-layout:bar;left:0;right:0;width:auto;transform:none;border-radius:0;
  min-height:80px;padding:8px 8px max(8px,env(safe-area-inset-bottom));box-shadow:0 -3px 18px #15384b06
}
.android-app .mobile-bottom>a,.android-app .mobile-bottom>button{min-height:64px;font-size:.75rem;line-height:1.3;padding:8px 3px;gap:6px;border-radius:16px;overflow-wrap:anywhere}
.android-app .mobile-bottom [aria-current=page],.android-app .mobile-bottom [aria-expanded=true]{background:#e6f1f9;color:#124d72}
.android-app .mobile-bottom svg{width:24px;height:24px}
.android-app .portal-sidebar{border-radius:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.android-app .portal-sidebar .mobile-role-chips{margin-top:14px}
.android-app .mobile-drawer-head h2{font-size:1.125rem}
.android-app .portal-sidebar .sidebar-caption{font-size:.75rem}
.android-app .portal-sidebar a{font-size:.9375rem;min-height:48px}
.android-app .ll-tabs>a{font-size:.875rem;flex-basis:120px;min-height:48px}
.android-app .ll-dialog{width:min(560px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
.android-app :where(.sticky-actions,.ll-message-form){scroll-margin-bottom:96px}
.android-app.mobile-keyboard .portal-main{padding-bottom:24px}
.android-app.mobile-keyboard .sticky-actions{bottom:12px}
@media(max-width:599px){
  .android-app .portal-main{padding:20px 16px calc(var(--mobile-nav-height) + 24px)}
  .android-app .mobile-header{padding-inline:16px}
  .android-app .panel{padding:18px}
  .android-app .mobile-shortcut{padding:16px;gap:14px}
  .android-app .portal-main :is(.card-grid,.compact-cards,.dashboard-grid,.teacher-group-summary,.form-grid,.crm-form-grid,.crm-two-columns){grid-template-columns:minmax(0,1fr)}
  .android-app .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Current window size (not device identity) determines bar vs rail. */
@media(min-width:600px) and (min-height:480px){
  .android-app .mobile-header{margin-left:var(--ui-rail-width);padding-inline:28px}
  .android-app .portal-layout{margin-left:var(--ui-rail-width);min-height:calc(100dvh - 68px)}
  .android-app .portal-main{padding:28px 28px 36px}
  .android-app .mobile-bottom{
    --navigation-layout:rail;inset:0 auto 0 0;width:var(--ui-rail-width);height:100vh;height:100dvh;
    min-height:0;grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(76px,max-content);
    align-content:start;gap:8px;padding:20px 8px;border:0;border-right:1px solid var(--ui-line);
    border-radius:0;box-shadow:none;overflow-y:auto
  }
  .android-app .mobile-bottom>a,.android-app .mobile-bottom>button{min-height:76px;padding:12px 3px}
  .android-app .mobile-shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .android-app .sticky-actions{bottom:16px}
  .android-app.mobile-keyboard .mobile-bottom{display:grid}
}
@media(min-width:1100px) and (min-height:480px){
  .android-app .mobile-home-grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(260px,1fr);gap:28px;align-items:start}
  .android-app .mobile-home-grid>.mobile-account-links{margin-top:60px}
  .android-app .mobile-shortcut-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-height:479px){.android-app .mobile-header{position:relative}.android-app .mobile-welcome{margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){:where(.portal-body,.android-app) *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(forced-colors:active){.android-app .mobile-bottom [aria-current=page]{outline:2px solid Highlight}.android-app .mobile-shortcut{border:1px solid CanvasText}}

/* Remove repeated section captions and unnecessary nested table outlines. */
.android-app .portal-page-head .eyebrow{display:none}
.portal-body .portal-main .table-wrap.ui-table-cards,
.android-app .portal-main .table-wrap.ui-table-cards{
  border:0;border-radius:0;background:transparent;box-shadow:none;padding:0
}
.portal-body .portal-main .ui-table-cards table[data-ui-mode=cards]{
  border:0;border-radius:0;background:transparent;box-shadow:none
}

/* Sentence-case headers avoid broken all-caps words in desktop columns. */
.portal-body table[data-ui-mode=table] th{padding-inline:12px;text-transform:none;letter-spacing:0}
