.mform-headline h3 {
    margin: 0;
}

.mform select.form-control {
    height: 34px;
}

.collapse-group .dropdown.bootstrap-select select {
    display: none !important;
}

.mform select[multiple], .mform select[size] {
    height: auto;
}

.mform .form-horizontal .mform-headline,
.mform .form-horizontal .mform-description {
    margin-left: 0;
    margin-right: 0;
}

.mform .mform-tabs .nav-tabs {
    margin-bottom: 0;
}

.mform .mform-tabs .tab-content {
    padding: 20px;
    background: #fff;
}

.mform .mform-tabs.rex-page-nav:last-child {
    margin-bottom: 0;
}

.mform .form-horizontal fieldset {
    width: 100%;
}

.mform .mform-headline.grey-legend-background h3,
.sortitem .mform fieldset.grey-legend-background > legend,
.mform fieldset.grey-legend-background > legend {
    border-bottom: none;
    padding: 8px 10px;
    background: #d8d8d8;
    font-size: 14px;
    font-weight: bold;
}

.mform .tab-content .mform-headline.grey-legend-background h3,
.mform .tab-content fieldset.grey-legend-background > legend,
.mform .tab-content fieldset.grey-legend-background > legend {
    background: #f3f3f3;
}

.sortitem .mform fieldset.grey-legend-background:first-child {
    margin-top: 5px;
}

.sortitem .mform .mform-headline.grey-legend-background h3,
.sortitem .mform fieldset.grey-legend-background > legend {
    background: #ececec;
}

.tab-content .sortitem {
    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}

.mform-alert + .mform-alert {
    margin-top: -15px;
}

.mform .btn-white {
    background-color: #fff;
    color: #333;
    border-radius: 0;
    text-align: left;
    font-size: 14px;
    height: 50px;
    line-height: 20px;
    padding: 15px;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
    margin-bottom: 1px;
}

.mform .btn-white[aria-expanded=true] {
    background: #4b9ad9;
    color: #fff;
}

.mform .btn-white:hover {
    background-color: #4b9ad9;
    color: #ffffff;
}

.mform .btn-white:focus,
.mform .btn-white:active {
    background-color: #2a81c7;
}

.mform-tabs .btn-white {
    background-color: #fafafa;
}

.mform .btn-white:after {
    content: '\f067';
    width: 10px;
    height: 10px;
    color: #4b9ad9;
    display: inline-block;
    margin-left: 15px;
    float: right;
    font: normal normal 900 14px/1 "Font Awesome 6 Free", FontAwesome;
    font-size: 15px;
}

.mform .btn-white:hover:after {
    color: #FFF;
}

.mform .btn-white[aria-expanded="true"]:after {
    content: '\f068';
    color: #fff;
}

.mform .collapse-wrapper {
    box-sizing: border-box;
    padding-top: 10px;
    display: block;
}

.mform .form-inline label {
    display: block;
}

.mform .form-inline .form-horizontal .form-group {
    margin-right: 0;
    margin-left: 0;
}


.mform a.mblock-info-tooltip {
    margin-left: 7px;
}

.mform .panel-group[data-group-hide-toggle-links=true] .panel > a[data-toggle=collapse] {
    display: none;
}

.mform .panel-group[data-group-hide-toggle-links] {
    margin-bottom: 2rem;
    background-color: transparent;
}

.mform .panel-group[data-group-hide-toggle-links] .panel {
    background-color: transparent;
    box-shadow: none;
    -webkit-box-shadow: none;
    border: none;
}

.mform .panel-group[data-group-hide-toggle-links] .panel + .panel {
    margin-top: 0;
}

body.rex-theme-dark .mform .mform-tabs .nav-tabs {
    /*background-color: rgba(0, 0, 0, 0.15);*/
}

body.rex-theme-dark .mform .mform-tabs .tab-content {
    background-color: #202b35;
}

