.kscc-root,
.kscc-root * {
    box-sizing: border-box;
}

.kscc-root {
    --kscc-bg: rgba(255, 255, 255, .94);
    --kscc-card: rgba(246, 249, 255, .98);
    --kscc-line: rgba(44, 88, 208, .18);
    --kscc-text: #2C58D0;
    --kscc-muted: rgba(44, 88, 208, .72);
    --kscc-shadow: 0 28px 90px rgba(0, 0, 0, .45);
    font-family: inherit;
    color: var(--kscc-text);
    position: relative;
    z-index: 999999;
}

.kscc-light {
    --kscc-bg: rgba(255, 255, 255, .94);
    --kscc-card: rgba(255, 255, 255, .96);
    --kscc-line: rgba(44, 88, 208, .16);
    --kscc-text: #2C58D0;
    --kscc-muted: rgba(44, 88, 208, .72);
}

.kscc-banner {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 22px;
    border: 1px solid var(--kscc-line);
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--kscc-accent) 26%, transparent), transparent 34%),
        linear-gradient(135deg, var(--kscc-bg), var(--kscc-card));
    box-shadow: var(--kscc-shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.kscc-position-top .kscc-banner {
    top: 24px;
    bottom: auto;
}

.kscc-banner h2,
.kscc-modal h2 {
    margin: 7px 0 8px;
    color: var(--kscc-text);
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.15;
    letter-spacing: -.03em;
}

.kscc-banner p,
.kscc-modal p {
    margin: 0;
    color: var(--kscc-muted);
    font-size: 14px;
    line-height: 1.65;
}

.kscc-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--kscc-text);
    background: color-mix(in srgb, var(--kscc-accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--kscc-accent) 28%, transparent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.kscc-policy-link {
    display: inline-flex;
    margin-top: 10px;
    color: var(--kscc-accent);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.kscc-banner-actions,
.kscc-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.kscc-banner-actions {
    min-width: 300px;
}

.kscc-btn,
.kscc-shortcode-button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    min-height: 42px;
    padding: 11px 16px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.kscc-btn:hover,
.kscc-shortcode-button:hover,
.kscc-reopen:hover {
    transform: translateY(-1px);
}

.kscc-btn-primary,
.kscc-shortcode-button {
    background: linear-gradient(135deg, var(--kscc-accent), color-mix(in srgb, var(--kscc-accent) 70%, #ffffff));
    color: #ffffff;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--kscc-accent) 30%, transparent);
}

.kscc-btn-soft {
    background: rgba(255, 255, 255, .09);
    border-color: var(--kscc-line);
    color: var(--kscc-text);
}

.kscc-btn-ghost {
    background: transparent;
    border-color: var(--kscc-line);
    color: var(--kscc-muted);
}

.kscc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(44, 88, 208, .22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999998;
}

.kscc-modal {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    border: 1px solid var(--kscc-line);
    border-radius: 30px;
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--kscc-accent) 18%, transparent), transparent 32%),
        linear-gradient(135deg, var(--kscc-bg), var(--kscc-card));
    box-shadow: var(--kscc-shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    z-index: 999999;
}

.kscc-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--kscc-line);
    background: rgba(255, 255, 255, .08);
    color: var(--kscc-text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.kscc-modal-intro {
    margin-bottom: 18px !important;
}

.kscc-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: 12px 0;
    padding: 16px;
    border: 1px solid var(--kscc-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .06);
}

.kscc-category strong {
    display: block;
    margin: 0 0 5px;
    color: var(--kscc-text);
    font-size: 15px;
}

.kscc-switch {
    position: relative;
    display: inline-flex;
    width: 56px;
    height: 32px;
}

.kscc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kscc-switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid var(--kscc-line);
    transition: .2s ease;
}

.kscc-switch span:before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: .2s ease;
}

.kscc-switch input:checked + span {
    background: var(--kscc-accent);
}

.kscc-switch input:checked + span:before {
    transform: translateX(24px);
}

.kscc-switch input:disabled + span {
    cursor: not-allowed;
    opacity: .72;
}

.kscc-modal-actions {
    margin-top: 18px;
}


/*
 * Reopen handle: hard reset against theme / Elementor / mobile menu button styles.
 * This must stay as a thin left-edge pull tab, not a round button.
 */
