/* Compact portal header. Device-only board and terminal use their own templates. */
body:not(.board)>header.portal-header{display:grid!important;grid-template-columns:185px minmax(0,1fr);grid-template-rows:auto auto;gap:7px 16px;padding:10px 22px!important;min-height:0;align-items:center}
.portal-header .authenticated-name{grid-column:1;grid-row:1;flex-basis:auto;text-align:left!important;padding:0!important;font-size:17px;overflow-wrap:anywhere}
.portal-header #portal-clock{position:static!important;grid-column:2;grid-row:1;justify-self:end;width:auto;max-width:100%;white-space:normal;text-align:right;margin:0;padding:5px 12px;font-size:21px}
.portal-header>.brand{grid-column:1;grid-row:2;font-size:25px;gap:7px}.portal-header>.brand span{font-size:23px}.portal-header .brand-logo{max-height:45px;max-width:130px}
.portal-header>nav{grid-column:2;grid-row:2;justify-content:flex-start;display:flex;flex-wrap:wrap!important;gap:5px 7px;line-height:1.3;min-width:0}
body:not(.board) .portal-header nav>a,body:not(.board) .portal-header nav button{font-size:15px;min-height:38px;padding:7px 9px;white-space:normal;line-height:1.3}
.portal-header .language-switch{gap:3px;flex-wrap:wrap;margin:0}.portal-header nav form{margin:0}.portal-header .language-flag{width:18px}
.header-tools{position:sticky;top:0;z-index:45;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px 22px;background:#fff;border-bottom:1px solid #d7e5df;box-shadow:0 3px 9px #163b360b;flex-shrink:0;min-width:0}
body:not(.board) .header-tools .button{font-size:15px;min-height:36px;padding:6px 10px;line-height:1.3}.header-compact-name{display:none;font-weight:800;color:#000;font-size:16px}.header-tools [data-header-clock]{display:none;margin-left:auto}.header-tools #portal-clock{position:static!important;margin:0;padding:4px 10px;font-size:18px;max-width:100%;width:auto;text-align:right}
body.portal-header-collapsed>header.portal-header,body.portal-header-collapsed>.pilot{display:contents!important}
body.portal-header-collapsed>.pilot,body.portal-header-collapsed>header.portal-header>:not(.back-button){display:none!important}
.portal-header-collapsed .header-compact-name,.portal-header-collapsed [data-header-clock]{display:block}
.header-notifications{gap:7px;max-width:100%;flex-wrap:wrap}.header-notifications.has-unread{background:#fff3cf!important;border-color:#c47b15!important;color:#6f4208!important}.header-notifications.has-new{box-shadow:0 0 0 2px #e6a331;animation:header-notice 1.6s ease-in-out infinite}.header-new-label{font-weight:750}.header-new-label[hidden]{display:none}.header-tools .badge{padding:0 6px;min-width:24px;text-align:center;border-radius:50px;background:#edf4f0}.header-notifications.has-unread .badge{background:#b94a13;color:#fff}
@keyframes header-notice{50%{box-shadow:0 0 0 4px #e6a33155}}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:700px){body:not(.board)>header.portal-header{grid-template-columns:minmax(0,1fr) auto;padding:8px 10px!important;gap:6px}.portal-header>.brand{display:none}.portal-header .authenticated-name{font-size:15px}.portal-header #portal-clock{font-size:15px;max-width:230px;padding:4px 6px}.portal-header>nav{grid-column:1/-1;overflow:visible!important;max-width:100%}.header-tools{padding:6px 10px;gap:6px}.header-tools [data-header-clock]{order:5;margin:0;width:100%}.header-tools #portal-clock{font-size:16px;width:100%;text-align:right}.header-new-label{font-size:13px}.header-compact-name{font-size:14px}.header-tools .header-notifications{margin-left:auto}}
@media(prefers-reduced-motion:reduce){.header-notifications.has-new{animation:none}}
@media print{.header-tools{display:none!important}body.portal-header-collapsed>header.portal-header{display:none!important}}

html.header-start-collapsed #portal-header{display:contents!important}html.header-start-collapsed #portal-header>:not(.back-button),html.header-start-collapsed body>.pilot{display:none!important}

@media(max-width:700px){body:not(.board) .portal-header>nav{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;padding-bottom:5px;scrollbar-width:thin}.portal-header>nav>*{flex-shrink:0}.portal-header .language-switch{flex-wrap:nowrap!important}}

.portal-header [data-emergency-start]{display:none!important}

#current-patient-strip{top:var(--header-tools-height,49px);z-index:44}

/* Menu aligns to the right, with identity and clock above it. */
#portal-header.portal-header{grid-template-columns:185px minmax(0,1fr) auto!important}
#portal-header>.brand{grid-column:1;grid-row:1}#portal-header>.brand small{font-size:9px;letter-spacing:1px}
#portal-header>.authenticated-name{grid-column:2;grid-row:1}
#portal-header>#portal-clock{grid-column:3;grid-row:1}
#portal-header>nav{grid-column:1/-1;grid-row:2;justify-self:end;justify-content:flex-end;width:100%}
@media(max-width:700px){#portal-header.portal-header{grid-template-columns:minmax(0,1fr) auto!important}#portal-header>.authenticated-name{grid-column:1;grid-row:1}#portal-header>#portal-clock{grid-column:2;grid-row:1}#portal-header>nav{grid-column:1/-1;grid-row:2}}
