.encypher-settings-page {
    --encypher-ink: #1b2f50;
    --encypher-blue: #2271b1;
    --encypher-border: #dcdcde;
    --encypher-muted: #50575e;
    max-width: 1120px;
}

.encypher-page-header {
    margin: 24px 0;
}

.encypher-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
}

.encypher-brand-lockup {
    display: block;
    width: 126px;
    height: auto;
}

.encypher-title-divider {
    color: #8c8f94;
    font-weight: 400;
}

.encypher-connection-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--encypher-muted);
    font-size: 14px;
}

.encypher-status-mark {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.encypher-status-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

.encypher-connect-cards,
.encypher-health-grid,
.encypher-advanced-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.encypher-connect-cards {
    margin-bottom: 16px;
}

.encypher-connect-card,
.encypher-card,
.encypher-advanced-connection {
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--encypher-border);
    border-radius: 6px;
}

.encypher-connect-card,
.encypher-card {
    padding: 24px;
}

.encypher-connect-card--recommended {
    border-color: var(--encypher-blue);
    box-shadow: inset 4px 0 0 var(--encypher-blue);
}

.encypher-connect-card h2,
.encypher-card h2 {
    margin: 0 0 10px;
    color: var(--encypher-ink);
    font-size: 18px;
    line-height: 1.35;
}

.encypher-card-tag {
    display: inline-block;
    margin: 0 0 8px;
    color: var(--encypher-blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.encypher-oauth-connect .button-hero {
    min-height: 44px;
}

/* wp-admin's `.button { display: inline-block }` (author origin) beats the
   UA stylesheet's `[hidden] { display: none }`, so the OAuth Cancel button
   rendered before any session started. Restore hidden semantics page-wide. */
.encypher-settings-page [hidden] {
    display: none !important;
}

.encypher-action-status {
    margin-top: 12px;
}

.encypher-action-status:empty {
    display: none;
}

.encypher-action-status.is-success,
#encypher-api-key-status.is-success {
    color: #008a20;
}

.encypher-action-status.is-error,
#encypher-api-key-status.is-error {
    color: #d63638;
}

.encypher-connected-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}


.encypher-connected-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.encypher-identity-facts,
.encypher-path-health,
.encypher-queue-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 14px;
}

.encypher-identity-facts div,
.encypher-path-health div,
.encypher-queue-facts div {
    min-width: 120px;
}

