/**Tab'd event display style*/
.tab {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
}

    .tab button {
        background-color: inherit;
        float: left;
        border: none;
        outline: none;
        cursor: pointer;
        padding: 14px 16px;
        transition: 0.3s;
    }

        .tab button:hover {
            background-color: #ddd;
        }

        .tab button.active {
            background-color: #ccc;
        }

.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;
}

.hiddenTags {
    display:none;
}

input[list] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="gray"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

    input[list]:focus {
        border-color: #0073aa;
        box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
    }

#sortable-settings {
    padding: 0;
    margin: 0;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 10px; 
    padding: 8px;
    border: 1px solid #ddd;
    background: #fff;
    margin-bottom: 5px;
    cursor: grab;
}

    .sortable-item .drag-handle {
        cursor: grab;
        padding: 5px;
        font-size: 18px;
        user-select: none;
    }

    .sortable-item label {
        white-space: nowrap; 
        min-width: 150px; 
        text-align: left;
    }

    .sortable-item input {
        flex-grow: 1; 
        max-width: 100%;
    }

.agile-content-section,
.agile-theme-section,
.agile-advanced-section,
.agile-credentials-section {
    margin-top: 20px;
}

.agile-content-intro,
.agile-theme-intro,
.agile-advanced-intro,
.agile-credentials-intro,
.agile-theme-mapping-intro,
.agile-config-intro {
    font-size: 14px;
    color: #646970;
    margin-bottom: 20px;
    line-height: 1.6;
}

.agile-config-intro,
.agile-advanced-intro {
    margin-bottom: 25px;
}

.agile-theme-mapping-intro {
    margin-bottom: 15px;
    font-style: italic;
}

.agile-utility-card,
.agile-content-card,
.agile-theme-card,
.agile-theme-mapping-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    margin-left: 0;
    margin-right: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.agile-utility-card:hover,
.agile-content-card:hover,
.agile-theme-card:hover,
.agile-theme-mapping-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.agile-utility-card-header,
.agile-content-card-header,
.agile-theme-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.agile-utility-card-header {
    gap: 10px;
    padding-bottom: 12px;
}

.agile-utility-card-header .icon,
.agile-content-card-header .icon,
.agile-theme-card-header .icon {
    width: 24px;
    height: 24px;
    color: #2271b1;
    flex-shrink: 0;
}

.agile-utility-card-header .icon {
    fill: #2271b1;
    margin-right: 10px;
}

.agile-utility-card-header h3,
.agile-content-card-header h3,
.agile-theme-card-header h2,
.agile-theme-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

.agile-utility-card-header h3 {
    font-size: 16px;
}

/* Style the advanced explainer when inside the card */
.agile-utility-card .agile-advanced-intro {
    margin-top: 0;
    margin-bottom: 15px;
    padding-top: 0;
    font-size: 14px;
    color: #646970;
    line-height: 1.6;
}

