:root {
    --ccb-overlay: rgba(24, 24, 27, 0.3);
    --ccb-backdrop-blur: blur(2px);
    --ccb-surface: #ffffff;
    --ccb-surface-translucent: rgba(255, 255, 255, 0.95);
    --ccb-surface-soft: #f4f4f5;
    --ccb-surface-hover: #f4f4f5;
    --ccb-border: #e4e4e7;
    --ccb-border-soft: #f4f4f5;
    --ccb-text: #18181b;
    --ccb-muted: #71717a;
    --ccb-muted-strong: #52525b;
    --ccb-primary: #18181b;
    --ccb-primary-hover: #27272a;
    --ccb-primary-text: #ffffff;
    --ccb-shadow: 0 24px 80px rgba(24, 24, 27, 0.18);
    --ccb-banner-shadow: 0 12px 40px rgba(24, 24, 27, 0.12);
    --ccb-radius-lg: 24px;
    --ccb-radius-md: 16px;
    --ccb-radius-sm: 12px;
    --ccb-focus: 0 0 0 3px rgba(24, 24, 27, 0.18);
}

.ccb-modal,
.ccb-modal * {
    box-sizing: border-box;
}

.ccb-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--ccb-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    pointer-events: none;
}

.ccb-modal.active {
    display: flex;
}

.ccb-modal-overlay {
    position: absolute;
    inset: 0;
    display: none;
    background: var(--ccb-overlay);
    backdrop-filter: var(--ccb-backdrop-blur);
    pointer-events: auto;
}

.ccb-modal[data-show-overlay="true"] .ccb-modal-overlay {
    display: block;
}

.ccb-modal-content {
    position: relative;
    z-index: 1;
    width: min(100%, 448px);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--ccb-surface);
    border: 1px solid var(--ccb-border);
    border-radius: var(--ccb-radius-lg);
    box-shadow: var(--ccb-shadow);
    pointer-events: auto;
    animation: ccb-card-in 180ms ease-out;
}

.ccb-modal[data-view="settings"] .ccb-modal-content {
    width: min(100%, 512px);
}

.ccb-modal[data-layout="banner"] {
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.ccb-modal[data-layout="banner"][data-position="top"] {
    align-items: flex-start;
}

.ccb-modal[data-layout="banner"] .ccb-modal-overlay {
    display: none;
}

.ccb-modal[data-layout="banner"][data-show-overlay="true"] .ccb-modal-overlay {
    display: block;
}

.ccb-modal[data-layout="banner"] .ccb-modal-content {
    width: min(100%, 1180px);
    max-height: calc(100vh - 24px);
    border-radius: var(--ccb-radius-md);
    box-shadow: var(--ccb-banner-shadow);
    background: var(--ccb-surface-translucent);
    backdrop-filter: blur(10px);
}

.ccb-main-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.ccb-modal[data-layout="banner"] .ccb-main-view {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.ccb-main-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ccb-modal[data-layout="banner"] .ccb-main-head {
    flex: 0 0 auto;
}

.ccb-cookie-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--ccb-surface-soft);
    color: var(--ccb-muted-strong);
}

.ccb-cookie-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.ccb-main-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccb-modal[data-layout="banner"] .ccb-main-copy {
    flex: 1 1 260px;
    min-width: 220px;
}

.ccb-modal-title,
.ccb-preferences-title {
    margin: 0;
    color: var(--ccb-text);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
}

.ccb-modal-text,
.ccb-preferences-text {
    margin: 0;
    color: var(--ccb-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.ccb-modal[data-layout="banner"] .ccb-modal-title {
    font-size: 14px;
}

.ccb-modal[data-layout="banner"] .ccb-modal-text {
    font-size: 12px;
    line-height: 1.45;
}

.ccb-policy-link {
    color: var(--ccb-muted-strong);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ccb-policy-link:hover {
    color: var(--ccb-text);
}

.ccb-modal-buttons,
.ccb-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ccb-modal[data-layout="banner"] .ccb-modal-buttons {
    margin-left: auto;
    flex: 0 0 auto;
}

.ccb-settings-actions {
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--ccb-border-soft);
}

.ccb-btn,
.ccb-close,
.ccb-back-link {
    appearance: none;
    border: 0;
    font: inherit;
    letter-spacing: 0;
    cursor: pointer;
}

.ccb-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ccb-btn:focus-visible,
.ccb-close:focus-visible,
.ccb-back-link:focus-visible,
.ccb-switch input:focus-visible + .ccb-switch-track {
    outline: none;
    box-shadow: var(--ccb-focus);
}

.ccb-btn-primary {
    background: var(--ccb-primary);
    border: 1px solid var(--ccb-primary);
    color: var(--ccb-primary-text);
}

.ccb-btn-primary:hover {
    background: var(--ccb-primary-hover);
    border-color: var(--ccb-primary-hover);
}

.ccb-btn-secondary {
    background: transparent;
    border: 1px solid var(--ccb-border);
    color: var(--ccb-text);
}

.ccb-btn-secondary:hover {
    background: var(--ccb-surface-hover);
}

.ccb-btn-tertiary {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ccb-muted-strong);
}

.ccb-btn-tertiary:hover {
    background: var(--ccb-surface-hover);
    color: var(--ccb-text);
}

.ccb-close,
.ccb-back-link {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ccb-muted);
    padding: 0;
    transition: background-color 160ms ease, color 160ms ease;
}

