:root {
    --cc-primary: #376e78;
    --cc-bg: #ffffff;
    --cc-text: #222222;
}

html.cc-scroll-lock, html.cc-scroll-lock body { overflow: hidden !important; }

.cc-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647;
    font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cc-text);
    display: none;
}

.cc-banner.cc-active {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
}

.cc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    will-change: opacity;
}

.cc-banner.cc-active .cc-overlay {
    opacity: 1;
    transition: opacity 0.35s ease-out;
}

.cc-container {
    position: relative;
    background: var(--cc-bg);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    will-change: transform, opacity;
    outline: none;
}

.cc-banner.cc-active .cc-container {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease-out;
}

.cc-main,
.cc-settings {
    padding: 16px;
}

.cc-view-animate {
    animation: ccViewSlide 0.2s ease-out;
}

@keyframes ccViewSlide {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cc-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--cc-text);
}

.cc-text {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 12px;
    line-height: 1.4;
}

.cc-quick-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f1f1f1;
    border-radius: 6px;
}

.cc-quick-toggle-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 3px 0;
}

.cc-quick-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: #444;
    margin-top: 0;
    line-height: 1;
}

.cc-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.cc-btn {
    flex: 1;
    padding: 11px 14px;
    min-height: 44px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cc-btn:hover {
    opacity: 0.9;
}

.cc-btn:focus,
.cc-btn:active {
    outline: none;
    box-shadow: none;
}

.cc-btn:focus-visible {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

.cc-btn-settings,
.cc-btn-reject {
    background: #ffffff;
    color: var(--cc-primary);
    border: 2px solid var(--cc-primary);
}

.cc-btn-accept {
    background: var(--cc-primary);
    color: #ffffff;
    border: 2px solid var(--cc-primary);
}

.cc-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #707070;
    flex-wrap: wrap;
}

.cc-link {
    color: #666;
    text-decoration: none;
}

.cc-link:hover {
    opacity: 0.85;
}

.cc-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.cc-separator {
    color: #ddd;
}

.cc-settings-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--cc-text);
}

.cc-quick-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.cc-quick-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--cc-primary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cc-quick-btn:hover {
    opacity: 0.9;
}

.cc-quick-btn:focus,
.cc-quick-btn:active {
    outline: none;
    box-shadow: none;
}

.cc-quick-btn:focus-visible {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

.cc-categories {
    margin: 0 0 16px;
    padding: 0 10px 0 0;
    scrollbar-gutter: stable;
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.cc-category {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.cc-category:first-child {
    border-top: 1px solid #eee;
}

.cc-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-category-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 0;
}

.cc-category-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--cc-text);
}

.cc-category-count {
    color: #707070;
    font-size: 12px;
}

.cc-expand-btn {
    width: 24px;
    height: 24px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: #707070;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.cc-expand-btn:hover {
    color: var(--cc-primary);
}

.cc-expand-btn:focus,
.cc-expand-btn:active {
    outline: none;
    box-shadow: none;
}

.cc-expand-btn:focus-visible {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

.cc-expand-btn svg {
    width: 16px;
    height: 16px;
}

.cc-category.cc-expanded .cc-expand-btn svg {
    transform: rotate(180deg);
}

.cc-category-description {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

.cc-category-details {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 11px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cc-category.cc-expanded .cc-category-details {
    display: block;
}

.cc-cookie-list {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
}

.cc-cookie-list th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    color: #555;
    font-weight: 600;
    font-size: 10px;
}

.cc-cookie-list td {
    padding: 4px 6px;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 10px;
}

.cc-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.cc-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
}

.cc-toggle input[type="checkbox"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
}

.cc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    width: 34px;
    height: 18px;
    background-color: #ccc;
    border-radius: 18px;
    transition: background-color 0.2s ease;
    border: none;
    outline: none;
    box-shadow: none;
}

.cc-toggle-slider:before {
    position: absolute;
    content: "";
    width: 14px;
    height: 14px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.cc-toggle input:checked + .cc-toggle-slider {
    background-color: var(--cc-primary);
}

.cc-toggle input:checked + .cc-toggle-slider:before {
    transform: translateY(-50%) translateX(16px);
}

.cc-toggle input:disabled + .cc-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cc-toggle input:focus-visible + .cc-toggle-slider {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

@media (max-width: 479px) {
    .cc-banner.cc-active {
        padding: 10px;
    }

    .cc-container {
        width: 100%;
        max-width: none;
    }

    .cc-main,
    .cc-settings {
        padding: 14px;
    }

    .cc-title {
        font-size: 16px;
    }

    .cc-text {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .cc-buttons {
        gap: 6px;
        margin-bottom: 8px;
    }

    .cc-btn {
        padding: 9px 10px;
        font-size: 12px;
    }

    .cc-footer {
        font-size: 11px;
        gap: 6px;
    }
}

@media (max-width: 379px) {
    .cc-banner.cc-active {
        padding: 8px;
    }

    .cc-main,
    .cc-settings {
        padding: 12px;
    }

    .cc-title {
        font-size: 15px;
    }

    .cc-btn {
        padding: 10px 8px;
        font-size: 11px;
        min-height: 44px;
    }

    .cc-categories {
        max-height: 200px;
    }

    .cc-quick-toggles {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .cc-quick-toggle-item {
        justify-content: space-between;
    }
}

@media (max-width: 359px) {
    .cc-banner.cc-active {
        padding: 6px;
    }

    .cc-main,
    .cc-settings {
        padding: 10px;
    }

    .cc-title {
        font-size: 14px;
    }

    .cc-text {
        font-size: 11px;
    }

    .cc-btn {
        padding: 10px 6px;
        font-size: 10px;
    }

    .cc-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .cc-footer {
        font-size: 10px;
        gap: 4px;
    }

    .cc-quick-btn {
        padding: 8px 10px;
        font-size: 10px;
    }

    .cc-category-name {
        font-size: 12px;
    }

    .cc-category-description {
        font-size: 11px;
    }
}

@supports (padding: env(safe-area-inset-bottom)) {
    .cc-banner.cc-active {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
        padding-left: calc(15px + env(safe-area-inset-left));
        padding-right: calc(15px + env(safe-area-inset-right));
    }

    @media (max-width: 479px) {
        .cc-banner.cc-active {
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner *,
    .cc-banner *::before,
    .cc-banner *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