.agileLink {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border: 2px solid #0056b3;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

    .agileLink:hover {
        background-color: #0056b3;
        border-color: #004080;
        box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
        transform: translateY(-2px);
    }

    .agileLink:focus {
        outline: 2px solid #3498db;
    }

.agilebutton {
    background: linear-gradient(135deg, #6e7dff, #7f8eff);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

    .agilebutton:hover {
        background: linear-gradient(135deg, #5e6eff, #6f7eff);
        transform: translateY(-2px);
    }

    .agilebutton:active {
        transform: translateY(2px);
    }

    .agilebutton:focus {
        outline: none;
    }


#agile_options_theme .form-table select,
#agile_options_theme .form-table input[type="text"],
#agile_options_theme .form-table input[type="number"],
#agile_options_advanced .form-table input[type="text"],
#agile_options_advanced .form-table input[type="number"],
#agile_options_credentials .form-table input[type="text"],
#agile_options_credentials .form-table input[type="password"],
#custom-fields-table input[type="text"],
#custom-term-table input[type="text"],
#custom-fields-table select,
#custom-term-table select,
.agile-config-fields select,
.agile-theme-mapping-fields .form-table select {
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    color: #23282d;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#agile_options_theme .form-table select:hover,
#agile_options_theme .form-table input[type="text"]:hover,
#agile_options_theme .form-table input[type="number"]:hover,
#agile_options_advanced .form-table input[type="text"]:hover,
#agile_options_advanced .form-table input[type="number"]:hover,
#agile_options_credentials .form-table input[type="text"]:hover,
#agile_options_credentials .form-table input[type="password"]:hover,
#custom-fields-table input[type="text"]:hover,
#custom-term-table input[type="text"]:hover,
#custom-fields-table select:hover,
#custom-term-table select:hover,
.agile-config-fields select:hover,
.agile-theme-mapping-fields .form-table select:hover {
    border-color: #2271b1;
}

#agile_options_theme .form-table select:focus,
#agile_options_theme .form-table input[type="text"]:focus,
#agile_options_theme .form-table input[type="number"]:focus,
#agile_options_advanced .form-table input[type="text"]:focus,
#agile_options_advanced .form-table input[type="number"]:focus,
#agile_options_credentials .form-table input[type="text"]:focus,
#agile_options_credentials .form-table input[type="password"]:focus,
#custom-fields-table input[type="text"]:focus,
#custom-term-table input[type="text"]:focus,
#custom-fields-table select:focus,
#custom-term-table select:focus,
.agile-config-fields select:focus,
.agile-theme-mapping-fields .form-table select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

#agile_options_theme .form-table select {
    width: 100%;
    max-width: 400px;
}

#agile_options_advanced .form-table input[type="text"],
#agile_options_advanced .form-table input[type="number"] {
    width: 100%;
    max-width: 300px;
}

#agile_options_credentials .form-table input[type="text"],
#agile_options_credentials .form-table input[type="password"] {
    width: 100%;
    max-width: 400px;
}

#custom-fields-table input[type="text"],
#custom-term-table input[type="text"],
#custom-fields-table select,
#custom-term-table select {
    width: 100%;
}

.agile-config-fields select {
    min-width: 200px;
}

.agile-theme-mapping-fields .form-table select {
    width: 100%;
    max-width: 400px;
}


.ace-editor-container {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    margin-top: 20px;
}

.ace-editor-tab {
    background: linear-gradient(to bottom, #f8f9fa 0%, #f6f7f7 100%);
    color: #23282d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border-bottom: 2px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    top: 0;
    left: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: background 0.2s ease;
}

.ace-editor-icon {
    width: 16px;
    height: 16px;
    color: #2271b1;
    flex-shrink: 0;
}

.ace-editor-tab span {
    color: #23282d;
}

.agile-json-example {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 1350px;
    max-height: 70vh;
    margin: 0;
    padding: 16px 20px;
    overflow: auto;
    border: 0;
    background: #272822;
    color: #f8f8f2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    tab-size: 2;
}

.agile-content-builder-wrapper {
    margin-top: 20px;
}

.agile-content-builder-title {
    font-size: 15px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 12px 0;
}

.agile-content-builder {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.agile-builder-palette {
    flex: 0 0 200px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    background: #fff;
}

.agile-builder-palette-title {
    font-weight: 600;
    font-size: 13px;
    color: #23282d;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.agile-builder-palette .agile-block {
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: grab;
    font-size: 13px;
    color: #23282d;
    background: #f9f9f9;
    transition: all 0.2s;
}

.agile-builder-palette .agile-block:hover {
    background: #f0f0f0;
    border-color: #2271b1;
    border-style: solid;
}

.agile-builder-palette .agile-block:last-child {
    margin-bottom: 0;
}

.agile-builder-canvas {
    flex: 1;
    min-height: 140px;
    border: 2px dashed #bbb;
    border-radius: 6px;
    background: #fafafa;
    padding: 12px;
}

.agile-builder-canvas-placeholder {
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

.agile-content-media-table {
    margin-top: 20px;
}

.agile-content-media-table th {
    font-weight: 600;
    color: #23282d;
    padding: 12px 0;
}

.agile-content-media-table td {
    padding: 12px 0;
}

.agile-info-box-warning,
.agile-webhook-warning,
.agile-config-fields .agile-widget-warning {
    padding: 12px 16px;
    border-radius: 4px;
    line-height: 1.5;
    font-size: 13px;
}

.agile-info-box-warning,
.agile-webhook-warning,
.agile-config-fields .agile-widget-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #dba617;
}

.agile-info-box-warning {
    margin: 16px 0;
}

.agile-config-fields .agile-widget-warning {
    border-left-color: #ffc107;
    margin-top: 12px;
}

.agile-info-box-warning-title {
    margin-top: 0;
    color: #856404;
    font-size: 16px;
    font-weight: 600;
}

.agile-info-box-example,
.agile-code-example {
    background-color: #fff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.agile-code-example {
    margin: 8px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    overflow-x: auto;
}

.agile-info-box {
    display: none;
    background-color: #f0f7ff;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
}

.agile-info-box-title {
    margin-top: 0;
    color: #2271b1;
    font-size: 16px;
    font-weight: 600;
}

.agile-info-box-text {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #23282d;
}

.agile-info-box-subtitle {
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
}

.agile-info-box-list {
    margin: 8px 0;
    padding-left: 20px;
    line-height: 1.6;
    color: #23282d;
}

.agile-info-box-list li {
    margin-bottom: 8px;
}

#agile_options_credentials .agile-info-box {
    margin-top: 12px;
}

.agile-entry-points-card {
    padding: 0;
    overflow: hidden;
}

.agile-entry-points-card-toggle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.agile-entry-points-card-toggle:hover .agile-entry-points-card-header,
.agile-entry-points-card-toggle:focus .agile-entry-points-card-header {
    background: #f6f7f7;
}

.agile-entry-points-card-header {
    margin: 0;
    padding: 20px;
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: 0;
}

.agile-entry-points-card-header h3 {
    flex: 1;
}

.agile-entry-points-collapse-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: auto;
    border-right: 2px solid #646970;
    border-bottom: 2px solid #646970;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.agile-entry-points-collapse-icon.is-expanded,
.agile-entry-points-card.is-expanded .agile-entry-points-card-toggle .agile-entry-points-collapse-icon {
    transform: rotate(45deg);
}

.agile-entry-points-card-body {
    padding: 0 20px 20px;
    border-top: 1px solid #dcdcde;
}

.agile-entry-points-intro {
    margin: 16px 0;
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
}

.agile-entry-points-controls {
    margin-bottom: 16px;
}

.agile-entry-points-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.agile-entry-points-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.agile-entry-points-controls-row .regular-text {
    flex: 1 1 220px;
    max-width: 320px;
}

.agile-entry-points-results {
    margin-top: 4px;
    padding: 12px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.agile-entry-points-results-loading {
    color: #646970;
}

.agile-entry-points-results-error {
    border-color: #d63638;
    background: #fcf0f1;
}

.agile-entry-points-results-error .agile-entry-points-results-text {
    color: #b32d2e;
    margin: 0;
}

.agile-entry-points-results-message .agile-entry-points-results-text {
    margin: 0;
    color: #1d2327;
}

.agile-entry-points-results-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.agile-entry-points-results-summary {
    margin: 0;
    font-weight: 600;
    color: #1d2327;
}

.agile-entry-points-legend {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #50575e;
}

.agile-entry-points-legend p {
    margin: 0 0 6px;
}

.agile-entry-points-legend p:last-child {
    margin-bottom: 0;
}

.agile-entry-points-legend code {
    font-size: 12px;
}

.agile-entry-points-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 420px;
    overflow-y: auto;
}

.agile-entry-points-list > .agile-entry-points-item,
.agile-entry-points-list > .agile-entry-points-group {
    padding: 10px 0;
    border-top: 1px solid #dcdcde;
}

.agile-entry-points-list > .agile-entry-points-item:first-child,
.agile-entry-points-list > .agile-entry-points-group:first-child {
    border-top: 0;
    padding-top: 0;
}

.agile-entry-points-group-label {
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #50575e;
}

.agile-entry-points-group-urls {
    margin-bottom: 8px;
}

.agile-entry-points-children {
    margin: 4px 0 0;
    padding: 0 0 0 14px;
    list-style: none;
    border-left: 2px solid #dcdcde;
}

.agile-entry-points-children .agile-entry-points-item,
.agile-entry-points-children .agile-entry-points-group {
    padding: 8px 0;
}

.agile-entry-points-children .agile-entry-points-item + .agile-entry-points-item,
.agile-entry-points-children .agile-entry-points-item + .agile-entry-points-group,
.agile-entry-points-children .agile-entry-points-group + .agile-entry-points-item,
.agile-entry-points-children .agile-entry-points-group + .agile-entry-points-group {
    border-top: 1px solid #eef0f2;
}

.agile-entry-points-item-title {
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
}

.agile-entry-points-url-row {
    margin-bottom: 8px;
}

.agile-entry-points-url-row:last-child {
    margin-bottom: 0;
}

.agile-entry-points-url-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agile-entry-points-empty {
    color: #a7aaad;
    font-size: 13px;
}

.agile-entry-points-url-cell {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.agile-entry-points-url {
    display: block;
    flex: 1;
    min-width: 0;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: 12px;
}

.agile-entry-points-copy {
    flex-shrink: 0;
}

.agile-info-box-image {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.agile-theme-mapping-section {
    margin-top: 20px;
    margin-bottom: 20px;
}

#agile_options_theme .agile-theme-card,
#agile_options_theme .agile-theme-mapping-card {
    clear: both;
    margin-left: 0 !important;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    float: none;
}

#agile_options_theme .form-table {
    margin-left: 0;
    padding-left: 0;
    margin-top: 20px;
    width: 100%;
}

#agile_options_theme .form-table tr:has(.agile-theme-card),
form[action="options.php"] .form-table tr:has(.agile-theme-card) {
    display: block;
}

#agile_options_theme .form-table tr:has(.agile-theme-card) th,
form[action="options.php"] .form-table tr:has(.agile-theme-card) th {
    display: none;
}

#agile_options_theme .form-table tr:has(.agile-theme-card) td,
form[action="options.php"] .form-table tr:has(.agile-theme-card) td {
    display: block;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

@supports selector(:has(*)) {
    #agile_options_theme .form-table:has(.agile-theme-card),
    form[action="options.php"] .form-table:has(.agile-theme-card) {
        width: 100% !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        margin-top: 20px;
    }
}

#agile_options_theme .form-table + .agile-theme-card,
#agile_options_theme .agile-theme-card {
    margin-left: 0 !important;
}

#agile_options_theme .form-table th,
#agile_options_theme .form-table td {
    padding-left: 0;
}

#agile_options_theme .form-table th {
    font-weight: 600;
    color: #23282d;
    padding: 12px 0;
    width: 200px;
}

