.wpcm-hidden { display: none !important; }
body.wpcm-modal-open { overflow: hidden; }
#wpcm-root {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.38);
    overflow: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}
.wpcm-banner, .wpcm-panel {
    position: relative;
    margin: auto;
    width: min(760px, 100%);
    background: #fff;
    color: #111;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 24px;
    box-sizing: border-box;
    font: inherit;
}
.wpcm-banner { margin-top: max(24px, calc(100vh - 420px)); }
.wpcm-banner-copy h2 { margin-top: 0; }
.wpcm-banner-copy p { margin-bottom: 0; }
.wpcm-privacy-link { margin-top: 8px !important; }
.wpcm-panel { max-height: calc(100vh - 48px); overflow: auto; }
.wpcm-banner:focus, .wpcm-panel:focus { outline: 2px solid currentColor; outline-offset: 2px; }
.wpcm-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
}
.wpcm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.wpcm-actions button, .wpcm-open-settings, .wpcm-embed-placeholder button {
    border: 1px solid currentColor;
    background: #fff;
    color: #111;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
}
.wpcm-actions button:focus-visible, .wpcm-open-settings:focus-visible, .wpcm-embed-placeholder button:focus-visible, .wpcm-close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}
.wpcm-actions button:disabled, .wpcm-close:disabled { cursor: wait; opacity: .65; }
.wpcm-category { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding: 16px 0; border-top: 1px solid #ddd; }
.wpcm-category-copy { flex: 1; }
.wpcm-category p { margin: 5px 0 0; }
.wpcm-required { white-space: nowrap; font-size: .9em; opacity: .7; }
.wpcm-switch { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.wpcm-switch input { min-width: 20px; min-height: 20px; }
.wpcm-services-details { margin-top: 8px; font-size: .92em; }
.wpcm-services-details ul { margin: 8px 0 0 18px; }
.wpcm-services-details li { margin-bottom: 8px; }
.wpcm-tag-management { padding: 16px 0; border-top: 1px solid #ddd; }
.wpcm-tag-management p { margin: 6px 0 0; }
.wpcm-tag-management-name { margin-top: 8px !important; }
.wpcm-tag-management code { overflow-wrap: anywhere; }
.wpcm-status { min-height: 1.4em; margin: 12px 0 0; font-size: .92em; }
.wpcm-embed-placeholder {
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f6f7f7;
    text-align: center;
}
.wpcm-embed-placeholder p { margin-top: 0; }

/* Optional compact first-visit layout. The full preferences panel remains modal. */
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) {
    background: transparent;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-banner {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 -8px 28px rgba(0,0,0,.14);
    padding: 12px 52px 12px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "copy actions"
        "status status";
    gap: 6px 18px;
    align-items: center;
    pointer-events: auto;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-banner-copy {
    grid-area: copy;
    min-width: 0;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-banner-copy h2 {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) #wpcm-description {
    margin: 0;
    font-size: .94em;
    line-height: 1.4;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-privacy-link {
    display: inline;
    margin: 0 0 0 8px !important;
    font-size: .9em;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-actions {
    grid-area: actions;
    margin: 0;
    flex-wrap: nowrap;
    align-items: center;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-actions button {
    padding: 8px 12px;
    white-space: nowrap;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-close {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 24px;
}
#wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-status {
    grid-area: status;
    min-height: 0;
    margin: 0;
}
#wpcm-root.wpcm-layout-bar.wpcm-preferences-open {
    background: rgba(0,0,0,.38);
    padding: 24px 16px;
    overflow: auto;
    pointer-events: auto;
}

@media (max-width: 780px) {
    #wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-banner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "actions"
            "status";
        padding: 12px 44px 12px 14px;
        gap: 10px;
    }
    #wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    #wpcm-root { padding: 0; display: flex; align-items: flex-end; }
    .wpcm-banner, .wpcm-panel { width: 100%; margin: auto 0 0; border-radius: 12px 12px 0 0; max-height: 92vh; overflow: auto; }
    #wpcm-root.wpcm-layout-bar:not(.wpcm-preferences-open) .wpcm-banner { margin: 0; border-radius: 0; max-height: none; overflow: visible; }
    #wpcm-root.wpcm-layout-bar.wpcm-preferences-open { padding: 0; }
    .wpcm-category { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    #wpcm-root, .wpcm-banner, .wpcm-panel { scroll-behavior: auto; }
}
