.third-party-embed {
    position: relative;
}

.third-party-embed iframe[hidden] {
    display: none;
}

.third-party-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-white);
    text-align: center;
}

.third-party-placeholder[hidden] {
    display: none;
}

.third-party-placeholder-icon {
    flex: 0 0 auto;
    color: var(--color-accent-light);
}

.third-party-placeholder h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
}

.third-party-placeholder p {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.82rem, 1.8vw, 0.95rem);
    line-height: 1.5;
}

.privacy-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1080;
    max-width: 72rem;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: 0 auto;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.privacy-banner[hidden] {
    display: none;
}

.privacy-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.privacy-banner h2,
.privacy-dialog h2 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.privacy-banner p {
    max-width: 48rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    line-height: 1.5;
}

.privacy-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.privacy-button {
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.privacy-button-primary {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-white);
}

.privacy-button-primary:hover {
    border-color: var(--color-accent-light);
    background: var(--color-accent-light);
}

.privacy-button-secondary {
    border-color: currentColor;
    background: transparent;
    color: inherit;
}

.privacy-button-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.privacy-settings-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    margin: 0.85rem auto 0;
    padding: 0.5rem;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.privacy-settings-button:hover {
    color: var(--color-primary);
}

.privacy-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1090;
    width: min(34rem, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--color-white);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, -50%);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.privacy-dialog:not([open]) {
    display: none;
}

.privacy-dialog::backdrop {
    background: rgba(10, 10, 20, 0.72);
}

.privacy-dialog.privacy-dialog-fallback {
    box-shadow: 0 0 0 100vmax rgba(10, 10, 20, 0.72), var(--shadow-lg);
}

html.privacy-dialog-open {
    overflow: hidden;
}

.privacy-dialog-content {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.privacy-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.privacy-dialog-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: -0.65rem -0.65rem 0 0;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.privacy-dialog p {
    color: var(--color-text-muted);
    line-height: 1.6;
}

.privacy-dialog .privacy-status {
    margin: 1rem 0 1.25rem;
    color: var(--color-text);
}

.privacy-dialog .privacy-button-secondary {
    color: var(--color-primary);
}

.privacy-dialog .privacy-button-secondary:hover {
    background: var(--color-bg);
}

@media (max-width: 700px) {
    .privacy-banner-content {
        align-items: stretch;
        flex-direction: column;
    }

    .privacy-actions {
        justify-content: stretch;
    }

    .privacy-actions .privacy-button {
        flex: 1 1 8rem;
    }

    .third-party-placeholder {
        gap: 0.45rem;
        padding: 1rem;
    }

    .third-party-placeholder-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 420px) {
    .privacy-banner {
        right: max(0.5rem, env(safe-area-inset-right));
        bottom: max(0.5rem, env(safe-area-inset-bottom));
        left: max(0.5rem, env(safe-area-inset-left));
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        padding: 1rem;
    }

    .privacy-banner-content {
        gap: 1rem;
    }

    .privacy-banner h2 {
        font-size: 1.1rem;
    }

    .privacy-banner p {
        font-size: 0.82rem;
    }

    .privacy-actions .privacy-button {
        flex-basis: 6rem;
    }

    .third-party-placeholder-icon {
        display: none;
    }

    .third-party-placeholder p {
        display: none;
    }

    .third-party-placeholder .privacy-button {
        min-height: 44px;
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .privacy-button {
        transition: none;
    }
}