#kscc-root .kscc-reopen {
    all: unset !important;
    box-sizing: border-box !important;
    position: fixed !important;
    left: 0 !important;
    right: auto !important;
    top: calc(55% + 40px) !important;
    bottom: auto !important;
    width: 42px !important;
    height: 96px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(158, 182, 244, .72) !important;
    border-left: 0 !important;
    border-radius: 0 14px 14px 0 !important;
    background: linear-gradient(180deg, #9EB6F4, #2C58D0) !important;
    box-shadow: 10px 14px 28px rgba(44, 88, 208, .22) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
    cursor: grab !important;
    z-index: 999997 !important;
    opacity: .94 !important;
    transform: translate3d(0, -50%, 0) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    transition: opacity .14s ease, box-shadow .14s ease, transform .14s ease !important;
}

#kscc-root .kscc-reopen::before {
    content: '' !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 12px !important;
    height: 12px !important;
    border: 0 !important;
    border-top: 3px solid rgba(255, 255, 255, .96) !important;
    border-right: 3px solid rgba(255, 255, 255, .96) !important;
    border-radius: 1px !important;
    transform: translate(-50%, -50%) rotate(45deg) !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .26)) !important;
}

#kscc-root .kscc-reopen::after {
    content: none !important;
    display: none !important;
}

#kscc-root .kscc-reopen:hover,
#kscc-root .kscc-reopen:focus-visible,
#kscc-root .kscc-reopen.kscc-dragging {
    width: 32px !important;
    height: 96px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    opacity: 1 !important;
    color: transparent !important;
    box-shadow: 12px 16px 30px rgba(44, 88, 208, .28) !important;
}

#kscc-root .kscc-reopen:active,
#kscc-root .kscc-reopen.kscc-dragging {
    cursor: grabbing !important;
}


.kscc-pull-preview {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    max-width: min(390px, 92vw);
    pointer-events: none;
    z-index: 999996;
    opacity: 0;
    border-radius: 0 26px 26px 0;
    background:
        radial-gradient(circle at 0% 30%, color-mix(in srgb, var(--kscc-accent) 20%, transparent), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(158, 182, 244, .88));
    border-right: 1px solid rgba(44, 88, 208, .20);
    box-shadow: 18px 0 44px rgba(0, 0, 0, .34);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity .12s ease, width .12s ease;
}

.kscc-pull-preview.kscc-pull-preview-active {
    opacity: 1;
}

.kscc-policy-content {
    max-width: 920px;
    line-height: 1.8;
}

@media (max-width: 782px) {
    .kscc-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: 22px;
    }

    .kscc-position-top .kscc-banner {
        top: 12px;
    }

    .kscc-banner-actions {
        min-width: 0;
        justify-content: stretch;
    }

    .kscc-banner-actions .kscc-btn,
    .kscc-modal-actions .kscc-btn {
        width: 100%;
    }

    .kscc-modal {
        inset: 0 auto 0 0;
        width: min(390px, 92vw);
        max-height: 100dvh;
        height: 100dvh;
        padding: 22px;
        border-radius: 0 26px 26px 0;
        transform: translateX(0);
        animation: kscc-drawer-in .22s ease-out both;
    }

    .kscc-category {
        grid-template-columns: 1fr;
    }

    #kscc-root .kscc-reopen,
    #kscc-root .kscc-reopen:hover,
    #kscc-root .kscc-reopen:focus-visible,
    #kscc-root .kscc-reopen.kscc-dragging {
        left: 0 !important;
        top: calc(55% + 40px) !important;
        width: 40px !important;
        height: 92px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        min-height: 92px !important;
        max-height: 92px !important;
        border-radius: 0 13px 13px 0 !important;
        transform: translate3d(0, -50%, 0) !important;
    }

    #kscc-root .kscc-reopen::before {
        left: 50% !important;
        top: 50% !important;
        width: 11px !important;
        height: 11px !important;
        border-top-width: 3px !important;
        border-right-width: 3px !important;
    }

    .kscc-pull-preview {
        max-width: min(390px, 92vw);
        border-radius: 0 24px 24px 0;
    }

    @keyframes kscc-drawer-in {
        from { transform: translateX(-104%); }
        to { transform: translateX(0); }
    }
}
