/* Container Box Visual Wrapper */
.gform-custom-dynamic-box {
    border: 2px solid #2271b1; 
    padding: 24px;
    border-radius: 8px;
    margin: 24px 0;
    background-color: #f6f7f7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    /* Force the container to span all 12 columns of the parent Gravity Forms grid */
    grid-column: 1 / -1 !important;
}

/* On desktop/tablet, make the box a grid container to preserve Gravity Forms internal field widths */
@media (min-width: 640px) {
    .gform-custom-dynamic-box {
        display: grid !important;
        grid-template-columns: repeat(12, 1fr) !important;
        gap: 16px 2% !important; /* Matches default Gravity Forms grid gap */
    }
}

/* Ensure headings/section fields span full width (12 columns) inside our nested grid */
.gform-custom-dynamic-box .gsection,
.gform-custom-dynamic-box .gfield--type-section {
    grid-column: 1 / -1 !important;
}

/* --- Enclosed Section Headings Font Scaling --- */
.gform-custom-dynamic-box.gf-box-sheadings-90 .gsection-title,
.gform-custom-dynamic-box.gf-box-sheadings-90 .gsection_title,
.gform-custom-dynamic-box.gf-box-sheadings-90 .gfield--type-section h2,
.gform-custom-dynamic-box.gf-box-sheadings-90 .gfield--type-section h3 {
    font-size: 1.575rem !important; /* ~25.2px (90% of base 28px) */
}
.gform-custom-dynamic-box.gf-box-sheadings-80 .gsection-title,
.gform-custom-dynamic-box.gf-box-sheadings-80 .gsection_title,
.gform-custom-dynamic-box.gf-box-sheadings-80 .gfield--type-section h2,
.gform-custom-dynamic-box.gf-box-sheadings-80 .gfield--type-section h3 {
    font-size: 1.4rem !important; /* ~22.4px (80% of base 28px) */
}
.gform-custom-dynamic-box.gf-box-sheadings-75 .gsection-title,
.gform-custom-dynamic-box.gf-box-sheadings-75 .gsection_title,
.gform-custom-dynamic-box.gf-box-sheadings-75 .gfield--type-section h2,
.gform-custom-dynamic-box.gf-box-sheadings-75 .gfield--type-section h3 {
    font-size: 1.3125rem !important; /* ~21px (75% of base 28px) */
}
.gform-custom-dynamic-box.gf-box-sheadings-70 .gsection-title,
.gform-custom-dynamic-box.gf-box-sheadings-70 .gsection_title,
.gform-custom-dynamic-box.gf-box-sheadings-70 .gfield--type-section h2,
.gform-custom-dynamic-box.gf-box-sheadings-70 .gfield--type-section h3 {
    font-size: 1.225rem !important; /* ~19.6px (70% of base 28px) */
}

/* --- Enclosed Field Labels Font Scaling --- */
.gform-custom-dynamic-box.gf-box-slabels-90 .gfield_label,
.gform-custom-dynamic-box.gf-box-slabels-90 label.gfield_label {
    font-size: 90% !important;
}
.gform-custom-dynamic-box.gf-box-slabels-80 .gfield_label,
.gform-custom-dynamic-box.gf-box-slabels-80 label.gfield_label {
    font-size: 80% !important;
}
.gform-custom-dynamic-box.gf-box-slabels-75 .gfield_label,
.gform-custom-dynamic-box.gf-box-slabels-75 label.gfield_label {
    font-size: 75% !important;
}
.gform-custom-dynamic-box.gf-box-slabels-70 .gfield_label,
.gform-custom-dynamic-box.gf-box-slabels-70 label.gfield_label {
    font-size: 70% !important;
}

/* Structural Layout Fallback (e.g. for mobile or older themes) */
.gform-custom-dynamic-box .gfield {
    width: 100% !important;
    clear: both;
}

/* Premium Magnifying Glass Search Icon after Section Title */
.gform-custom-dynamic-box .gsection-title::after,
.gform-custom-dynamic-box .gsection_title::after,
.gform-custom-dynamic-box .gfield--type-section h2::after,
.gform-custom-dynamic-box .gfield--type-section h3::after {
    content: "" !important;
    display: inline-block !important;
    width: 0.8em !important;  /* Scales dynamically with the text font-size */
    height: 0.8em !important; /* Scales dynamically with the text font-size */
    margin-left: 8px !important;
    vertical-align: middle !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232271b1' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    position: relative !important;
    top: -0.05em !important; /* Visual optical alignment scaled dynamically */
}

