.bf-form-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;inset:0;z-index:1900;background:#050a08bd;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.bf-form-backdrop[hidden]{display:none!important}
body #panel .bf-form-modal{position:fixed!important;z-index:1901;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:calc(100vw - 64px)!important;max-width:900px!important;max-height:calc(100vh - 64px)!important;max-height:calc(100dvh - 64px)!important;overflow:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:0!important;padding:0!important;border:1px solid #8ba45a66!important;border-radius:22px!important;background:linear-gradient(145deg,#273521,#172116)!important;color:#edf4e6;box-shadow:0 35px 110px #000a,inset 0 1px #e2f4ca14;box-sizing:border-box;scrollbar-width:thin}
body #panel .bf-form-behind{display:none!important}
.bf-modal-header{position:sticky;top:0;z-index:55;display:flex;justify-content:space-between;align-items:center;gap:18px;padding:18px 24px;background:#1c291a;border-bottom:1px solid #90ad5d38;box-shadow:0 5px 18px #0002}
body #panel .bf-modal-header h2{font-family:inherit;font-size:22px!important;line-height:1.3;letter-spacing:-.3px;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#f0f6e7!important}
body #panel .bf-modal-header .bf-modal-close{flex:0 0 42px;width:42px!important;height:42px;min-height:42px!important;margin:0!important;padding:0!important;font-size:28px!important;font-weight:400;background:#839c4b1c!important;border:1px solid #91ae6038!important;box-shadow:none!important;color:#e6efd9!important}
.bf-modal-title-source,.bf-modal-source-close{display:none!important}
body #panel .bf-form-modal>form,body #panel .bf-form-modal>.training-card,body #panel .bf-form-modal>.finance-payment-start{margin:0!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:24px!important;max-width:none;background:transparent!important}
body #panel .bf-form-modal>.training-card>form{margin:0!important;padding:0!important}
body #panel form.bf-form-modal{padding:24px!important}
body #panel form.bf-form-modal>.bf-modal-header{margin:-24px -24px 20px}
body #panel .bf-form-modal .shared-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px}
body #panel .bf-form-modal .shared-form-grid>label{margin:0!important}
body #panel .bf-form-modal input,body #panel .bf-form-modal textarea,body #panel .bf-form-modal select{box-sizing:border-box;max-width:100%}
body #panel .bf-modal-actions{position:sticky;bottom:0;z-index:45;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;margin:24px -24px 0!important;padding:16px 24px!important;background:#1b2919;border-top:1px solid #90ad5d38;box-shadow:0 -8px 20px #0002}
body #panel .bf-modal-actions button{width:auto!important;margin:0!important;min-height:46px}
body #panel .bf-form-modal .befit-picker{width:100%;max-width:none}
/* Payment steps: separate consecutive blocks and retain contrast in the totals. */
body #panel #finance-form [data-payment-client-new]{display:inline-flex;align-items:center;margin:16px 0 0!important}
body #panel #finance-form #finance-preview{margin:18px 0!important}
body #panel #finance-form #finance-preview:empty{display:none}
body #panel #finance-form .finance-preview{padding:18px 20px;border:1px solid #809f534d;background:#132111!important;color:#e7f1da!important;gap:18px}
body #panel #finance-form .finance-preview small{color:#b8caa7!important;line-height:1.45}
body #panel #finance-form .finance-preview strong{color:#e8f5d4!important;line-height:1.35}
body #panel #finance-form #finance-edit>.assessment-check{margin:16px 0!important;gap:12px;line-height:1.5}
body #panel #finance-form #finance-payment-options{margin:18px 0!important}
@media(max-width:600px){
 body #panel .bf-form-modal{top:0!important;left:0!important;transform:none!important;width:100%!important;max-width:none!important;height:100vh!important;height:100dvh!important;max-height:100vh!important;max-height:100dvh!important;border-radius:0!important;border:0!important;padding-bottom:env(safe-area-inset-bottom)!important}
 .bf-modal-header{padding:14px 16px;padding-top:max(14px,env(safe-area-inset-top))}
 body #panel .bf-modal-header h2{font-size:20px!important}
 body #panel .bf-form-modal>form,body #panel .bf-form-modal>.training-card,body #panel .bf-form-modal>.finance-payment-start{padding:18px 16px!important}
 body #panel form.bf-form-modal{padding:18px 16px!important}
 body #panel form.bf-form-modal>.bf-modal-header{margin:-18px -16px 18px}
 body #panel .bf-form-modal .shared-form-grid{grid-template-columns:minmax(0,1fr)}
 body #panel .bf-modal-actions{bottom:0;margin:20px -16px 0!important;padding:14px 16px!important;padding-bottom:max(14px,env(safe-area-inset-bottom))!important}
 body #panel .bf-modal-actions button{flex:1 1 auto}
 body #panel .bf-form-modal{top:var(--bf-modal-offset,0px)!important;height:var(--bf-modal-viewport,100dvh)!important;max-height:var(--bf-modal-viewport,100dvh)!important}
}

/* Touch tablets: explicit viewport bounds, compatible with older Safari. */
@media(min-width:601px){body #panel .bf-form-modal.bf-touch-modal{top:var(--bf-touch-modal-top,12px)!important;left:12px!important;right:12px!important;transform:none!important;width:calc(100% - 24px)!important;max-width:none!important;max-height:var(--bf-touch-modal-max-height,calc(100vh - 24px))!important;overflow-y:scroll!important;-webkit-overflow-scrolling:touch;touch-action:pan-y}}
body #panel .bf-form-modal #training-edit-rows{min-height:0;overflow:visible}