body.rex-theme-dark .mform .mform-headline.grey-legend-background h3,
body.rex-theme-dark .sortitem .mform fieldset.grey-legend-background > legend,
body.rex-theme-dark .mform fieldset.grey-legend-background > legend {
    background-color: #1a3332;
}

body.rex-theme-dark .mform .tab-content .mform-headline.grey-legend-background h3,
body.rex-theme-dark .mform .tab-content fieldset.grey-legend-background > legend,
body.rex-theme-dark .mform .tab-content fieldset.grey-legend-background > legend {
    background-color: #f3f3f3;
}

body.rex-theme-dark .sortitem .mform .mform-headline.grey-legend-background h3,
body.rex-theme-dark .sortitem .mform fieldset.grey-legend-background > legend {
    background-color: #ececec;
}

body.rex-theme-dark .mform .btn-white {
    background-color: #202b35;
    color: rgba(255, 255, 255, 0.75);
    border-top-color: #151c22;
    border-bottom-color: #151c22;
}

body.rex-theme-dark .mform .btn-white[aria-expanded=true] {
    background-color: #0f4671;
    color: rgba(255, 255, 255, 0.75);
}

body.rex-theme-dark .mform .btn-white:hover {
    background-color: #0f4671;
    color: rgba(255, 255, 255, 0.75);
}

body.rex-theme-dark .mform .btn-white:focus,
body.rex-theme-dark .mform .btn-white:active {
    background-color: #0f4671;
}

body.rex-theme-dark .mform-tabs .btn-white {
    background-color: #202b35;
}

body.rex-theme-dark .mform .btn-white:after {
    color: rgba(255, 255, 255, 0.75);
}

body.rex-theme-dark .mform .btn-white:hover:after {
    color: #7abaec;
}

body.rex-theme-dark .mform .btn-white[aria-expanded="true"]:after {
    color: #7abaec;
}

body.rex-theme-dark .mform .collapse,
body.rex-theme-dark .mform .collapsing {

}

