/* Shared viewport geometry. Page-specific layouts live with their own modules. */
html[data-mobile-surface=dashboard] body[data-page]{--dock-space:100px;grid-template-rows:var(--header-space) minmax(0,1fr)}
.mgm-mobile-close{display:none}
#recBody .rwCardHead{cursor:default}
#recBody .rwCardHead .rec-section-toggle{display:flex;align-items:center;gap:12px;flex:1 1 180px;min-width:0;min-height:44px;padding:6px 0!important;border:0;border-radius:6px;background:transparent;box-shadow:none;color:inherit;text-align:left;cursor:pointer;white-space:normal}
#recBody .rec-section-toggle .rwName{font-size:inherit;overflow-wrap:anywhere;line-height:1.35}
#recBody .rwCardHead .rec-section-toggle{font-size:19px!important}
#recBody .rec-section-toggle:focus-visible{outline:2px solid #0071e3;outline-offset:4px}
#recBody .rec-section-chevron{flex:none;width:9px;height:9px;margin:0 5px 4px 0;border-right:2px solid #52718d;border-bottom:2px solid #52718d;transform:rotate(45deg)}
#recBody .rec-section-toggle[aria-expanded=true] .rec-section-chevron{transform:rotate(225deg);margin-bottom:-4px}
#recBody .rwCardBody[hidden]{display:none!important}
#recBox button:disabled{opacity:.4;cursor:not-allowed;filter:grayscale(1)}
html[data-mobile-surface=dashboard] body[data-page=support]{--dock-space:0px;grid-template-rows:0 minmax(0,1fr)}
@media(max-width:1023px){
 html[data-mobile-surface=dashboard]:has(body[data-page=daily-review]),
 html[data-mobile-surface=dashboard] body[data-page=daily-review]{background:#f3f7fa!important}
 html[data-mobile-surface=dashboard] body[data-page]{--dock-space:calc(82px + env(safe-area-inset-bottom,0px));--header-space:44px;padding-top:env(safe-area-inset-top,0px)}
 html[data-mobile-surface=dashboard] body[data-page] #board{padding:8px 12px 16px!important;scroll-padding-bottom:16px}
 /* Auto margins center the tools in the usable viewport, but collapse to zero
    on short screens so the first row stays reachable by scrolling. */
 html[data-mobile-surface=dashboard] body[data-page=tools] #board{justify-content:flex-start}
 html[data-mobile-surface=dashboard] body[data-page=tools] #board .tools-gallery{flex:none;width:min(100%,max(260px,calc(100dvh - var(--header-space) - var(--dock-space) - 40px)));max-width:520px!important;margin:auto;gap:clamp(10px,3vw,16px)!important;padding:0}
 html[data-mobile-surface=dashboard] body[data-page=home] #board{padding:4px 0 8px!important}
 html[data-mobile-surface=dashboard] body[data-page=home] #board>#featureBlocks.home-feature-blocks{width:calc(100% - 16px);margin:0 8px;min-height:0;height:auto;aspect-ratio:auto}
 body[data-page] #topWrap header{padding:2px 12px}
 body[data-page] #topWrap h1{height:40px}
 body[data-page] #topWrap .calendar-brand{padding:0 4px}
 #navigationDock{bottom:max(8px,env(safe-area-inset-bottom,0px));height:62px;padding:4px;border-radius:22px}
 body[data-page] #navigationDock :is(.ptab,#settingsToggle){width:clamp(40px,11vw,64px);flex-basis:clamp(40px,11vw,64px);height:52px;min-height:44px;padding:2px 0 5px!important}
 body[data-page] #navigationDock #loginArea{width:clamp(40px,11vw,64px);flex-basis:clamp(40px,11vw,64px)}
 #dockBubble{height:54px;top:3px}
 #navigationDock .dock-symbol{width:34px;height:34px}
 #navigationDock .dock-date{font-size:11px}
 #dockTooltip{display:none}
 body[data-page] #navigationDock #helloMenu{left:auto!important;right:0!important;width:min(320px,calc(100vw - 28px));max-width:calc(100vw - 28px);bottom:calc(100% + 12px);max-height:calc(100dvh - 110px);overflow:auto}
 html[data-mobile-surface=dashboard] body[data-page=support]{--dock-space:0px;padding:0}
 html[data-mobile-surface=dashboard] body[data-page=support] #board{padding:0!important}
 body[data-page=support] #topWrap{top:env(safe-area-inset-top,0px)}
 body:has(:is(#overlay,#rewOv,#recOv,#recLogOv,#rewEditOv,#rewExtraOv,#logOv,#pwdOv).show) #navigationDock{visibility:hidden}

 /* A mobile dialog is a usable window, without the desktop's decorative offsets. */
 html[data-mobile-surface=dashboard] :is(#overlay,#rewOv,#recOv,#recLogOv,#rewEditOv,#rewExtraOv,#myPerfOv,#fundAuditOv){padding:8px;align-items:center;overflow:auto}
 html[data-mobile-surface=dashboard] :is(#myPerfOv,#fundAuditOv){padding:8px!important;overflow:auto!important}
 #fundAuditOv .perf-desk-scene{height:calc(100dvh - 16px);overflow:visible}
 html[data-mobile-surface=dashboard] :is(.rec-terminal,.my-perf-desk,.perf-desk-scene){width:100%;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);aspect-ratio:auto;background:none}
 html[data-mobile-surface=dashboard] :is(#recOv,#recLogOv,#rewEditOv,#rewExtraOv,#myPerfOv,#fundAuditOv) :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox,#myPerfBox,#fundAuditBox){position:relative;inset:auto;width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;border:1px solid #cad8e3;border-radius:16px!important;box-shadow:0 12px 40px #182b3d30;background:#f5f8fa;overflow:hidden!important}
 :is(.my-perf-folder-label,.perf-folder-art,.perf-folder-tab){display:none}
 #myPerfBox .my-perf-head,#fundAuditBox .perf-window-head{padding:12px;gap:8px;flex-wrap:wrap}
 #myPerfBox .my-perf-heading h2,#fundAuditBox .perf-window-title h2{font-size:19px;white-space:normal}
 #myPerfBox .my-perf-actions,#fundAuditBox .perf-window-actions{display:flex;flex-wrap:wrap;gap:8px;width:auto;max-width:100%;margin-left:auto}
 #myPerfBox .my-perf-close,#fundAuditBox .perf-window-close{min-width:44px;min-height:44px}
 #myPerfBox #myPerfMonth,#fundAuditBox #fundAuditMonth{min-width:0;height:44px;max-width:100%}
 #myPerfOv #myPerfBody{padding:12px}
 #fundAuditBox .perf-window-actions .perf-export-btn{height:44px}
 #fundAuditOv #fundAuditBody{padding-bottom:66px;scroll-padding-top:12px}
 #fundAuditBody .perf-payout-overview{position:static;box-shadow:none}
 .perf-calculator{display:none;position:absolute;right:8px;bottom:58px;width:min(280px,calc(100vw - 32px));height:auto;max-height:calc(100dvh - 90px);aspect-ratio:auto;transform:none;overflow:auto;padding:12px;border:1px solid #96adbe;border-radius:16px;background:#263d4c;box-shadow:0 8px 30px #182b3d50;z-index:10}
 .perf-calculator.is-open{display:block}
 .perf-calculator>img{display:none}
 .perf-calc-screen{position:relative;inset:auto;width:100%;height:52px;padding:8px;background:#e1edde;border-radius:6px;margin-bottom:10px}
 .perf-calc-screen output{font-size:calc(24px * var(--calc-fit,1))}
 .perf-calc-keys{position:static;width:100%;height:auto;grid-template-rows:repeat(6,44px);gap:6px}
 #performanceCalculator .perf-calc-keys button{font-size:18px;min-height:44px;background:#ffffff15}
 #performanceCalculatorToggle{display:block;position:absolute;bottom:10px;right:12px;padding:10px 16px;min-height:44px;border:1px solid #b4ccef;border-radius:12px;background:#eef5ff;color:#205699;font-size:14px;z-index:11}
 #modalBox.k2-calculator-mode{height:calc(100dvh - 16px)!important;max-height:calc(100dvh - 16px)!important;width:100%!important;max-width:100%!important;border-width:2px!important;border-radius:16px!important;padding-bottom:0}
 #modalBox.k2-calculator-mode .reward-status-bar,#modalBox.k2-calculator-mode::after{display:none}
 #modalBox.k2-calculator-mode #mHead{margin-top:0;padding:8px 12px!important;min-height:52px;flex-wrap:nowrap}
 #modalBox.k2-calculator-mode #mHead button{width:44px;max-width:44px;min-height:44px;flex-basis:44px}
 html[data-mobile-surface=dashboard] #rewBox{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)!important;border-width:2px;border-radius:16px!important;padding:0;overflow:hidden}
 #rewBox .reward-status-bar,#rewBox .reward-home-indicator{display:none}
 #rewBox .rewHead{margin:0;padding:10px 12px!important;gap:8px;flex-wrap:nowrap}
 #rewBox .rewHeadMain{gap:8px;flex:1}
 #rewBox .rewTitle,#rewBox .rewHeadMain>b{font-size:21px}
 #rewBox .reward-switch{width:100%;max-width:300px}
 #rewBox .reward-close{width:44px;min-width:44px;height:44px;min-height:44px}
 #rewBox .rwIllustration{min-height:92px;grid-template-columns:minmax(0,1fr) 82px;grid-template-rows:auto}
 #rewBox .rwIllustrationArt{min-height:92px}
 #rewBox .rwIllustrationArt img{max-height:92px}
 #rewBox .rwIllustrationHead{padding:12px}
 #rewBox .rwIllustrationHead b{font-size:17px}
 #rewBox #rewFoot.reward-toolbar{padding:8px 12px!important}
 #rewBox #rewMyTotal{font-size:20px!important;max-width:100%;overflow-x:auto}
 :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox) .rewHead{padding:10px!important;min-height:54px}
 :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox) .rewHead>div{flex-wrap:wrap;max-width:100%;gap:6px!important}
 :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox) button{min-height:44px!important}
 #rewEditFoot,#rewExtraFoot{flex-wrap:wrap}
 #dlgBox{max-height:calc(100dvh - 24px)!important}

 /* The management panel uses one scroll surface; close stays reachable. */
 html[data-mobile-surface=dashboard] #mgmOv{align-items:flex-start;padding:8px;overflow:auto}
 html[data-mobile-surface=dashboard] #mgmOv #mgmBox{display:flex;flex-direction:column;width:100%!important;max-height:none!important;height:auto;aspect-ratio:auto;padding:0;gap:12px;overflow:visible!important}
 #mgmBox :is(.mgm-structure,.mgm-props){display:none}
 #mgmBox .mgm-nameplate{order:-1;position:sticky;top:0;z-index:4;width:100%;height:auto;padding:8px 12px;border-radius:14px;background:#edf4ff;display:flex;align-items:center;justify-content:space-between;gap:8px}
 #mgmBox .mgm-nameplate h2{font-size:20px}
 #mgmBox .mgm-mobile-close{display:inline-flex}
 #mgmBox .mgm-monitor{position:relative;inset:auto;width:100%;height:auto;min-height:0;border:1px solid #cad8e3;border-radius:14px;overflow:visible;flex:none}
 #mgmBox .mgm-monitor::after{display:none}
 #mgmBox .mgm-screen-head{position:sticky;top:0;z-index:3;padding:8px 12px;min-height:52px;border-radius:14px 14px 0 0}
 #mgmBox .mgm-screen-head :is(h3,span){font-size:18px}
 #mgmBox .mgm-screen-scroll,#mgmBox .mgm-monitor-review .mgm-screen-scroll{padding:12px;overflow:visible}
 #mgmBox .mgm-monitor-review{height:min(400px,55dvh);min-height:260px;overflow:hidden}
 #mgmBox .mgm-monitor-review .mgm-screen-scroll{min-height:0;overflow:hidden}
 #mgmBox .audit-event-body{max-height:260px}
 #mgmBox #userList{overflow-x:auto;scrollbar-width:thin}
 #mgmBox #userList::-webkit-scrollbar{display:block;height:6px}
 #mgmBox button{min-height:44px}
 #mgmBox .usTable{min-width:560px}
 #mgmBox .audit-pagination{padding:8px}
 #recycleDialog .recycle-close{min-width:44px;min-height:44px}
 #recycleDialog .recycle-item-copy{overflow-wrap:anywhere}
 #loginOv .login-scene{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;min-height:100dvh;padding:20px 16px max(20px,env(safe-area-inset-bottom));gap:16px}
 #loginOv .login-scene::before{inset:8px}
 #loginOv .login-brand{position:relative;inset:auto;align-self:center;margin:0;gap:12px}
 #loginOv .login-brand>img{width:56px;height:40px}
 #loginOv .login-brand b{font-size:20px}
 #loginOv .login-brand span{font-size:8px;letter-spacing:3px}
 #loginOv .login-message{position:relative;inset:auto;width:100%;max-width:430px;margin:0 auto}
 #loginOv .login-message h1{font-size:23px;line-height:1.35}
 #loginOv .login-message h1 br{display:none}
 #loginOv .login-message p{font-size:12px;letter-spacing:1px;margin-top:4px}
 #loginOv .login-message::after,#loginOv .login-art{display:none}
 #loginOv #loginBox{width:100%;max-width:430px;margin:0 auto;padding:22px;min-height:0;border-radius:18px}
 #loginBox h2{font-size:25px}
 #loginBox .subT{font-size:14px;margin-bottom:16px}
 #loginBox .login-options{margin:12px 0 16px;font-size:12px}
 #loginBox .login-field{margin-bottom:12px}
 #loginBox .act{height:50px;font-size:19px}
 #loginOv .login-filing{position:static;margin:0;flex:none}
 #fundAuditBody .perf-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #fundAuditBody .perf-summary-grid div>span,#fundAuditBody .perf-carry-card>div{max-width:100%;overflow-x:auto;scrollbar-width:thin}
 #board .monthly-file-list{grid-template-columns:minmax(0,1fr)}
}
#recPermBox{overflow:auto;max-height:calc(100dvh - 32px)}
#recPermBox .rec-perm-account{margin:4px 0 14px;color:#45688f;font-size:14px;overflow-wrap:anywhere}
.rec-allowance-setting{margin-top:18px;padding:16px;border:1px solid #ccdeed;border-radius:16px;background:#edf5fc}
.rec-allowance-setting label{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px;align-items:center;margin-bottom:10px;font-size:15px;font-weight:650;color:#254565}
.rec-allowance-setting label span{font-size:12px;font-weight:400;color:#59738d}
#recPermAllowance{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:44px;margin:0;padding:10px 12px;border:1px solid #adc4da;border-radius:10px;background:#fff;color:#183c62;font-size:20px;font-variant-numeric:tabular-nums}
.rec-allowance-setting p{margin:10px 0 0;font-size:12px;line-height:1.7;color:#536c83;overflow-wrap:anywhere}
#recPermBox .btns{flex-wrap:wrap}
#recPermBox .btns button{min-height:44px}
@media(max-width:360px){
 #myPerfBox .my-perf-actions{width:100%;justify-content:space-between}
 #fundAuditBox .perf-window-actions{width:100%}
 #fundAuditBox .perf-window-actions .perf-export-btn{padding:0 8px}
 #logPop .settings-log-main{padding:18px 12px}
 #logPop .settings-log-actions{gap:5px}
 #logPop .settings-log-actions button{padding:8px}
 #fundAuditBody .perf-summary-grid{grid-template-columns:minmax(0,1fr)}
 .settings-password-art{display:none}
 .settings-password-head{min-height:0;padding:0;margin-bottom:18px}
}
@media(max-width:1023px) and (max-height:500px){
 html[data-mobile-surface=dashboard] body[data-page]{--header-space:36px;--dock-space:72px}
 #navigationDock{height:56px;bottom:6px}
 body[data-page] #navigationDock :is(.ptab,#settingsToggle){height:46px}
 #dockBubble{height:48px}
 #navigationDock .dock-symbol{width:30px;height:30px}
 :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox){overflow:auto!important}
 html[data-mobile-surface=dashboard] :is(#recOv,#recLogOv,#rewEditOv,#rewExtraOv) :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox){overflow:auto!important}
 :is(#recBox,#recLogBox,#rewEditBox,#rewExtraBox) :is(.rewHead,#recTop,#recBody,#recLogBody,#rewEditBody,#rewExtraBody){position:static;flex:none;overflow:visible;max-height:none}
 .settings-password-art{display:none}
 .settings-password-head{min-height:0;padding:0;margin-bottom:16px}
 #logPop .settings-log-head{margin-bottom:8px;gap:6px}
 #logPop .settings-log-head p{display:none}
 #logPop .settings-log-main{padding:12px}
}
