/* New forms opt into bounded-form. Width follows the expected content. */
@media screen {
 html:root body form.bounded-form{box-sizing:border-box;min-width:0;max-width:100%}
 html:root body .password-policy-fields{box-sizing:border-box;min-width:0;max-width:100%;padding:0;border:0;display:grid;grid-template-columns:minmax(0,240px) minmax(0,1fr);align-items:end;gap:12px 22px}
 html:root body .password-policy-fields>small{grid-column:1/-1}
 html:root body .password-policy-fields>.choice-line{min-height:44px;align-items:center!important}
 html:root body .password-policy-fields .password-policy-duration{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;min-width:0;width:min(100%,240px)!important;max-width:240px!important}
 html:root body .password-policy-fields select{width:100%!important;max-width:240px!important;min-width:0!important}
 html:root body :is(.password-policy-fields,.staff-vault-fields) label.choice-line{display:grid!important;grid-template-columns:18px minmax(0,1fr)!important;align-items:start!important;justify-content:start!important;gap:10px!important;min-width:0;max-width:100%;margin:0}
 html:root body :is(.password-policy-fields,.staff-vault-fields) label.choice-line>input[type=checkbox]{appearance:auto!important;width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;min-height:18px!important;padding:0!important;margin:2px 0 0!important;grid-column:1!important;justify-self:start!important}
 html:root body :is(.password-policy-fields,.staff-vault-fields) label.choice-line>span{grid-column:2!important;line-height:1.5;min-width:0;overflow-wrap:anywhere}
 html:root body form.personal-password-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:400px!important;gap:14px!important;align-items:stretch!important}
 html:root body form.personal-password-form>*{grid-column:1!important;min-width:0!important;max-width:100%!important}
 html:root body form.personal-password-form>label{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:7px!important;width:100%!important;min-width:0!important}
 html:root body form.personal-password-form :is(input,.emerald-password){box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important}
 html:root body .server-auth:has(#personalPasswordForm) .auth-card{box-sizing:border-box!important;overflow-x:hidden!important;overflow-y:auto!important;max-height:calc(100dvh - 32px)!important;min-height:0!important;height:auto!important}
 html:root body .server-auth #personalPasswordForm{max-width:100%!important;margin:0!important}
 html:root body .server-auth #personalPasswordForm button[type=submit]{position:static!important;width:100%!important;min-width:0!important;white-space:normal!important}
 html:root body #userForm.staff-account-form{display:grid!important;grid-template-columns:repeat(3,minmax(0,320px))!important;align-items:start!important;justify-content:start!important;gap:18px 22px!important;padding:0!important}
 html:root body #userForm.staff-account-form>label{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;min-width:0!important;width:100%!important;max-width:320px!important}
 html:root body #userForm.staff-account-form>label>span{display:block!important;line-height:1.4;font-weight:500}
 html:root body #userForm.staff-account-form :is(input:not([type=checkbox]),select){box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important}
 html:root body #userForm.staff-account-form>.password-policy-fields{grid-column:1/-1!important;width:100%!important;max-width:100%!important}
 html:root body #userForm.staff-account-form>.staff-vault-fields{grid-column:1/-1!important;min-width:0;max-width:100%;padding:0;border:0;display:grid;gap:12px}
 html:root body #userForm.staff-account-form [hidden]{display:none!important}
 html:root body #userForm.staff-account-form>button{grid-column:1/-1!important;justify-self:end!important;width:auto!important;max-width:100%!important}
 @media(max-width:1100px){html:root body #userForm.staff-account-form{grid-template-columns:repeat(2,minmax(0,320px))!important}}
 @media(max-width:650px){html:root body .password-policy-fields{grid-template-columns:minmax(0,1fr)!important}html:root body #userForm.staff-account-form{grid-template-columns:minmax(0,1fr)!important}html:root body #userForm.staff-account-form>label{max-width:400px!important}}
}
@media screen {
 html:root body .password-policy-fields>label.choice-line{align-items:center!important;align-self:end!important}
}
@media screen {
 html:root body form.password-rules-form{display:grid;grid-template-columns:minmax(0,420px);gap:14px;justify-content:start}
 html:root body form.password-rules-form>label:not(.choice-line){display:grid;gap:8px;width:160px;max-width:100%}
 html:root body form.password-rules-form>label.choice-line{display:grid!important;grid-template-columns:18px minmax(0,1fr)!important;align-items:center!important;gap:10px!important}
 html:root body form.password-rules-form input[type=checkbox]{width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;margin:0!important;padding:0!important}
 html:root body form.password-rules-form button{justify-self:start;width:auto}
 html:root body .password-complexity-help{display:block;min-width:0;max-width:100%;grid-column:1/-1;line-height:1.5;overflow-wrap:anywhere}
}

/* V890: client creation shares space with the action rail; never beneath it. */
@media screen {
 html body #recordForm[data-record-kind="clients"] .record-panel-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px 22px!important;min-width:0!important;width:100%!important;box-sizing:border-box!important}
 html body #recordForm[data-record-kind="clients"] .record-panel-grid>.form-field{min-width:0!important;width:100%!important;max-width:none!important;grid-column:auto!important;box-sizing:border-box!important}
 html body #recordForm[data-record-kind="clients"] .record-panel-grid>.form-field.wide,
 html body #recordForm[data-record-kind="clients"] .record-panel-grid>.form-field:has([name="notes"]){grid-column:1/-1!important}
 html body #recordForm[data-record-kind="clients"] .form-field>:is(input:not([type="checkbox"]):not([type="hidden"]),select,textarea){width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
 html body #recordForm[data-record-kind="clients"] :is(fieldset,.rich-notes-wrap,.rich-notes-editor,.rich-notes-toolbar){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 html body #recordForm[data-record-kind="clients"] .rich-notes-toolbar{flex-wrap:wrap!important}
 html body #recordForm[data-record-kind="clients"] .record-tab-panel[hidden]{display:none!important}
}
@media screen and (min-width:760px){
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form){grid-template-rows:auto auto minmax(0,1fr) auto!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>.record-head{grid-column:1!important;grid-row:1!important;position:relative!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>#recordTabs{grid-column:1!important;grid-row:2!important;min-width:0!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>#formFields{grid-column:1!important;grid-row:3!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>.record-footer{grid-column:1!important;grid-row:4!important;padding:8px 18px!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>.right-tools-aside{grid-column:2!important;grid-row:1/5!important;position:relative!important;top:auto!important;align-self:stretch!important;height:100%!important;max-height:100%!important}
}
@media screen and (max-width:1200px){html body #recordForm[data-record-kind="clients"] .record-panel-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media screen and (max-width:640px){html body #recordForm[data-record-kind="clients"] .record-panel-grid{grid-template-columns:minmax(0,1fr)!important}}

/* V891: use the Matériel rail command sizes, icons and theme, from the top. */
@media screen and (min-width:760px){
 html body #recordForm[data-record-kind="clients"].right-tools-root:not(.business-pilot-form)>.record-head .ui-head-actions{position:static!important;inset:auto!important;margin-left:auto!important}
 html body #recordForm[data-record-kind="clients"].right-tools-root #formFields .waze-button{display:none!important}
 html body #recordForm[data-record-kind="clients"]>.right-tools-aside .rt-edit-actions{gap:0!important;margin:0!important}
 html body #recordForm[data-record-kind="clients"]>.right-tools-aside :is(.rt-edit-save,.rt-edit-cancel){gap:10px!important;min-height:40px!important;padding:10px 4px!important;font-size:13px!important;line-height:1.4!important;border:0!important;border-radius:6px!important;text-align:left!important;justify-content:flex-start!important;font-weight:400!important}
 html body #recordForm[data-record-kind="clients"]>.right-tools-aside .rt-edit-cancel{background:transparent!important;color:var(--blue,#0876f3)!important}
 html body #recordForm[data-record-kind="clients"]>.right-tools-aside .rt-edit-save{justify-content:center!important;padding:10px!important;margin:4px 0 10px!important;background:var(--blue,#0876f3)!important;color:var(--button-ink,#fff)!important}
 html body #recordForm[data-record-kind="clients"]>.right-tools-aside :is(.rt-edit-save,.rt-edit-cancel)>svg{width:23px!important;height:23px!important;flex:0 0 23px!important}
}