#agile_options_theme .form-table td {
    padding: 12px 0;
}

#agile_options_theme .form-table tr.agile-theme-card-row {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}

#agile_options_theme .form-table tr.agile-theme-card-row th {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

#agile_options_theme .form-table tr.agile-theme-card-row td {
    display: block;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none;
    max-width: 100%;
}

.agile-code-example pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #23282d;
    line-height: 1.5;
}


#agile_options_theme table.agile-theme-card-table,
form[action="options.php"] table.agile-theme-card-table {
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-top: 20px;
}

#custom-fields-table,
#custom-term-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

#custom-fields-table thead,
#custom-term-table thead {
    background: #f6f7f7;
}

#custom-fields-table th,
#custom-term-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #23282d;
    border-bottom: 2px solid #ddd;
}

#custom-fields-table td,
#custom-term-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

#meta-add-field,
#term-add-field {
    margin-top: 15px;
}

.agile-theme-mapping-card {
    margin-bottom: 20px;
}

.agile-theme-mapping-fields {
    margin-top: 15px;
}

.agile-config-fields .form-table,
.agile-theme-mapping-fields .form-table {
    margin: 0;
    border: none;
    width: 100%;
}

.agile-config-fields .form-table tbody,
.agile-theme-mapping-fields .form-table tbody {
    display: block;
}

