.app-invite-trigger {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    padding: 0.45rem 0.72rem;
    border: 1px solid rgba(197, 170, 111, 0.5);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(197, 170, 111, 0.16), rgba(197, 170, 111, 0.07));
    color: #f5f0e5;
    font: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.app-invite-trigger:hover,
.app-invite-trigger:focus-visible {
    background: linear-gradient(180deg, rgba(197, 170, 111, 0.25), rgba(197, 170, 111, 0.1));
    outline: none;
}

.app-invite-trigger > span {
    color: #dec68f;
    font-size: 1rem;
    line-height: 1;
}

.app-invite-trigger > strong {
    font-size: 0.74rem;
    font-weight: 760;
    letter-spacing: 0.025em;
}

.invite-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: clamp(0.8rem, 3vw, 2rem);
    background: rgba(2, 9, 7, 0.68);
    backdrop-filter: blur(8px);
}

.invite-dialog {
    width: min(760px, 100%);
    max-height: min(860px, calc(100dvh - 2rem));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(197, 170, 111, 0.42);
    background:
        radial-gradient(circle at 88% 0%, rgba(197, 170, 111, 0.1), transparent 27%),
        linear-gradient(155deg, #122a22, #0b1c17 62%, #081510);
    color: #f5f0e5;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.54), inset 0 1px rgba(255, 255, 255, 0.04);
}

.invite-dialog__header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.2rem, 3vw, 1.7rem) clamp(1.15rem, 3.5vw, 2rem);
    border-bottom: 1px solid rgba(245, 240, 229, 0.11);
    background: rgba(255, 255, 255, 0.018);
}

.invite-dialog__header h2,
.invite-dialog__header p,
.invite-ready h3,
.invite-form h3,
.invite-acceptance-card h1,
.invite-acceptance-card h2,
.invite-acceptance-card p,
.invite-personal-note p {
    margin-top: 0;
}

.invite-dialog__header h2 {
    margin-bottom: 0.4rem;
    color: #fbf5e8;
    font: 500 clamp(1.8rem, 4vw, 2.45rem) var(--font-display, Georgia, serif);
}

.invite-dialog__header p {
    max-width: 40rem;
    margin-bottom: 0;
    color: rgba(245, 240, 229, 0.6);
    font-size: 0.82rem;
    line-height: 1.55;
}

.invite-dialog__close {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 1px solid rgba(245, 240, 229, 0.09);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(245, 240, 229, 0.72);
    font-size: 1.6rem;
    cursor: pointer;
}

.invite-dialog__close:hover,
.invite-dialog__close:focus-visible {
    border-color: rgba(197, 170, 111, 0.42);
    color: #fff8e9;
    outline: none;
}

.invite-dialog__body {
    overflow-y: auto;
    padding: clamp(1rem, 3vw, 1.7rem) clamp(1.05rem, 3.5vw, 2rem) clamp(1.4rem, 4vw, 2.2rem);
}

.invite-kicker {
    display: block;
    margin-bottom: 0.22rem;
    color: #cdb57f;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.invite-loading {
    padding: 1rem;
    border: 1px solid rgba(245, 240, 229, 0.08);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(245, 240, 229, 0.7);
    font-size: 0.82rem;
}

.invite-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.15rem;
}

