/**
 * WooCommerce → ChronoFresh settings screen.
 * Native wp-admin patterns. Does not style checkout, maps, or order labels.
 */

body.woocommerce_page_sccfcw-settings .nav-tab-wrapper {
    margin-bottom: 16px;
}

body.woocommerce_page_sccfcw-settings .form-table th {
    width: 220px;
    padding: 20px 10px 20px 0;
    color: #1d2327;
}

body.woocommerce_page_sccfcw-settings .form-table td .description {
    color: #646970;
}

body.woocommerce_page_sccfcw-settings .wrap > div[style*="max-width:860px"] {
    color: #1d2327;
}

body.woocommerce_page_sccfcw-settings .wrap > div[style*="max-width:860px"] table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0 16px;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

body.woocommerce_page_sccfcw-settings .wrap > div[style*="max-width:860px"] table th {
    background: #f6f7f7 !important;
    border: 1px solid #c3c4c7 !important;
    color: #1d2327;
    font-weight: 600;
    padding: 8px 10px !important;
    text-align: left;
}

body.woocommerce_page_sccfcw-settings .wrap > div[style*="max-width:860px"] table td {
    border: 1px solid #c3c4c7 !important;
    padding: 8px 10px !important;
    color: #2c3338;
}

body.woocommerce_page_sccfcw-settings .wrap > div[style*="max-width:860px"] > p[style*="f0f7fb"] {
    background: #fff !important;
    border: 1px solid #c3c4c7 !important;
    border-left: 4px solid #72aee6 !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    color: #1d2327;
    margin-top: 24px !important;
    padding: 12px !important;
}

/* ── Connection health check ─────────────────────────────────────── */

.sccfcw-health {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    margin: 12px 0 0;
    max-width: 640px;
    padding: 4px 16px;
}

.sccfcw-health li {
    border-bottom: 1px solid #f0f0f1;
    margin: 0;
    padding: 10px 0;
}

.sccfcw-health li:last-child {
    border-bottom: none;
}

.sccfcw-health-row {
    align-items: baseline;
    display: flex;
    gap: 8px;
}

.sccfcw-health-label {
    color: #1d2327;
    flex-shrink: 0;
}

/* Dotted leader between the service name and its verdict. */
.sccfcw-health-leader {
    border-bottom: 1px dotted #c3c4c7;
    flex-grow: 1;
    min-width: 24px;
    transform: translateY(-4px);
}

.sccfcw-health-state {
    flex-shrink: 0;
    font-weight: 600;
}

.sccfcw-state-pending { color: #c3c4c7; }
.sccfcw-state-loading { color: #2271b1; }
.sccfcw-state-ok      { color: #00a32a; }
.sccfcw-state-warn    { color: #996800; }
.sccfcw-state-fail    { color: #d63638; }
.sccfcw-state-skip    { color: #646970; font-weight: 400; }
.sccfcw-state-info    { color: #646970; }

.sccfcw-state-loading::after {
    animation: sccfcw-ellipsis steps(4, end) 1.2s infinite;
    content: "";
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    white-space: nowrap;
    width: 0;
}

@keyframes sccfcw-ellipsis {
    to { width: 1.2em; }
}

@media (prefers-reduced-motion: reduce) {
    .sccfcw-state-loading::after {
        animation: none;
    }
}

.sccfcw-health-detail {
    color: #646970;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.sccfcw-health-detail:empty {
    display: none;
}

.sccfcw-ai-box {
    margin-top: 16px;
    max-width: 42rem;
    padding-top: 12px;
    border-top: 1px solid #dcdcde;
}

#sccfcw-label-container .sccfcw-ai-box {
    margin-top: 12px;
    padding-top: 10px;
}

.sccfcw-ai-box__title {
    margin: 0 0 6px;
}

.sccfcw-ai-box textarea {
    width: 100%;
}

.sccfcw-ai-status {
    display: inline-block;
    margin-left: 8px;
    color: #50575e;
}