.agile-config-fields .form-table tr,
.agile-theme-mapping-fields .form-table tr {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: none;
    background: transparent;
}

.agile-config-fields .form-table tr {
    margin: 0;
}

.agile-theme-mapping-fields .form-table tr {
    margin: 0 0 20px 0;
}

.agile-theme-mapping-fields .form-table tr:last-child {
    margin-bottom: 0;
}

.agile-config-fields .form-table th,
.agile-theme-mapping-fields .form-table th {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 0 12px 0;
    font-weight: 600;
    font-size: 14px;
    color: #23282d;
}

.agile-config-fields .form-table th {
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.agile-theme-mapping-fields .form-table th {
    border: none;
}

.agile-config-fields .form-table th:before,
.agile-theme-mapping-fields .form-table th:before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.agile-config-fields .form-table th:before {
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232271b1"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/></svg>');
}

.agile-theme-mapping-fields .form-table th:before {
    margin-right: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232271b1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.agile-utility-card:has(#agile_field_widget_active) .form-table th:before,
.agile-utility-card:has(#agile_field_widget_target) .form-table th:before,
.agile-utility-card:has(#agile_field_widget_mode) .form-table th:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232271b1"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');
}

.agile-config-fields .form-table td,
.agile-theme-mapping-fields .form-table td {
    display: block;
    width: 100%;
    padding: 0;
}

.custom-input-container {
    border: 1px solid #ddd;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); 
    max-width: 500px; 
    margin: auto; 
}

#agile-builder-palette .agile-block {
    background: #fff;
}

#agile-builder-canvas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agile-canvas-block {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px;
}

.agile-canvas-block .drag-handle {
    cursor: grab;
    padding: 4px 6px;
    font-size: 16px;
    user-select: none;
}

.agile-canvas-block .content {
    flex: 1 1 auto;
}

.agile-canvas-block .block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.agile-canvas-block .block-label {
    font-weight: 600;
}

.agile-canvas-block .token-badge code {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 0 4px;
}

.agile-canvas-block .textless-note {
    font-size: 12px;
    color: #666;
}

.agile-canvas-block .content input[type="text"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.agile-canvas-block .content .property-name-input,
.agile-canvas-block .content .template-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}


.agile-utility-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.agile-utility-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.agile-utility-stat:last-child {
    border-bottom: none;
}

.agile-utility-stat-label {
    font-size: 13px;
    color: #646970;
    font-weight: 500;
}

.agile-utility-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: #23282d;
    text-align: right;
}

.agile-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agile-stat-highlight {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1.2;
}

.agile-stat-subtext {
    font-size: 12px;
    color: #8c8f94;
    margin-top: 4px;
}

.agile-utility-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
}

