/* Platform cookie consent — injected on publish for Classic and Template sites. */
#platform-cookie-consent-root {
    --pcc-bg: #0f172a;
    --pcc-fg: #f8fafc;
    --pcc-muted: #94a3b8;
    --pcc-accent: #2563eb;
    --pcc-border: rgba(148, 163, 184, 0.35);
    --pcc-reserve-bottom: max(5.75rem, calc(4.5rem + env(safe-area-inset-bottom, 0px)));
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#platform-cookie-consent-root .pcc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    background: var(--pcc-bg);
    color: var(--pcc-fg);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.35);
    padding: 1rem 1.25rem;
}

#platform-cookie-consent-root .pcc-banner-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

#platform-cookie-consent-root .pcc-banner-copy {
    flex: 1 1 280px;
    min-width: 0;
}

#platform-cookie-consent-root .pcc-banner-message {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--pcc-muted);
}

#platform-cookie-consent-root .pcc-banner-copy .pcc-link {
    display: inline-block;
    margin-top: 0.35rem;
}

#platform-cookie-consent-root .pcc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

#platform-cookie-consent-root .pcc-btn {
    border: 1px solid var(--pcc-border);
    background: transparent;
    color: var(--pcc-fg);
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

#platform-cookie-consent-root .pcc-btn:hover {
    border-color: var(--pcc-fg);
}

#platform-cookie-consent-root .pcc-btn-primary {
    background: var(--pcc-accent);
    border-color: var(--pcc-accent);
    color: #fff;
}

#platform-cookie-consent-root .pcc-btn-primary:hover {
    filter: brightness(1.08);
}

#platform-cookie-consent-root .pcc-link {
    color: var(--pcc-fg) !important;
    text-decoration: underline;
    font-size: 0.8125rem;
}

#platform-cookie-consent-root .pcc-banner a.pcc-link {
    color: var(--pcc-fg) !important;
}

#platform-cookie-consent-root .pcc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#platform-cookie-consent-root .pcc-modal-backdrop.is-open {
    display: flex;
}

#platform-cookie-consent-root .pcc-modal {
    width: min(100%, 560px);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: #fff;
    color: #0f172a;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    /* Banner uses light --pcc-fg on dark bg; modal buttons must use dark text on white. */
    --pcc-fg: #0f172a;
    --pcc-border: #94a3b8;
}

#platform-cookie-consent-root .pcc-modal h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

#platform-cookie-consent-root .pcc-modal-intro {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
}

#platform-cookie-consent-root .pcc-category {
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
}

#platform-cookie-consent-root .pcc-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

#platform-cookie-consent-root .pcc-category h3 {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
}

#platform-cookie-consent-root .pcc-category p {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.45;
}

#platform-cookie-consent-root .pcc-always-on {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

#platform-cookie-consent-root .pcc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

#platform-cookie-consent-root .pcc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

#platform-cookie-consent-root .pcc-toggle-track {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#platform-cookie-consent-root .pcc-toggle-track::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

#platform-cookie-consent-root .pcc-toggle input:checked + .pcc-toggle-track {
    background: var(--pcc-accent);
}

#platform-cookie-consent-root .pcc-toggle input:checked + .pcc-toggle-track::after {
    transform: translateX(20px);
}

#platform-cookie-consent-root .pcc-toggle input:disabled + .pcc-toggle-track {
    opacity: 0.55;
    cursor: not-allowed;
}

#platform-cookie-consent-root .pcc-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

#platform-cookie-consent-root .pcc-modal-footer .pcc-btn:not(.pcc-btn-primary) {
    color: #0f172a;
    background: #fff;
    border-color: #94a3b8;
}

#platform-cookie-consent-root .pcc-modal-footer .pcc-btn:not(.pcc-btn-primary):hover {
    background: #f1f5f9;
    border-color: #475569;
}

#platform-cookie-consent-root.is-hidden {
    display: none;
}

body:has(#platform-cookie-consent-root:not(.is-hidden)) {
    padding-bottom: var(--pcc-reserve-bottom);
}

@media (max-width: 640px) {
    #platform-cookie-consent-root {
        --pcc-reserve-bottom: max(9.5rem, calc(8.25rem + env(safe-area-inset-bottom, 0px)));
    }

    #platform-cookie-consent-root .pcc-banner {
        padding: 0.5rem 0.625rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    #platform-cookie-consent-root .pcc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    #platform-cookie-consent-root .pcc-banner-copy {
        flex: none;
    }

    #platform-cookie-consent-root .pcc-banner-message {
        flex: none;
        font-size: 0.6875rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    #platform-cookie-consent-root .pcc-banner-copy .pcc-link {
        margin-top: 0.25rem;
        font-size: 0.6875rem;
        line-height: 1.25;
    }

    #platform-cookie-consent-root .pcc-banner-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.3125rem;
        width: 100%;
    }

    #platform-cookie-consent-root .pcc-banner-actions .pcc-btn-primary {
        grid-column: 1 / -1;
        order: -1;
        padding: 0.4375rem 0.625rem;
    }

    #platform-cookie-consent-root .pcc-btn {
        flex: unset;
        width: 100%;
        padding: 0.375rem 0.4375rem;
        font-size: 0.6875rem;
        text-align: center;
    }
}
