/*
 * Cookie banner and settings dialog (Magelan_SwissupGdprHyva).
 * Colours come from the Degriz theme tokens when present (--accent), with the dark palette as fallback.
 */
.mcc {
    --mcc-bg: #141416;
    --mcc-panel: #1c1c1f;
    --mcc-ink: #f5f4f1;
    --mcc-muted: #a1a1a6;
    --mcc-line: rgba(245, 244, 241, .14);
    --mcc-accent: var(--accent, #f26322);
    font-family: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--mcc-ink);
}

.mcc *,
.mcc *::before,
.mcc *::after {
    box-sizing: border-box;
}

/*
 * Banner: a fixed wrapper (bottom left) holding the box and, next to it, the round icon button. Scrolling shrinks the box
 * into the icon (clip-path morph, shopify.com style). Collapsing is UI only, it never stores a consent choice.
 */
.mcc-banner {
    --mcc-edge: 16px;
    --mcc-fab: 52px;
    --mcc-min-bottom: var(--mcc-edge);
    position: fixed;
    left: var(--mcc-edge);
    bottom: var(--mcc-edge);
    z-index: 9000;
    width: min(1040px, calc(100vw - 120px)); /* leaves the bottom right corner to the chat box */
    font-size: 14px;
    line-height: 1.5;
    pointer-events: none;
    transition: bottom .45s cubic-bezier(.2, .7, .1, 1);
}

.mcc-banner-box {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
    padding: 18px 56px 18px 22px;
    background: var(--mcc-bg);
    border: 1px solid var(--mcc-line);
    border-radius: 18px;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .65);
    pointer-events: auto;
    clip-path: inset(-80px round 18px);
    transition: clip-path .5s cubic-bezier(.65, 0, .2, 1), visibility 0s;
    animation: mcc-rise .35s cubic-bezier(.2, .7, .1, 1);
}

.mcc-banner-box > * {
    transition: opacity .2s ease;
}

.mcc-min {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mcc-muted);
    cursor: pointer;
}

.mcc-min:hover {
    color: var(--mcc-ink);
    background: rgba(245, 244, 241, .08);
}

.mcc-fab {
    position: fixed;
    left: var(--mcc-edge);
    bottom: var(--mcc-min-bottom);
    display: grid;
    place-items: center;
    width: var(--mcc-fab);
    height: var(--mcc-fab);
    padding: 0;
    border: 1px solid var(--mcc-line);
    border-radius: 50%;
    background: var(--mcc-bg);
    color: var(--mcc-accent);
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, .6);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(.9);
    transition: opacity .2s ease, transform .2s ease, border-color .2s;
}

.mcc-fab:hover {
    border-color: var(--mcc-accent);
    transform: scale(1.06);
}

/* collapsed: the box clips down to the icon's circle, its content fades, then the icon takes over */
.mcc-banner-is-min {
    bottom: var(--mcc-min-bottom);
}

.mcc-banner-is-min .mcc-banner-box {
    clip-path: inset(calc(100% - var(--mcc-fab)) calc(100% - var(--mcc-fab)) 0 0 round calc(var(--mcc-fab) / 2));
    visibility: hidden;
    transition: clip-path .5s cubic-bezier(.65, 0, .2, 1), visibility 0s .5s;
    pointer-events: none;
    animation: none;
}

.mcc-banner-is-min .mcc-banner-box > * {
    opacity: 0;
}

.mcc-banner-is-min .mcc-fab {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: opacity .25s ease .3s, transform .25s ease .3s, border-color .2s;
}

.mcc-banner-is-min .mcc-fab:hover {
    transform: scale(1.06);
    transition-delay: 0s;
}

.mcc-banner-text {
    flex: 1 1 360px;
    min-width: 0;
    color: var(--mcc-muted);
}

.mcc-banner-text p {
    margin: 0;
}

.mcc-banner-text h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mcc-ink);
}

.mcc-banner-text a {
    color: var(--mcc-ink);
    text-decoration: underline;
    text-decoration-color: var(--mcc-accent);
    text-underline-offset: 3px;
}