.agile-utility-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.agile-metric-large {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.agile-metric-large .value {
    font-size: 36px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1;
    margin-bottom: 8px;
}

.agile-metric-large .label {
    font-size: 13px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agile-utility-card-full-width {
    grid-column: 1 / -1;
}

.agile-utility-status-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.agile-utility-status-item {
    flex: 1;
    min-width: 200px;
}

.agile-utility-stat-label-spacing {
    margin-bottom: 8px;
}

.agile-post-count-created {
    color: #28a745;
}

.agile-post-count-updated {
    color: #007bff;
}

.agile-post-count-deleted {
    color: #dc3545;
}

.agile-utility-stat-total {
    border-top: 2px solid #2271b1;
    margin-top: 10px;
    padding-top: 15px;
}

.agile-utility-stat-label-total {
    font-weight: 600;
    font-size: 14px;
}

.agile-utility-stat-value-total {
    font-size: 18px;
    color: #2271b1;
}


.agile-refresh-buttons-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.agile-utility-refresh-buttons-top {
    margin: 0 0 24px;
    padding-top: 0;
    border-top: 0;
    justify-content: center;
    align-items: stretch;
    gap: 24px;
}

.agile-utility-refresh-buttons-top .agile-refresh-button {
    flex: 0 1 380px;
    min-width: 48%;
    max-width: 49%;
    padding: 30px 40px;
}

.agile-utility-refresh-buttons-top .agile-refresh-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
}

.agile-utility-refresh-buttons-top .agile-refresh-text {
    font-size: 18px;
}

.agile-utility-refresh-buttons-top .agile-refresh-subtitle {
    font-size: 14px;
}

.agile-utility-refresh-notice {
    margin: 0 0 12px;
    color: #646970;
    text-align: center;
}

.agile-verify-credentials-intro {
    margin: 0 0 12px;
    color: #646970;
}

.agile-verify-credentials-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 4px;
    display: none;
}

