/* One display control beside the account photo/menu, on every signed-in portal page. */
body.portal-fullscreen-enabled>header :is(#patient-account,#doctor-account,#admin-account){display:flex;align-items:center;gap:6px;min-width:0}
body.portal-fullscreen-enabled>header :is(#patient-account,#doctor-account,#admin-account)>#portal-identity{min-width:0}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 46px;box-sizing:border-box;width:46px;height:46px;min-width:46px;min-height:46px;max-width:46px;max-height:46px;padding:8px;margin:0;border:1px solid #b8cec1;border-radius:8px;background:#fff;color:#345f4e;font:600 24px/1 system-ui,sans-serif;cursor:pointer;vertical-align:middle}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]:hover{background:#edf5f0;border-color:#729d87;filter:none}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]:focus-visible{outline:3px solid #70a68f;outline-offset:2px}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle][aria-pressed="true"]{background:#e7f3eb;border-color:#528369;color:#174f37}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]:disabled{opacity:.55;cursor:default}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle][hidden]{display:none!important}
body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]>svg{display:block;flex:none;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.portal-fullscreen-enabled :is([data-calendar-expand],[data-waiting-expand]){display:none!important}
body.portal-fullscreen-enabled #eh-staff-calendar .td-calendar-primary-actions:not(:has([data-new])){display:none}

/* Keep the real header and main in place; expanding changes their layout only. */
body.portal-fullscreen-active{overflow:hidden}
body.portal-fullscreen-active>header{position:fixed;inset:0 0 auto;z-index:1100;isolation:isolate;box-sizing:border-box;width:100%;max-width:none;margin-left:0;margin-right:0}
body.portal-fullscreen-active>header>#portal-home{display:inline-flex;min-width:0}
body.portal-fullscreen-active>header>.portal-brand-compact{display:none!important}
body.portal-fullscreen-active>main{position:fixed;inset:var(--portal-fullscreen-header-height,70px) 0 0;z-index:1000;isolation:isolate;box-sizing:border-box;width:100%;height:auto;min-height:0;max-width:none;max-height:none;margin:0;padding:18px 24px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;background:#f5f8f5;color:#18332f}
body.portal-fullscreen-active>main>#app{width:100%;max-width:none;min-width:0}
body.portal-fullscreen-active :is(#workspace-sidebar,#workspace-toolbar,#workspace-backdrop,#workspace-menu-toggle){display:none!important}
body.portal-fullscreen-active>footer{display:none!important}
body.portal-fullscreen-active #eh-staff-calendar .td-week{max-block-size:max(240px,calc(100vh - var(--portal-fullscreen-header-height,70px) - 260px));max-block-size:max(240px,calc(100dvh - var(--portal-fullscreen-header-height,70px) - 260px))}
body.portal-fullscreen-active #eh-staff-calendar .td-context-menu{max-height:max(0px,calc(100vh - var(--portal-fullscreen-header-height,70px) - 16px))!important;max-height:max(0px,calc(100dvh - var(--portal-fullscreen-header-height,70px) - 16px))!important}
body.portal-fullscreen-active.case-chat-open>main,body.portal-fullscreen-active.case-chat-open>header{margin-right:0}
body.portal-fullscreen-active #case-chat-panel{top:var(--portal-fullscreen-header-height,70px);bottom:0;z-index:1150}
body.portal-fullscreen-active #case-chat-incoming{z-index:1150}

@media(max-width:760px){
 body.portal-fullscreen-active>main{padding:14px}
 body.portal-fullscreen-active #eh-staff-calendar .td-week{max-block-size:max(240px,calc(100vh - var(--portal-fullscreen-header-height,70px) - 300px));max-block-size:max(240px,calc(100dvh - var(--portal-fullscreen-header-height,70px) - 300px))}
}
@media(max-width:480px){
 body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]{flex-basis:42px;width:42px;height:42px;min-width:42px;min-height:42px;max-width:42px;max-height:42px;padding:7px}
 body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]>svg{width:22px;height:22px}
}
/* Keep the mobile form dock inside its existing flex viewport, below the content. */
@media screen and (max-width:760px), screen and (max-width:1100px) and (pointer:coarse){
 html.patient-mobile-fixed body.patient-mobile-fixed.portal-fullscreen-active>header{position:fixed;top:0;margin-left:0}
 html.patient-mobile-fixed body.patient-mobile-fixed.portal-fullscreen-active>main{position:fixed;inset:var(--portal-fullscreen-header-height,70px) 0 auto;display:flex;flex:none;flex-direction:column;gap:0;height:max(0px,calc(var(--patient-mobile-height,100dvh) - var(--portal-fullscreen-header-height,70px)));min-height:0!important;max-width:none;max-height:none;margin:0!important;padding:10px 12px 0!important;overflow:hidden}
 body.patient-mobile-fixed.portal-fullscreen-active #app{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden}
 body.patient-mobile-fixed.portal-fullscreen-active #patient-mobile-actions{flex:0 0 auto}
}
@media print{
 body.portal-fullscreen-active{overflow:visible}
 body.portal-fullscreen-active>header{position:static;width:auto}
 body.portal-fullscreen-active>main{position:static;inset:auto;width:auto;height:auto;padding:0;overflow:visible;background:transparent}
 body.portal-fullscreen-enabled>header [data-portal-fullscreen-toggle]{display:none!important}
}
