.encypher-c2pa-badge {
    display: inline-flex;
    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-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;
}

/* One status glyph per verdict. The mark to the left of the label is brand
 * artwork and is identical in every state; this glyph is what differs, so the
 * five verdicts are distinguishable without reading the label and without
 * colour being the only signal. */
.encypher-c2pa-badge__glyph,
.encypher-verification-state__glyph {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
}

/* A check is reachable only from the `trusted` verdict. */
.encypher-c2pa-badge__glyph--check::before,
.encypher-verification-state__glyph--check::before {
    content: "\2713";
}

.encypher-c2pa-badge__glyph--caution::before,
.encypher-verification-state__glyph--caution::before {
    content: "\0021";
}

/* Not-equal: the served bytes are not the signed bytes. */
.encypher-c2pa-badge__glyph--changed::before,
.encypher-verification-state__glyph--changed::before {
    content: "\2260";
}

.encypher-c2pa-badge__glyph--unknown::before,
.encypher-verification-state__glyph--unknown::before {
    content: "\003F";
}

/* Em dash: nothing to report, as distinct from a failed report. */
.encypher-c2pa-badge__glyph--absent::before,
.encypher-verification-state__glyph--absent::before {
    content: "\2013";
}

.encypher-c2pa-badge__glyph--record::before,
.encypher-verification-state__glyph--record::before {
    content: "\00B7";
}

.encypher-c2pa-badge__glyph--checking::before,
.encypher-verification-state__glyph--checking::before {
    content: "\2026";
}

.encypher-c2pa-badge__check {
    display: inline-block;
    flex: 0 0 auto;
    width: 0.55em;
    height: 0.55em;
    background: #0f5132;
    border-radius: 50%;
}

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

/* Verdict tone drives colour. `data-encypher-verdict` is authoritative; the
 * legacy class selectors below it remain for themes that already target them,
 * and are deliberately narrower than the tone rules so a stale cached class
 * cannot repaint a state green. */
.encypher-c2pa-badge[data-encypher-tone="positive"] {
    color: #0f5132;
    border-color: #8bc69e;
}

.encypher-c2pa-badge[data-encypher-tone="caution"] {
    color: #7a4b0a;
    border-color: #e0a458;
}

.encypher-c2pa-badge[data-encypher-tone="warning"] {
    color: #744b00;
    border-color: #dba617;
}

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

.encypher-c2pa-badge-verified {
    color: #0f5132;
    border-color: #8bc69e;
}

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

.encypher-c2pa-badge-changed_after_signing {
    color: #744b00;
    border-color: #dba617;
}

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

.encypher-c2pa-badge-wrapper {
    width: 100%;
}

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

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

.encypher-c2pa-badge-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
}

.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: 28px;
}

.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 {
    padding: 22px;
}

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

.encypher-c2pa-modal-description {
    margin: 0 0 20px;
    color: #64748b;
}

.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;
}

/* One block per verdict. `trusted` is the only green surface in the dialog:
 * `valid_untrusted` describes valid bytes with an unverified publisher, and
 * painting that green was the visual half of the same contradiction the copy
 * used to carry. */
.encypher-verification-state--trusted {
    color: #0f5132;
    background: #e9f7ef;
    border-color: #b7e1c8;
}

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

.encypher-verification-state--changed {
    color: #744b00;
    background: #fff8e1;
    border-color: #f2d16b;
}

.encypher-verification-state--unavailable {
    color: #475569;
    background: #f8fafc;
}

.encypher-verification-state--not_present {
    color: #475569;
    background: #f4f5f7;
    border-color: #d6d9de;
}

.encypher-verification-state--checking,
.encypher-verification-state--signed_unchecked {
    color: #1b2f50;
    background: #f2f7fc;
    border-color: #b7d5ed;
}

/* 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-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 {
    color: #64748b;
    font-weight: 600;
}

.encypher-verification-facts dd {
    margin: 0;
    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-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .encypher-c2pa-badge-floating {
        right: 12px;
        bottom: 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 {
    position: absolute;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(27, 47, 80, 0.15);
    border-radius: 50% 50% 50% 4px;
    box-shadow: 0 1px 4px rgba(27, 47, 80, 0.25);
    line-height: 0;
    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;
}

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

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