.koritec-consent {
    --consent-green: #2e782e;
    --consent-green-dark: #235c25;
    --consent-text: #f4f8f5;
    --consent-motion: 180ms;
    position: fixed;
    right: max(1.6rem, env(safe-area-inset-right));
    bottom: max(1.6rem, env(safe-area-inset-bottom));
    z-index: 900;
    max-width: calc(100vw - 3.2rem);
    color: var(--consent-text);
}

.koritec-consent:popover-open {
    top: auto;
    left: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
}

.koritec-consent [hidden] {
    display: none !important;
}

.koritec-consent section,
.koritec-consent button[data-action="open"] {
    background: linear-gradient(145deg, rgba(25, 55, 43, .88), rgba(12, 32, 25, .94));
    border: 1px solid rgba(220, 240, 226, .32);
    box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 8px 32px rgba(10, 32, 20, .28);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
}

.koritec-consent section {
    box-sizing: border-box;
    width: 42rem;
    max-width: 100%;
    max-height: 75vh;
    max-height: 75dvh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: clamp(1.6rem, 4vw, 2.6rem);
    border-radius: 2rem;
    animation: koritec-consent-appear var(--consent-motion) ease-out;
}

.koritec-consent h2 {
    margin: 0 0 .8rem;
    color: var(--consent-text);
}

.koritec-consent p {
    margin: 0;
}

.koritec-consent fieldset {
    margin: 1.6rem 0;
    padding: 0;
    border: 0;
}

.koritec-consent-category {
    margin-top: 1.2rem;
}

.koritec-consent-category label {
    display: block;
    font-weight: 600;
}

.koritec-consent-category p,
.koritec-consent-category details {
    margin: .3rem 0 0 1.8rem;
}

.koritec-consent-category details {
    margin-top: .6rem;
    border: 1px solid rgba(220, 240, 226, .24);
    border-radius: .9rem;
    background: rgba(220, 240, 226, .06);
}

.koritec-consent-category summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.4rem;
    box-sizing: border-box;
    padding: .7rem 1.2rem;
    border-radius: inherit;
    cursor: pointer;
    list-style: none;
    transition: background-color var(--consent-motion) ease;
}

.koritec-consent-category summary::-webkit-details-marker {
    display: none;
}

.koritec-consent-category summary:hover,
.koritec-consent-category details[open] > summary {
    background-color: rgba(220, 240, 226, .1);
}

.koritec-consent-category summary::after {
    content: "";
    flex: 0 0 .65rem;
    height: .65rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: translateY(-.2rem) rotate(45deg);
    transition: transform var(--consent-motion) ease;
}

.koritec-consent-category details[open] > summary::after {
    transform: translateY(.2rem) rotate(225deg);
}

.koritec-consent-category dl {
    margin: 0;
    padding: 1rem 1.2rem;
    overflow-wrap: anywhere;
}

.koritec-consent-category dt {
    font-weight: 600;
}

.koritec-consent-category dd {
    margin: .3rem 0 0;
}

.koritec-consent-category dd + dt {
    margin-top: .8rem;
}

.koritec-consent-category dd span {
    display: block;
}

@supports selector(details::details-content) and (interpolate-size: allow-keywords) {
    .koritec-consent-category details::details-content {
        interpolate-size: allow-keywords;
        block-size: 0;
        overflow: hidden;
        opacity: 0;
        transition: block-size var(--consent-motion) ease,
            opacity var(--consent-motion) ease,
            content-visibility var(--consent-motion) allow-discrete;
    }

    .koritec-consent-category details[open]::details-content {
        block-size: auto;
        opacity: 1;
    }
}

@supports not (selector(details::details-content) and (interpolate-size: allow-keywords)) {
    .koritec-consent-category details[open] dl {
        animation: koritec-consent-appear var(--consent-motion) ease-out;
    }
}

.koritec-consent input[type="checkbox"] {
    accent-color: var(--consent-green);
}

.koritec-consent-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .8rem 1.6rem;
    margin-top: 1.6rem;
}

.koritec-consent button.koritec-consent-primary {
    min-height: 4.4rem;
    padding: .8rem 1.8rem;
    background: linear-gradient(var(--consent-green), var(--consent-green-dark));
    color: #fff;
    border: 1px solid var(--consent-green-dark);
    border-radius: 999px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .22), 0 4px 12px rgba(42, 59, 13, .2);
}

.koritec-consent button.koritec-consent-primary:hover {
    background: var(--consent-green-dark);
}

.koritec-consent button.koritec-consent-link {
    min-height: 4.4rem;
    padding: 0;
    background: transparent;
    color: var(--consent-text);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: .2em;
}

#koritec-consent-summary .koritec-consent-primary {
    width: 100%;
}

#koritec-consent-summary .koritec-consent-link {
    text-decoration: none;
}

.koritec-consent button[data-action="open"] {
    min-height: 4.4rem;
    padding: .8rem 1.4rem;
    color: var(--consent-text);
    border-radius: 999px;
    transition: opacity var(--consent-motion) ease, visibility var(--consent-motion);
}

.koritec-consent button.koritec-consent-opener-faded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes koritec-consent-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .koritec-consent {
        --consent-motion: 0ms;
    }
}

.koritec-consent button:focus-visible,
.koritec-consent input:focus-visible,
.koritec-consent summary:focus-visible {
    outline: 2px solid #c9ebc7;
    outline-offset: 3px;
}