.mcc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mcc-btn {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--mcc-line);
    background: transparent;
    color: var(--mcc-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background .2s, filter .2s;
}

.mcc-btn:hover {
    border-color: rgba(245, 244, 241, .4);
}

.mcc-btn-primary {
    border-color: transparent;
    background: linear-gradient(0deg, #db5518 0%, var(--mcc-accent) 100%);
    color: #fff;
}

.mcc-btn-primary:hover {
    border-color: transparent;
    filter: brightness(1.08);
}

.mcc-btn-ghost {
    border-color: transparent;
    color: var(--mcc-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mcc-btn-ghost:hover {
    border-color: transparent;
    color: var(--mcc-ink);
}

.mcc button:focus-visible,
.mcc summary:focus-visible,
.mcc input:focus-visible + .mcc-track {
    outline: 2px solid var(--mcc-accent);
    outline-offset: 2px;
}

.mcc-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .66);
}

.mcc-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    background: var(--mcc-bg);
    border: 1px solid var(--mcc-line);
    border-radius: 20px;
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .7);
    font-size: 14px;
    line-height: 1.5;
}

.mcc-dialog:focus {
    outline: none;
}

.mcc-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--mcc-line);
}

.mcc-dialog-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--mcc-ink);
}

.mcc-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mcc-muted);
    cursor: pointer;
}

.mcc-close:hover {
    color: var(--mcc-ink);
    background: rgba(245, 244, 241, .08);
}

.mcc-dialog-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 22px;
}

.mcc-group {
    padding: 16px 0;
    border-bottom: 1px solid var(--mcc-line);
}

.mcc-group:last-child {
    border-bottom: 0;
}

.mcc-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mcc-group-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mcc-ink);
}

.mcc-always {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mcc-accent);
}

.mcc-group-desc {
    margin: 6px 0 0;
    color: var(--mcc-muted);
}

.mcc-switch {
    position: relative;
    display: inline-block;
    flex: none;
    width: 46px;
    height: 26px;
    cursor: pointer;
}

.mcc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.mcc-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #3a3a3f;
    transition: background .2s;
    pointer-events: none;
}

.mcc-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
}

.mcc-switch input:checked + .mcc-track {
    background: var(--mcc-accent);
}

.mcc-switch input:checked + .mcc-track::after {
    transform: translateX(20px);
}

.mcc-cookies {
    margin-top: 10px;
    color: var(--mcc-muted);
}

.mcc-cookies summary {
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mcc-cookies table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 12.5px;
}

.mcc-cookies th,
.mcc-cookies td {
    padding: 6px 8px 6px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--mcc-line);
    word-break: break-word;
}

.mcc-cookies th {
    font-weight: 600;
    color: var(--mcc-ink);
}

.mcc-dialog-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid var(--mcc-line);
}

@keyframes mcc-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {
    .mcc-banner {
        --mcc-edge: 8px;
        left: 8px;
        width: calc(100vw - 16px);
        bottom: 94px; /* above the corner box (AI launcher) */
    }

    .mcc-banner-box {
        padding: 14px 14px 14px 14px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }

    .mcc-banner-text {
        padding-right: 28px;
    }

    .mcc-actions {
        width: 100%;
    }

    .mcc-actions .mcc-btn-primary {
        flex: 1 1 100%;
    }

    .mcc-actions .mcc-btn:not(.mcc-btn-primary) {
        flex: 1 1 calc(50% - 4px);
        padding: 0 10px;
    }

    .mcc-dialog-body,
    .mcc-dialog-head,
    .mcc-dialog-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mcc-dialog-foot .mcc-btn {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mcc-banner,
    .mcc-banner-box,
    .mcc-banner-box > *,
    .mcc-fab,
    .mcc-banner-is-min .mcc-fab {
        animation: none;
        transition: none !important;
    }

    .mcc-track,
    .mcc-track::after {
        transition: none;
    }
}

/* blog posts show a reading-progress pill in the same corner: the icon sits above it */
body:has(.xa-pill) .mcc-banner {
    --mcc-min-bottom: 76px;
}

body:has(.xa-pill) .mcc-fab {
    --mcc-min-bottom: 76px;
}
