/* Keep workspace forms consistent: large centred dialogs on desktop, nearly full-screen on mobile. */
:is(.action-drawer,.add-customer-drawer,.customer-profile-drawer,.agent-drawer,.investment-drawer,.crm-lead-drawer,.member-program-drawer){
    position:fixed!important;
    top:50%!important;
    left:50%!important;
    right:auto!important;
    bottom:auto!important;
    width:min(1040px,calc(100vw - 48px))!important;
    height:min(820px,calc(100vh - 48px))!important;
    max-height:calc(100vh - 48px)!important;
    border:1px solid rgba(216,224,218,.92);
    border-radius:20px!important;
    box-shadow:0 30px 90px rgba(13,28,45,.28)!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translate(-50%,-46%) scale(.975)!important;
    transition:opacity .2s ease,transform .24s ease,visibility .2s ease!important;
}

:is(.action-drawer,.add-customer-drawer,.customer-profile-drawer,.agent-drawer,.investment-drawer,.crm-lead-drawer,.member-program-drawer).open{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1)!important;
}

.action-drawer{overflow:auto!important}
.workspace-record-drawer{inset:auto!important;top:50%!important;left:50%!important;right:auto!important;bottom:auto!important;width:min(780px,calc(100vw - 48px))!important;height:min(700px,calc(100vh - 48px))!important;max-height:calc(100vh - 48px)!important;border:1px solid rgba(216,224,218,.92);border-radius:20px;overflow:hidden;box-shadow:0 30px 90px rgba(13,28,45,.28)!important;opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,-46%) scale(.975)!important;transition:opacity .2s ease,transform .24s ease,visibility .2s ease!important}
.workspace-record-drawer.open{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1)!important}
.action-drawer[data-payment-drawer]{width:min(760px,calc(100vw - 48px))!important;height:min(690px,calc(100vh - 48px))!important;padding:22px 26px!important}
.action-drawer[data-payment-drawer] h2{font-size:26px;margin:5px 0}
.action-drawer[data-payment-drawer] fieldset{margin-bottom:15px}
.action-drawer[data-payment-drawer] form{padding-top:0}
.action-drawer[data-payment-drawer] form>fieldset:first-child{margin-bottom:8px;padding-top:8px}
.action-drawer[data-payment-drawer] form>fieldset:first-child{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.action-drawer[data-payment-drawer] form>fieldset:first-child>label:first-child{margin-top:0}
.action-drawer[data-payment-drawer] form>fieldset:first-child>label{margin-top:0}
.action-drawer[data-payment-drawer] form>fieldset:nth-child(2) legend{margin-bottom:8px;padding-bottom:8px}
.action-drawer[data-payment-drawer] .payment-agent-field{width:calc(50% - 8px)}
.action-drawer[data-payment-drawer] .payment-agent-field small{display:inline;font-weight:500;color:#7b8794}
.action-drawer[data-payment-drawer] label:has(input[name="agent"]) small{display:inline;font-weight:500;color:#7b8794}
.action-drawer[data-payment-drawer] label{margin:9px 0}
.action-drawer[data-payment-drawer] input,.action-drawer[data-payment-drawer] select,.action-drawer[data-payment-drawer] textarea{padding:10px 12px}
.payment-header-actions{display:flex;align-items:flex-start;gap:12px;flex:0 0 auto}
.action-drawer .payment-new-toggle{display:flex;align-items:center;gap:7px;margin:4px 0 0;padding:7px 10px;border:1px solid #d7dee8;border-radius:8px;color:#344054;cursor:pointer}
.action-drawer .payment-new-toggle input{display:inline-block;width:15px;height:15px;margin:0;padding:0}
.payment-new-toggle span{font-size:12px;font-weight:800}
.add-customer-drawer{width:min(920px,calc(100vw - 48px))!important;overflow:auto!important}
.customer-profile-drawer{width:min(1000px,calc(100vw - 48px))!important;overflow:auto!important}
.agent-drawer{width:min(920px,calc(100vw - 48px))!important;overflow:auto!important}
.member-program-drawer{width:min(820px,calc(100vw - 48px))!important;overflow:auto!important}
.investment-drawer{overflow:auto!important}
.crm-lead-drawer{width:min(920px,calc(100vw - 48px))!important;overflow:hidden!important}

/* Add-property is a compact, stepped form rather than a full workspace window. */
.action-drawer[data-property-drawer]{
    width:min(860px,calc(100vw - 48px))!important;
    height:min(700px,calc(100vh - 48px))!important;
    overflow:hidden!important;
    padding:0!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr);
}
.action-drawer[data-property-drawer]>header{padding:22px 28px 18px;margin:0}
.action-drawer[data-property-drawer] h2{font-size:26px;margin:5px 0}
.action-drawer[data-property-drawer] form{min-height:0;padding:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.property-form-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px 28px 0;border-bottom:1px solid #e5e9ef;background:#fbfcfe}
.property-form-tabs button{display:flex;align-items:center;justify-content:center;gap:8px;border:0;border-bottom:3px solid transparent;background:transparent;color:#687770;padding:9px 8px;font:750 13px Inter,Arial,sans-serif;cursor:pointer}
.property-form-tabs button span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#edf1f5;color:#637168;font-size:11px}
.property-form-tabs button.active{color:#2563eb;border-bottom-color:#2563eb}
.property-form-tabs button.active span{background:#2563eb;color:#fff}
.property-form-panels{min-height:0;overflow:auto}
.property-form-panel{padding:16px 28px 20px}
.property-form-panel[hidden]{display:none}
.property-form-panel fieldset{margin:0}
.property-form-panel>fieldset>label:first-child,.property-form-panel .smart-location>.action-form-grid:first-child label{margin-top:0}
.property-form-panel[data-property-form-panel="details"]>fieldset{display:grid;grid-template-columns:1fr 1fr;column-gap:16px;row-gap:16px;align-items:start}
.property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid{display:contents}
.property-form-panel[data-property-form-panel="details"]>fieldset label{margin:0}
.property-form-panel[data-property-form-panel="details"]>fieldset label>small{display:block;margin-top:4px;line-height:1.25}
.property-form-panel[data-property-form-panel="details"]>fieldset>label:first-child{order:1;width:auto}
.property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:first-of-type>label:first-child{order:2}
.property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:first-of-type>label:last-child{order:3}
.property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:nth-of-type(2)>label:first-child{order:4}
.property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:nth-of-type(2)>label:last-child{order:5}
.property-form-panel[data-property-form-panel="details"]>fieldset>label:last-child{order:6}
.property-form-footer{display:flex!important;align-items:center;justify-content:space-between!important;gap:12px;padding:14px 28px!important;background:#fff}
.property-form-footer>div{display:flex;gap:9px}
.property-form-footer [hidden]{display:none}

@media(max-width:700px){
    .workspace-record-drawer{width:calc(100vw - 20px)!important;height:calc(100vh - 20px)!important;max-height:calc(100vh - 20px)!important;border-radius:14px}
    .property-form-panel[data-property-form-panel="details"]>fieldset{grid-template-columns:1fr}
    .property-form-panel[data-property-form-panel="details"]>fieldset>label:first-child{order:1;width:100%}
    .property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:first-of-type>label:first-child{order:2}
    .property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:first-of-type>label:last-child{order:3}
    .property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:nth-of-type(2)>label:first-child{order:4}
    .property-form-panel[data-property-form-panel="details"]>fieldset>.action-form-grid:nth-of-type(2)>label:last-child{order:5}
    .property-form-panel[data-property-form-panel="details"]>fieldset>label:last-child{order:6}
    .action-drawer[data-payment-drawer] form>fieldset:first-child{grid-template-columns:1fr;gap:4px}
    .action-drawer[data-payment-drawer] .payment-agent-field{width:100%}
    .action-drawer[data-property-drawer]{width:calc(100vw - 20px)!important;height:calc(100vh - 20px)!important}
    .action-drawer[data-property-drawer]>header{padding:18px 20px 14px}
    .property-form-tabs{padding:8px 14px 0;gap:0}
    .property-form-tabs button{font-size:0;gap:5px;padding:10px 4px}
    .property-form-tabs button span{font-size:11px}
    .property-form-tabs button::after{font-size:11px}
    .property-form-tabs button[data-property-form-tab="details"]::after{content:'Details'}
    .property-form-tabs button[data-property-form-tab="location"]::after{content:'Location'}
    .property-form-tabs button[data-property-form-tab="media"]::after{content:'Media'}
    .property-form-panel{padding:14px 20px 18px}
    .property-form-footer{padding:12px 20px!important}
    .property-form-footer .action-primary{min-width:0}
}

/* The profile footer belonged to the old right drawer. Keep it inside the modal. */
.customer-profile-drawer .profile-drawer-actions{
    position:sticky!important;
    right:auto!important;
    bottom:0!important;
    width:auto!important;
    z-index:3;
}

:is(.action-drawer-backdrop,.customer-backdrop,.agent-drawer-backdrop,.investment-drawer-backdrop,.crm-drawer-backdrop){
    background:rgba(15,23,42,.62)!important;
    backdrop-filter:blur(4px)!important;
}

@media(max-width:700px){
    :is(.action-drawer,.add-customer-drawer,.customer-profile-drawer,.agent-drawer,.investment-drawer,.crm-lead-drawer,.member-program-drawer){
        width:calc(100vw - 20px)!important;
        height:calc(100vh - 20px)!important;
        max-height:calc(100vh - 20px)!important;
        border-radius:14px!important;
    }
}
.agent-drawer{width:min(980px,calc(100vw - 40px))!important;height:auto!important;max-height:calc(100vh - 40px)!important;overflow:hidden!important}.agent-drawer .agent-form{grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:stretch;overflow-y:auto!important;overflow-x:hidden!important;padding:20px 24px 22px!important;gap:16px!important}.agent-drawer .agent-form fieldset{display:flex;flex-direction:column;min-width:0!important;width:100%;box-sizing:border-box;padding:18px!important}.agent-drawer .agent-form fieldset:first-of-type{padding-top:46px!important}.agent-drawer .agent-form label,.agent-drawer .agent-form input,.agent-drawer .agent-form select{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}.agent-drawer .agent-form input,.agent-drawer .agent-form select{width:100%!important}.agent-drawer .agent-rule-row{margin-top:auto!important;min-height:58px;box-sizing:border-box}.agent-drawer .agent-drawer-actions{grid-column:1/-1!important;display:flex!important;align-items:center;justify-content:flex-end!important;padding:2px 0 0!important}.agent-drawer .agent-drawer-actions button{height:42px!important}.agent-drawer .save-agent{min-width:190px}@media(max-width:900px){.agent-drawer .agent-form{grid-template-columns:1fr 1fr!important}.agent-drawer .agent-form fieldset:first-of-type{padding-top:18px!important}.agent-drawer .agent-form fieldset:last-of-type{grid-column:1/-1!important}}@media(max-width:620px){.agent-drawer{height:calc(100vh - 20px)!important}.agent-drawer .agent-form{grid-template-columns:1fr!important}.agent-drawer .agent-form fieldset:last-of-type{grid-column:auto!important}}
.add-customer-drawer{width:min(920px,calc(100vw - 40px))!important;height:auto!important;max-height:calc(100vh - 40px)!important;overflow:hidden!important}.add-customer-drawer .add-customer-form{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch;max-height:calc(100vh - 146px);overflow-y:auto!important;overflow-x:hidden!important;padding:20px 24px 0!important;gap:16px!important}.add-customer-drawer .add-customer-form fieldset{min-width:0!important;width:100%;box-sizing:border-box;padding:18px!important}.add-customer-drawer .add-customer-form fieldset:first-of-type{padding-top:46px!important}.add-customer-drawer .add-customer-form label,.add-customer-drawer .add-customer-form input,.add-customer-drawer .add-customer-form select,.add-customer-drawer .add-customer-form textarea{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}.add-customer-drawer .add-customer-form input,.add-customer-drawer .add-customer-form select,.add-customer-drawer .add-customer-form textarea{width:100%!important}.add-customer-drawer .add-customer-form fieldset:nth-of-type(3){grid-column:1/-1!important;display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)!important;gap:0 14px!important}.add-customer-drawer .add-customer-form fieldset:nth-of-type(3) legend{grid-column:1/-1!important}.add-customer-drawer .add-customer-actions{position:sticky;bottom:0;z-index:3;grid-column:1/-1!important;margin:0 -24px!important;padding:14px 24px!important;border-top:1px solid #e1e7ee;background:#fff;box-shadow:0 -8px 20px rgba(16,24,40,.05)}.add-customer-drawer .add-customer-actions button{height:42px!important}.add-customer-drawer .save-customer{min-width:150px}@media(max-width:700px){.add-customer-drawer{height:calc(100vh - 20px)!important}.add-customer-drawer .add-customer-form{grid-template-columns:1fr!important}.add-customer-drawer .add-customer-form fieldset:first-of-type{padding-top:18px!important}.add-customer-drawer .add-customer-form fieldset:nth-of-type(3){grid-column:auto!important;display:block!important}}

.property-form-panel[data-property-form-panel="details"] .property-ownership{display:contents}.property-ownership>label{grid-column:2;order:5;max-width:none;margin:0}.property-ownership label>span{color:#87918b;font-weight:500}.property-owner-summary{grid-column:1/-1;order:6;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:62px;padding:10px 12px;border:1px solid #d8e4de;border-radius:9px;background:#f6faf8}.property-owner-summary[hidden]{display:none!important}.property-owner-summary small,.property-owner-summary strong{display:block}.property-owner-summary small{color:#6d7b74;font-size:9px;font-weight:800;letter-spacing:.08em}.property-owner-summary strong{margin-top:4px;color:#21382f;font-size:11px;line-height:1.35}.property-owner-summary button{flex:none;border:1px solid #bfd0c7;border-radius:7px;background:#fff;color:#17624d;padding:7px 9px;font:800 10px Inter,Arial;cursor:pointer}
.ownership-terms-backdrop{position:fixed;inset:0;z-index:110;background:rgba(15,23,42,.66);backdrop-filter:blur(5px)}.ownership-terms-backdrop[hidden],.ownership-terms-modal[hidden],.ownership-terms-modal label[hidden]{display:none!important}.ownership-terms-modal{position:fixed;z-index:111;top:50%;left:50%;transform:translate(-50%,-50%);width:min(680px,calc(100vw - 40px));max-height:calc(100vh - 40px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:1px solid #e3e9e6;border-radius:18px;background:#fff;box-shadow:0 30px 80px rgba(15,23,42,.28);font-family:Inter,Arial,sans-serif}.ownership-terms-modal>header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 18px;border-bottom:1px solid #e8ecea}.ownership-terms-modal>header span{color:#39705e;font-size:10px;font-weight:850;letter-spacing:.13em}.ownership-terms-modal>header h2{margin:5px 0 4px;color:#12243d;font-size:23px;line-height:1.15}.ownership-terms-modal>header p{margin:0;color:#697872;font-size:12px}.ownership-terms-modal>header button{width:38px;height:38px;display:grid;place-items:center;flex:none;border:0;border-radius:9px;background:#f0f4f2;color:#254c3e;font-size:24px;cursor:pointer}.ownership-terms-body{overflow:auto;padding:20px 24px}.ownership-terms-modal label{display:block;margin:12px 0;color:#344054;font-size:12px;font-weight:750}.ownership-terms-body>.action-form-grid:first-child label{margin-top:0}.ownership-terms-modal input,.ownership-terms-modal select,.ownership-terms-modal textarea{display:block;width:100%;box-sizing:border-box;margin-top:7px;border:1px solid #d3ddd8;border-radius:9px;background:#fff;color:#111827;padding:11px 12px;font:500 13px Inter,Arial;outline:none}.ownership-terms-modal input:focus,.ownership-terms-modal select:focus,.ownership-terms-modal textarea:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12)}.ownership-terms-modal label>small{display:block;margin-top:5px;color:#73817a;font-size:10px;font-weight:500}.ownership-terms-modal textarea{min-height:68px;resize:vertical}.ownership-terms-modal>footer{display:flex;justify-content:flex-end;gap:9px;padding:14px 24px;border-top:1px solid #e8ecea;background:#fbfcfb}.ownership-terms-modal>footer button{min-height:40px;border:1px solid #d5ddd9;border-radius:9px;background:#fff;color:#344054;padding:0 16px;font:800 12px Inter,Arial;cursor:pointer}.ownership-terms-modal>footer .action-primary{border-color:#2563eb;background:#2563eb;color:#fff}.ownership-terms-modal .demo-new-owner{margin:14px 0}
@media(max-width:700px){.property-ownership>label,.property-owner-summary{grid-column:1}.property-owner-summary{order:7}.ownership-terms-modal{width:calc(100vw - 20px);max-height:calc(100vh - 20px);border-radius:14px}.ownership-terms-modal .action-form-grid{grid-template-columns:1fr}.ownership-terms-modal>header,.ownership-terms-body,.ownership-terms-modal>footer{padding-left:18px;padding-right:18px}}

/* Align the customer form groups and keep the footer in normal flow. */
.add-customer-drawer .add-customer-form{align-items:stretch!important;grid-auto-rows:auto!important;padding:16px 22px 0!important;gap:12px!important}
.add-customer-drawer .add-customer-form fieldset{padding:14px!important}
.add-customer-drawer .add-customer-form fieldset:first-child{padding-top:14px!important}
.add-customer-drawer .add-customer-form fieldset:first-child legend{display:block!important}
.add-customer-drawer .add-customer-form fieldset:nth-child(-n+2){height:100%;align-self:stretch}
.add-customer-drawer .add-customer-form fieldset:nth-child(3){align-items:start!important}
.add-customer-drawer .add-customer-actions{position:static!important;align-self:end;margin:0 -22px!important;padding:10px 22px!important}
.add-customer-drawer .add-customer-actions button{height:38px!important}

/* Match the first realtor card to the titled cards beside it. */
.agent-drawer .agent-form{align-items:stretch!important}
.agent-drawer .agent-form fieldset:first-child{padding-top:18px!important}
.agent-drawer .agent-form fieldset:first-child legend{display:block!important}
.agent-drawer .agent-form fieldset{height:100%;align-self:stretch}
.demo-new-owner{margin-top:12px;padding:12px;border:1px dashed #b9cfc3;border-radius:9px;background:#fff}.demo-new-owner[hidden]{display:none!important}.demo-new-owner>strong{display:block;font-size:12px;color:#233b31}.demo-new-owner>button{margin-top:10px;border:0;border-radius:8px;background:#173d32;color:#fff;padding:10px 13px;font-weight:800;cursor:pointer}.owner-company-drawer{width:min(720px,calc(100vw - 48px))!important;height:min(650px,calc(100vh - 48px))!important;padding:24px!important}.owner-company-list{display:grid;gap:9px;margin:18px 0}.owner-company-list article{display:grid;grid-template-columns:42px 1fr auto;gap:12px;align-items:center;padding:12px;border:1px solid #e1e8e3;border-radius:10px}.owner-company-list article>b{width:40px;height:40px;display:grid;place-items:center;border-radius:9px;background:#e4f1eb;color:#17624d;font-size:12px}.owner-company-list article strong,.owner-company-list article small{display:block}.owner-company-list article small{margin-top:3px;color:#75817b;font-size:10px}.owner-company-list article>span{color:#617069;font-size:11px}.owner-company-drawer form{padding-top:14px;border-top:1px solid #e5e9ef}.owner-company-drawer form footer{display:flex;justify-content:flex-end;gap:9px}.property-heading-actions .quiet-action:is(button){font:700 12px Inter,Arial;cursor:pointer}
