/* ============================================================
   Share button floating in lightbox (bottom-right)
   ============================================================ */
.lightbox-share-btn {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-cr-btn {
    position: absolute;
    bottom: 14px;
    right: 64px;
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-cr-btn:hover,
.lightbox-cr-btn:focus-visible {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.65);
    outline: none;
}

.lightbox-cr-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.lightbox-share-btn:hover,
.lightbox-share-btn:focus-visible {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.65);
    outline: none;
}

/* ============================================================
   Share sheet overlay (slides up from bottom)
   ============================================================ */
#shareLightboxOverlay {
    position: fixed;
    inset: 0;
    z-index: 32000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
}

#shareLightboxOverlay[data-open="1"] {
    opacity: 1;
    pointer-events: auto;
}

.share-sheet {
    background: #1c1c1e;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#shareLightboxOverlay[data-open="1"] .share-sheet {
    transform: translateY(0);
}

.share-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.share-sheet-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.4);
}

.share-sheet-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.12s;
}

.share-sheet-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.share-sheet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.share-sheet-option:last-child {
    border-bottom: none;
    padding-bottom: 18px;
}

.share-sheet-option:hover,
.share-sheet-option:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.share-option-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

#provenanceLightboxOverlay {
    position: fixed;
    inset: 0;
    z-index: 32001;
    background: rgba(0, 0, 0, 0.56);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
}

#provenanceLightboxOverlay[data-open="1"] {
    opacity: 1;
    pointer-events: auto;
}

.provenance-sheet {
    background: #101419;
    color: #f3f6fa;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 84vh;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

#provenanceLightboxOverlay[data-open="1"] .provenance-sheet {
    transform: translateY(0);
}

.provenance-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.provenance-sheet-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.76);
}

.provenance-sheet-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.provenance-sheet-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.provenance-sheet-body {
    padding: 14px 16px 18px;
}

.provenance-loading,
.provenance-empty {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.provenance-note {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    line-height: 1.35;
}

.provenance-summary {
    display: grid;
    gap: 8px;
}

.provenance-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(129, 199, 132, 0.6);
    color: #b8f5bf;
    background: rgba(32, 78, 36, 0.38);
    padding: 4px 8px;
    border-radius: 999px;
}

.provenance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

.provenance-row span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.provenance-row strong,
.provenance-row code {
    color: #fff;
    font-size: 0.84rem;
    word-break: break-all;
}

.provenance-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.provenance-link-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #f5f7ff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.provenance-link-btn:hover,
.provenance-link-btn:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}
