/* UI90.2 — explicit dialog geometry survives resets; scoped to modal surfaces. */
dialog:is(.sp-confirm,.sp-product-dialog,.op-confirm,.m90-confirm,.ac-dialog,.member-pay-dialog,.sv-dialog,.sv-confirm-dialog,.complex-dialog,.sv-review-lightbox),dialog#memberOrder{
 box-sizing:border-box;position:fixed;inset:0;margin:auto;
 max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);
 overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;scroll-padding-block:64px 20px;
}
dialog:is(.sp-confirm,.sp-product-dialog){--sp-bg:#21172d;--sp-panel:#2c2038;--sp-line:#725c7e;--sp-gold:#e5c78e;--sp-text:#f5eef8;--sp-muted:#cbbcd6;color:var(--sp-text);font:14px/1.6 system-ui,sans-serif}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm){width:min(460px,calc(100vw - 24px));padding:24px;border:1px solid #aa8a5c;border-radius:20px;background:#261b31;color:#f5eef8;box-shadow:0 24px 90px #0008;font:14px/1.6 system-ui,sans-serif;text-align:left}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm)::backdrop{background:#100b19cc;backdrop-filter:blur(5px)}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm) :is(h2,h3){margin:4px 0 14px;font:24px/1.25 Georgia,serif;letter-spacing:0;color:#f5eef8}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm)>p{clear:both;margin:0 0 22px;font-size:14px;line-height:1.65;color:#d5c8df}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm) :is(.sp-actions,.op-actions,.actions){display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;margin:0}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm) :is(.sp-actions,.op-actions,.actions)>button{flex:1 1 150px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:46px;max-width:100%;margin:0;padding:12px 16px;border:1px solid #8b7497;border-radius:11px;background:#32233e;color:#f5eef8;font:600 13px/1.4 system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm) button[data-yes]{background:#e5c78e;color:#261b31;border-color:#e5c78e}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm) button[data-yes]:hover{background:#f0d7a9;color:#261b31}
/* Close buttons remain reachable when a long dialog scrolls. */
dialog :is(.sv-modal-close,.ac-close,.sv-close,.sv-confirm-close),dialog:is(.m90-confirm,.member-pay-dialog,#memberOrder)>.close{
 position:sticky;float:right;top:0;right:auto;z-index:5;display:grid;place-items:center;flex:none;
 box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;margin:0 0 10px 12px;padding:0;
 border:1px solid #947b9d;border-radius:50%;background:#32233e;color:#f5deb0;font:28px/1 system-ui,sans-serif;cursor:pointer;transform:none
}
dialog:is(.sp-confirm,.op-confirm,.m90-confirm)>.sv-modal-close{margin-top:-6px;margin-right:-6px}
dialog:is(.sp-product-dialog,.ac-dialog,.member-pay-dialog,.sv-dialog,.sv-confirm-dialog,#memberOrder) :is(button,.btn,.sv-button){white-space:normal;overflow-wrap:anywhere;max-width:100%}
dialog:is(.sp-product-dialog,.ac-dialog,.member-pay-dialog,.sv-dialog,.sv-confirm-dialog,#memberOrder) button{min-height:44px}
dialog:is(.sp-product-dialog,.ac-dialog,.member-pay-dialog,.sv-dialog,.sv-confirm-dialog,#memberOrder) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;min-width:0;max-width:100%}
dialog.sp-product-dialog .sp-product-head{position:sticky;top:-1px;z-index:2;background:var(--sp-bg);padding-bottom:10px;align-items:flex-start}
dialog.sp-product-dialog .sp-product-head>div{min-width:0}
dialog.sp-product-dialog .sp-product-head button{min-width:44px;min-height:44px;background:#32233e;color:#f5deb0;border-color:#947b9d;border-radius:50%}
dialog.sp-product-dialog .sp-pagination{flex-wrap:wrap;gap:10px}
dialog.sp-product-dialog .sp-product-option{flex-shrink:0}
dialog.sp-product-dialog .sp-product-results{min-height:0}
dialog.ac-dialog .ac-form-actions{flex-wrap:wrap}
dialog.ac-dialog .ac-form-actions>button{flex:1 1 160px}
dialog.member-pay-dialog .pay-total{clear:both;flex-wrap:wrap}
dialog.member-pay-dialog .pay-total strong{white-space:normal}
dialog.member-pay-dialog h2{font-size:27px}
dialog.complex-dialog{padding:0;overflow:hidden;border-radius:24px}
dialog.complex-dialog .complex-dialog-shell{box-sizing:border-box;max-height:calc(100vh - 26px);max-height:calc(100dvh - 26px);overscroll-behavior:contain;scroll-padding:64px 0 20px}
dialog.complex-dialog .complex-dialog-close{position:sticky;top:0;float:right;margin:0 0 8px 12px;right:auto;min-width:44px;min-height:44px;background:#32233e;color:#f5deb0}
dialog.sv-review-lightbox>.sv-photo-button{position:sticky;top:0;z-index:2;min-height:44px}
dialog:focus-visible,dialog :focus-visible,.sv-admin-modals .modal :focus-visible{outline:2px solid #f5d79d;outline-offset:3px}
/* Admin editors are custom overlays, not native <dialog> elements. */
body.sv-admin-modals .modal{box-sizing:border-box;padding:12px;z-index:1600;overflow:hidden}
body.sv-admin-modals .modal .modal-content{box-sizing:border-box;min-width:0;max-width:min(1050px,100%);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain;scroll-padding:64px 0 24px;overflow:auto;overflow-wrap:anywhere}
body.sv-admin-modals .modal .modal-content:not(.wide){max-width:min(800px,100%)}
body.sv-admin-modals #orderModal .modal-content{max-width:min(940px,100%);min-height:96px}
body.sv-admin-modals .modal:not(#orderModal) .close-modal{position:sticky;top:0;float:right;z-index:5;width:44px;height:44px;min-width:44px;min-height:44px;display:grid;place-items:center;margin:0 0 12px 12px;padding:0;border:1px solid #947b9d;border-radius:50%;background:#32233e;color:#f5deb0;font:28px/1 system-ui,sans-serif}
body.sv-admin-modals .modal :is(button,.btn-small,.btn-primary){max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere}
body.sv-admin-modals .modal :is(input:not([type=checkbox]):not([type=radio]),select,textarea){min-width:0;max-width:100%}
body.sv-admin-modals .modal :is(.form-actions,.actions){flex-wrap:wrap;gap:10px}
#symptomConsultationModal{z-index:1600;box-sizing:border-box}
#symptomConsultationModal .symptom-consult-dialog{box-sizing:border-box;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain;overflow-wrap:anywhere;scroll-padding-block:64px 20px}
#symptomConsultationModal .symptom-consult-close{position:sticky;float:right;top:0;right:auto;z-index:3;margin:0 0 10px 12px;width:44px;height:44px;background:#32233e;color:#f5deb0;border:1px solid #947b9d}
/* Legacy product preview: keep its existing opening logic, bound its scroll area. */
#pmodal{max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px)}
#pmodal .pm-scroll{max-height:calc(100vh - 26px);max-height:calc(100dvh - 26px);overscroll-behavior:contain;scroll-padding-top:64px}
#pmodal .pm-close{min-width:44px;min-height:44px;background:#32233e;color:#f5deb0;border:1px solid #947b9d;border-radius:50%}
html:has(dialog:modal,body.sv-admin-modals .modal.open,#symptomConsultationModal:not([hidden]),#pmodal.open){overflow:hidden}
body:has(dialog:modal,.modal.open,#symptomConsultationModal:not([hidden]),#pmodal.open)>.sp-launcher{visibility:hidden}
@media(max-width:600px){
 dialog:is(.sp-confirm,.op-confirm,.m90-confirm,.ac-dialog,.member-pay-dialog,.sv-dialog,.sv-confirm-dialog){padding:20px;border-radius:18px}
 dialog:is(.sp-product-dialog,.ac-dialog,.member-pay-dialog,.sv-dialog,#memberOrder) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px}
 body.sv-admin-modals .modal :is(.form-row,.ac-form-grid){grid-template-columns:minmax(0,1fr)}
 body.sv-admin-modals .modal .modal-content:not(#orderModal .modal-content){padding:16px}
 body.sv-admin-modals .modal input:not([type=checkbox]):not([type=radio]),body.sv-admin-modals .modal select,body.sv-admin-modals .modal textarea{font-size:16px}
 dialog.complex-dialog{width:calc(100% - 24px);margin:auto;border-radius:20px}
 #symptomConsultationModal{padding:12px;align-items:center}
 #symptomConsultationModal .symptom-consult-dialog{padding:20px;border-radius:20px}
}
@media(prefers-reduced-motion:reduce){dialog,.sv-admin-modals .modal{scroll-behavior:auto!important}}
@media(max-width:480px){dialog.sv-dialog .sv-form-row{grid-template-columns:minmax(0,1fr)}dialog.sv-dialog .sv-rating>div{flex-wrap:wrap}}
