.phlx-invite-share {
    position: relative;
    margin-top: 1rem;
}

.phlx-invite-share__button {
    display: inline-flex;
    gap: .55rem;
    align-items: center;
}

.phlx-invite-share__overlay[hidden],
.phlx-invite-share__native[hidden],
.phlx-invite-share__toast[hidden] {
    display: none !important;
}

body.phlx-invite-share-open {
    overflow: hidden;
}

.phlx-invite-share__overlay {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity .18s ease;
}

.phlx-invite-share__overlay.is-open {
    opacity: 1;
}

.phlx-invite-share__modal {
    width: min(100%, 620px);
    max-height: min(86vh, 760px);
    overflow: auto;
    padding: 1.1rem;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 22px;
    background: var(--phlx-surface, #fff);
    color: var(--phlx-ink, #0f172a);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .34);
    transform: translateY(14px) scale(.985);
    transition: transform .18s ease;
}

.phlx-invite-share__overlay.is-open .phlx-invite-share__modal {
    transform: translateY(0) scale(1);
}

.phlx-invite-share__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.phlx-invite-share__eyebrow {
    margin: 0 0 .2rem;
    color: var(--phlx-primary, #1463ff);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.phlx-invite-share__title {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 1.65rem);
    line-height: 1.15;
}

.phlx-invite-share__close {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--phlx-line, #dbe2ea);
    border-radius: 50%;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.phlx-invite-share__native,
.phlx-invite-share__copy {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 0;
    border-radius: 14px;
    background: var(--phlx-primary, #1463ff);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.phlx-invite-share__native {
    margin-bottom: .9rem;
}

.phlx-invite-share__copy {
    margin-top: .9rem;
    border: 1px solid var(--phlx-line, #dbe2ea);
    background: #fff;
    color: var(--phlx-ink, #0f172a);
}

.phlx-invite-share__native:disabled,
.phlx-invite-share__copy:disabled {
    opacity: .62;
    cursor: wait;
}

.phlx-invite-share__platforms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}

.phlx-invite-share__platform {
    display: flex;
    min-width: 0;
    min-height: 88px;
    padding: .75rem .45rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--phlx-line, #dbe2ea);
    border-radius: 15px;
    background: #fff;
    color: var(--phlx-ink, #0f172a);
    font: inherit;
    font-size: .82rem;
    font-weight: 750;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.phlx-invite-share__platform:hover {
    border-color: var(--phlx-primary, #1463ff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.phlx-invite-share__platform-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--phlx-primary-soft, #eef4ff);
    color: var(--phlx-primary, #1463ff);
    font-size: .88rem;
    font-weight: 900;
}

.phlx-invite-share__status {
    min-height: 1.25rem;
    margin: .7rem 0 0;
    color: #15803d;
    font-size: .86rem;
    text-align: center;
}

.phlx-invite-share__status.is-error {
    color: #b91c1c;
}

.phlx-invite-share__toast {
    position: fixed;
    z-index: 100001;
    right: 1rem;
    bottom: 1rem;
    max-width: min(360px, calc(100vw - 2rem));
    padding: .82rem 1rem;
    border-radius: 13px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .28);
    font-size: .9rem;
    font-weight: 750;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease;
}

.phlx-invite-share__toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.phlx-invite-share button:focus-visible,
.phlx-invite-share [tabindex]:focus-visible {
    outline: 3px solid rgba(20, 99, 255, .34);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .phlx-invite-share__button {
        width: 100%;
    }

    .phlx-invite-share__overlay {
        align-items: end;
        padding: 0;
    }

    .phlx-invite-share__modal {
        width: 100%;
        max-height: 88vh;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        transform: translateY(28px);
    }

    .phlx-invite-share__platforms {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .phlx-invite-share__platforms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .phlx-invite-share__overlay,
    .phlx-invite-share__modal,
    .phlx-invite-share__platform,
    .phlx-invite-share__toast {
        transition: none;
    }
}
