.cookie-consent {
    --cc-primary: #3339ff;
    --cc-primary-hover: #262bd9;
    --cc-primary-soft: rgba(51, 57, 255, 0.1);
    --cc-surface: rgba(255, 255, 255, 0.92);
    --cc-border: rgba(23, 26, 43, 0.08);
    --cc-title: #171a2b;
    --cc-text: #5d6275;

    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    width: min(440px, calc(100vw - 32px));
    padding: 22px 22px 20px;
    overflow: hidden;
    color: var(--cc-title);
    background: var(--cc-surface) !important;
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--cc-border);
    border-radius: 8px;
    box-shadow:
        0 1px 2px rgba(20, 25, 50, 0.06),
        0 24px 60px -12px rgba(20, 25, 50, 0.28);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
    animation: cookie-consent-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

/* Subtle brand accent along the top edge */
.cookie-consent::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cc-primary), #8a8eff 60%, transparent);
}

.cookie-consent.is-hiding {
    animation: cookie-consent-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

.cookie-consent * {
    box-sizing: border-box;
}

.cookie-consent__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--cc-primary);
    background: var(--cc-primary-soft);
    border-radius: 6px;
}

.cookie-consent__icon svg {
    width: 26px;
    height: 26px;
    animation: cookie-consent-wiggle 0.9s ease-in-out 1s both;
}

.cookie-consent__title {
    margin: 0 0 4px;
    padding: 0;
    color: var(--cc-title);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.cookie-consent__message {
    margin: 0;
    color: var(--cc-text);
}

.cookie-consent__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
}

.cookie-consent__readmore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cc-primary);
    font-weight: 600;
    text-decoration: none;
}

.cookie-consent__readmore::after {
    content: "→";
    transition: transform 0.15s ease;
}

.cookie-consent__readmore:hover,
.cookie-consent__readmore:focus {
    color: var(--cc-primary-hover);
    text-decoration: none;
}

.cookie-consent__readmore:hover::after {
    transform: translateX(3px);
}

.cookie-consent__agree {
    flex-shrink: 0;
    padding: 10px 18px;
    color: #ffffff;
    background: var(--cc-primary);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 16px -6px rgba(51, 57, 255, 0.6);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cookie-consent__agree:hover {
    background: var(--cc-primary-hover);
    box-shadow: 0 10px 22px -8px rgba(51, 57, 255, 0.7);
    transform: translateY(-1px);
}

.cookie-consent__agree:active {
    transform: translateY(0);
}

.cookie-consent__agree:focus-visible,
.cookie-consent__readmore:focus-visible {
    outline: 3px solid rgba(51, 57, 255, 0.35);
    outline-offset: 3px;
}

@keyframes cookie-consent-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cookie-consent-out {
    to {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

@keyframes cookie-consent-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-5deg); }
}

/* Light by default (legacy layouts). Dark only when the app itself is in dark mode. */
.dark .cookie-consent {
    --cc-primary: #7b80ff;
    --cc-primary-hover: #9599ff;
    --cc-primary-soft: rgba(123, 128, 255, 0.16);
    --cc-surface: rgba(24, 26, 38, 0.92);
    --cc-border: rgba(255, 255, 255, 0.08);
    --cc-title: #f3f4f8;
    --cc-text: #a9adbf;
}

.dark .cookie-consent__agree {
    color: #0f1020;
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent,
    .cookie-consent.is-hiding,
    .cookie-consent__icon svg {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
    }
}

@media (max-width: 600px) {
    .cookie-consent {
        right: 12px;
        bottom: 12px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        width: calc(100vw - 24px);
        padding: 18px;
        border-radius: 8px;
    }

    .cookie-consent__icon {
        width: 40px;
        height: 40px;
        border-radius: 6px;
    }

    .cookie-consent__icon svg {
        width: 22px;
        height: 22px;
    }

    .cookie-consent__actions {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .cookie-consent__agree {
        width: 100%;
        padding: 12px 18px;
    }

    .cookie-consent__readmore {
        justify-content: center;
    }
}
