/* Shared header geometry. Content columns may differ; brand and account controls do not. */
html:not([data-record-page=true]):has(body[data-patient-theme] > #patient-header){scrollbar-gutter:stable both-edges;}
html body[data-patient-theme] > #patient-header{box-sizing:border-box;display:flex;align-items:center;flex-wrap:nowrap;gap:12px;width:min(1184px,100vw);max-width:none;min-height:84px;height:calc(84px + env(safe-area-inset-top));margin-block:0;margin-inline:calc((100% - min(1184px,100vw))/2);padding:calc(16px + env(safe-area-inset-top)) 32px 16px;}
html body:has(.account-card) > .home-header{box-sizing:border-box;display:flex;align-items:center;min-height:84px;height:calc(84px + env(safe-area-inset-top));padding:calc(16px + env(safe-area-inset-top)) 32px 16px max(32px,calc((100vw - 1120px)/2));}
html body:has(.account-card) > .home-header .wordmark{display:flex;align-items:center;gap:10px;}
html body:has(.account-card) > .home-header .wordmark > img{width:36px;height:36px;flex:none;}
html body:has(.account-card) > .home-header .wordmark strong{display:block;font-size:1.125rem;line-height:1.35;font-weight:700;white-space:nowrap;}
html body:has(.account-card) > .home-header .wordmark small{display:block;margin-top:5px;font-size:.75rem;line-height:1.4;font-weight:400;}
html body[data-patient-theme] > #patient-header .brand-link{display:flex;align-items:center;gap:10px;min-width:0;flex:1;}
html body[data-patient-theme] > #patient-header .brand-link > img{width:36px;height:36px;flex:none;}
html body[data-patient-theme] > #patient-header .bn{font-size:1.125rem;font-weight:700;line-height:1.35;white-space:nowrap;}
html body[data-patient-theme] > #patient-header .bn small{display:block;margin-top:5px;font-size:.75rem;line-height:1.4;font-weight:400;}
html body[data-patient-theme] > #patient-header .rec-link{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;margin-left:auto;}
html body[data-patient-theme] :is(#patient-header,.ctop) .acct > summary{display:flex;align-items:center;justify-content:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;gap:0;line-height:0;border-radius:50%;}
html body[data-patient-theme] .acct > .acct-menu{width:280px;min-width:0;max-width:calc(100vw - 32px);max-height:calc(var(--patient-visible-height,100dvh) - 88px);overflow-y:auto;padding:8px;border:1px solid #E1E0DA;border-radius:22px;background:#fff;color:#242421;}
html body[data-patient-theme] .acct-menu .mi{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:10px 12px;font-size:.9375rem;color:#242421;}
html body[data-patient-theme] .acct-menu #logout-button{color:#914B43;}
html body.video-call .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}
html[data-record-page=true]:has(body.b27-records){scrollbar-gutter:auto;}
html[data-record-page=true] body.patient.b27-records > #patient-header{display:none;}
html body[data-patient-theme] .call-disclosure > summary{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;height:auto;min-width:0;min-height:48px;margin:0;padding:10px 12px;border-radius:12px;background:transparent;color:#65645F;font-size:.875rem;line-height:1.5;white-space:normal;overflow-wrap:break-word;list-style:none;}
html body[data-patient-theme] .call-disclosure > summary::after{content:'⌄';flex:none;font-size:1rem;transition:transform 160ms ease;}
html body[data-patient-theme] .call-disclosure[open] > summary::after{transform:rotate(180deg);}
html body[data-patient-theme] .call-disclosure .notice{width:auto;max-width:none;margin:0;padding:4px 12px 12px;color:#65645F;font-size:.8125rem;line-height:1.75;text-align:left;}
html body.video-call > .ctop{height:calc(64px + env(safe-area-inset-top));min-height:64px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;}
html body.video-call .ctop #continue-link{display:flex;align-items:center;justify-content:center;gap:0;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;line-height:0;font-size:0;}
html body.video-call .ctop #continue-link .icon{width:22px;height:22px;}
html body.video-call .b23-sheet .call-message[data-role=assistant] .message-heading{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;position:static;min-height:44px;padding:0;}
html body.video-call .b23-sheet .call-message[data-role=assistant] .message-heading .message-speaker{flex:1;min-width:0;font-size:.8125rem;color:#65645F;}
html body.video-call .b23-sheet .call-message[data-role=assistant] .message-heading .question-label{display:none;}
html body.video-call .b23-sheet .call-message[data-role=assistant] .message-heading #connect{position:static;display:flex;align-items:center;justify-content:center;align-self:center;gap:0;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;border-radius:50%;font-size:0;line-height:0;}
html body.video-call #pain-location-current:empty{display:none;}
html body.video-call #text-chat-open .call-control-label{white-space:nowrap;font-size:.75rem;}
/* A recovered video draft has a separate row; it cannot cover the mode or end controls. */
html body.video-call .b23-sheet .cbar:has(#type-panel[open]){grid-template-columns:76px minmax(0,1fr) 76px;grid-template-rows:auto auto auto;}
html body.video-call .b23-sheet .cbar #type-panel[open]{grid-column:1/-1;grid-row:1;order:initial;}
html body.video-call .b23-sheet .cbar #type-panel[open] > summary{display:none;}
html body.video-call .b23-sheet .cbar:has(#type-panel[open]) > #text-chat-open{grid-column:1;grid-row:2;}
html body.video-call .b23-sheet .cbar:has(#type-panel[open]) > .cmain{grid-column:2;grid-row:2;}
html body.video-call .b23-sheet .cbar:has(#type-panel[open]) > #hangup{grid-column:3;grid-row:2;}
html body.video-call .b23-sheet .cbar:has(#type-panel[open]) > .sub{grid-column:1/-1;grid-row:3;}
html body.video-call .b23-sheet #text-send{background:#20201D;border-color:#20201D;color:#FFF;box-shadow:none;}
@media(max-width:719px){
 html:not([data-record-page=true]):has(body[data-patient-theme] > #patient-header){scrollbar-gutter:auto;scrollbar-width:none;}
 html body[data-patient-theme] > #patient-header{height:calc(76px + env(safe-area-inset-top));min-height:76px;padding:calc(12px + env(safe-area-inset-top)) 20px 12px;gap:8px;}
 html body[data-patient-theme] > #patient-header .brand-link > img{width:32px;height:32px;}
 html body[data-patient-theme] > #patient-header .bn{font-size:1rem;}
 html body[data-patient-theme] > #patient-header .rec-link{padding-inline:12px;font-size:.8125rem;}
 html body:has(.account-card) > .home-header{min-height:76px;height:calc(76px + env(safe-area-inset-top));padding:calc(12px + env(safe-area-inset-top)) 20px 12px;}
 html body:has(.account-card) > .home-header .wordmark > img{width:32px;height:32px;}
 html body:has(.account-card) > .home-header .wordmark strong{font-size:1rem;}
}
@media(max-width:359px){html body[data-patient-theme] > #patient-header,html body:has(.account-card) > .home-header{padding-inline:16px;}html body[data-patient-theme] > #patient-header .rec-link{width:44px;min-width:44px;padding:0;font-size:0;}}
@media(max-height:540px){html body.video-call > .ctop{height:calc(56px + env(safe-area-inset-top));min-height:56px;padding-block:calc(6px + env(safe-area-inset-top)) 6px;}}
@media(orientation:landscape) and (max-height:540px){html body.video-call .b23-sheet .cbar:has(#type-panel[open]){grid-template-columns:60px minmax(0,1fr) 60px;}}
@media(prefers-reduced-motion:reduce){html body[data-patient-theme] .call-disclosure > summary::after{transition:none;}}
/* Native close removes [open] before its exit transition finishes. Keep the
   shared frame during that interval; display remains owned by native dialog. */
html body[data-patient-theme] :is(#menu-dialog,#settings-dialog,#privacy-dialog,#end-dialog,#summary-dialog,#detail-dialog,#transcript-dialog,#pain-location-dialog)[data-b29-shell]:not([open]){flex-direction:column;box-sizing:border-box;inset:0;width:min(720px,calc(100vw - 32px));height:fit-content;min-height:0;max-width:none;max-height:calc(var(--dialog-viewport,100dvh) - 24px);margin:auto;padding:0;overflow:hidden;border:0;border-radius:28px;background:var(--b29-paper);color:var(--b29-ink);box-shadow:0 24px 64px -26px rgb(25 25 23 / .28);--bg:var(--b29-paper);--surface:var(--b29-paper);--fill:var(--b29-fill);--line:var(--b29-line);--ink:var(--b29-ink);--ink2:var(--b29-muted);--brand:var(--b29-action);--brand-d:var(--b29-action);}
html body[data-patient-theme] :is(#summary-dialog,#detail-dialog,#pain-location-dialog)[data-b29-shell]:not([open]){height:min(780px,calc(var(--dialog-viewport,100dvh) - 24px));}
@media(max-width:719px){
 html body[data-patient-theme] :is(#menu-dialog,#settings-dialog,#privacy-dialog,#end-dialog,#summary-dialog,#detail-dialog,#transcript-dialog,#pain-location-dialog)[data-b29-shell]:not([open]){inset:auto 0 0;width:100%;max-height:calc(var(--dialog-viewport,100dvh) - 12px);margin:0;border-radius:28px 28px 0 0;}
 html body[data-patient-theme] :is(#summary-dialog,#detail-dialog,#pain-location-dialog)[data-b29-shell]:not([open]){height:min(780px,calc(var(--dialog-viewport,100dvh) - 12px));}
}
