/* Final responsive constraints shared by the legacy account/cabinet/patient pages. */
html{scroll-padding-top:20px}body{min-width:0}*,*::before,*::after{box-sizing:border-box}
img,video,canvas{max-width:100%}img{height:auto}
main,section,article,form,fieldset,details,.panel,.booking,.detail-grid>div,.page-head>div{min-width:0}
input,select,textarea{min-width:0;max-width:100%;scroll-margin-block:24px}
input[type=date],input[type=time]{width:100%;min-inline-size:0;max-inline-size:100%}
input[type=date]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value{min-width:0;text-align:start}
input[type=checkbox],input[type=radio]{flex-shrink:0}
h1,h2,h3,p,dd,dt,label,summary,.request-name,.request-bottom,.message,.form-error,.error{overflow-wrap:anywhere}
pre{max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
.flow-actions,.form-actions,.actions,.more-shortcuts,.page-head,.panel-head,.detail-head,.request-top,.request-bottom,.ios-toolbar,.ios-footer{min-width:0;flex-wrap:wrap}
.flow-actions>*,.form-actions>*,.actions>*,.more-shortcuts>*,.page-head>*,.panel-head>*,.detail-head>*{max-width:100%;min-width:0}
.flow-actions :is(a,button),.form-actions :is(a,button),.actions :is(a,button){white-space:normal;text-align:center;line-height:1.4}
.agenda-status-tabs{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,7rem),1fr));gap:6px!important}
.agenda-status-tabs>button{min-width:0!important;min-height:44px;overflow-wrap:normal;white-space:normal}
.dialog,.receipt,.patient-card{max-width:100%}
dialog{max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain;scroll-padding-block:70px 24px}
dialog::backdrop{touch-action:none}
#patient-dialog .sheet-toolbar{position:sticky;top:0;z-index:3;background:#fff}
#toast{background:#fff!important;color:#0f172a!important;border:1px solid #c8ded8!important;border-radius:12px!important;box-shadow:0 8px 30px #0f172a18!important;padding:12px 16px!important;line-height:1.45;overflow-wrap:anywhere;max-width:calc(100% - 32px);max-height:35dvh;overflow:auto}
body.staff-page>.staff-navigation{overflow-y:auto;overscroll-behavior:contain}
@media(min-width:761px) and (max-width:1100px){.cabinet-workspace .work-grid{grid-template-columns:minmax(0,1fr)!important}.detail-grid{grid-template-columns:minmax(0,1fr)!important}.staff-page{padding-left:180px}.staff-page>.staff-navigation{width:180px;padding-inline:8px}.staff-page>.staff-navigation .nav{gap:8px}}
@media(max-width:760px){body.staff-page>.staff-navigation{overflow:visible}.staff-page,.cabinet-workspace main{padding-bottom:calc(104px + env(safe-area-inset-bottom))}.detail-head{align-items:flex-start}.detail-head h2{font-size:clamp(20px,5.5vw,26px)}.message-search{grid-template-columns:minmax(0,1fr)}.ios-toolbar{gap:6px}.ios-date-picker{flex:1 1 140px}.ios-date-picker label{white-space:normal}.ios-schedule .arrows{margin-left:auto}dialog{padding:20px}#patient-dialog{padding:0;max-width:100%}#toast{bottom:calc(90px + env(safe-area-inset-bottom))}.form-actions{position:static}.booking{padding:20px 16px}.flow-actions{gap:8px}}
@media(max-width:360px){.staff-navigation .nav em{font-size:10px}.navigation-header .header-navigation{flex-wrap:wrap!important}.ios-footer{gap:8px}.ios-footer span{max-width:100%;text-align:left}.page-head{gap:8px}.page-head h1{font-size:25px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important}}

/* Patient header: reserve independent tracks for logo, links and account. */
html body:not(.cabinet-workspace) .navigation-header:not(.topbar){display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;gap:12px 20px;align-items:center;height:auto;overflow:visible}
html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.brand{grid-column:1;grid-row:1;justify-self:start;flex:none;min-width:max-content}
html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.header-navigation{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;justify-content:flex-end;margin:0;min-width:0}
html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.patient-account-link{grid-column:3;grid-row:1;justify-self:end;margin:0;max-width:100%;white-space:normal;text-align:left}
@media(max-width:1100px){
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar){grid-template-columns:minmax(0,1fr) max-content;gap:8px 12px}
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.patient-account-link{grid-column:2}
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.header-navigation{grid-column:1 / -1;grid-row:2;justify-content:flex-start;width:100%}
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.header-navigation>a{flex:1 1 130px;min-width:0;white-space:normal}
}
@media(max-width:370px){
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar){grid-template-columns:minmax(0,1fr)}
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.patient-account-link{grid-column:1;grid-row:2;justify-self:start}
 html body:not(.cabinet-workspace) .navigation-header:not(.topbar)>.header-navigation{grid-row:3}
}
