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

.acm-modal-open {
    overflow: hidden;
}

.acm-banner {
    position: fixed;
    z-index: 999999;
    right: 20px;
    bottom: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
    color: var(--acm-text);
    background: var(--acm-bg);
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    font-family: inherit;
}

.acm-banner[hidden],
.acm-modal[hidden] {
    display: none !important;
}

.acm-banner h2,
.acm-modal h2,
.acm-modal h3 {
    color: var(--acm-primary);
    margin-top: 0;
}

.acm-banner h2 {
    margin-bottom: 8px;
    font-size: 21px;
}

.acm-banner p,
.acm-modal p {
    margin: 0;
    line-height: 1.55;
}

.acm-banner__actions,
.acm-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.acm-btn,
.acm-open-preferences,
.acm-floating-link,
.acm-modal__close {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.acm-btn {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 9px;
    font-weight: 700;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.acm-btn:hover {
    transform: translateY(-1px);
}

.acm-btn:focus-visible,
.acm-open-preferences:focus-visible,
.acm-floating-link:focus-visible,
.acm-modal__close:focus-visible,
.acm-switch input:focus-visible + span {
    outline: 3px solid var(--acm-accent);
    outline-offset: 2px;
}

.acm-btn--primary {
    color: #fff;
    background: var(--acm-primary);
}

.acm-btn--secondary {
    color: var(--acm-primary);
    background: rgba(17, 24, 39, 0.08);
}

.acm-btn--outline {
    color: var(--acm-primary);
    background: transparent;
    border: 1px solid currentColor;
}

.acm-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
    font-size: 13px;
}

.acm-legal-links a {
    color: var(--acm-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.acm-modal {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.acm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
}

.acm-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    color: var(--acm-text);
    background: var(--acm-bg);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
}

.acm-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    color: var(--acm-primary);
    background: transparent;
    font-size: 28px;
    line-height: 1;
}

.acm-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 12px;
}

.acm-category h3 {
    margin-bottom: 5px;
    font-size: 17px;
}

.acm-category p {
    font-size: 14px;
}

.acm-always-active {
    color: #166534;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.acm-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 27px;
}

.acm-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.acm-switch span {
    position: absolute;
    inset: 0;
    background: #9ca3af;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.acm-switch span::before {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 19px;
    height: 19px;
    content: '';
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.acm-switch input:checked + span {
    background: var(--acm-primary);
}

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

.acm-modal__actions {
    margin-top: 24px;
}

.acm-floating-link {
    position: fixed;
    z-index: 999998;
    left: 14px;
    bottom: 12px;
    padding: 7px 10px;
    color: var(--acm-primary);
    background: var(--acm-bg);
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 7px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

.acm-open-preferences {
    color: inherit;
    background: transparent;
    text-decoration: underline;
}

@media (max-width: 780px) {
    .acm-banner {
        grid-template-columns: 1fr;
        gap: 16px;
        right: 10px;
        bottom: 10px;
        left: 10px;
        padding: 18px;
    }

    .acm-banner__actions,
    .acm-modal__actions {
        justify-content: stretch;
    }

    .acm-banner__actions .acm-btn,
    .acm-modal__actions .acm-btn {
        flex: 1 1 100%;
    }

    .acm-modal {
        padding: 10px;
    }

    .acm-modal__dialog {
        max-height: calc(100vh - 20px);
        padding: 24px 18px;
    }

    .acm-category {
        padding: 15px;
    }
}