.encypher-identity-facts dt,
.encypher-path-health dt,
.encypher-queue-facts dt {
    color: var(--encypher-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.encypher-identity-facts dd,
.encypher-path-health dd,
.encypher-queue-facts dd {
    margin: 2px 0 0;
    color: var(--encypher-ink);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.encypher-path-health {
    margin-top: 16px;
}

.encypher-queue-diagnostics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    border-left: 4px solid #dba617;
}

.encypher-queue-diagnostics.is-stalled {
    border-left-color: #d63638;
}

.encypher-queue-diagnostics p {
    margin: 0 0 12px;
}

.encypher-queue-facts {
    margin-bottom: 12px;
}

.encypher-queue-actions {
    display: flex;
    min-width: 180px;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}

.encypher-remediation {
    max-width: 760px;
    color: var(--encypher-muted);
}
.encypher-overall-status {
    border-left: 4px solid var(--encypher-blue);
}

.encypher-overall-status--action {
    border-left-color: #d63638;
}

.encypher-overall-status--check,
.encypher-overall-status--progress {
    border-left-color: #dba617;
}

.encypher-overall-message {
    max-width: 680px;
    margin: 4px 0 10px;
    color: var(--encypher-ink);
    font-size: 16px;
}

.encypher-coverage-outcome {
    margin: 0 0 16px;
}


.encypher-health-grid {
    margin-bottom: 16px;
}


.encypher-provenance-coverage-card {
    display: flex;
    flex-direction: column;
}

.encypher-provenance-coverage-card h2 {
    margin-bottom: 4px;
}

.encypher-provenance-coverage-card > .description {
    margin: 0 0 16px;
}

.encypher-coverage-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 12px;
    margin: 0;
}

.encypher-coverage-metric {
    min-width: 0;
    padding-left: 12px;
    border-left: 3px solid var(--encypher-border);
}

.encypher-coverage-metric--verified,
.encypher-coverage-metric--signed {
    border-left-color: var(--encypher-blue);
}

.encypher-coverage-metric--signing {
    border-left-color: #dba617;
}

.encypher-coverage-metric--edited,
.encypher-coverage-metric--needs_attention {
    border-left-color: #d63638;
}

.encypher-coverage-metric--not_signed {
    border-left-color: #8c8f94;
}

.encypher-coverage-metric dt {
    color: var(--encypher-muted);
    font-size: 12px;
    line-height: 1.35;
}

.encypher-coverage-metric dd {
    margin: 2px 0 0;
    color: var(--encypher-ink);
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.encypher-coverage-actions-menu > summary {
    display: none;
}

.encypher-coverage-actions-menu > summary::marker {
    content: "";
}

.encypher-coverage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.encypher-draft-count {
    margin: 12px 0 0;
}

.encypher-media-scan-progress {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 16px 0;
}

.encypher-media-scan-progress div {
    padding-left: 10px;
    border-left: 3px solid var(--encypher-border);
}

.encypher-media-scan-progress dt {
    color: var(--encypher-muted);
    font-size: 12px;
}

.encypher-media-scan-progress dd {
    margin: 2px 0 0;
    color: var(--encypher-ink);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.encypher-media-scan-empty {
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    color: var(--encypher-ink);
    font-weight: 600;
}

.encypher-media-scan-last-run {
    color: var(--encypher-muted);
}

.encypher-media-scan-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.encypher-media-scan-actions form {
    margin: 0;
}

.encypher-protected-mode-current {
    margin: 0 0 10px;
}

.encypher-protected-mode-current.is-protected {
    color: #008a20;
}

.encypher-protected-mode-current.is-unprotected {
    color: #d63638;
}

.encypher-policy-option {
    display: block;
    margin-bottom: 4px;
}

.encypher-registry-retry-form {
    margin-top: 6px;
}

.encypher-recent-failures-card {
    margin-bottom: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.encypher-recent-failures-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.encypher-recent-failures-heading h2,
.encypher-recent-failures-heading .description {
    margin: 0;
}
.encypher-disclosure-title {
    color: var(--encypher-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.encypher-recent-failures-heading {
    cursor: pointer;
    list-style: none;
}

.encypher-recent-failures-heading::-webkit-details-marker {
    display: none;
}

.encypher-recent-failures-heading::after {
    content: "Hide";
    color: var(--encypher-blue);
    font-size: 12px;
    font-weight: 600;
}

.encypher-recent-failures-card:not([open]) .encypher-recent-failures-heading::after {
    content: "Show";
}

.encypher-recent-failures-bulk {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}


.encypher-recent-failures-list {
    margin: 0;
    border-top: 1px solid var(--encypher-border);
}

.encypher-recent-failure {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--encypher-border);
}

.encypher-recent-failure-title,
.encypher-recent-failure-detail {
    margin: 0 0 2px;
}

.encypher-recent-failure-type {
    margin-left: 6px;
    color: var(--encypher-muted);
    font-size: 12px;
}

.encypher-recent-failure-operation {
    color: var(--encypher-ink);
    font-weight: 600;
}

.encypher-recent-failure time,
.encypher-recent-failure-status {
    color: var(--encypher-muted);
    font-size: 12px;
}
.encypher-recent-failure-resolved {
    color: #008a20;
    font-size: 12px;
    font-weight: 600;
}

.encypher-recent-failure-repeat {
    margin: 2px 0;
    color: var(--encypher-muted);
    font-size: 12px;
}

.encypher-failure-technical {
    margin: 4px 0;
    color: var(--encypher-muted);
    font-size: 12px;
}

.encypher-failure-technical summary {
    cursor: pointer;
}

.encypher-failure-technical code {
    display: block;
    margin-top: 4px;
    padding: 6px 8px;
    overflow-wrap: anywhere;
    white-space: normal;
}


.encypher-recent-failure-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.encypher-recent-failure-status.is-success {
    color: #008a20;
}

.encypher-recent-failure-status.is-error {
    color: #d63638;
}

.encypher-behavior-settings {
    margin-bottom: 16px;
}

.encypher-behavior-settings .form-table {
    margin-top: 8px;
}
.encypher-behavior-disclosure > summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.encypher-behavior-disclosure > summary::-webkit-details-marker {
    display: none;
}

.encypher-behavior-body {
    padding-top: 8px;
}


.encypher-behavior-settings .form-table th {
    width: 260px;
}

.encypher-behavior-settings .form-table td,
.encypher-behavior-settings .form-table th {
    padding-top: 16px;
    padding-bottom: 16px;
}

.encypher-advanced-connection {
    margin: 0 0 24px;
}

.encypher-advanced-connection > summary {
    cursor: pointer;
    padding: 16px 20px;
    color: var(--encypher-ink);
    font-weight: 600;
}

.encypher-advanced-connection > summary:hover,
.encypher-advanced-connection > summary:focus-visible {
    color: var(--encypher-blue);
}

.encypher-advanced-body {
    padding: 0 20px 20px;
    border-top: 1px solid #f0f0f1;
}

.encypher-advanced-body h3 {
    margin: 18px 0 6px;
    font-size: 14px;
}

.encypher-advanced-body .regular-text {
    width: 100%;
    max-width: 100%;
}

.encypher-advanced-body hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid var(--encypher-border);
}

#encypher-api-key-status {
    display: block;
    margin-top: 8px;
}

@media screen and (max-width: 782px) {
    .encypher-settings-page {
        margin-right: 10px;
    }

    .encypher-connect-cards,
    .encypher-health-grid,
    .encypher-advanced-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .encypher-connected-identity {
        align-items: stretch;
        flex-direction: column;
    }

    .encypher-connected-actions {
        justify-content: flex-start;
    }

    .encypher-queue-diagnostics {
        align-items: stretch;
        flex-direction: column;
    }

    .encypher-queue-actions {
        min-width: 0;
        align-items: flex-start;
        text-align: left;
    }

    .encypher-identity-facts,
    .encypher-path-health,
    .encypher-queue-facts {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .encypher-media-scan-progress {
        grid-template-columns: minmax(0, 1fr);
    }

    .encypher-connected-actions .button {
        text-align: center;
    }

    .encypher-connected-actions .button,
    .encypher-recent-failure-action .button,
    .encypher-coverage-actions-menu > summary.button {
        min-height: 44px;
        line-height: 2.4;
    }

    .encypher-behavior-settings .form-table,
    .encypher-behavior-settings .form-table tbody,
    .encypher-behavior-settings .form-table tr,
    .encypher-behavior-settings .form-table th,
    .encypher-behavior-settings .form-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .encypher-behavior-settings .form-table th {
        padding-bottom: 4px;
    }

    .encypher-behavior-settings .form-table td {
        padding-top: 4px;
    }

    .encypher-coverage-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .encypher-coverage-actions .button {
        flex: 1 1 100%;
        text-align: center;
    }

    .encypher-coverage-actions-menu > summary {
        display: inline-flex;
        align-items: center;
        margin-top: 16px;
    }

    .encypher-coverage-actions-menu:not([open]) .encypher-coverage-actions {
        display: none;
    }

    .encypher-coverage-actions-menu[open] > summary {
        margin-bottom: 8px;
    }

    .encypher-recent-failures-heading,
    .encypher-recent-failure {
        align-items: stretch;
        grid-template-columns: minmax(0, 1fr);
    }

    .encypher-recent-failures-heading {
        display: block;
    }

    .encypher-recent-failures-heading .description {
        margin-top: 4px;
    }

    .encypher-recent-failures-card {
        padding: 18px;
    }

    .encypher-recent-failures-heading {
        min-height: 44px;
    }

    .encypher-recent-failures-heading::after {
        float: right;
    }

    .encypher-behavior-settings {
        padding: 18px;
    }

    .encypher-behavior-disclosure > summary {
        min-height: 44px;
        align-items: center;
    }

    .encypher-behavior-disclosure > summary .description {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .encypher-settings-page * {
        scroll-behavior: auto;
    }
}