.agile-verify-credentials-result:not(:empty) {
    display: block;
}

.agile-verify-credentials-result.is-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.agile-verify-credentials-result.is-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.agile-credential-verify-notice {
    margin: 12px 0 16px;
}

.agile-tab-panel-full-width {
    width: 100%;
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
}

.agile-tab-panel-full-width #agile_options_utility_settings,
.agile-tab-panel-full-width #agile_options_credentials_settings,
.agile-tab-panel-full-width #agile_options_config_settings,
.agile-tab-panel-full-width #agile-utility-output,
.agile-tab-panel-full-width .agile-credentials-container,
.agile-tab-panel-full-width .agile-config-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#agile-utility-output .agile-utility-container,
#agile-utility-output .agile-utility-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 782px) {
    #agile-utility-output .agile-utility-container,
    #agile-utility-output .agile-utility-grid-2 {
        grid-template-columns: 1fr;
    }

    .agile-utility-refresh-buttons-top .agile-refresh-button {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Shared shimmer button behavior */
.agile-refresh-button,
.agile-webhook-button {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agile-refresh-button::before,
.agile-webhook-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.agile-refresh-button:hover::before,
.agile-webhook-button:hover::before {
    left: 100%;
}

.agile-refresh-button:active,
.agile-webhook-button:active {
    transform: translateY(0);
}

.agile-refresh-button:disabled,
.agile-webhook-button:disabled {
    background: linear-gradient(135deg, #8c8f94 0%, #646970 100%);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.agile-refresh-button:disabled:hover,
.agile-webhook-button:disabled:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.agile-refresh-button {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.agile-refresh-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.4);
    background: linear-gradient(135deg, #135e96 0%, #2271b1 100%);
}

.agile-refresh-button:active {
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.agile-refresh-button-full {
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
    box-shadow: 0 4px 12px rgba(0, 163, 42, 0.3);
}

.agile-refresh-button-full:hover {
    background: linear-gradient(135deg, #008a20 0%, #00a32a 100%);
    box-shadow: 0 6px 20px rgba(0, 163, 42, 0.4);
}

.agile-refresh-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    animation: none;
    transition: transform 0.3s ease;
}

.agile-refresh-button:hover .agile-refresh-icon {
    transform: rotate(15deg);
}

.agile-refresh-button:active .agile-refresh-icon {
    transform: rotate(30deg);
}

.agile-refresh-button.refreshing .agile-refresh-icon {
    animation: spin 1s linear infinite;
}

.agile-refresh-button-full.refreshing .agile-refresh-icon {
    animation: spin-counter-clockwise 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-counter-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

.agile-refresh-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.agile-refresh-subtitle {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.3;
}

.agile-refresh-button:disabled .agile-refresh-icon,
.agile-refresh-button:disabled .agile-refresh-text,
.agile-refresh-button:disabled .agile-refresh-subtitle {
    opacity: 0.7;
}

.agile-refresh-button.agile-verify-credentials-button {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.agile-refresh-button.agile-verify-credentials-button .agile-refresh-icon {
    animation: none;
}

.agile-refresh-button.agile-verify-credentials-button:hover .agile-refresh-icon,
.agile-refresh-button.agile-verify-credentials-button:active .agile-refresh-icon,
.agile-refresh-button.agile-verify-credentials-button.refreshing .agile-refresh-icon {
    animation: none;
    transform: none;
}


.agile-webhook-activation-card {
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.agile-webhook-activation-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agile-webhook-description {
    margin: 0;
    font-size: 14px;
    color: #23282d;
    line-height: 1.6;
}

.agile-webhook-note {
    margin: 0;
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
    font-style: italic;
}

.agile-webhook-warning {
    margin: 0;
}

.agile-webhook-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
}

.agile-webhook-button-activate {
    background: linear-gradient(135deg, #00a32a 0%, #008a20 100%);
    color: #fff;
}

.agile-webhook-button-activate:hover {
    background: linear-gradient(135deg, #008a20 0%, #00a32a 100%);
    box-shadow: 0 6px 20px rgba(0, 163, 42, 0.4);
    transform: translateY(-2px);
}

.agile-webhook-button-deactivate {
    background: linear-gradient(135deg, #d63638 0%, #b32d2e 100%);
    color: #fff;
}

.agile-webhook-button-deactivate:hover {
    background: linear-gradient(135deg, #b32d2e 0%, #d63638 100%);
    box-shadow: 0 6px 20px rgba(214, 54, 56, 0.4);
    transform: translateY(-2px);
}

.agile-webhook-button:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.agile-webhook-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.agile-webhook-button:hover .agile-webhook-icon {
    transform: scale(1.1);
}

.agile-webhook-button-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}


.agile-config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.agile-config-radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.agile-config-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.agile-config-radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #2271b1;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #8c8f94;
    border-radius: 50%;
    background-color: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.agile-config-radio-option input[type="radio"]:checked {
    border-color: #2271b1;
    background-color: #fff;
}

.agile-config-radio-option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #2271b1;
    display: block;
    margin: 0;
    padding: 0;
}

.agile-config-radio-option input[type="radio"]:hover {
    border-color: #2271b1;
}

.agile-config-radio-option label {
    font-size: 14px;
    color: #23282d;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.agile-config-fields .agile-widget-warning i {
    color: #dc3545;
    font-style: italic;
}

.agile-config-field-help {
    margin-top: 8px;
    font-size: 13px;
    color: #646970;
    font-style: italic;
    line-height: 1.5;
}


#agile_options_credentials .form-table,
#agile_options_advanced .form-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
    border: none;
}

#agile_options_credentials .form-table tbody,
#agile_options_advanced .form-table tbody {
    display: contents;
}

#agile_options_credentials .form-table tr,
#agile_options_advanced .form-table tr {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    margin: 0;
}

#agile_options_credentials .form-table tr:hover,
#agile_options_advanced .form-table tr:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#agile_options_credentials .form-table th,
#agile_options_advanced .form-table th {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 0 15px 0;
    font-weight: 600;
    font-size: 15px;
    color: #23282d;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 15px;
}

#agile_options_credentials .form-table th:before,
#agile_options_advanced .form-table th:before {
    content: '';
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

#agile_options_advanced .form-table th:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232271b1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

#agile_options_advanced .form-table td,
#agile_options_credentials .form-table td {
    display: block;
    width: 100%;
    padding: 0;
}

#agile_options_credentials .form-table th:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232271b1"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>');
}

.agile-password-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}

.agile-password-input {
    flex: 1;
}

.agile-password-toggle {
    cursor: pointer;
    width: 24px;
    height: 24px;
    color: #646970;
    transition: color 0.2s;
    flex-shrink: 0;
}

.agile-password-toggle:hover {
    color: #2271b1;
}


.agile_switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.agile_switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.agile_slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
    width: 50px;
    height: 26px;
}

.agile_slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    right: auto;
    background-color: white;
    transition: left 0.3s ease, right 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .agile_slider {
    background-color: #2271b1;
}

input:focus + .agile_slider {
    box-shadow: 0 0 1px #2271b1;
}

input:checked + .agile_slider:before {
    left: auto;
    right: 3px;
}

.agile-field-explainer {
    display: inline-block;
    vertical-align: middle;
}

.agile-field-explainer svg path {
    fill: #000000;
}