.ccb-close:hover,
.ccb-back-link:hover {
    background: var(--ccb-surface-hover);
    color: var(--ccb-text);
}

.ccb-close[hidden] {
    display: none;
}

.ccb-icon-mask {
    display: inline-block;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.ccb-preferences-panel {
    display: none;
    min-height: 0;
}

.ccb-settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--ccb-border-soft);
}

.ccb-settings-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ccb-settings-heading .ccb-preferences-title {
    font-size: 14px;
}

.ccb-settings-heading .ccb-preferences-text {
    font-size: 12px;
}

.ccb-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    overflow: auto;
}

.ccb-consent-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--ccb-border-soft);
    border-radius: var(--ccb-radius-md);
    background: var(--ccb-surface);
}

.ccb-consent-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccb-consent-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ccb-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.ccb-consent-row p {
    margin: 0;
    color: var(--ccb-muted);
    font-size: 12px;
    line-height: 1.55;
}

.ccb-always-active {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--ccb-surface-soft);
    color: var(--ccb-muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

.ccb-switch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.ccb-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ccb-switch-track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d4d4d8;
    transition: box-shadow 160ms ease;
}

.ccb-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(24, 24, 27, 0.2);
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.ccb-switch input:checked + .ccb-switch-track {
    background: var(--ccb-primary);
}

.ccb-switch input:checked + .ccb-switch-track .ccb-switch-thumb {
    transform: translateX(18px);
}

.ccb-switch input:disabled + .ccb-switch-track {
    opacity: 0.65;
    cursor: not-allowed;
}

.ccb-modal.hiding {
    animation: ccb-modal-out 180ms ease-in forwards;
}

@keyframes ccb-card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ccb-modal-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.ccb-preferences-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ccb-preferences-widget-wrap {
    position: fixed;
    z-index: 999998;
    bottom: 20px;
    color: var(--ccb-text);
    pointer-events: none;
}

.ccb-preferences-widget-wrap[hidden] {
    display: none !important;
}

.ccb-widget-bottom-left {
    left: 20px;
}

.ccb-widget-bottom-right {
    right: 20px;
}

.ccb-preferences-widget-wrap .ccb-preferences-widget {
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--ccb-border);
    border-radius: 999px;
    background: var(--ccb-surface-translucent);
    box-shadow: 0 12px 32px rgba(24, 24, 27, 0.14);
    color: var(--ccb-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.ccb-preferences-widget-wrap .ccb-preferences-widget:hover {
    background: var(--ccb-surface);
    border-color: var(--ccb-border);
    box-shadow: 0 16px 40px rgba(24, 24, 27, 0.18);
}

.ccb-preferences-widget .ccb-icon {
    display: inline-flex;
    line-height: 1;
    color: inherit;
    flex-shrink: 0;
}

.ccb-preferences-widget.ccb-only-icon .ccb-icon {
    margin-right: 0;
}

.ccb-preferences-widget .ccb-icon-svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 860px) {
    .ccb-modal[data-layout="banner"] .ccb-main-view {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .ccb-modal[data-layout="banner"] .ccb-modal-buttons {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .ccb-modal {
        padding: 12px;
    }

    .ccb-modal-content,
    .ccb-modal[data-view="settings"] .ccb-modal-content {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }

    .ccb-main-view {
        padding: 20px;
    }

    .ccb-modal[data-layout="banner"] {
        padding: 12px;
    }

    .ccb-modal[data-layout="banner"] .ccb-main-view {
        flex-direction: column;
    }

    .ccb-modal[data-layout="banner"] .ccb-main-copy {
        width: 100%;
        min-width: 0;
        flex: 0 1 auto;
    }

    .ccb-modal-buttons,
    .ccb-settings-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .ccb-btn {
        width: 100%;
        white-space: normal;
    }

    .ccb-consent-row {
        align-items: center;
    }

    .ccb-settings-header,
    .ccb-settings-list,
    .ccb-settings-actions {
        padding: 16px;
    }

    .ccb-preferences-widget-wrap {
        bottom: 12px;
    }

    .ccb-widget-bottom-left {
        left: 12px;
    }

    .ccb-widget-bottom-right {
        right: 12px;
    }
}