.invite-choice {
    min-height: 132px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.65rem;
    padding: 0.9rem;
    border: 1px solid rgba(245, 240, 229, 0.11);
    background: rgba(255, 255, 255, 0.025);
    color: #f5f0e5;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.invite-choice:hover:not(:disabled),
.invite-choice:focus-visible:not(:disabled) {
    border-color: rgba(197, 170, 111, 0.52);
    background: rgba(197, 170, 111, 0.07);
    outline: none;
}

.invite-choice.is-selected {
    border-color: rgba(222, 198, 143, 0.75);
    background: linear-gradient(145deg, rgba(197, 170, 111, 0.14), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 0 0 1px rgba(222, 198, 143, 0.08);
}

.invite-choice:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.invite-choice__mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(197, 170, 111, 0.34);
    color: #dec68f;
    font-size: 1rem;
}

.invite-choice strong,
.invite-choice small {
    display: block;
}

.invite-choice strong {
    margin-top: 0.12rem;
    color: #fff8e9;
    font-size: 0.88rem;
}

.invite-choice small {
    margin-top: 0.38rem;
    color: rgba(245, 240, 229, 0.56);
    font-size: 0.69rem;
    line-height: 1.45;
}

.invite-choice > b {
    min-width: 16px;
    color: #dec68f;
    font-size: 0.82rem;
}

.invite-form {
    display: grid;
    gap: 0.9rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    border: 1px solid rgba(197, 170, 111, 0.18);
    background: rgba(1, 9, 6, 0.3);
}

.invite-form__heading h3,
.invite-ready h3 {
    margin-bottom: 0;
    color: #faf2df;
    font: 500 1.55rem var(--font-display, Georgia, serif);
}

.invite-form label {
    display: grid;
    gap: 0.38rem;
}

.invite-form label > span {
    color: rgba(245, 240, 229, 0.76);
    font-size: 0.72rem;
    font-weight: 720;
}

.invite-form label > span b {
    color: #d7bf88;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invite-form label > span small {
    color: rgba(245, 240, 229, 0.42);
    font-weight: 500;
}

.invite-form input,
.invite-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 0.7rem 0.78rem;
    border: 1px solid rgba(197, 170, 111, 0.34);
    background: rgba(0, 7, 5, 0.52);
    color: #f9f3e6;
    font: inherit;
    font-size: 0.86rem;
    resize: vertical;
}

.invite-form input:focus,
.invite-form textarea:focus {
    border-color: rgba(222, 198, 143, 0.72);
    outline: 3px solid rgba(197, 170, 111, 0.08);
}

.invite-form__meaning {
    padding: 0.8rem 0.9rem;
    border-left: 2px solid rgba(197, 170, 111, 0.62);
    background: rgba(197, 170, 111, 0.055);
}

.invite-form__meaning strong {
    color: #ead9b3;
    font-size: 0.71rem;
}

.invite-form__meaning p {
    margin: 0.3rem 0 0;
    color: rgba(245, 240, 229, 0.62);
    font-size: 0.72rem;
    line-height: 1.5;
}

.invite-status {
    margin: 0;
    padding: 0.7rem 0.8rem;
    border-left: 2px solid #9aac78;
    background: rgba(154, 172, 120, 0.08);
    color: rgba(245, 240, 229, 0.78);
    font-size: 0.74rem;
    line-height: 1.45;
}

.invite-status.is-error {
    border-left-color: #c88474;
    background: rgba(200, 132, 116, 0.08);
    color: #efc2b8;
}

