.consent-manager {
    --consent-bg: #ffffff;
    --consent-text: #1f2937;
    --consent-muted: #4b5563;
    --consent-border: #d1d5db;
    --consent-primary: #4f46e5;
    --consent-primary-hover: #4338ca;
    color: var(--consent-text);
    font-family: inherit;
    position: relative;
    z-index: 2147483000;
}

.consent-panel {
    background: var(--consent-bg);
    border: 1px solid var(--consent-border);
    border-radius: 14px;
    bottom: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
    display: grid;
    gap: 16px;
    left: 16px;
    max-height: calc(100vh - 32px);
    max-width: 760px;
    overflow: auto;
    padding: 20px;
    position: fixed;
    right: 16px;
}

.consent-panel--compact {
    -webkit-backdrop-filter: blur(18px);
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(17, 24, 39, 0.86);
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    bottom: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.3);
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    left: 50%;
    max-width: 880px;
    padding: 11px 13px;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 28px);
}

.consent-panel--compact h2 {
    color: #ffffff;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.consent-panel--compact p {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.8rem;
    line-height: 1.35;
}

.consent-panel--compact a {
    color: #c7d2fe;
    white-space: nowrap;
}

.consent-panel--compact .consent-panel__actions {
    flex-wrap: nowrap;
    gap: 6px;
}

.consent-panel--compact .consent-button {
    border-radius: 8px;
    font-size: 0.78rem;
    min-height: 34px;
    padding: 6px 10px;
    white-space: nowrap;
}

.consent-panel--compact .consent-button--primary {
    background: rgba(99, 102, 241, 0.88);
    border-color: rgba(165, 180, 252, 0.45);
}

.consent-panel--compact .consent-button--secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.consent-panel[hidden],
.consent-reopen[hidden] {
    display: none !important;
}

.consent-panel h2 {
    color: var(--consent-text);
    font-size: 1.2rem;
    line-height: 1.35;
    margin: 0 0 8px;
}

.consent-panel p {
    color: var(--consent-muted);
    font-size: 0.94rem;
    line-height: 1.55;
    margin: 0;
}

.consent-panel a {
    color: var(--consent-primary);
    text-decoration: underline;
}

.consent-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.consent-button,
.consent-reopen {
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 44px;
    padding: 10px 16px;
}

.consent-button:focus-visible,
.consent-reopen:focus-visible,
.consent-category input:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.35);
    outline-offset: 2px;
}

.consent-button--primary {
    background: var(--consent-primary);
    border: 1px solid var(--consent-primary);
    color: #ffffff;
}

.consent-button--primary:hover {
    background: var(--consent-primary-hover);
    border-color: var(--consent-primary-hover);
}

.consent-button--secondary {
    background: #ffffff;
    border: 1px solid var(--consent-border);
    color: var(--consent-text);
}

.consent-panel--settings {
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    background: rgba(17, 24, 39, 0.94);
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    bottom: 14px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.42);
    left: 12px;
    max-width: 640px;
    right: auto;
    transform: none;
    width: calc(100% - 24px);
}

.consent-panel--settings h2,
.consent-panel--settings .consent-category strong,
.consent-panel--settings .consent-category > span {
    color: #ffffff;
}

.consent-panel--settings p,
.consent-panel--settings .consent-category span span,
.consent-panel--settings .consent-category div p {
    color: rgba(255, 255, 255, 0.72);
}

.consent-panel--settings .consent-category {
    border-color: rgba(255, 255, 255, 0.14);
}

.consent-panel--settings .consent-button--secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.consent-panel--settings .consent-button--secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.consent-panel--settings .consent-category__notice {
    color: #fbbf24 !important;
}

.consent-panel--settings .consent-panel__error {
    color: #fecaca !important;
}

.consent-category {
    align-items: center;
    border-top: 1px solid var(--consent-border);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 14px 0 0;
}

.consent-category strong,
.consent-category span {
    color: var(--consent-text);
    display: block;
}

.consent-category span span,
.consent-category div p {
    color: var(--consent-muted);
    font-size: 0.88rem;
    font-weight: 400;
    margin-top: 4px;
}

.consent-category input {
    accent-color: var(--consent-primary);
    flex: 0 0 auto;
    height: 22px;
    width: 22px;
}

.consent-category__notice {
    color: #9a3412 !important;
}

.consent-panel__error {
    color: #b91c1c !important;
    font-weight: 700;
}

.consent-reopen {
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    background: rgba(17, 24, 39, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.18);
    bottom: 12px;
    box-shadow: 0 5px 20px rgba(15, 23, 42, 0.18);
    color: #ffffff;
    font-size: 0.78rem;
    left: 12px;
    min-height: 38px;
    padding: 7px 12px;
    position: fixed;
}

@media (min-width: 800px) {
    .consent-panel__error {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .consent-panel {
        border-radius: 12px 12px 0 0;
        bottom: 0;
        left: 0;
        max-height: 85vh;
        padding: 16px;
        right: 0;
    }

    .consent-panel--compact {
        border-radius: 14px;
        bottom: 8px;
        gap: 8px;
        grid-template-columns: 1fr;
        left: 8px;
        max-height: none;
        padding: 10px;
        right: 8px;
        transform: none;
        width: auto;
    }

    .consent-panel--compact .consent-panel__actions {
        display: flex;
    }

    .consent-panel--compact .consent-button {
        flex: 1 1 auto;
        padding-left: 7px;
        padding-right: 7px;
    }

    .consent-panel--settings .consent-panel__actions {
        display: grid;
    }

    .consent-panel--settings {
        border-radius: 14px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        transform: none;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consent-button,
    .consent-reopen {
        scroll-behavior: auto;
    }
}
