#portal-reset-dialog{width:min(34rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;box-sizing:border-box;padding:clamp(1.1rem,4vw,2rem);border:1px solid #c1cfc5;border-radius:16px;color:#183a2c}
#portal-reset-dialog h2{font-size:clamp(1.4rem,5vw,1.85rem);line-height:1.25;margin-top:.4rem}
#portal-reset-dialog p{line-height:1.6}#portal-reset-dialog label{display:block;margin-top:1.2rem;line-height:1.6}
#delete-test-confirmation{width:100%;box-sizing:border-box;margin:.5rem 0 1.2rem;padding:.75rem;font:inherit;border:1px solid #647e6e;border-radius:6px}
#confirm-reset-portal{background:#8b2e28;border-color:#8b2e28;color:white}#confirm-reset-portal:disabled{opacity:.5;cursor:not-allowed}
.test-delete-menu{border-top:1px solid #d8ddd9!important;margin-top:.5rem!important;color:#8b2e28!important;white-space:normal;text-align:left;font-size:.85rem!important;line-height:1.5}
@media(max-width:420px){#portal-reset-dialog .action-row{display:flex;flex-direction:column}#portal-reset-dialog .action-row button{width:100%}}

#auth-screen.auth-recovery{min-height:0;padding:clamp(28px,7vw,64px) 20px;display:block}
#auth-screen.auth-recovery .auth-intro{display:flex;flex-direction:column;align-items:center;gap:20px;width:min(440px,100%);margin:0 auto}
#auth-screen.auth-recovery img{width:200px;max-width:75%;height:auto;margin:0 0 8px}
#auth-screen.auth-recovery h1{font-size:clamp(28px,5vw,36px);line-height:1.2;margin:0}
#auth-screen.auth-recovery p{margin:0;line-height:1.6}
#auth-screen.auth-recovery #auth-trigger{display:block;position:static;width:100%;height:auto;min-height:48px;padding:14px 24px;border:1px solid #123d32;border-radius:12px;background:#123d32;color:#fff;font:600 16px/1.4 inherit;cursor:pointer}
#auth-screen.auth-recovery #auth-trigger:focus-visible{outline:3px solid #b08c56;outline-offset:4px}

/* Keep submission feedback beside its action, including narrow screens. */
.wizard-action-error{color:#8b2020;background:#fff4f2;border-left:4px solid #8b2020;padding:1rem;margin:1rem 0;line-height:1.5;overflow-wrap:anywhere;}
.wizard-action-error:focus{outline:2px solid #8b2020;outline-offset:3px;}
.wizard-action-error[hidden]{display:none;}

.wizard-action-error{scroll-margin-top:90px;scroll-margin-bottom:240px;}
.wizard-action-error:not([hidden]) + .wizard-actions{position:static!important;}

@media(max-width:820px){.wizard-action-error{scroll-margin-bottom:320px;}#intake-form:has(.wizard-action-error:not([hidden])){padding-bottom:160px;}}

/* Keep location eligibility guidance and Save & Exit clear of mobile navigation. */
[data-care-location-restriction]{grid-column:1/-1;border-left:4px solid #8b2020;background:#fff4f2;color:#8b2020;padding:1rem;line-height:1.5;scroll-margin-block:100px 240px;}
[data-care-location-restriction][hidden]{display:none;}
#intake-form:has([data-care-location-restriction]:not([hidden])) .wizard-actions{position:static!important;}
#intake-form:has([data-care-location-restriction]:not([hidden])) [data-wizard-next]:disabled{opacity:.5;cursor:not-allowed;}
@media(max-width:820px){#intake-form:has([data-care-location-restriction]:not([hidden])){padding-bottom:160px;}}

/* Patient Portal action system. Natural height prevents flex/grid row stretching. */
.portal-workspace .button,.portal-workspace .text-button,.wizard-actions .button,.payment-method-actions .button{display:inline-flex;align-items:center;justify-content:center;text-align:center;align-self:start;height:auto;min-height:44px;max-width:100%;padding:.65rem 1rem;border-radius:10px;font-family:inherit;font-weight:600;font-size:.875rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere;flex-grow:0}
.portal-workspace .text-button{background:transparent;text-decoration:underline;min-height:44px}
.portal-workspace .button:focus-visible,.portal-workspace .text-button:focus-visible{outline:3px solid #755611;outline-offset:3px}
.portal-workspace .button:disabled{opacity:.6;cursor:not-allowed}
.appointment-row-actions{display:flex;align-items:flex-start;justify-content:flex-start;gap:.5rem;flex-wrap:wrap;align-self:start}
.appointment-row-actions .appointment-action{flex:0 1 auto;align-self:start;min-height:44px;height:auto;max-width:100%;margin:0}
#payment-method-required{color:#b4232b;font-weight:400;margin:1.25rem 0 0}
/* Intake controls share a baseline; grouped choices retain native semantics. */
#intake-form .wizard-fields{align-items:end;gap:1.1rem}
#intake-form .wizard-fields>label:not(:has(input[type=radio],input[type=checkbox])){display:flex;flex-direction:column;justify-content:flex-end;gap:.45rem;margin:0;min-width:0;line-height:1.45}
#intake-form .wizard-fields input:not([type=radio]):not([type=checkbox]),#intake-form .wizard-fields select{box-sizing:border-box;width:100%;min-height:46px;font:inherit;margin:0;border-radius:8px}
#intake-form .wizard-fields textarea{box-sizing:border-box;width:100%;font:inherit;margin:0}
#intake-form .wizard-checks{align-self:start;min-width:0;margin:0;padding:.65rem .8rem;border:1px solid #ccd8d2;border-radius:10px}
#intake-form .wizard-checks legend{line-height:1.45;padding:0 .2rem}
#intake-form .wizard-checks label,#intake-form .wizard-fields>label:has(input[type=radio],input[type=checkbox]){display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:.6rem;min-height:44px;margin:0;padding:.25rem 0;line-height:1.45}
#intake-form input[type=radio],#intake-form input[type=checkbox]{flex:0 0 auto;width:20px;height:20px;min-height:20px;margin:0;vertical-align:middle}
#intake-form [hidden]{display:none!important}
@media(max-width:760px){#intake-form .wizard-fields{grid-template-columns:minmax(0,1fr)}#intake-form .wizard-fields>*{max-width:100%;grid-column:auto}}
.appointments-history{margin-inline:clamp(1rem,3vw,2rem);gap:1rem}
#appointment-payment-options{margin-inline:clamp(1rem,3vw,2rem);padding:1.3rem;min-width:0}
#appointment-payment-options>.button{margin:.5rem .75rem 1rem 0}
#appointment-payment-options>div[role=status]{clear:both;margin-top:1rem;max-width:42rem}
.saved-card-actions{margin-top:1rem}
@media(max-width:600px){.appointment-row{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:.7rem!important;min-height:0!important}.appointment-row-actions{width:100%}.portal-workspace .button{padding:.65rem .8rem}.appointment-row-actions .appointment-action{flex:0 1 auto;min-height:44px;height:auto!important;border-radius:10px!important}.portal-workspace{min-width:0}.portal-workspace .account-card{min-width:0}}

#intake-form .wizard-step .wizard-checks label.wizard-option,#intake-form .wizard-step .wizard-fields>label.wizard-option{display:flex;align-items:center;gap:.6rem;min-height:44px}
#intake-form .wizard-step label.wizard-option>input[type=radio],#intake-form .wizard-step label.wizard-option>input[type=checkbox]{align-self:center;margin:0;flex:0 0 20px}
#intake-form .wizard-step label.wizard-option>span{align-self:center;min-width:0}

/* Owner UAT: intrinsic controls and readable combined savings. */
#credit-purchase-clinic.care-plan-clinic-select{width:max-content;max-width:100%;min-width:0;display:block}
.credit-package .care-plan-total-savings{display:block;font-size:1.05rem;margin-top:.75rem}
.care-policy>h2{font-size:1rem;margin:0 0 1rem}
.booking-review>#book-slot{margin-bottom:1.25rem}
.credit-dialog .action-row{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}
.provider-portrait{position:relative;display:grid;place-items:center;width:76px;height:88px;flex:none;overflow:hidden;border-radius:12px;background:#e6efea;color:#173f33;font:600 1.25rem var(--font-body,sans-serif)}
.provider-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
/* Booking controls stay clear of the fixed header and mobile navigation. */
#appointment-payment-options,#next-available-date,#visit-mode,.payment-success h2,.booking-card-setup h3{scroll-margin-block:8rem 16rem}
.booking-card-setup{width:100%;min-width:0;max-width:100%}
.booking-card-setup button,.credit-payment-options button{max-width:100%;white-space:normal}
.booking-card-setup iframe{display:block;width:100%;max-width:100%}
@media(max-width:600px){.booking-card-setup .checkbox{align-items:flex-start}.booking-card-setup button{width:100%;min-height:44px}.credit-payment-options{min-width:0;padding:1rem}#appointment-controls .payment-success{overflow-wrap:anywhere}}
/* Keep enough room for provider-hosted fields on the narrowest supported phone. */
@media(max-width:360px){#payment-method.account-card{padding:1rem}#payment-method-element.stripe-element{padding:.25rem}#appointment-payment-options{margin-inline:0;padding:1rem}}

/* Keep payment thanks and the visit summary as separate sections. */
#appointment-controls>[data-booking-paid-success]{margin-bottom:clamp(1.25rem,3vw,2rem)}
.booking-processing{font-weight:600;scroll-margin-block:8rem}
.booking-save-required{margin-block:1rem}

/* Payment settlement covers intermediate account/scheduler hydration. */
.booking-settlement-overlay:not([hidden]){position:fixed;inset:0;z-index:10000;display:grid;place-content:center;padding:2rem;background:var(--color-cream,#fcf9f2);color:#173f33;font-weight:600;text-align:center;overflow:auto}
#clinic-choice,#practitioner-list{scroll-margin-block:8rem 16rem}

/* Scoped Support conversation controls, shared by Patient and Staff views. */
.case-messages{display:grid;gap:16px;margin:20px 0;min-width:0}.case-message{padding:16px;border:1px solid #d8e2da;border-radius:8px;background:#fff;min-width:0;overflow-wrap:anywhere}.case-message h3{font-size:1rem;margin:0 0 6px}.case-message time{font-size:.8rem;color:#506158}.case-message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}.case-internal{background:#fff8e8;border:2px solid #b28229}.case-compose{border-top:1px solid #b9c9be;padding-top:18px}.case-composer,.case-routing-form{display:grid;gap:12px;min-width:0}.case-composer label,.case-routing-form label,.case-queue-filters label{display:grid;gap:6px;font-weight:600}.case-composer textarea,.case-composer input,.case-composer select,.case-routing-form input,.case-routing-form textarea,.case-routing-form select,.case-queue-filters input,.case-queue-filters select{box-sizing:border-box;max-width:100%;width:100%;min-width:0;padding:10px;border:1px solid #8fa397;border-radius:5px;font:inherit;background:#fff;color:#173f33}.case-file-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}.case-file-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px;border:1px solid #bdccbf;overflow-wrap:anywhere;min-width:0}.case-file-item>span:first-child{flex:1 1 130px;min-width:0}.case-status{font-weight:600}.case-unread{display:inline-block;border-radius:4px;background:#173f33;color:#fff;padding:3px 7px;width:max-content;font-size:.8rem}.case-overdue{color:#8a320e}.case-workspace details>summary,.patient-case-detail details>summary{cursor:pointer;padding:12px 0;font-weight:600}.case-workspace .form-actions,.patient-case-detail .form-actions,.support-inbox .form-actions{display:flex;flex-wrap:wrap;gap:10px}.case-workspace button,.patient-case-detail button,.support-inbox button{white-space:normal;max-width:100%;min-height:44px}.case-workspace :focus-visible,.patient-case-detail :focus-visible,.support-inbox :focus-visible{outline:3px solid #bd8219;outline-offset:3px}

.support-inbox-list{display:grid;gap:12px;margin-top:20px}.support-inbox-item{display:grid;text-align:left;gap:7px;background:#fff;color:#173f33;border:1px solid #bacbbf;border-radius:8px;padding:18px;width:100%;min-width:0;overflow-wrap:anywhere;font:inherit;cursor:pointer}.support-inbox-item:hover{background:#edf4ed}.patient-case-detail{max-width:880px}.support-new-request{max-width:760px}.patient-case-detail [hidden]{display:none!important}.patient-case-detail .case-messages{max-height:none}.support-inbox [hidden]{display:none!important}
