/* Premium phone layout. Desktop layouts and native business handlers are preserved. */
@media screen and (max-width:850px){
 html.um-workspace-document{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:76px}
 .up-modern-shell{--um-mobile-bottom:calc(70px + env(safe-area-inset-bottom,0px))}
 .up-modern-shell :is(.um-column,.um-main,.up-workspace-page,section,article,form,fieldset){min-width:0}
 html.um-workspace-document .um-header{height:auto;min-height:64px;padding:10px max(14px,env(safe-area-inset-right,0px)) 10px max(14px,env(safe-area-inset-left,0px));gap:10px;background:#f6f8f5f5}
 .up-modern-shell .um-header-tools{gap:8px}.up-modern-shell :is(.um-menu-button,.um-header-module,.um-year){min-height:44px!important;border-radius:12px!important}
 .up-modern-shell .um-menu-button,.up-modern-shell .um-header-module{width:44px;flex:0 0 44px;padding:10px!important}.um-header-context,.um-location{min-width:0}
 html.um-workspace-document .um-main{padding:22px max(16px,env(safe-area-inset-right,0px)) calc(var(--um-mobile-bottom) + 24px) max(16px,env(safe-area-inset-left,0px))!important}
 .up-modern-shell .um-page-heading{align-items:flex-start;margin-bottom:20px}.up-modern-shell .um-page-heading h1{font-size:25px!important;line-height:1.3;letter-spacing:-.7px;overflow-wrap:break-word;word-break:normal}
 .up-modern-shell .um-page-heading div>span{font-size:13px;line-height:1.7;margin-top:8px}
 .up-modern-shell :is(.up-workspace-page button,.up-workspace-page summary,.up-bie-dialog button){min-height:44px!important;max-width:100%;white-space:normal}
 .up-modern-shell :is(button,a,summary){touch-action:manipulation;-webkit-tap-highlight-color:transparent}
 .up-modern-shell :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;max-width:100%;min-width:0;min-height:46px!important;box-sizing:border-box}
 .up-modern-shell textarea{line-height:1.6}.up-modern-shell input[type=date]{min-width:0;width:100%;appearance:none;-webkit-appearance:none}
 .up-modern-shell :is(.overflow-x-auto,.up-rp-table-wrap,.up-fb-scroll){max-width:100%;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 .up-modern-shell :is(.up-student-name,.up-fc-name,.up-fi-name,.up-pw-student h3,.up-bie-person strong){word-break:normal;overflow-wrap:break-word;line-height:1.6}
 .up-modern-shell .um-mobile-nav{height:auto;min-height:var(--um-mobile-bottom);padding:7px max(10px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));background:#fffffff5;backdrop-filter:blur(16px);box-shadow:0 -4px 20px #24332f05;z-index:60}
 .up-modern-shell .um-mobile-nav .um-nav-link{min-width:0;min-height:50px!important;padding:7px 3px!important;gap:5px;font-size:10px!important;line-height:1.3;border-radius:12px!important}
 .up-modern-shell .um-mobile-nav .um-nav-link svg{width:21px;height:21px}
 .up-modern-shell .um-menu-overlay{z-index:1100}.up-modern-shell .um-drawer{width:min(300px,calc(100vw - 40px));max-width:100%;height:100vh;height:100dvh}
 .up-modern-shell .um-drawer .um-rail{width:100%;padding:calc(18px + env(safe-area-inset-top,0px)) 16px calc(14px + env(safe-area-inset-bottom,0px));overflow:hidden}
 .um-drawer .um-brand{padding-bottom:14px}.um-drawer .um-school{margin-bottom:12px}.up-modern-shell .um-drawer .um-close{width:44px;height:44px;align-items:center;justify-content:center;flex-shrink:0}
 .um-drawer .um-nav{overflow-y:auto;overscroll-behavior:contain}.um-drawer .um-nav-link{flex-shrink:0}.um-drawer .um-rail-bottom{margin-top:auto}
 .up-modern-shell .up-bie-overlay{padding:12px;align-items:center;z-index:1200;background:#24332f6b}.up-modern-shell .up-bie-dialog{max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));border-radius:20px;border-color:#dce3dd;background:#f6f8f5}
 .up-modern-shell .up-bie-header{padding:16px;gap:12px}.up-modern-shell .up-bie-header h2{font-size:20px!important}.up-modern-shell .up-bie-header>button{width:44px;height:44px;color:#58665f;background:#f6f8f5;border-color:#dce3dd}
 .up-modern-shell .up-bie-scroll{padding:16px}.up-modern-shell .up-bie-rows{grid-template-columns:1fr;gap:12px}.up-modern-shell .up-bie-person strong{font-size:14px}.up-modern-shell .up-bie-person small{font-size:12px}.up-modern-shell .up-bie-money dt{font-size:11px}.up-modern-shell .up-bie-money dd{font-size:13px;color:#24332f}
 .up-modern-shell .up-bie-footer{padding:12px 16px;background:#fff;border-color:#dce3dd}.up-modern-shell .up-bie-footer>div:last-child{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;width:100%}.up-modern-shell .up-bie-footer button{min-height:46px;white-space:normal;padding:10px!important}.up-modern-shell .up-bie-primary{background:#14785c!important;color:#fff!important}
}
@media screen and (max-width:600px){
 .up-modern-shell .um-welcome{padding:22px 20px;border-radius:20px;box-shadow:none}.up-modern-shell .um-welcome h2{font-size:27px!important;line-height:1.3!important}.up-modern-shell .um-welcome p{font-size:13px;line-height:1.7}.up-modern-shell .um-hero-primary{width:100%;min-height:46px!important}
 .up-modern-shell .um-stats{gap:10px}.up-modern-shell .um-stat{padding:16px 14px;border-radius:16px}.up-modern-shell .um-stat>strong{font-size:clamp(18px,5.4vw,24px)!important;white-space:normal;word-break:normal;overflow-wrap:break-word;font-variant-numeric:tabular-nums}.um-stat>div{gap:6px;margin-bottom:12px}.um-stat>div>span{font-size:11px;line-height:1.5}.um-stat small{font-size:11px;line-height:1.6}
 .up-modern-shell .um-stat:is(.is-cash,.is-balance)>strong{font-size:clamp(16px,4.4vw,20px)!important;white-space:nowrap}
 .up-modern-shell .um-module-heading{align-items:flex-start;gap:12px}.up-modern-shell .um-module-heading h2{font-size:22px!important;line-height:1.4}.up-modern-shell .um-module-heading .um-btn{font-size:11px!important;min-height:44px}
 .up-modern-shell .um-quick.um-module-grid{grid-template-columns:1fr;gap:10px}.up-modern-shell .um-module-grid :is(button,a).um-module-card{min-height:110px;padding:18px!important;gap:12px;border-radius:16px!important}.up-modern-shell .um-module-grid .um-module-copy strong{font-size:17px!important}.up-modern-shell .um-module-grid .um-module-copy small{font-size:12px!important}
 .up-modern-shell :is(.up-student-list,.up-fi-card,.up-fc-card,.up-fo,.up-pw-summary,.up-pw-form-panel,.up-pw-history,.up-rp-panel,.sw-panel,.sw-hero){border-radius:18px;border-color:#dce3dd}
 .up-modern-shell .up-student-row{padding:16px;gap:12px}.up-modern-shell .up-student-name{font-size:14px!important;text-align:left;min-height:44px}.up-modern-shell .up-student-phone,.up-modern-shell .up-student-membership p{font-size:12px}.up-modern-shell .up-student-row-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}.up-modern-shell .up-student-row-actions button{min-height:44px}.up-modern-shell .up-student-selection{gap:12px;flex-wrap:wrap}.up-modern-shell .up-student-selection label{min-height:44px}
 .up-modern-shell :is(.up-fc-primary,.up-fi-primary,.up-pw-submit,.sw-primary,.up-rp-exports .primary){background:#14785c!important;color:#fff!important;border-color:#14785c!important}
 .up-modern-shell :is(.up-fi-name,.up-fc-name,.up-pw-student h3){color:#24332f!important}
 .up-modern-shell .up-fi-card{padding:16px}.up-modern-shell .up-fi-card>header{gap:12px;align-items:flex-start}.up-modern-shell .up-fi-name{font-size:18px!important;min-height:44px;letter-spacing:-.35px}.up-modern-shell .up-fi-rate{min-width:90px;flex-shrink:0}.up-modern-shell .up-fi-rate strong{font-size:13px}.up-modern-shell .up-fi-metrics dd{font-size:15px}.up-modern-shell .up-fi-metrics dt{font-size:11px}.up-modern-shell .up-fi-card footer{flex-wrap:wrap;gap:8px}.up-modern-shell .up-fi-card footer :is(button,summary){min-height:44px}
 .up-modern-shell .up-fc-card{padding:16px}.up-modern-shell .up-fc-name{font-size:14px!important;min-height:44px}.up-modern-shell .up-fc-amounts{gap:8px;padding:12px 0}.up-modern-shell .up-fc-amounts dt{font-size:10px;line-height:1.5}.up-modern-shell .up-fc-amounts dd{font-size:13px}.up-modern-shell .up-fc-actions{display:flex;flex-wrap:wrap;gap:8px}.up-modern-shell .up-fc-actions>:is(button,details){flex:1 1 auto}.up-modern-shell .up-fc-actions :is(button,summary){min-height:44px;padding:10px 12px;font-size:12px}.up-modern-shell .up-fc-quick[open]{flex-basis:100%}.up-modern-shell .up-fc-footer summary,.up-modern-shell .up-fc-footer a{min-height:44px}.up-modern-shell .up-fc-quick-panel{gap:12px}.up-modern-shell .up-fc-quick-panel label{min-width:0;flex-basis:100%}
 .up-modern-shell :is(.up-fo-heading,.up-pw-heading,.up-rp-heading){flex-wrap:wrap;gap:12px}.up-modern-shell :is(.up-fo-heading h2,.up-pw-heading h2,.up-rp-heading h2){font-size:21px!important;line-height:1.4;word-break:normal;overflow-wrap:break-word}
 .up-modern-shell .up-pw-totals{grid-template-columns:1fr;gap:0}.up-modern-shell .up-pw-totals>div{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:11px 0;border-bottom:1px solid #eef0fa}.up-modern-shell .up-pw-totals dd{font-size:18px;white-space:nowrap}.up-modern-shell .up-pw-fields{grid-template-columns:1fr}.up-modern-shell .up-pw-submit{min-height:48px}.up-modern-shell .up-pw-actions :is(button,summary){min-height:44px}
 .up-modern-shell .up-rp-exports{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}.up-modern-shell .up-rp-exports button{min-height:44px;font-size:12px}.up-modern-shell .up-rp-metrics{grid-template-columns:1fr 1fr;gap:10px}.up-modern-shell .up-rp-metrics article{min-width:0;padding:14px}.up-modern-shell .up-rp-metrics strong{font-size:20px;overflow-wrap:break-word}.up-modern-shell .up-rp-metrics span,.up-modern-shell .up-rp-metrics small{font-size:11px}.up-modern-shell .up-rp-tabs{display:grid;grid-template-columns:repeat(3,1fr);width:100%}.up-modern-shell .up-rp-tabs button{min-height:44px;padding:9px 8px}.up-modern-shell .up-rp-filters{grid-template-columns:1fr}.up-modern-shell .up-rp-search>div{min-width:0}.up-modern-shell .up-rp-search input{width:100%}
 .up-modern-shell .sw-hero{padding:18px}.up-modern-shell .sw-hero p{font-size:13px;line-height:1.7}.up-modern-shell .sw-filters{grid-template-columns:1fr;gap:12px}.up-modern-shell .sw-filters label{min-width:0}.up-modern-shell .sw-queue-actions{display:grid;grid-template-columns:1fr;gap:8px}.up-modern-shell .up-smartwa :is(button,a.sw-primary){min-height:44px}.up-modern-shell .sw-section-title{gap:10px;flex-wrap:wrap}
 .up-modern-shell .um-bulk-paste{margin:14px;padding:14px;border-radius:14px}.up-modern-shell .um-bulk-paste summary{min-height:36px;line-height:1.6}.up-modern-shell .um-bulk-paste button{width:100%}
 #bulkItemForm .overflow-x-auto{overflow:visible}.up-modern-shell #bulkItemForm table{display:block;min-width:0!important;width:100%;border:0}.up-modern-shell #bulkItemForm thead{display:none}.up-modern-shell #bulkItemRowsBody{display:grid;gap:12px;padding:0 14px 14px;background:transparent}
 .up-modern-shell #bulkItemRowsBody tr{display:grid;grid-template-columns:1fr;gap:8px;border:1px solid #dce3dd;border-radius:14px;padding:14px;background:#fff}.up-modern-shell #bulkItemRowsBody td{display:block;min-width:0!important;width:100%!important;padding:0!important;background:transparent;text-align:left}.up-modern-shell #bulkItemRowsBody td:first-child{font-size:11px;color:#58665f}.up-modern-shell #bulkItemRowsBody td:first-child:before{content:'Item '}.up-modern-shell #bulkItemRowsBody td:nth-child(2):before{content:'Nama item yuran';display:block;font-size:12px;color:#58665f;margin-bottom:5px}.up-modern-shell #bulkItemRowsBody td:nth-child(3):before{content:'Kadar (RM)';display:block;font-size:12px;color:#58665f;margin:2px 0 5px}.up-modern-shell #bulkItemRowsBody input{border:1px solid #dce3dd!important;border-radius:10px!important;padding:10px 12px!important;background:#fff!important}.up-modern-shell #bulkItemRowsBody td:nth-child(3)>div{padding:0!important;border:0!important}.up-modern-shell #bulkItemRowsBody td:nth-child(3)>div>span{display:none}
 .up-modern-shell .up-bie-fields{grid-template-columns:90px minmax(0,1fr)}.up-modern-shell .up-bie-fields label{font-size:12px}.up-modern-shell .up-bie-person{flex-wrap:wrap}.up-modern-shell .up-bie-person>div{flex:1 1 180px}.up-modern-shell .up-bie-row [data-item-edit-status]{max-width:100%;font-size:10px!important}.up-modern-shell .up-bie-footer>div:first-child{font-size:11px;line-height:1.6;margin-bottom:8px}
 .up-modern-shell :is(.pm-grid,.pm-split){grid-template-columns:1fr}.up-modern-shell .pm-bar{flex-wrap:wrap;gap:10px}.up-modern-shell .pm-bar :is(button,select){min-height:44px;max-width:100%}.up-modern-shell .pm-title{font-size:20px!important;line-height:1.4}
}
/* Scoped teacher, invitation and access-management pages share the phone scale. */
@media screen and (max-width:600px){
 html:not(.um-workspace-document){-webkit-text-size-adjust:100%}
 body:has(.topbar .brand) .topbar{padding:14px 16px;gap:10px;flex-wrap:wrap}
 body:has(.topbar .brand) main{padding:22px 16px calc(28px + env(safe-area-inset-bottom,0px));min-width:0}
 body:has(.topbar .brand) :is(.page-heading,.section-heading,.student-title,.tools){align-items:flex-start;flex-wrap:wrap;gap:12px}
 body:has(.topbar .brand) :is(.card,.student-card,.stat){padding:16px;border-radius:16px;min-width:0}
 body:has(.topbar .brand) :is(.tools input,.tools select){width:100%;max-width:100%;flex:1 1 100%}
 body:has(.topbar .brand) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:46px;min-width:0;max-width:100%}
 body:has(.topbar .brand) .stats{grid-template-columns:1fr 1fr;gap:10px}body:has(.topbar .brand) .stat strong{font-size:22px;overflow-wrap:break-word}
 body:has(.topbar .brand) .form-grid{grid-template-columns:1fr}body:has(.topbar .brand) .button{min-height:46px;white-space:normal;text-align:center}
 body:has(.topbar .brand) dialog{max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px);overflow:auto;padding:18px}
}
@media screen and (max-height:480px) and (max-width:850px){
 .up-modern-shell .um-drawer .um-rail{padding-top:10px;padding-bottom:10px}.um-drawer .um-brand{padding-bottom:8px}.um-drawer .um-school,.um-drawer .um-nav-caption{display:none}.up-modern-shell .um-drawer .um-nav-link{min-height:44px}.up-modern-shell .um-drawer .um-account{padding-top:6px;margin-top:6px}
 .up-modern-shell .up-bie-header{padding:10px 14px}.up-modern-shell .up-bie-kicker{display:none}.up-modern-shell .up-bie-footer{padding:8px 14px}
}

@media screen and (max-width:359px){.up-modern-shell .um-stat:is(.is-cash,.is-balance){grid-column:1/-1}.up-modern-shell .um-stat:is(.is-cash,.is-balance)>strong{font-size:22px!important}.up-modern-shell .up-fi-card>header{flex-direction:column}.up-modern-shell .up-fi-rate{display:flex;align-items:center;gap:8px;width:100%}}

@media screen and (max-width:600px){.up-modern-shell .um-bulk-intro{flex-direction:row!important;margin-bottom:0;gap:0}.up-modern-shell .um-bulk-intro>div:first-child>div,.up-modern-shell .um-bulk-intro>div:last-child:not(:first-child){display:none}.up-modern-shell .um-bulk-intro>div:first-child{gap:0}.up-modern-shell .um-bulk-intro [data-action=back-bulk-items-page]{width:auto;gap:8px;padding:0 12px}.up-modern-shell .um-bulk-intro [data-action=back-bulk-items-page]:after{content:'Kembali';font-size:12px}}

@media screen and (max-width:600px){body:has(.topbar .brand) .member-row{flex-wrap:wrap;gap:12px}body:has(.topbar .brand) :is(.member-row p,.member-row h3,.student-title h3,.audit){overflow-wrap:anywhere}body:has(.topbar .brand) dialog{width:calc(100vw - 24px);margin:auto}body:has(.topbar .brand) dialog header{gap:12px;align-items:flex-start}body:has(.topbar .brand) .table-wrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}}

@media screen and (max-width:600px){
 .up-modern-shell :is(.up-fo,.up-pw,.up-rp,.up-fi-card,.up-fc-card,.up-bie-dialog){color:#24332f}
 .up-modern-shell :is(.up-fo h2,.up-fo h3,.up-rp h2,.up-rp h3,.up-pw h2,.up-pw h3,.up-bie-header h2,.up-bie-person strong){color:#24332f!important}
 .up-modern-shell .up-bie-header p,.up-modern-shell .up-bie-person small{color:#58665f}.up-modern-shell .up-bie-row{border-color:#dce3dd}
 .up-modern-shell .up-fo-metrics{grid-template-columns:1fr;gap:0;padding:4px 0;margin-top:14px}.up-modern-shell .up-fo-metrics>div{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0}.up-modern-shell .up-fo-metrics>div+div{border-left:0;border-top:1px solid #eef0fa;padding-left:0}.up-modern-shell .up-fo-metrics dt{font-size:12px;color:#58665f}.up-modern-shell .up-fo-metrics dd{margin:0;font-size:18px;color:#24332f;white-space:nowrap;overflow-wrap:normal}.up-modern-shell .up-fo-metrics dd.up-fo-cash{color:#14785c}.up-modern-shell :is(.up-fo-progress>span,.up-fi-progress>span,.up-rp-progress>span){background:#8770d5}
 .up-modern-shell .up-rp-metrics article{background:#fff;border-color:#dce3dd}.up-modern-shell .up-rp-metrics strong{color:#24332f}.up-modern-shell .up-rp-metrics .collected strong{color:#14785c}.up-modern-shell .up-rp-metrics .outstanding strong{color:#b7791f}
 .up-modern-shell .up-rp-filters :is(label,select){width:100%;min-width:0;max-width:100%}.up-modern-shell .up-rp-filters label{display:grid;gap:7px}
}