.invite-action {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.64rem 0.9rem;
    border: 1px solid rgba(197, 170, 111, 0.5);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 740;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.invite-action--primary {
    border-color: #d2b97f;
    background: linear-gradient(180deg, #c6aa70, #aa894f);
    color: #0d1e18;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 10px 25px rgba(0, 0, 0, 0.18);
}

.invite-action--primary:hover,
.invite-action--primary:focus-visible {
    filter: brightness(1.06);
    outline: 3px solid rgba(210, 185, 127, 0.14);
}

.invite-action--secondary {
    background: rgba(255, 255, 255, 0.035);
    color: #f5f0e5;
}

.invite-action--quiet {
    border-color: transparent;
    background: transparent;
    color: rgba(245, 240, 229, 0.62);
}

.invite-action--quiet:hover,
.invite-action--quiet:focus-visible {
    color: #fff8e9;
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.invite-action--wide {
    width: 100%;
}

.invite-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.invite-form__truth {
    color: rgba(245, 240, 229, 0.42);
    font-size: 0.66rem;
    line-height: 1.45;
    text-align: center;
}

.invite-ready {
    max-width: 36rem;
    display: grid;
    justify-items: stretch;
    gap: 0.85rem;
    margin: 0 auto;
    padding: clamp(1.1rem, 4vw, 2rem);
    border: 1px solid rgba(197, 170, 111, 0.26);
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}

.invite-ready__seal {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    justify-self: center;
    border: 1px solid rgba(197, 170, 111, 0.58);
    border-radius: 50%;
    background: rgba(197, 170, 111, 0.08);
    color: #dfc890;
    font-size: 1.3rem;
}

.invite-ready > p {
    margin: 0;
    color: rgba(245, 240, 229, 0.61);
    font-size: 0.78rem;
    line-height: 1.55;
}

.invite-ready__steps {
    display: grid;
    gap: 0.45rem;
    margin: 0.25rem 0;
    text-align: left;
}

.invite-ready__steps > div {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(245, 240, 229, 0.08);
    color: rgba(245, 240, 229, 0.68);
    font-size: 0.72rem;
}

.invite-ready__steps b {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(197, 170, 111, 0.4);
    color: #d7bf88;
    font-size: 0.68rem;
}

/* Recipient experience */
.invite-acceptance-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background:
        radial-gradient(circle at 15% 10%, rgba(72, 104, 87, 0.1), transparent 30%),
        linear-gradient(145deg, #f5f0e5, #eee5d2 58%, #e7dcc5);
    color: #242d28;
}

.invite-acceptance-card {
    width: min(760px, 100%);
    box-sizing: border-box;
    padding: clamp(1.25rem, 4vw, 2.4rem);
    border: 1px solid rgba(77, 68, 46, 0.2);
    background: rgba(255, 253, 246, 0.96);
    box-shadow: 0 28px 80px rgba(51, 54, 44, 0.16), inset 0 1px #fff;
}

.invite-acceptance-card--loading {
    max-width: 480px;
    justify-items: center;
    text-align: center;
}

.invite-acceptance-card--success {
    max-width: 620px;
    text-align: center;
}

.invite-acceptance-card--success .invite-action {
    margin-top: 0.8rem;
}

.invite-acceptance-seal {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #a88a50;
    border-radius: 50%;
    color: #224739;
    background: #f8f1de;
    font: 600 1.5rem var(--font-display, Georgia, serif);
}

.invite-acceptance-seal.is-success {
    margin: 0 auto 1rem;
    color: #46633d;
}

.invite-acceptance-heading {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid rgba(56, 57, 49, 0.12);
}

.invite-acceptance-heading h1,
.invite-acceptance-card > h1 {
    margin-bottom: 0.5rem;
    color: #17382e;
    font: 500 clamp(2rem, 5vw, 3.25rem) var(--font-display, Georgia, serif);
    line-height: 1.02;
}

.invite-acceptance-heading p,
.invite-acceptance-lede {
    margin-bottom: 0;
    color: #687069;
    font-size: 0.88rem;
    line-height: 1.6;
}

.invite-acceptance-card .invite-kicker {
    color: #8f743f;
}

.invite-personal-note {
    margin: 1.15rem 0;
    padding: 1rem 1.1rem;
    border: 0;
    border-left: 3px solid #b99b60;
    background: #faf4e7;
}

.invite-personal-note > span {
    color: #856c3e;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.invite-personal-note p {
    margin-bottom: 0;
    color: #50574f;
    font: italic 500 1rem var(--font-display, Georgia, serif);
    line-height: 1.5;
}

.invite-acceptance-explainer {
    margin: 1.15rem 0;
    padding: 1rem;
    border: 1px solid rgba(50, 70, 59, 0.12);
    background: #f6f2e9;
}

.invite-acceptance-explainer h2,
.invite-acceptance-steps h2,
.invite-account-gate h2,
.invite-wrong-account h2 {
    margin-bottom: 0.35rem;
    color: #24463a;
    font: 500 1.45rem var(--font-display, Georgia, serif);
}

.invite-acceptance-explainer p,
.invite-account-gate p,
.invite-wrong-account p {
    margin-bottom: 0;
    color: #656c65;
    font-size: 0.8rem;
    line-height: 1.55;
}

.invite-acceptance-steps {
    margin: 1.2rem 0;
}

.invite-acceptance-steps > div {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.invite-acceptance-steps article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 62px;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(58, 60, 52, 0.12);
    background: #fffdf8;
}

.invite-acceptance-steps article > b {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid #b79a60;
    border-radius: 50%;
    color: #806733;
    font-size: 0.75rem;
}

.invite-acceptance-steps article.is-complete > b {
    border-color: #78906b;
    background: #edf1e7;
    color: #49633f;
}

.invite-acceptance-steps strong,
.invite-acceptance-steps small {
    display: block;
}

.invite-acceptance-steps strong {
    color: #38423c;
    font-size: 0.8rem;
}

.invite-acceptance-steps small {
    margin-top: 0.15rem;
    color: #777d77;
    font-size: 0.7rem;
    line-height: 1.4;
}

.invite-account-gate,
.invite-wrong-account,
.invite-confirm-account {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(47, 65, 55, 0.15);
    background: #f7f3e9;
}

.invite-account-gate__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.invite-acceptance-page .invite-action--secondary,
.invite-acceptance-page .invite-action--quiet {
    color: #29483d;
    border-color: rgba(50, 69, 59, 0.22);
    background: transparent;
}

.invite-acceptance-page .invite-action--quiet {
    margin-top: 0.45rem;
    border-color: transparent;
}

.invite-wrong-account {
    border-color: rgba(157, 91, 73, 0.3);
    background: #fbf0ec;
}

.invite-wrong-account .invite-kicker {
    color: #9d5b49;
}

.invite-wrong-account h2 {
    color: #764034;
}

.invite-wrong-account form {
    margin-top: 0.85rem;
}

.invite-confirm-account {
    display: grid;
    gap: 0.65rem;
}

.invite-confirm-account__identity {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.invite-confirm-account__identity > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid #7f976f;
    border-radius: 50%;
    background: #edf2e8;
    color: #4f6d45;
}

.invite-confirm-account__identity strong,
.invite-confirm-account__identity small {
    display: block;
}

.invite-confirm-account__identity strong {
    color: #34463d;
    font-size: 0.8rem;
}

.invite-confirm-account__identity small {
    margin-top: 0.15rem;
    color: #727b74;
    font-size: 0.7rem;
}

.invite-acceptance-page .invite-status.is-error {
    color: #7d4136;
    background: #f9e9e5;
}

@media (max-width: 760px) {
    .app-invite-trigger {
        min-width: 44px;
        min-height: 44px;
        padding-inline: 0.55rem;
    }

    .app-invite-trigger > strong {
        display: none;
    }

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

    .invite-dialog {
        width: 100%;
        max-height: 94dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 20px 20px 0 0;
    }

    .invite-dialog__header {
        padding: 1.15rem 1rem 0.95rem;
    }

    .invite-dialog__header h2 {
        font-size: 1.8rem;
    }

    .invite-dialog__body {
        padding: 0.9rem 0.9rem calc(1.35rem + env(safe-area-inset-bottom));
    }

    .invite-choices {
        grid-template-columns: 1fr;
    }

    .invite-choice {
        min-height: 88px;
    }

    .invite-acceptance-page {
        align-items: start;
        padding: 0;
        background: #f5f0e5;
    }

    .invite-acceptance-card {
        min-height: 100dvh;
        padding: max(1.15rem, env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
        border: 0;
        box-shadow: none;
    }

    .invite-acceptance-heading {
        display: grid;
        gap: 0.8rem;
    }

    .invite-account-gate__actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .invite-dialog__header p {
        display: none;
    }

    .invite-form {
        padding: 0.85rem;
    }
}
