.encypher-c2pa-badge {
    display: inline-flex;
    box-sizing: border-box;
    flex-wrap: nowrap;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #1b2f50;
    font: 500 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.encypher-c2pa-badge--small {
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
}

.encypher-c2pa-badge:hover {
    border-color: #2a87c4;
    box-shadow: 0 2px 8px rgba(27, 47, 80, 0.14);
}

.encypher-c2pa-badge:focus-visible,
.encypher-editorial-section-button:focus-visible,
.encypher-c2pa-modal-close:focus-visible,
.encypher-verification-retry:focus-visible {
    outline: 2px solid #2a87c4;
    outline-offset: 2px;
}

.encypher-c2pa-badge__icon {
    display: block;
    flex: 0 0 auto;
}

.encypher-c2pa-badge__status {
    display: inline-flex;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.encypher-c2pa-badge__action {
    flex: 0 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 400;
}

.encypher-c2pa-control-verdict {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}


/* Result text follows the mark: brand navy for a trusted match, amber when
 * credential acceptance is qualified, red for a failed attempt or result,
 * and neutral gray where no verification result exists. */
.encypher-c2pa-badge[data-encypher-tone="caution"] {
    color: #7a4b0a;
    border-color: #e6c79c;
}

.encypher-c2pa-badge-verified,
.encypher-c2pa-badge[data-encypher-tone="positive"] {
    color: #1b2f50;
    border-color: #b7d5ed;
}

.encypher-c2pa-badge[data-encypher-tone="neutral"],
.encypher-c2pa-badge[data-encypher-tone="info"] {
    color: #475569;
    border-color: #a7aaad;
}

.encypher-c2pa-badge[data-encypher-tone="warning"],
.encypher-c2pa-badge[data-encypher-verdict="unavailable"] {
    color: #b42318;
    border-color: #b42318;
}

.encypher-c2pa-badge-signed {
    color: #1b2f50;
    border-color: #b7d5ed;
}

.encypher-c2pa-badge-changed_after_signing {
    color: #b42318;
    border-color: #b42318;
}

.encypher-c2pa-badge-verification_unavailable {
    color: #475569;
    border-color: #a7aaad;
}

.encypher-c2pa-no-js {
    box-sizing: border-box;
    max-width: 40rem;
    padding: 14px 16px;
    color: #1e293b;
    font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.encypher-c2pa-no-js p {
    margin: 0 0 8px;
}

.encypher-c2pa-no-js p:last-child {
    margin-bottom: 0;
}

.encypher-c2pa-no-js__title {
    color: #1b2f50;
}

/*
 * The in-content wrappers set vertical spacing and nothing else.
 *
 * A block theme constrains the children of its content area to the content
 * width and centres them with automatic side margins, through rules written at
 * zero specificity so a theme or plugin can override them. This wrapper used to
 * do exactly that by accident: a max-width and a margin shorthand that also set
 * the side margins to zero. The result was a control stretched across the full
 * padded width of the page and pinned to its left edge, while the article text
 * sat in a narrow centred column. Leave the side margins and the width alone
 * and the control lands in the column with the text.
 */
.encypher-c2pa-badge-wrapper {
    box-sizing: border-box;
}

.encypher-c2pa-badge-top {
    margin-top: 0;
    margin-bottom: 24px;
}

.encypher-c2pa-badge-bottom {
    margin-top: 32px;
    margin-bottom: 48px;
}

/*
 * Directly under the headline. On a block theme this wrapper is a sibling of
 * the post-title block inside the same constrained group, so it takes the same
 * content width; on a classic theme it is the first thing inside the entry
 * content. Either way it sits in the article column.
 */
.encypher-c2pa-badge-below-title {
    margin-top: 12px;
    margin-bottom: 24px;
}

/*
 * The floating control stays inside the article column.
 *
 * It used to be pinned 20 pixels from the right edge of the window, which on a
 * wide screen put it far outside the article and over whatever the theme had
 * there. The wrapper is now a band holding the control at the column's right
 * edge. The band itself does not take pointer events, so nothing outside the
 * control is covered.
 *
 * Two rules, because the column's position can only be known by measuring it.
 * Without script the band is centred on the window at no more than the theme's
 * declared content size, which is right wherever the column is centred. The
 * script measures both edges of the real column and adds the measured class,
 * which places the band over the column wherever it actually sits, including
 * a theme that puts a sidebar beside it.
 */
.encypher-c2pa-badge-floating {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0 20px;
    width: min(100%, var(--wp--style--global--content-size, 40rem));
    pointer-events: none;
}

.encypher-c2pa-badge-floating--measured {
    left: var(--encypher-reader-content-left, 0);
    right: auto;
    margin: 0;
    width: var(--encypher-reader-content-width, auto);
    max-width: 100%;
}

.encypher-c2pa-badge-floating > * {
    pointer-events: auto;
}

.encypher-c2pa-modal[hidden] {
    display: none;
}

.encypher-c2pa-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.encypher-c2pa-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.encypher-c2pa-modal-content {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    color: #1e293b;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 64px rgba(15, 23, 42, 0.32);
}

.encypher-c2pa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #dbe3ec;
}

.encypher-c2pa-modal-logo {
    width: auto;
    height: 40px;
    object-fit: contain;
}

.encypher-c2pa-modal-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #475569;
    font-size: 30px;
    line-height: 1;
    place-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.encypher-c2pa-modal-close:hover {
    color: #1b2f50;
    background: #f1f5f9;
}

.encypher-c2pa-modal-body {
    min-width: 0;
    padding: 22px;
}

.encypher-c2pa-modal-body h2 {
    margin: 0 0 6px;
    color: #1b2f50;
    font-size: 23px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.encypher-c2pa-modal-loading {
    padding: 28px 0;
    text-align: center;
}

.encypher-c2pa-loader {
    display: block;
    width: 38px;
    height: 38px;
    margin: 0 auto 12px;
}

.encypher-verification-state {
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.encypher-verification-state__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.encypher-verification-state__mark {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.encypher-verification-state h3 {
    margin: 0;
    font-size: 18px;
}

.encypher-verification-state p {
    margin: 0;
    line-height: 1.5;
}

/* The state copy carries the same distinction as the adjacent status mark.
 * Credential caution stays separate from a trusted content match, and a
 * passage that matched is neither of those: it is a narrower answer, so it
 * reads as a plain statement rather than a pass or a warning. */
.encypher-verification-state--trusted {
    color: #1b2f50;
    background: #f2f7fc;
    border-color: #b7d5ed;
}

.encypher-verification-state--valid_untrusted {
    color: #7a4b0a;
    background: #fdf6ec;
    border-color: #e6c79c;
}

/* A publisher withdrawing its own article is a caution, not a failed check:
 * it shares the credential-caution palette and never the failure red. */
.encypher-verification-state--retracted {
    color: #7a4b0a;
    background: #fdf6ec;
    border-color: #e6c79c;
}

.encypher-verification-state--excerpt_verified {
    color: #33475b;
    background: #f4f7fa;
    border-color: #c8d6e2;
}

/* A marker whose words could not be checked is a caution, never the failure
 * red: nobody established that the text was altered. */
.encypher-verification-state--excerpt_unconfirmed {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.encypher-verification-state--changed,
.encypher-verification-state--unavailable {
    color: #b42318;
    background: #fef3f2;
    border-color: #fecdca;
}

.encypher-verification-state--updated_unsigned,
.encypher-verification-state--not_present,
.encypher-verification-state--checking,
.encypher-verification-state--signed_unchecked {
    color: #475569;
    background: #f8fafc;
    border-color: #d6d9de;
}

.encypher-source-declaration {
    min-width: 0;
    margin-top: 16px;
    padding: 0 2px;
}

.encypher-source-declaration__heading {
    margin: 0 0 4px;
    color: #1b2f50;
    font-size: 14px;
}

.encypher-source-declaration__text {
    margin: 0;
    color: #475569;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.encypher-editorial-note {
    margin: 0 0 10px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

/* Section headings for the rights and edit-history groups. */
.encypher-verification-section {
    margin: 20px 0 0;
    color: #1b2f50;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.encypher-verification-section + .encypher-verification-facts {
    margin-top: 10px;
    padding-top: 10px;
}

.encypher-rights-subheading {
    margin: 14px 0 0;
    color: #1b2f50;
    font-size: 14px;
    font-weight: 700;
}

.encypher-rights-note {
    margin: 6px 0 0;
    color: #475569;
    font-size: 13px;
}

.encypher-rights-note--unavailable {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
}

.encypher-verification-facts--rights,
.encypher-verification-facts--licensing {
    margin-top: 10px;
    padding-top: 10px;
}

.encypher-licensing-inquiry__action {
    display: inline-block;
    max-width: 100%;
    margin-top: 12px;
    padding: 9px 13px;
    color: #fff;
    background: #1b2f50;
    border-radius: 6px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.encypher-licensing-inquiry__action:hover,
.encypher-licensing-inquiry__action:focus-visible {
    color: #fff;
    background: #24416f;
}

.encypher-verification-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 14px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid #dbe3ec;
}

.encypher-verification-facts dt {
    min-width: 0;
    color: #64748b;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.encypher-verification-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.encypher-verification-facts a,
.encypher-verification-link {
    overflow-wrap: anywhere;
}

.encypher-reader-disclosure,
.encypher-verification-checks,
.encypher-verification-technical {
    margin-top: 18px;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
}

.encypher-reader-disclosure > summary,
.encypher-verification-checks > summary,
.encypher-verification-technical > summary {
    padding: 10px 12px;
    color: #1b2f50;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.encypher-reader-disclosure[open] > summary,
.encypher-verification-checks[open] > summary,
.encypher-verification-technical[open] > summary {
    border-bottom: 1px solid #dbe3ec;
    border-radius: 8px 8px 0 0;
}

.encypher-reader-disclosure__body,
.encypher-verification-checks > .encypher-verification-facts,
.encypher-verification-technical__body {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border-top: 0;
}

.encypher-reader-disclosure__body > :first-child {
    margin-top: 0;
}

.encypher-verification-checks__limit {
    margin: 0;
    padding: 0 12px 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.encypher-verification-technical__section + .encypher-verification-technical__section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dbe3ec;
}

.encypher-verification-technical__section h4 {
    margin: 0 0 8px;
    color: #1b2f50;
    font-size: 12px;
}

.encypher-verification-technical pre {
    max-height: 280px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    color: #1e293b;
    background: #f6f7f7;
    border-radius: 4px;
    font: 11px/1.45 Consolas, Monaco, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.encypher-verification-timeline {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
    padding-left: 22px;
}

.encypher-verification-timeline li {
    padding-left: 3px;
}

.encypher-verification-timeline strong,
.encypher-verification-timeline span {
    display: block;
}

.encypher-verification-timeline strong {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
}

.encypher-verification-timeline span {
    overflow-wrap: anywhere;
}

.encypher-verification-retry {
    min-height: 42px;
    margin-top: 16px;
    padding: 8px 16px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    background: #1b2f50;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.encypher-verification-retry:hover {
    background: #24416f;
}

body.encypher-c2pa-dialog-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .encypher-c2pa-modal {
        align-items: end;
        padding: 0;
    }

    .encypher-c2pa-modal-content {
        width: 100%;
        max-width: 100vw;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .encypher-c2pa-badge-floating {
        bottom: 12px;
        padding: 0 12px;
    }

    .encypher-verification-facts {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .encypher-verification-facts dd + dt {
        margin-top: 8px;
    }
}

@media print {
    .encypher-c2pa-badge-floating,
    .encypher-c2pa-modal {
        display: none !important;
    }
}

/* ------------------------------------------------------------------ */
/* Whitelabel brand logo (badge + modal) and Powered by Encypher link */
/* ------------------------------------------------------------------ */

.encypher-c2pa-badge__icon--brand {
    object-fit: contain;
}

.encypher-c2pa-modal-logo--brand {
    width: auto;
    max-height: 28px;
    object-fit: contain;
}

.encypher-c2pa-modal-brand-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.encypher-c2pa-modal-powered-by {
    margin: 16px 0 0;
    text-align: center;
}

.encypher-c2pa-modal-powered-by a {
    color: #6b7280;
    font-size: 12px;
    text-decoration: none;
}

.encypher-c2pa-modal-powered-by a:hover,
.encypher-c2pa-modal-powered-by a:focus-visible {
    color: #2a87c4;
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Reader image verification overlay: a small floating corner button  */
/* positioned over content images (never reparented, so no layout     */
/* shift). Mirrors the Chrome extension's image badge visual language. */
/* ------------------------------------------------------------------ */

.encypher-c2pa-media-badge {
    box-sizing: border-box;
    max-width: calc(100vw - 8px);
    position: absolute;
    width: auto;
    min-height: 28px;
    margin: 0;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-align: left;
    color: #1b2f50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fff;
    border: 1px solid rgba(27, 47, 80, 0.15);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(27, 47, 80, 0.25);
    cursor: pointer;
    opacity: 0.92;
    z-index: 9998;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.encypher-c2pa-media-badge:hover,
.encypher-c2pa-media-badge:focus-visible {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(27, 47, 80, 0.35);
}

.encypher-c2pa-media-badge:focus-visible {
    outline: 2px solid #2a87c4;
    outline-offset: 2px;
}

.encypher-c2pa-media-badge__icon,
.encypher-c2pa-media-badge__logo {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.encypher-c2pa-media-badge__logo {
    object-fit: contain;
    border-radius: 50%;
}

.encypher-editorial-sections {
    margin-top: 14px;
}

.encypher-editorial-sections ul {
    display: grid;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.encypher-editorial-section-button {
    width: 100%;
    padding: 6px 9px;
    color: #1b2f50;
    font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    cursor: pointer;
}

.encypher-editorial-section-button:hover,
.encypher-editorial-section-button:focus-visible {
    background: #eef5fa;
    border-color: #8293a6;
}

.encypher-editorial-scope {
    margin: 8px 0;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.encypher-reader-disclosure summary:focus-visible,
.encypher-verification-checks summary:focus-visible,
.encypher-verification-technical summary:focus-visible {
    outline: 2px solid #1b2f50;
    outline-offset: 2px;
}

@media print {
    .encypher-c2pa-media-badge {
        display: none !important;
    }
}

/*
 * D6 AI disclosure.
 *
 * It sits beside the reader control on the page and directly under the check
 * result in the dialog. It carries no status colour: it reports the
 * publisher's own declaration, not the outcome of a check, and colouring it
 * would read as a verdict.
 */
.encypher-ai-disclosure {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: #1f2933;
}

/* The label can stand alone, above the article and with no control beside it. */
.encypher-c2pa-badge-wrapper > .encypher-ai-disclosure:first-child {
    margin-top: 0;
}

.encypher-c2pa-modal .encypher-ai-disclosure {
    margin: 0 0 12px;
    padding: 6px 10px;
    background: #f1f3f5;
    border-radius: 4px;
}
