/* Shared native dropdown treatment, including dynamically created forms. */
:root select:not([multiple]):not([size]){
 -webkit-appearance:none;
 appearance:none;
 padding-inline-end:42px;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368737f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 background-repeat:no-repeat;
 background-position:right 14px center;
 background-size:16px 16px;
}
:root :is(.permission-group,.lease-clause-editor,.unit-fold)>summary{list-style:none;position:relative;padding-inline-end:34px}
:root :is(.permission-group,.lease-clause-editor,.unit-fold)>summary::-webkit-details-marker{display:none}
:root :is(.permission-group,.lease-clause-editor,.unit-fold)>summary::marker{content:''}
:root :is(.permission-group,.lease-clause-editor,.unit-fold)>summary::after{content:'';position:absolute;right:0;top:50%;width:16px;height:16px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2368737f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/16px no-repeat;transform:translateY(-50%)}
:root .unit-fold>summary{padding-inline-end:46px}
:root .unit-fold>summary::after{right:18px}
:root :is(.permission-group,.lease-clause-editor,.unit-fold)[open]>summary::after{content:'';transform:translateY(-50%) rotate(180deg)}

/* Header and actions stay visible while only the dialog's fields scroll. */
:root .modal.dialog-shell{display:flex;flex-direction:column;padding:0;overflow:hidden;max-height:calc(100dvh - 32px);min-height:0}
.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px 16px;flex:none;background:#fff;border-bottom:1px solid #edf0f3}
.dialog-header>div{min-width:0}
.dialog-header .badge:empty{display:none}
:root .dialog-header h2{font-size:22px;line-height:1.3;margin:0;letter-spacing:-.5px;padding-top:4px}
:root .dialog-header .close{position:static;flex:none;display:grid;place-items:center;padding:0;margin:-2px -8px -2px 0;width:36px;height:36px;min-width:36px;min-height:36px;font-size:25px;line-height:1;color:#687482;border-radius:9px;background:transparent}
.dialog-header .close:hover{background:#f3f5f7}
.dialog-body{min-height:0;flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:18px 24px 24px;scrollbar-gutter:stable}
.dialog-body>p:first-child{margin:0;font-size:12px;line-height:1.65}
.dialog-body .create-form{margin-top:16px}
.dialog-body .create-form>label,.dialog-body .create-form .design-form-grid>div>label{margin-top:12px;font-size:12px}
.dialog-body .form-error:empty{display:none}
.dialog-footer{padding:14px 24px 18px;border-top:1px solid #e5e9ee;background:white;flex:none;box-shadow:0 -4px 14px #1a1d2403}
.dialog-footer[hidden]{display:none}
:root .dialog-footer .form-actions{position:static;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin:0;padding:0}
:root .dialog-footer .form-actions .btn{margin:0;min-height:44px;font-size:12px;padding:10px 17px;border-radius:10px}
.bill-tenant-context{background:#f6f8fa;border:1px solid #e7ebef;border-radius:10px;padding:12px 14px;margin:0 0 16px}
.bill-tenant-context>span{display:block;font-size:10px;color:#86909b;margin-bottom:5px}
.bill-tenant-context>strong{display:block;font-size:14px;line-height:1.4;font-weight:650;color:#293440}
@media (max-width:760px){
 :root .modal-backdrop{padding:12px}
 :root .modal.dialog-shell{max-height:calc(100dvh - 24px);border-radius:18px}
 .dialog-header{padding:18px 18px 14px}
 :root .dialog-header h2{font-size:21px}
 .dialog-body{padding:16px 18px 20px}
 .dialog-footer{padding:12px 18px max(14px,env(safe-area-inset-bottom))}
 :root .dialog-footer .form-actions .btn{flex:1;min-width:100px}
}
@media (forced-colors:active){
 :root select:not([multiple]):not([size]){appearance:auto;-webkit-appearance:auto;background-image:none;padding-inline-end:12px}
 :root :is(.permission-group,.lease-clause-editor,.unit-fold)>summary::after{background:none;width:8px;height:8px;border:solid ButtonText;border-width:0 2px 2px 0;transform:translateY(-65%) rotate(45deg)}
 :root :is(.permission-group,.lease-clause-editor,.unit-fold)[open]>summary::after{transform:translateY(-25%) rotate(225deg)}
}
