.telegram-onboarding-modal {
    position: fixed;
    inset: 0;
    z-index: 1600;
    box-sizing: border-box;
}

.telegram-onboarding-modal *,
.telegram-onboarding-modal *::before,
.telegram-onboarding-modal *::after {
    box-sizing: inherit;
}

.telegram-onboarding-modal[aria-hidden="true"] {
    display: none;
}

.telegram-onboarding-modal[aria-hidden="false"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegram-onboarding-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 11, 0.72);
}

.telegram-onboarding-modal__panel {
    position: relative;
    width: min(calc(100% - 32px), 440px);
    max-height: calc(100dvh - 24px);
    margin: 16px;
    padding: 24px;
    border-radius: 8px;
    background: #ffffff;
    color: #0b0b0b;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    font-family: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    overflow-y: auto;
}

.telegram-onboarding-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(11, 11, 11, 0.66);
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.telegram-onboarding-modal__title {
    margin: 0 42px 12px 0;
    font-size: 30px;
    line-height: 1.06;
    font-weight: 900;
    letter-spacing: 0;
}

.telegram-onboarding-modal__helper,
.telegram-onboarding-modal__instruction,
.telegram-onboarding-modal__status {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.telegram-onboarding-modal__helper,
.telegram-onboarding-modal__instruction {
    color: rgba(11, 11, 11, 0.7);
}

.telegram-onboarding-modal__primary,
.telegram-onboarding-modal__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border-radius: 6px;
    font: inherit;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.telegram-onboarding-modal__primary {
    margin-top: 20px;
    padding: 0 18px;
    border: 0;
    background: #0b0b0b;
    color: #ffffff;
}

.telegram-onboarding-modal__fallback {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(11, 11, 11, 0.1);
}

.telegram-onboarding-modal__trouble {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.telegram-onboarding-modal__copy {
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 6px 8px 6px 16px;
    border: 1px solid rgba(11, 11, 11, 0.12);
    background: #f2f1ed;
    color: rgba(11, 11, 11, 0.68);
    font-weight: 500;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.telegram-onboarding-modal__copy-text {
    min-width: 0;
    font-family: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.telegram-onboarding-modal__copy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 6px;
    background: #ffffff;
    color: rgba(11, 11, 11, 0.62);
    box-shadow: 0 1px 2px rgba(11, 11, 11, 0.08);
}

.telegram-onboarding-modal__copy-icon svg {
    width: 18px;
    height: 18px;
}

.telegram-onboarding-modal__status {
    min-height: 1.5em;
    margin-top: 12px;
    color: #128247;
}

.telegram-onboarding-modal__status.is-error {
    color: #b8331d;
}

.telegram-onboarding-modal__close:hover,
.telegram-onboarding-modal__close:focus-visible,
.telegram-onboarding-modal__primary:hover,
.telegram-onboarding-modal__primary:focus-visible,
.telegram-onboarding-modal__copy:hover,
.telegram-onboarding-modal__copy:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

.telegram-onboarding-modal__close:focus-visible,
.telegram-onboarding-modal__primary:focus-visible,
.telegram-onboarding-modal__copy:focus-visible {
    box-shadow: 0 0 0 3px rgba(229, 71, 42, 0.18);
}

body.telegram-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .telegram-onboarding-modal__panel {
        width: min(calc(100% - 24px), 420px);
        margin: 12px;
        padding: 18px;
    }

    .telegram-onboarding-modal__title {
        margin-right: 40px;
        font-size: 24px;
    }

    .telegram-onboarding-modal__helper,
    .telegram-onboarding-modal__instruction,
    .telegram-onboarding-modal__status {
        font-size: 14px;
    }

    .telegram-onboarding-modal__primary,
    .telegram-onboarding-modal__copy {
        min-height: 48px;
        font-size: 16px;
    }

    .telegram-onboarding-modal__copy-text {
        font-size: 15px;
    }
}
