/* Shared mobile presentation layer; preserve native controls, zoom and app behavior. */
.app-frame{--km-radius:10px;--km-border:#d6e2ef;--km-action:#1465e8}
.app-frame input,.app-frame select,.app-frame textarea{box-sizing:border-box;min-width:0;max-width:100%}
.app-frame .main-nav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.app-frame .rail-bottom{flex-shrink:0}
@media screen and (max-width:1024px){
 .app-frame{font-size:15px;line-height:1.55}
 .app-frame[lang="my"]{line-height:1.85}
 .app-frame .main-area,.app-frame .content-area,.app-frame .panel,.app-frame .page-heading>div{min-width:0;max-width:100%}
 .app-frame .content-area{padding:16px 12px 32px}
 .app-frame h1,.app-frame .page-heading h1{font-size:24px;line-height:1.45;letter-spacing:normal;margin:0 0 8px}
 .app-frame h2,.app-frame .panel-head h2{font-size:19px;line-height:1.5}
 .app-frame h3{font-size:17px;line-height:1.5}
 .app-frame[lang="my"] :is(h1,h2,h3,h4){line-height:1.75;letter-spacing:normal}
 .app-frame .page-heading p{font-size:15px;line-height:1.7;margin:0}
 .app-frame .page-heading{gap:12px;align-items:flex-start;margin-bottom:16px;flex-wrap:wrap}
 .app-frame button:not(.km-step-photo),.app-frame a.soft-action{font-size:14px;line-height:1.55;min-height:44px;border-radius:var(--km-radius);padding:10px 12px;max-width:100%;height:auto;white-space:normal}
 .app-frame[lang="my"] button:not(.km-step-photo){line-height:1.85;letter-spacing:normal}
 .app-frame button svg{flex-shrink:0;width:19px;height:19px}
 .app-frame .module-icon{width:24px;height:24px;flex-shrink:0}
 .app-frame :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px;line-height:1.6;border-radius:var(--km-radius);width:100%;max-width:100%;min-width:0;min-height:46px;padding:10px 12px}
 .app-frame input:is([type="date"],[type="month"],[type="time"]){display:block;box-sizing:border-box;min-width:0;width:100%;max-width:100%;-webkit-appearance:none;appearance:none}
 .app-frame input::-webkit-date-and-time-value{text-align:left;min-width:0}
 .app-frame label{font-size:14px;min-width:0;max-width:100%;gap:6px}
 .app-frame :is(.monthly-filter,.attendance-filter,.staff-month-filter){display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:14px}
 .app-frame .parent-layout{grid-template-columns:minmax(0,1fr);gap:16px}
 .app-frame .parent-phone{width:100%;max-width:360px;min-width:0;margin-inline:auto}
 .app-frame .office-family-tools{min-width:0;max-width:100%}
 .app-frame .fee-filter-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
 .app-frame .monthly-filter>*,.app-frame .panel-head>*{min-width:0;max-width:100%}
 .app-frame .attendance-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%}
 .app-frame .attendance-actions button{width:100%;min-width:0;flex:none}
 .app-frame .segmented-tabs,.app-frame .staff-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:4px;scroll-padding-inline:8px;padding-bottom:4px}
 .app-frame .segmented-tabs button,.app-frame .staff-tabs button{flex:0 0 auto;white-space:nowrap;max-width:none;font-size:14px;border-radius:0;padding:10px 12px}
 .app-frame .stats-grid{gap:10px}
 .app-frame .stat-card{padding:14px;min-width:0;gap:10px;border-radius:12px}
 .app-frame .stat-card :is(p,small){font-size:13px;line-height:1.7}
 .app-frame .stat-card strong{font-size:24px;line-height:1.4;overflow-wrap:normal}
 .app-frame .stat-card h3,.app-frame .stat-card h4{font-size:14px;line-height:1.7}
 .app-frame[lang="my"] .stats-grid{grid-template-columns:minmax(0,1fr)}
 .app-frame .panel-head{gap:10px;flex-wrap:wrap}
 .app-frame .topbar[data-tools-open="true"] .topbar-right{display:flex;gap:10px;align-items:center;padding:12px 0}
 .app-frame .vps-session-bar{display:flex;flex-wrap:wrap;flex-basis:100%;width:100%;gap:10px}
 .app-frame .vps-session-bar label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;flex-basis:100%;width:100%}
 .app-frame .vps-session-bar select{max-width:100%;width:100%}
 .app-frame .vps-session-bar button{flex:1 1 130px;background:#fff;color:#285187;border:1px solid #cedcf0;font-weight:600}
 .app-frame .side-rail{height:100dvh;max-height:100dvh;padding:16px 12px max(16px,env(safe-area-inset-bottom))}
 .app-frame .side-rail .brand-lockup{margin-bottom:14px;flex-shrink:0}
 .app-frame .side-rail .school-switch{margin-bottom:14px;flex-shrink:0}
 .app-frame .nav-item{font-size:14px;min-height:44px;gap:10px;padding:10px 12px}
 .app-frame .rail-bottom{padding-top:10px}
 .app-frame .school-switch strong{font-size:14px}
 .app-frame .row-actions{gap:8px;flex-wrap:wrap}
 .app-frame .km-step-photo{padding:0;min-height:0;border-radius:10px}
 .app-frame [hidden]{display:none!important}
}
@media screen and (max-width:380px){.app-frame .stats-grid{grid-template-columns:minmax(0,1fr)}}
@media print{.km-owner-return{display:none!important}}

/* Dialogs render through a portal outside .app-frame. */
@media screen and (max-width:1024px){
 [role="dialog"]{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow-y:auto;min-width:0}
 [role="dialog"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){box-sizing:border-box;font-size:16px!important;line-height:1.6;min-height:46px;min-width:0;width:100%;max-width:100%;padding:10px 12px;border-radius:10px}
 [role="dialog"] input:is([type="date"],[type="month"]){-webkit-appearance:none;appearance:none;min-width:0}
 [role="dialog"] label{font-size:14px;line-height:1.7;min-width:0}
 [role="dialog"] h2{font-size:20px;line-height:1.6}
 [role="dialog"] button:not([data-slot="dialog-close"]){min-height:44px;height:auto;padding:10px 12px;font-size:14px;line-height:1.6;white-space:normal;border-radius:10px}
 html[lang="my"] [role="dialog"] :is(h2,label,button){line-height:1.85}
}
