/* B26: task details, stable controls, and shared dialog framing. */
body[data-patient-theme] :is(.htop .rec-link,.htop .acct>summary,.ctop .back,.ctop .acct>summary){min-height:44px;}
body.patient-chat .composer .steps button.st{min-height:40px;}
body.patient-chat #history-list .message-question{font-weight:600;line-height:1.55;}

/* Entry: keep the form in the first common phone viewport, one entrance motion. */
body:has(.account-card) .home-main>:is(.welcome,.account-card){animation:none;}
body:has(.account-card) #auth-pane,body:has(.account-card) #signed-in-pane{transition:opacity 160ms ease-out;}
body:has(.account-card) .auth-tabs::before{transition-duration:200ms;}
body:has(.account-card) #toggle-password{transform:none;}
@media(orientation:portrait) and (max-width:599px){
 body:has(.account-card){--b23-hero-h:clamp(260px,34svh,350px);}
 body:has(.account-card) .home-header{padding:12px 20px 0;}
 body:has(.account-card) .home-main{margin:8px auto 16px;gap:14px;}
 body:has(.account-card) .home-main>.welcome{margin-top:calc(var(--b23-hero-h) - 128px);padding:0;}
 body:has(.account-card) .b23-hero i:nth-child(n){background-size:112vw auto;background-position:50% 38px;}
 body:has(.account-card) .welcome h1{font-size:1.625rem;line-height:1.3;margin-bottom:8px;}
 body:has(.account-card) .welcome-description{font-size:.9375rem;line-height:1.65;}
 body:has(.account-card) .account-card{margin-top:14px;}
 body:has(.account-card) .auth-tabs{margin-bottom:12px;}
 body:has(.account-card) .account-card #account-form>label,body:has(.account-card) .account-card #account-form .confirm-inner>label{margin:10px 0 6px;font-size:.875rem;}
 body:has(.account-card) #account-form input{min-height:48px;height:48px;}
 body:has(.account-card) .password-field button{top:2px;}
 body:has(.account-card) .form-hint{margin:10px 0 12px;font-size:.8125rem;line-height:1.5;min-height:2lh;}
 body:has(.account-card) .home-footer{padding-top:10px;}
}
@media(orientation:portrait) and (max-height:700px) and (max-width:599px){
 body:has(.account-card) .b23-hero{display:none;}
 body:has(.account-card) .home-main{gap:8px;}
 body:has(.account-card) .home-main>.welcome{margin-top:4px;}
 body:has(.account-card) .welcome h1{font-size:1.375rem;margin-bottom:6px;}
 body:has(.account-card) .welcome-description{display:none;}
 body:has(.account-card) .account-card{margin-top:0;}
 body:has(.account-card) .auth-tabs{margin-bottom:8px;}
 body:has(.account-card) .account-card #account-form>label,body:has(.account-card) .account-card #account-form .confirm-inner>label{margin-top:8px;}
 body:has(.account-card) #account-form input{min-height:44px;height:44px;}
 body:has(.account-card) .password-field button{top:0;}
 body:has(.account-card) .form-hint{margin:8px 0;}
 body:has(.account-card) #submit-account{margin-top:6px;}
}

/* Choice page: compact context without changing portrait calibration. */
body:has(.doctors) .resume-slot{margin-block:0 20px;}
body:has(.doctors) .resume-status{margin:0;line-height:1.55;}
body:has(.doctors) .resume{margin:0;}
body:has(.doctors) .how{color:var(--ink2);}
body:has(.doctors) .dc{transition-duration:160ms;}

