.subscription-restriction-modal {
    --restriction-primary: #3d4895;
    --restriction-primary-dark: #303a7d;
    --restriction-accent: #ef4b3f;
    --restriction-text: #252637;
    --restriction-muted: #747687;
    --restriction-border: #e4e6ed;
    --restriction-soft: #f6f7fb;
    --restriction-warning: #bd7916;
    --restriction-warning-soft: #fff7e7;

    position: fixed;
    z-index: 10050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(22, 25, 46, 0.58);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.subscription-restriction-modal[hidden] {
    display: none !important;
}

.subscription-restriction-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.subscription-restriction-modal *,
.subscription-restriction-modal *::before,
.subscription-restriction-modal *::after {
    box-sizing: border-box;
}

.subscription-restriction-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 34px 36px 32px;
    border: 1px solid rgba(61, 72, 149, 0.1);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(23, 27, 58, 0.28);
    color: var(--restriction-text);
    font-family: inherit;
    text-align: center;
    opacity: 0;
    outline: none;
    transform: translateY(14px) scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.subscription-restriction-modal.is-open .subscription-restriction-modal__dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.subscription-restriction-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #737686;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.subscription-restriction-modal__close:hover,
.subscription-restriction-modal__close:focus {
    background: #f0f1f5;
    color: var(--restriction-primary);
    outline: none;
}

.subscription-restriction-modal__close span::before,
.subscription-restriction-modal__close span::after {
    position: absolute;
    top: 16px;
    left: 10px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: '';
}

.subscription-restriction-modal__close span::before {
    transform: rotate(45deg);
}

.subscription-restriction-modal__close span::after {
    transform: rotate(-45deg);
}

.subscription-restriction-modal__icon {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 0 auto 17px;
    border-radius: 50%;
    background: #ca3234;
}

/* Lock body */
.subscription-restriction-modal__icon::before {
    position: absolute;
    top: 31px;
    left: 22px;
    width: 24px;
    height: 21px;
    border: 2px solid white;
    border-radius: 4px;
    background: #ffffff;
    content: '';
}

/* Lock shackle */
.subscription-restriction-modal__icon::after {
    position: absolute;
    top: 17px;
    left: 27px;
    width: 14px;
    height: 17px;
    border: 2px solid white;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    content: '';
}

.subscription-restriction-modal--limit .subscription-restriction-modal__icon {
    background: var(--restriction-warning-soft);
}

.subscription-restriction-modal--limit .subscription-restriction-modal__icon::before,
.subscription-restriction-modal--limit .subscription-restriction-modal__icon::after {
    border-color: var(--restriction-warning);
}

.subscription-restriction-modal__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--restriction-primary);
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subscription-restriction-modal__title {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--restriction-text);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.subscription-restriction-modal__feature {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--restriction-border);
    border-radius: 7px;
    background: var(--restriction-soft);
    text-align: left;
}

.subscription-restriction-modal__feature-caption {
    flex: 0 0 auto;
    color: var(--restriction-muted);
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.subscription-restriction-modal__feature-name {
    min-width: 0;
    color: var(--restriction-text);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-align: right;
}

.subscription-restriction-modal__message {
    margin: 17px 0 0;
    font-family: 'Roboto', sans-serif;
    color: var(--restriction-muted);
    font-size: 14px;
    line-height: 1.55;
}

.subscription-restriction-modal__usage {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--restriction-border);
    border-radius: 7px;
    background: #fafbfc;
    text-align: left;
}

.subscription-restriction-modal__usage[hidden] {
    display: none !important;
}

.subscription-restriction-modal__usage-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.subscription-restriction-modal__usage-value {
    font-family: 'Roboto', sans-serif;
    color: var(--restriction-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.subscription-restriction-modal__usage-remaining {
    font-family: 'Roboto', sans-serif;
    color: var(--restriction-muted);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.subscription-restriction-modal--limit .subscription-restriction-modal__usage-remaining {
    color: var(--restriction-warning);
    font-weight: 600;
}

.subscription-restriction-modal__progress {
    display: block;
    width: 100%;
    height: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #e7e8ee;
    color: var(--restriction-primary);
    appearance: none;
    -webkit-appearance: none;
}

.subscription-restriction-modal__progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #e7e8ee;
}

.subscription-restriction-modal__progress::-webkit-progress-value {
    border-radius: 999px;
    background: var(--restriction-warning);
}

.subscription-restriction-modal__progress::-moz-progress-bar {
    border-radius: 999px;
    background: var(--restriction-warning);
}

.subscription-restriction-modal__actions {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    gap: 11px;
    margin-top: 25px;
}

.subscription-restriction-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.subscription-restriction-modal__button:hover,
.subscription-restriction-modal__button:focus {
    outline: none;
    text-decoration: none;
    transform: translateY(-1px);
}

.subscription-restriction-modal__button--primary {
    border-color: var(--restriction-primary);
    background: var(--restriction-primary);
    color: #ffffff;
}

.subscription-restriction-modal__button--primary:hover,
.subscription-restriction-modal__button--primary:focus {
    border-color: var(--restriction-primary-dark);
    background: var(--restriction-primary-dark);
    color: #ffffff;
}

.subscription-restriction-modal__button--secondary {
    border-color: #d8dae2;
    background: #ffffff;
    color: #545766;
}

.subscription-restriction-modal__button--secondary:hover,
.subscription-restriction-modal__button--secondary:focus {
    border-color: var(--restriction-primary);
    color: var(--restriction-primary);
}

body.subscription-restriction-modal-open {
    overflow: hidden;
}

@media (max-width: 575px) {
    .subscription-restriction-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .subscription-restriction-modal__dialog {
        max-height: calc(100vh - 20px);
        padding: 32px 20px 22px;
        border-radius: 11px;
        transform: translateY(22px);
    }

    .subscription-restriction-modal__icon {
        width: 62px;
        height: 62px;
    }

    .subscription-restriction-modal__icon::before {
        top: 28px;
        left: 20px;
        width: 22px;
        height: 20px;
    }

    .subscription-restriction-modal__icon::after {
        top: 15px;
        left: 25px;
        width: 12px;
        height: 16px;
    }

    .subscription-restriction-modal__title {
        font-size: 22px;
    }

    .subscription-restriction-modal__feature {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .subscription-restriction-modal__feature-name {
        text-align: left;
    }

    .subscription-restriction-modal__usage-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .subscription-restriction-modal__usage-remaining {
        text-align: left;
    }

    .subscription-restriction-modal__actions {
        display: flex;
        flex-direction: column;
    }

    .subscription-restriction-modal__button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .subscription-restriction-modal,
    .subscription-restriction-modal__dialog,
    .subscription-restriction-modal__button {
        transition: none;
    }
}