@media (max-width: 1024px) {
    fieldset .fieldBox + .fieldBox {
	    margin-top: 0px;
	    padding-top: 0px;
	    border-top: none;
    }

    #content-main-change-form {
        padding-right: 0px;
    }
}
@media (max-width: 767px) {
    fieldset .fieldBox + .fieldBox {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--hairline-color);
    }

    fieldset .fieldBox {
        padding-right: 10px;
        margin-right: 0;
    }

    /* Django sizes these by the viewport (100vw - 30px), which ignores the
       wider page gutters here and makes the floated boxes overflow. */
    .aligned .form-row > div {
        width: 100%;
    }

    /* Let widgets with inline sizes shrink instead of widening the form. */
    fieldset.aligned {
        min-width: 0 !important;
    }

    /* A short line stub would remain beside the 500px legend. */
    form fieldset > legend {
        min-width: 0;
        width: 100%;
    }

    /* Tabular inlines scroll horizontally; size their legend to the visible
       width instead of the full table width. */
    .inline-group:has(> .tabular) {
        container-type: inline-size;
    }

    form .tabular > fieldset > legend {
        width: 100cqi;
    }

    /* Fixes displaying checkboxes in changeforms without flexbox */
    .aligned .form-row input[type="checkbox"] {
        flex: 0 0 auto;
    }

    /* Fixes displaying checkbox label in changeforms without margin */
    .aligned .vCheckboxLabel {
        margin-top: 0px;
    }

    /* Fixes displaying checkbox label in changeforms without margin */
    .aligned .vCheckboxLabel.inline {
        margin-top: 0px;
    }

    .aligned .form-row, .aligned .form-row > div {
        display: block;
        padding-left: 1px;
	    padding-right: 15px;
    }

    .aligned .form-row .select2-container {
        width: 100% !important;
    }

    .aligned .form-row .related-widget-wrapper.dNDT-related-select-widget > .select2-container {
        flex: 1 1 auto;
        min-width: 0;
        width: auto !important;
    }

    .aligned .form-row input[type=text],
    .aligned .form-row input[type=number],
    .aligned .form-row textarea {
        width: 100%;
        /* Also caps widget sizes set as inline styles. */
        max-width: 100%;
    }

    .aligned .form-row .split-datetime-input-widget {
        grid-template-columns: max-content minmax(0, 1fr);
        width: 100%;
    }

    .aligned .form-row .datetime-input-widget {
        display: flex;
        width: 100%;
    }

    .aligned .form-row .datetime-input-widget > input[type="text"] {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
    }

    /* fixes helper widgets of datetime fields which should have no margin */
    .aligned .related-lookup, .aligned .datetimeshortcuts, .aligned .related-lookup + strong {
        margin-left: 0px;
    }

    /* fixes padding of related widget wrapper links */
    select + .related-widget-wrapper-link, .related-widget-wrapper-link + .related-widget-wrapper-link {
        margin-left: 7px;
    }

     /* fixes display of arrows between many-2-many fields */
    .selector ul.selector-chooser {
        padding: 0px;
    }

    .select2-container {
        margin-right: 10px;
    }

    #content-main-change-form {
        padding-right: 0px;
    }
}

form div.radiolist label {
    width: auto;
    min-width: auto;
}

form div.radiolist.inline div {
    white-space: nowrap;
}