/* Profile and record cards. */
body.patient .profile-forms{gap:36px;}
body.patient .profile-forms #password-form{padding-left:36px;}
body.patient .profile-forms .edit-form{gap:16px;}
body.patient .profile-forms :is(#profile-status,#password-status){min-height:1.4em;}
body.patient .b26-password-field{position:relative;display:block;}
body.patient .b26-password-field input{padding-right:68px;}
body.patient .b26-password-toggle{position:absolute;right:4px;top:3px;min-width:54px;min-height:44px;margin:0;padding:0 10px;border:0;border-radius:10px;background:transparent;color:var(--brand-d);font-size:.8125rem;cursor:pointer;}
body.patient .visit-meta{font-size:.8125rem;}
body.patient .visit-time{font-size:.8125rem;}
body.patient:has(> .htop) .visit-actions>:is(a,button){min-height:44px;font-size:.8125rem;}
body.patient:has(> .htop) .records-privacy{margin-bottom:18px;}
@media(max-width:719px){body.patient .profile-forms{gap:18px;}body.patient .profile-forms #password-form{padding:22px 0 0;}}

/* Sheet headings and main actions stay put; only content scrolls. */
html body[data-patient-theme] :is(#menu-dialog,#settings-dialog,#privacy-dialog,#end-dialog)[open]{display:flex;flex-direction:column;box-sizing:border-box;width:min(560px,calc(100vw - 24px));height:auto;max-height:calc(var(--dialog-viewport,100dvh) - 24px);padding:0;margin:auto;border-radius:24px;overflow:hidden;background:var(--bg);}
body[data-patient-theme] [data-b26-sheet] .dialog-heading{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;margin:0;padding:10px 20px;background:#fff;border-bottom:1px solid var(--line);}
body[data-patient-theme] [data-b26-sheet] .dialog-heading h2{margin:0;font-size:1.125em;}
body[data-patient-theme] [data-b26-sheet] .dialog-heading .icon-button{display:grid;place-items:center;width:44px;height:44px;min-height:44px;min-width:44px;margin:0;padding:0;border:0;border-radius:50%;background:var(--fill);}
body[data-patient-theme] .b26-dialog-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 20px 16px;}
body[data-patient-theme] .b26-dialog-footer{flex:none;padding:10px 20px;background:#fff;border-top:1px solid var(--line);}
body[data-patient-theme] .b26-dialog-footer>.dialog-primary{margin:0;min-height:44px;}
body[data-patient-theme] #menu-dialog .b26-dialog-scroll{padding-block:8px;}
body[data-patient-theme] #menu-dialog .mi{min-height:54px;}
body[data-patient-theme] #settings-dialog .setting-row{min-height:56px;}
body[data-patient-theme] #voice-select{font-size:.9375em;}
@media(max-width:719px){html body[data-patient-theme] :is(#menu-dialog,#settings-dialog,#privacy-dialog,#end-dialog)[open]{inset:auto 0 0;width:100%;max-height:calc(var(--dialog-viewport,100dvh) - 12px);margin:0;border-radius:24px 24px 0 0;}}
@media(max-height:540px){body[data-patient-theme] [data-b26-sheet] .dialog-heading{min-height:56px;padding:6px 18px;}body[data-patient-theme] .b26-dialog-scroll{padding:8px 18px 12px;}body[data-patient-theme] .b26-dialog-footer{padding:6px 18px;}}

/* Summary status follows the actual application badge, including unconfirmed reports. */
body[data-patient-theme] #b26-summary-state{display:inline-flex;align-items:center;min-height:28px;width:fit-content;margin:0 0 16px;padding:4px 10px;border-radius:99px;background:#e6f1ec;color:#28725f;font-size:.8125em;font-weight:600;}
body[data-patient-theme] #b26-summary-state:not([data-review=confirmed]){background:#f7eedf;color:#7c5b21;}
body[data-patient-theme] #summary-dialog .summary-footer:has(#summary-actions:not([hidden])){display:grid;grid-template-columns:1fr;gap:8px;}
body[data-patient-theme] #summary-dialog .summary-footer #summary-actions:not([hidden]){display:grid;grid-template-columns:1fr 1fr;gap:8px;}
body[data-patient-theme] #summary-dialog .summary-footer #summary-actions button{min-height:44px;margin:0;padding:8px 10px;font-size:.8125em;}
body[data-patient-theme] #summary-dialog .summary-footer:has(#summary-actions:not([hidden])) #summary-back{grid-column:auto;grid-row:auto;width:100%;font-size:.8125em;}
body[data-patient-theme] #summary-dialog .summary-footer #summary-download{background:var(--brand);color:#fff;border-color:var(--brand);}
body[data-patient-theme] #summary-dialog .summary-footer #summary-copy{background:var(--fill);color:var(--ink);box-shadow:none;}
@media(orientation:landscape) and (max-height:540px){body[data-patient-theme] #summary-dialog .summary-footer:has(#summary-actions:not([hidden])){grid-template-columns:auto minmax(0,1fr);align-items:center;}body[data-patient-theme] #summary-dialog .summary-footer #summary-actions:not([hidden]){grid-template-columns:repeat(4,minmax(0,1fr));grid-column:2;grid-row:1;}body[data-patient-theme] #summary-dialog .summary-footer:has(#summary-actions:not([hidden])) #summary-back{grid-column:1;grid-row:1;padding-inline:12px;max-width:104px;}}

/* Record detail is a reading surface, not a list of internal jobs. */
html body.patient #detail-dialog[open]{display:flex;flex-direction:column;box-sizing:border-box;inset:0;margin:auto;width:min(880px,calc(100vw - 24px));height:min(820px,calc(var(--dialog-viewport,100dvh) - 24px));max-height:calc(var(--dialog-viewport,100dvh) - 24px);padding:0;overflow:hidden;border:0;border-radius:24px;background:var(--bg);}
body.patient #detail-dialog .dialog-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;background:#fff;border-bottom:1px solid var(--line);}
body.patient #detail-dialog .dialog-head h2{margin:0;font-size:1.125rem;}
body.patient #close-detail{min-height:44px;margin:0;padding:0 16px;border:0;border-radius:99px;background:var(--fill);color:var(--ink);font-weight:600;}
body.patient #detail-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0;padding:18px 20px;}
body.patient #detail-content .record-context{margin:0 0 12px;color:var(--ink2);font-size:.8125rem;line-height:1.7;}
body.patient #detail-content .record-opening{margin:12px 0;border:1px solid var(--line);border-radius:14px;background:#fff;}
body.patient #detail-content .record-opening summary{min-height:44px;padding:10px 14px;color:var(--ink2);font-size:.875rem;cursor:pointer;}
body.patient #detail-content .record-opening p{margin:0;padding:0 14px 14px;font-size:.9375rem;line-height:1.7;}
body.patient #detail-content>.actions{gap:8px;margin:14px 0 18px;}
body.patient #detail-content>.actions>:is(a,button){min-height:44px;font-size:.8125rem;}
body.patient #detail-content .record-turn{padding:16px 0;border-top:1px solid var(--line);}
body.patient #detail-content .record-turn-head{display:flex;align-items:center;gap:8px;justify-content:space-between;margin-bottom:12px;color:var(--ink2);font-size:.75rem;}
body.patient #detail-content .record-turn-head h3{margin:0;font-size:.8125rem;font-weight:500;}
body.patient #detail-content .record-message{max-width:90%;width:fit-content;margin:12px 0;}
body.patient #detail-content .record-message[data-role=user]{margin-left:auto;}
body.patient #detail-content .record-speaker{display:block;margin-bottom:5px;color:var(--ink2);font-size:.75rem;}
body.patient #detail-content .record-message[data-role=user] .record-speaker{text-align:right;}
body.patient #detail-content .record-text{margin:0;padding:12px 14px;border:1px solid #dce4f2;border-radius:18px 18px 18px 6px;background:#fff;color:var(--ink);font-size:1rem;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;}
body.patient #detail-content .record-message[data-role=user] .record-text{border-color:var(--brand);border-radius:18px 18px 6px 18px;background:var(--brand);color:#fff;}
body.patient #detail-content .record-confirmed-badge{width:fit-content;padding:6px 10px;border-radius:99px;background:#e6f1ec;color:#28725f;font-size:.8125rem;}
body.patient #detail-content[data-doctor-report] h2{margin:10px 0;font-size:1.25rem;}
body.patient #detail-content[data-doctor-report] h3{margin:22px 0 10px;font-size:1.0625rem;}
body.patient #detail-content[data-doctor-report]>p{line-height:1.75;}

/* Video: one symmetric control row, independently expanding text input. */
body.video-call .b23-sheet .cbar{display:grid;grid-template-columns:76px minmax(0,1fr) 76px;align-items:start;column-gap:8px;row-gap:10px;}
body.video-call .cbar #type-panel{grid-column:1;grid-row:1;order:initial;min-width:0;width:auto;}
body.video-call .cbar .cmain{grid-column:2;grid-row:1;order:initial;min-width:0;}
body.video-call .cbar #hangup{grid-column:3;grid-row:1;order:initial;width:76px;}
body.video-call .cbar>.sub{grid-column:1/-1;grid-row:2;margin:0;max-width:none;text-align:center;font-size:.6875rem;line-height:1.4;color:var(--ink2);}
body.video-call .cbar #type-panel[open]{grid-column:1/-1;grid-row:1;position:relative;width:100%;padding:0;margin:0;}
body.video-call .cbar:has(#type-panel[open]) .cmain{grid-row:2;}
body.video-call .cbar:has(#type-panel[open]) #hangup{grid-row:2;}
body.video-call .cbar:has(#type-panel[open])>.sub{grid-row:3;}
body.video-call .b23-sheet .cbar:has(#type-panel[open]){grid-template-columns:76px minmax(0,1fr) 76px;}
body.video-call .b23-sheet .cbar:has(#type-panel[open])>.cmain{grid-column:2;grid-row:2;}
body.video-call .b23-sheet .cbar:has(#type-panel[open])>#hangup{grid-column:3;grid-row:2;}
body.video-call .cbar #type-panel[open]>summary{position:absolute;left:0;right:auto;top:calc(100% + 10px);width:76px;min-height:76px;margin:0;padding:11px 0 0;display:flex;flex-direction:column;gap:6px;background:transparent;border-radius:0;}
body.video-call .cbar #type-panel[open]>summary .ci{display:grid;place-items:center;}
body.video-call .cbar #type-panel[open]>summary .shut{display:block;font-size:.75rem;}
body.video-call .cbar #type-panel[open]>summary .shut svg{display:none;}
body.video-call .cbar #type-panel[open]>summary .lb{display:none;}
body.video-call .cbar #type-panel[open] #text-form{margin:0;padding:0;}
body.video-call .cbar #type-panel[open] #typed-text{min-width:0;height:64px;min-height:52px;max-height:120px;resize:vertical;padding:10px 12px;font-size:1rem;line-height:1.5;}
body.video-call .call-message .message-heading{display:flex;align-items:center;flex-wrap:wrap;gap:6px;}
body.video-call .b23-sheet .call-message .message-heading #connect{flex:none;margin-left:auto;display:grid;place-items:center;min-width:44px;width:44px;min-height:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);font-size:0;}
body.video-call .message-heading #connect .icon{width:20px;height:20px;}
body.video-call .b23-sheet .call-conversation>.caption-actions:not(:has(#answer-actions:not([hidden]))){display:none;}
body.video-call .b23-sheet .call-conversation>#quick-replies:not([hidden]){flex:1 0 100%;width:100%;}
body.video-call .b23-sheet .quick-reply-row{flex-wrap:wrap;overflow:visible;gap:6px;}
body.video-call .b23-sheet :is(.quick-reply-chip,#answer-actions button){min-height:44px;padding-inline:12px;font-size:.875rem;}
body.video-call .b23-side :is(#transcript-open,#pain-location #pain-location-open){min-height:44px;}
body.video-call main .stage:has(#type-panel[open]) :is(#quick-replies,.caption-actions){display:none;}
body.video-call #transcript-dialog[open]{display:flex;flex-direction:column;box-sizing:border-box;height:auto;max-height:calc(var(--dialog-viewport,100dvh) - 24px);overflow:hidden;padding:0;background:var(--bg);border-radius:24px;}
body.video-call #transcript-dialog>header{flex:none;min-height:64px;padding:10px 18px;background:#fff;border-bottom:1px solid var(--line);}
body.video-call #transcript-close{min-width:44px;min-height:44px;border-radius:50%;}
body.video-call #call-transcript-list{flex:1;min-height:140px;max-height:calc(var(--dialog-viewport,100dvh) - 130px);overflow-y:auto;padding:14px 18px;}
body.video-call #transcript-dialog>.transcript-note{flex:none;margin:0;padding:10px 18px;color:var(--ink2);background:#fff;}
@media(orientation:landscape) and (max-height:540px){
 body.video-call .b23-sheet{max-height:calc(100dvh - 104px);}
 body.video-call .b23-sheet .call-conversation{padding:10px 14px 0;}
 body.video-call .call-message .message-heading{position:relative;min-height:20px;padding-right:48px;flex-wrap:nowrap;}
 body.video-call .message-heading .question-label{display:none;}
 body.video-call .message-heading #connect{position:absolute;right:0;top:-6px;}
 body.video-call .b23-sheet .call-conversation #assistant-caption{font-size:1rem;line-height:1.5;padding-right:42px;}
 body.video-call .b23-sheet .quick-reply-row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-bottom:3px;}
 body.video-call .b23-sheet :is(.quick-reply-chip,#answer-actions button){padding-inline:10px;font-size:.8125rem;}
 body.video-call .b23-sheet .cbar{padding:6px 14px 8px;grid-template-columns:60px minmax(0,1fr) 60px;row-gap:6px;}
 body.video-call .b23-sheet .cbar:has(#type-panel[open]){grid-template-columns:60px minmax(0,1fr) 60px;}
 body.video-call #hangup,body.video-call .cbar #type-panel[open]>summary{width:60px;}
 body.video-call #record-toggle::before{width:50px;height:50px;background-size:24px;box-shadow:0 0 0 4px rgb(54 83 201 / .12);}
 body.video-call :is(#type-panel>summary,#hangup){padding-top:3px;}
 body.video-call :is(#type-panel>summary,#hangup) .ci{width:44px;height:44px;}
 body.video-call .cbar #type-panel[open]>summary{top:calc(100% + 6px);min-height:64px;padding-top:3px;}
 body.video-call .cbar #type-panel[open] #typed-text{height:52px;min-height:44px;max-height:80px;}
 body.video-call .cbar #type-panel[open] #text-send{min-width:54px;min-height:44px;}
 body.video-call .cbar>.sub{font-size:.625rem;}
 body.video-call main .stage:has(#type-panel[open]) .b23-side{display:none;}
 body.video-call main .stage:has(#type-panel[open]) .b23-sheet{max-height:calc(100dvh - 64px);}
}
@media(orientation:landscape) and (max-height:360px){body.video-call main .stage:has(#type-panel[open]) .b23-sheet{width:calc(100% - 16px);margin-inline:8px;}body.video-call main .stage:has(#type-panel[open]) .call-portrait{opacity:.35;}}
@media(max-height:300px){body.video-call main .stage:has(#type-panel[open]) .b23-sheet{width:calc(100% - 16px);margin-inline:8px;}body.video-call main .stage:has(#type-panel[open]) .call-portrait{opacity:.35;}}
@media(orientation:portrait) and (max-width:899px){body.video-call main .stage .b23-sheet{width:calc(100vw - 16px);margin-inline:8px;}}
/* Short previews keep the explanation and all three choices visible. */
@media(orientation:landscape) and (max-height:540px){
 body[data-patient-theme] #voice-preview{max-height:calc(var(--dialog-viewport,100dvh) - 24px);padding:12px 18px;}
 body[data-patient-theme] #voice-preview-text{min-height:72px;max-height:96px;}
 body[data-patient-theme] #voice-preview .voice-preview-actions{display:flex;flex-wrap:nowrap;gap:8px;}
 body[data-patient-theme] #voice-preview .voice-preview-actions>button{flex:1;min-height:44px;width:auto;margin:0;}
 body[data-patient-theme] #voice-preview .voice-preview-actions #voice-preview-send{flex:1;order:initial;}
}
@media(prefers-reduced-motion:reduce){body:has(.account-card) .auth-tabs::before{transition:none;}}
