html:has(.referral-dialog[open]) {
    overflow: hidden;
}

.referral-dialog {
    box-sizing: border-box;
    width: min(440px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid #dfdfd3;
    border-radius: 20px;
    background: #fffefa;
    color: var(--ink);
    box-shadow: 0 22px 68px rgba(14, 40, 28, .28);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.referral-dialog:not([open]) {
    display: none;
}

.referral-dialog::backdrop {
    background: rgba(20, 37, 30, .54);
}

.referral-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 19px 15px 23px;
    border-bottom: 1px solid #e8e9df;
}

.referral-dialog-header h2 {
    margin: 0;
    font-size: clamp(1rem, 4vw, 1.17rem);
    line-height: 1.35;
}

.referral-dialog-close {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #eef1e7;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.referral-dialog-close:hover {
    background: #e2e9db;
}

.referral-dialog-content {
    display: grid;
    gap: 17px;
    padding: 20px 23px 22px;
    text-align: center;
}

.referral-dialog-content p {
    margin: 0;
    color: #535e54;
    font-size: .91rem;
    line-height: 1.5;
}

.referral-dialog-reward:not([hidden]) {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 17px 12px;
    border: 1px solid #e7dff4;
    border-radius: 14px;
    background: #f4eefb;
    color: #3d2463;
}

.referral-dialog-label {
    font-size: .8rem;
    font-weight: 600;
}

.referral-dialog-value {
    font-size: 2.65rem;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.referral-dialog-reward-name {
    font-weight: 650;
}

.referral-dialog-actions {
    display: grid;
    gap: 8px;
}

.referral-dialog-actions a {
    display: grid;
    place-items: center;
    min-height: 45px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 650;
    font-size: .9rem;
    line-height: 1.3;
    text-decoration: none;
}

.referral-dialog-actions .referral-dialog-signup {
    background: #573591;
    color: #fff;
}

.referral-dialog-actions .referral-dialog-signup:hover {
    background: #472974;
}

.referral-dialog-actions .referral-dialog-continue {
    border-color: #dce3d9;
    color: var(--ink);
}

.referral-dialog-actions .referral-dialog-continue:hover {
    background: #eef1e8;
}

.referral-dialog-content .referral-dialog-fine {
    font-size: .76rem;
}

.referral-dialog-fine a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