.mform .custom-link.input-group {
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.mform .custom-link.input-group input.form-control[readonly] {
    border: 0;
    box-shadow: none;
    background: transparent;
    min-height: 36px;
}

.mform .custom-link.input-group .input-group-btn {
    white-space: nowrap;
}

.mform .custom-link.input-group .btn.btn-popup {
    border: 0;
    border-left: 1px solid #e3e8ee;
    background: #f7f9fb;
    min-width: 34px;
    min-height: 36px;
}

.mform .custom-link.input-group .btn.btn-popup:hover,
.mform .custom-link.input-group .btn.btn-popup:focus {
    background: #eaf1f8;
}

.mform .custom-link.input-group .btn.btn-popup.active {
    background: #d0e8fa;
    color: #1a6ca8;
    border-left-color: #b0d0ef;
}

.mform .custom-link.input-group.is-empty input.form-control[readonly] {
    color: #7c8997;
}

body.rex-theme-dark .mform .custom-link.input-group {
    border-color: #3a4753;
    background: #1f2830;
}

body.rex-theme-dark .mform .custom-link.input-group .btn.btn-popup {
    border-left-color: #344150;
    background: #27323d;
    color: #c9d4df;
}

body.rex-theme-dark .mform .custom-link.input-group .btn.btn-popup:hover,
body.rex-theme-dark .mform .custom-link.input-group .btn.btn-popup:focus {
    background: #30404d;
}

body.rex-theme-dark .mform .custom-link.input-group .btn.btn-popup.active {
    background: #1a3a55;
    color: #7ec8f4;
    border-left-color: #2a5070;
}

body.rex-theme-dark .mform .custom-link.input-group.is-empty input.form-control[readonly] {
    color: #9fb0c0;
}

@media (prefers-color-scheme: dark) {
    body.rex-has-theme:not(.rex-theme-light) .mform .mform-tabs .nav-tabs {
        /*background-color: rgba(0, 0, 0, 0.15);*/
    }


    body.rex-has-theme:not(.rex-theme-light) .mform .mform-tabs .tab-content {
        background-color: #202b35;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .mform-headline.grey-legend-background h3,
    body.rex-has-theme:not(.rex-theme-light) .sortitem .mform fieldset.grey-legend-background > legend,
    body.rex-has-theme:not(.rex-theme-light) .mform fieldset.grey-legend-background > legend {
        background-color: #1a3332;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .tab-content .mform-headline.grey-legend-background h3,
    body.rex-has-theme:not(.rex-theme-light) .mform .tab-content fieldset.grey-legend-background > legend,
    body.rex-has-theme:not(.rex-theme-light) .mform .tab-content fieldset.grey-legend-background > legend {
        background-color: #f3f3f3;
    }

    body.rex-has-theme:not(.rex-theme-light) .sortitem .mform .mform-headline.grey-legend-background h3,
    body.rex-has-theme:not(.rex-theme-light) .sortitem .mform fieldset.grey-legend-background > legend {
        background-color: #ececec;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group {
        border-color: #3a4753;
        background: #1f2830;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group .btn.btn-popup {
        border-left-color: #344150;
        background: #27323d;
        color: #c9d4df;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group .btn.btn-popup:hover,
    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group .btn.btn-popup:focus {
        background: #30404d;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group .btn.btn-popup.active {
        background: #1a3a55;
        color: #7ec8f4;
        border-left-color: #2a5070;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .custom-link.input-group.is-empty input.form-control[readonly] {
        color: #9fb0c0;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white {
        background-color: #202b35;
        color: rgba(255, 255, 255, 0.75);
        border-top-color: #151c22;
        border-bottom-color: #151c22;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white[aria-expanded=true] {
        background-color: #1867a6;
        color: rgba(255, 255, 255, 0.75);
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white:hover {
        background-color: #1867a6;
        color: rgba(255, 255, 255, 0.75);
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white:focus,
    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white:active {
        background-color: #1867a6;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-tabs .btn-white {
        background-color: #202b35;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white:after {
        color: rgba(255, 255, 255, 0.75);
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white:hover:after {
        color: #7abaec;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .btn-white[aria-expanded="true"]:after {
        color: #7abaec;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform .collapse,
    body.rex-has-theme:not(.rex-theme-light) .mform .collapsing {
    }
}


.rex-theme-light section.repeater .repeater-group,
section.repeater .repeater-group {
    padding: 0.5rem 1.25rem 1.25rem 1.25rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.3s ease-in-out;

    border: 1px solid rgba(100, 100, 100, 0.20);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
    position: relative;
}

section.repeater .repeater-group:before {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: auto;
    width: 0;
    content: '';
    display: block;
    background-color: rgba(0, 0, 0, 0.3);
    transition: width 0.25s ease-in-out;
}

.rex-theme-light section.repeater .repeater-group:hover::before,
section.repeater .repeater-group:hover::before {
    background-color: rgba(0, 0, 0, 0.3);
    width: 3px;
}

.rex-theme-light section.repeater .repeater-group:hover,
section.repeater .repeater-group:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, .22);
}

.rex-theme-dark section.repeater .repeater-group {
    border: 1px solid rgba(17, 17, 17, 0.1);
    background: rgba(17, 17, 17, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}

.rex-theme-dark section.repeater .repeater-group:hover::before {
    background-color: rgba(255, 255, 255, 0.3);
}

.rex-theme-dark section.repeater .repeater-group:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, .22);
}

section.repeater .repeater-group:last-child {
    margin-bottom: 0;
}

@media (prefers-color-scheme: dark) {
    section.repeater .repeater-group {
        border: 1px solid rgba(17, 17, 17, 0.1);
        background: rgba(17, 17, 17, 0.15);
        box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
    }

    section.repeater .repeater-group:hover::before {
        background-color: rgba(255, 255, 255, 0.3);
    }

    section.repeater .repeater-group:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, .22);
    }
}

section.repeater .repeater-group header > div {
    display: block;
    position: absolute;
    right: 0;
    width: 120px;
    text-align: right;
}

section.repeater .repeater-group header {
    position: relative;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: background 0.3s ease-out;
    min-height: 30px;
    z-index: 1;
}

section.repeater .repeater-group header + .mform > .mform-tabs {
    margin-top: 20px;
}

section.repeater .repeater-group > .mform > fieldset:first-child,
section.repeater .repeater-group header + .mform > .mform-tabs:first-child {
    margin-top: -8px;
}

section.repeater .repeater-group header + .mform > .mform-tabs .tab-content {
    padding-bottom: 10px;
}

.repeater-group header + .mform > .mform-tabs:last-child .tab-content {
    margin-bottom: -5px;
    padding: 15px 10px;
}

.repeater-group header .btn {
    padding: 1px;
    text-decoration: none;
}

.repeater-group header .btn.disabled {
    opacity: .2;
}

.repeater-group header .btn-red {
    color: #d9534f;
}

.repeater-group header .btn-red:hover {
    color: #ff0800;
}

.btn-mform-repeater {
    margin-bottom: 5px;
    margin-right: 5px;
}

.mform-icon-radios input[type=radio],
.mform-inline-icon-radios input[type=radio],
.mform-inline-img-radios input[type=radio] {
    display: none;
}

.mform-inline-img-radios label span {
    position: absolute;
    top: 5px;
    left: 5px;
    max-width: 140px;
    padding: 2px 4px;
    font-size: 11px;
}

.mform-inline-img-radios label span {
    background-color: rgba(27, 27, 27, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
}

.mform-inline-img-radios label img {
    opacity: 0.67;
}

.mform-inline-img-radios input[type=radio] {
    display: none;
}

.mform-inline-img-radios label img {
    transition: 100ms all;
    width: 150px;
    height: 150px;
    border: 4px solid transparent;
}

.mform-inline-img-radios label.active img {
    border: 4px solid #79af8a;
    box-shadow: 0 0 5px 5px rgba(0, 0, 0, .03);
    opacity: 0.97;
}

.mform-inline-img-radios label img {
    border: 2px solid rgba(94, 94, 94, 0.3);
}

.mform-inline-img-radios.form-group .radio {
    position: relative;
    display: inline-block;
    padding-left: 0;
    margin-bottom: 0;
    vertical-align: middle;
    font-weight: normal;
    cursor: pointer;
}

.mform-inline-img-radios label {
    position: relative;
    padding-left: 0;
    padding-right: 5px;
}

.mform-icon-radios .radio label,
.mform-inline-icon-radios .radio label {
    border: 2px solid rgba(94, 94, 94, 0.3);
    position: relative;
    margin-right: 5px;
    padding: 0 5px;
    opacity: 0.67;
}

.mform-icon-radios .radio label span,
.mform-inline-icon-radios .radio label span {
    position: relative;
    top: -3px;
}

.mform-icon-radios .radio label i,
.mform-inline-icon-radios .radio label i {
    transition: 100ms all;
    width: 25px;
    height: 18px;
    display: inline-block;
    font-size: 20px;
    margin: 5px 0;
}

.mform-icon-radios label.active,
.mform-inline-icon-radios label.active {
    border: 4px solid #79af8a;
    box-shadow: 0 0 5px 5px rgba(0, 0, 0, .03);
    opacity: 0.97;
}

.mform-icon-radios.form-group .radio,
.mform-inline-icon-radios.form-group .radio {
    position: relative;
    padding-left: 0;
    margin-bottom: 0;
    vertical-align: middle;
    font-weight: normal;
    cursor: pointer;
    display: block;
}

.mform-inline-icon-radios.form-group .radio {
    display: inline-block;
}

.mform-inline-color-radios.form-group .radio {
    position: relative;
    padding-left: 0;
    padding-right: 5px;
    display: inline-block;
    width: 25px;
    height: 25px;
    margin-right: 10px;
    cursor: pointer;
}

.mform-inline-color-radios.form-group .radio > label {
    padding-left: 0;
}

.mform-inline-color-radios.form-group .radio > label span {
    transform: scale(1);
    position: relative;
    display: block;
    width: 25px;
    height: 25px;
    transition: transform 0.2s ease-in-out;
    border: 1px solid rgba(150, 150, 150, 0.5);
}

.mform-inline-color-radios.form-group .radio > label:hover span {
    transform: scale(1.25);
}

.mform-inline-color-radios.form-group .radio input {
    display: none;
}

.mform-inline-color-radios.form-group .radio input[type=radio]:checked + span {
    transform: scale(1.25);
    border: 2px solid #79af8a;
}

.mform .checkbox .mform-toggle {
    margin-top: -7px;
}

/* -------------------------------------------------------
 * Checkbox Group Widget (.mform-checkbox-group)
 * ------------------------------------------------------- */

.mform-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.mform-checkbox-group.mform-cbg--vertical {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
}

.mform-cbg-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 2px solid rgba(94, 94, 94, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
    user-select: none;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
    opacity: 0.75;
    margin: 0;
}

.mform-cbg-option:hover {
    border-color: rgba(94, 94, 94, 0.55);
    opacity: 0.9;
}

.mform-cbg-option.active {
    border-color: #79af8a;
    background-color: rgba(121, 175, 138, 0.12);
    color: inherit;
    opacity: 1;
}

.mform-cbg-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(94, 94, 94, 0.45);
    border-radius: 3px;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

.mform-cbg-option.active .mform-cbg-indicator {
    border-color: #79af8a;
    background-color: #79af8a;
}

.mform-cbg-option.active .mform-cbg-indicator::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -1px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Radio mode: round indicator */
.mform-checkbox-group[data-mode="radio"] .mform-cbg-indicator {
    border-radius: 50%;
}

.mform-checkbox-group[data-mode="radio"] .mform-cbg-option.active .mform-cbg-indicator::after {
    left: 3px;
    top: 3px;
    width: 4px;
    height: 4px;
    border: none;
    border-radius: 50%;
    background: #fff;
    transform: none;
}

/* Dark mode */
body.rex-theme-dark .mform-cbg-option {
    border-color: rgba(180, 180, 180, 0.25);
    color: rgba(220, 220, 220, 0.85);
}

body.rex-theme-dark .mform-cbg-option:hover {
    border-color: rgba(180, 180, 180, 0.45);
}

body.rex-theme-dark .mform-cbg-option.active {
    border-color: #79af8a;
    background-color: rgba(121, 175, 138, 0.18);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    body.rex-has-theme:not(.rex-theme-light) .mform-cbg-option {
        border-color: rgba(180, 180, 180, 0.25);
        color: rgba(220, 220, 220, 0.85);
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cbg-option:hover {
        border-color: rgba(180, 180, 180, 0.45);
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cbg-option.active {
        border-color: #79af8a;
        background-color: rgba(121, 175, 138, 0.18);
        color: #fff;
    }
}



.collapse-group > .collapse > .form-group {
    margin-bottom: 15px !important;
}

@media (prefers-color-scheme:dark) {
    body:not(.rex-theme-light) .tab-content .form-control[disabled],
    body:not(.rex-theme-light) .tab-content .form-control[readonly],
    fieldset[disabled] body:not(.rex-theme-light) .tab-content .form-control {
        background-color: rgba(27, 35, 44, 0.8);
        border-color: rgba(21, 28, 34, 0.8);
    }
}

/* -------------------------------------------------------
 * Custom Link Multi Widget (.mform-cl-multi)
 * ------------------------------------------------------- */

.mform-cl-multi {
    display: block;
}

.mform-cl-multi-list {
    margin-bottom: 6px;
}

.mform-cl-multi-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    background: #f7f9fb;
    border: 1px solid #dde4ec;
    border-radius: 4px;
    padding: 4px 6px;
}

.mform-cl-multi-item .rex-js-widget-customlink {
    flex: 1 1 auto;
    min-width: 0;
}

.mform-cl-multi-item .rex-js-widget-customlink .custom-link.input-group {
    border: 0;
    border-radius: 0;
    background: transparent;
    margin-bottom: 0;
}

.mform-cl-multi-handle {
    cursor: grab;
    color: #aaa;
    padding: 0 4px;
    flex-shrink: 0;
}

.mform-cl-multi-handle:active {
    cursor: grabbing;
}

.mform-cl-multi-remove {
    flex-shrink: 0;
    border: 0 !important;
    background: transparent !important;
    color: #c0392b !important;
    padding: 2px 6px;
}

.mform-cl-multi-remove:hover {
    color: #922b21 !important;
}

.mform-cl-multi-add {
    margin-top: 2px;
}

/* Dark mode */
body.rex-theme-dark .mform-cl-multi-item {
    background: #1f2830;
    border-color: #3a4753;
}

body.rex-theme-dark .mform-cl-multi-handle {
    color: #5a6a78;
}

body.rex-theme-dark .mform-cl-multi-remove {
    color: #e57373 !important;
}

@media (prefers-color-scheme: dark) {
    body.rex-has-theme:not(.rex-theme-light) .mform-cl-multi-item {
        background: #1f2830;
        border-color: #3a4753;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cl-multi-handle {
        color: #5a6a78;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cl-multi-remove {
        color: #e57373 !important;
    }
}

/* -------------------------------------------------------
 * Color Swatch Field (.mform-color-swatch)
 * ------------------------------------------------------- */

.mform-color-swatch {
    position: relative;
}

.mform-cs-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    vertical-align: middle;
    background: repeating-linear-gradient(45deg, #ccc 0, #ccc 3px, transparent 0, transparent 50%) 0 / 8px 8px;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

.mform-cs-preview--class {
    font-size: 9px;
    line-height: 20px;
    text-align: center;
    color: #333;
    background: #e0e0e0 !important;
    font-weight: bold;
    letter-spacing: -0.5px;
}

/* CSS class with known preview color: show the color, add small corner dot as indicator */
.mform-cs-preview--class-color {
    position: relative;
    overflow: hidden;
}

.mform-cs-preview--class-color::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent rgba(255,255,255,0.75) transparent;
}

/* CSS class swatches that have a preview color: show color, add "." overlay */
.mform-cs-swatch--class[data-preview-color] {
    position: relative;
    overflow: hidden;
}

.mform-cs-swatch--class[data-preview-color]::after {
    content: '.';
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.mform-cs-popup {
    display: none;
    position: absolute;
    z-index: 1060;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 6px;
    min-width: 160px;
    max-width: 300px;
}

.mform-cs-popup.mform-cs-popup--open {
    display: flex;
}

.mform-cs-swatch {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.mform-cs-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(0, 0, 0, 0.4);
}

.mform-cs-swatch.mform-cs-active {
    border-color: #79af8a;
    box-shadow: 0 0 0 2px rgba(121, 175, 138, 0.4);
}

.mform-cs-swatch--class {
    background: #e0e0e0;
    font-size: 8px;
    font-weight: bold;
    color: #444;
    line-height: 24px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
}

/* Dark mode */
body.rex-theme-dark .mform-cs-popup {
    background: #1e2a35;
    border-color: rgba(255, 255, 255, 0.12);
    color: #ccd4dc;
}

body.rex-theme-dark .mform-cs-preview--class {
    background: #2d3b48 !important;
    color: #ccc;
}

body.rex-theme-dark .mform-cs-swatch--class {
    background: #2d3b48;
    color: #ccc;
}

@media (prefers-color-scheme: dark) {
    body.rex-has-theme:not(.rex-theme-light) .mform-cs-popup {
        background: #1e2a35;
        border-color: rgba(255, 255, 255, 0.12);
        color: #ccd4dc;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cs-preview--class {
        background: #2d3b48 !important;
        color: #ccc;
    }

    body.rex-has-theme:not(.rex-theme-light) .mform-cs-swatch--class {
        background: #2d3b48;
        color: #ccc;
    }
}