.gg-wa-referral {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    max-width: 100%;
}

/* Desktop: the avatar is a circle as tall as the bar. frontend.js sets
   --gg-wa-avatar to the bar height; 56px is the fallback and the minimum. */
.gg-wa-referral__avatar {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    align-self: center;
    width: var(--gg-wa-avatar, 56px);
    height: var(--gg-wa-avatar, 56px);
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    margin-right: -20px;
}

/* The image must not size the avatar: it fills it from the outside. */
.gg-wa-referral__avatar-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gg-wa-referral__avatar-empty {
    display: block;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
}

.gg-wa-referral__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2A5747;
    border-radius: 999px;
    padding: 10px 18px 10px 32px;
    min-height: 56px;
    box-sizing: border-box;
}

.gg-wa-referral__icon {
    flex: 0 0 auto;
    align-self: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #25D366;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gg-wa-referral__text {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.35;
}

/* When a manual line of the free-form text would wrap, the manual breaks are
   ignored and the text flows naturally (class set by frontend.js). */
.gg-wa-referral--flow .gg-wa-br {
    display: none;
}

/* Mobile: fixed avatar, centered. */
@media (max-width: 480px) {
    .gg-wa-referral__avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        margin-right: -16px;
    }

    .gg-wa-referral__bar {
        padding: 8px 14px 8px 26px;
        min-height: 44px;
        gap: 8px;
    }

    .gg-wa-referral__icon {
        width: 24px;
        height: 24px;
    }

    .gg-wa-referral__text {
        font-size: 12px;
    }
}
