/* Room for visible focus outlines in the shared workspace, Careers and admin forms.
   Checkbox/radio rows, hidden labels and existing component grid gaps stay intact. */
:root{--form-label-space:12px;--form-help-space:12px;--form-field-space:24px}
/* Plain panel-based Django forms need the same gap as the older form-card
   layouts. Password Show/Hide wraps its input after the page has loaded. */
:is(.form-grid p,.form-card form>p,.upload-panel form>p,.career-form-card form>p,.auth-card form>p,.main .panel form>p,.main .hiring-card form>p)>label:not(.sr-only):not(.visually-hidden):not([hidden]):has(+ :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.password-visibility)){display:block;margin-block:0 var(--form-label-space);line-height:1.6}
:is(.form-grid p,.form-card form>p,.upload-panel form>p,.career-form-card form>p,.auth-card form>p,.main .panel form>p,.main .hiring-card form>p):has(>label + :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.password-visibility)){margin-block:0 var(--form-field-space)}
:is(.form-grid p,.form-card form>p,.upload-panel form>p,.career-form-card form>p,.auth-card form>p,.main .panel form>p,.main .hiring-card form>p)>:is(input,select,textarea,.password-visibility)+:is(.helptext,.help-block,.form-help,small){display:block;margin-block-start:var(--form-help-space);line-height:1.7}
:where(.main,.careers-main,#content-main) form label:not(.sr-only):not(.visually-hidden):not(:has(input[type=checkbox],input[type=radio])):has(> :is(input:not([type=hidden]),select,textarea)){display:grid;row-gap:var(--form-label-space);line-height:1.6}
:where(.main,.careers-main,#content-main) form label:not(:has(input[type=checkbox],input[type=radio]))>:is(input:not([type=hidden]),select,textarea){margin-block:0;min-width:0}
.assessment-survey .survey-field>label{margin-block-end:var(--form-label-space)}
.assessment-survey .survey-field>.helptext{margin-block-start:var(--form-help-space)}
:is(.standard-sections,.section-fields,.custom-section-row) p>label:has(+ :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea)){display:block;margin-block-end:var(--form-label-space);line-height:1.6}
.line-description-fields{gap:var(--form-label-space)}
@media(max-width:767px){
  #content-main .aligned .form-row .flex-container:has(>label + :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.related-widget-wrapper,p.date,p.datetime,.password-visibility)){display:flex;flex-direction:column;align-items:stretch;gap:var(--form-label-space)}
  #content-main .aligned .form-row .flex-container:has(>label + :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,.related-widget-wrapper,p.date,p.datetime,.password-visibility))>label{width:auto;float:none;padding:0;margin:0;line-height:1.6}
  #content-main .aligned .form-row .flex-container>:is(p.date,p.datetime){margin-block:0}
}
