.thecore-cc,
.thecore-cc * {
    box-sizing: border-box;
}

.thecore-cc {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: var(--thecore-cc-root-align-items, flex-end);
    justify-content: var(--thecore-cc-root-justify-content, center);
    padding: var(--thecore-cc-root-padding, 16px);
    color: var(--thecore-cc-panel-color);
    background: var(--thecore-cc-overlay);
    font-size: 16px;
    line-height: 1.5;
}

.thecore-cc--hidden {
    display: none;
}

.thecore-cc__container {
    width: min(var(--thecore-cc-container-width, var(--thecore-cc-panel-width)), calc(100vw - var(--thecore-cc-viewport-gap, 32px)));
    height: var(--thecore-cc-container-height, auto);
    max-height: var(--thecore-cc-container-max-height, calc(100vh - var(--thecore-cc-viewport-gap, 32px)));
    overflow: var(--thecore-cc-container-overflow, auto);
    background: var(--thecore-cc-panel-background);
    color: var(--thecore-cc-panel-color);
    border-radius: var(--thecore-cc-container-radius, var(--thecore-cc-panel-radius));
    padding: var(--thecore-cc-container-padding, var(--thecore-cc-panel-padding));
    box-shadow: var(--thecore-cc-container-shadow, var(--thecore-cc-panel-shadow));
}

.thecore-cc__text {
    margin: 0;
    text-align: var(--thecore-cc-text-align, initial);
}

.thecore-cc__text > :first-child {
    margin-top: 0;
}

.thecore-cc__text > :last-child {
    margin-bottom: 0;
}

.thecore-cc__categories {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.thecore-cc__category {
    position: relative;
    padding: 16px;
    background: var(--thecore-cc-category-background);
    border: 1px solid var(--thecore-cc-category-border);
    border-radius: 16px;
    text-align: var(--thecore-cc-category-text-align, initial);
}

.thecore-cc__category input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.thecore-cc__category label {
    position: relative;
    display: inline-block;
    padding-left: 42px;
    color: inherit;
    cursor: pointer;
    font-weight: var(--thecore-cc-category-label-weight, inherit);
}

.thecore-cc__category label::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.18);
    transition: background-color 0.2s ease;
}

.thecore-cc__category label::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 7px;
    width: 12px;
    height: 7px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    opacity: 0;
    transform: rotate(-45deg);
    transition: opacity 0.2s ease;
}

.thecore-cc__category input:checked + label::before {
    background: var(--thecore-cc-accent);
}

.thecore-cc__category input:checked + label::after {
    opacity: 1;
}

.thecore-cc__category input:disabled + label {
    cursor: default;
}

.thecore-cc__category-description {
    margin: 10px 0 0 42px;
    color: inherit;
    opacity: 0.72;
}

.thecore-cc__categories--inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
    justify-content: var(--thecore-cc-categories-inline-justify, flex-start);
}

.thecore-cc__categories--inline .thecore-cc__category {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.thecore-cc__categories--inline .thecore-cc__category-description {
    display: none;
}

.thecore-cc__buttons {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    justify-content: var(--thecore-cc-buttons-justify, flex-start);
}

.thecore-cc__button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 18px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--thecore-cc-button-border);
    border-radius: var(--thecore-cc-button-radius, 0);
    background: var(--thecore-cc-button-background);
    color: var(--thecore-cc-button-color);
    transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.thecore-cc__button--inline {
    min-width: 0;
}

.thecore-cc__button:hover,
.thecore-cc__button:focus-visible {
    color: var(--thecore-cc-button-color);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.thecore-cc__accept-button {
    background: var(--thecore-cc-primary-background);
    color: var(--thecore-cc-primary-color);
    border-color: var(--thecore-cc-primary-border);
    font-weight: var(--thecore-cc-accept-button-weight, inherit);
}

.thecore-cc__accept-button:hover,
.thecore-cc__accept-button:focus-visible {
    color: var(--thecore-cc-primary-color);
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.08);
}

.thecore-cc--loading .thecore-cc__container {
    position: relative;
    overflow: hidden;
}

.thecore-cc--loading .thecore-cc__container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 1;
}

.thecore-cc--loading .thecore-cc__container::after {
    content: "";
    position: absolute;
    top: calc(50% - 20px);
    left: calc(50% - 20px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-left-color: transparent;
    border-right-color: transparent;
    animation: thecore-cc-spinner 0.75s linear infinite;
    z-index: 2;
}

.thecore-cc--editor-preview {
    position: relative;
    inset: auto;
    z-index: auto;
    display: block;
    padding: 0;
    background: transparent;
}

.thecore-cc--editor-preview .thecore-cc__container {
    width: min(var(--thecore-cc-container-width, var(--thecore-cc-panel-width)), 100%);
    height: auto;
    max-height: none;
}

.thecore-cc__embed {
    padding: 20px;
    background: var(--thecore-cc-panel-background, #ffffff);
    color: var(--thecore-cc-panel-color, #111111);
    border: 1px solid var(--thecore-cc-category-border);
    border-radius: 18px;
}

.thecore-cc__embed-blocked-notice {
    margin: 0 0 16px;
}

.thecore-cc__embed-unblock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--thecore-cc-primary-border);
    background: var(--thecore-cc-primary-background);
    color: var(--thecore-cc-primary-color);
    cursor: pointer;
    text-decoration: none;
}

.thecore-cc__embed-unblock:hover,
.thecore-cc__embed-unblock:focus-visible {
    color: var(--thecore-cc-primary-color);
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.08);
}

.thecore-cc__status {
    margin: 0;
}

@media (min-width: 768px) {
    .thecore-cc {
        padding: var(--thecore-cc-root-padding, 24px);
    }

    .thecore-cc__container {
        width: min(var(--thecore-cc-container-width, var(--thecore-cc-panel-width)), calc(100vw - var(--thecore-cc-viewport-gap, 48px)));
        max-height: var(--thecore-cc-container-max-height, calc(100vh - var(--thecore-cc-viewport-gap, 48px)));
    }

    .thecore-cc__buttons {
        flex-direction: row;
    }

    .thecore-cc__button {
        width: auto;
    }
}

@keyframes thecore-cc-spinner {
    to {
        transform: rotate(180deg);
    }
}
