.support-fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: #f3c969;
    color: #20170b;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(11, 7, 20, 0.34);
    transition: transform 180ms ease-out, background-color 180ms ease-out;
}

/* Keep Donate above the contact FAB so they never overlap */
body:has(.support-fab:not([hidden])) .floating-donate-btn {
    bottom: calc(84px + env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
}

.support-fab:hover,
.support-fab:focus-visible {
    color: #20170b;
    background: #ffe09a;
    text-decoration: none;
    transform: translateY(-2px);
}

.support-fab[hidden] {
    display: none !important;
}

.support-shell {
    width: min(760px, calc(100% - 24px));
    margin: 24px auto 96px;
    text-align: left;
    color: #f4f0ff;
}

.support-heading {
    display: block;
    padding: 20px 0;
}

.support-heading h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    color: #fff8df;
}

.support-heading p {
    max-width: 62ch;
    margin: 0;
    color: #c7c0db;
    line-height: 1.55;
}

.support-retry-link {
    display: inline-block;
    margin-top: 12px;
    color: #f3c969;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.support-footer {
    display: flex;
    justify-content: center;
    padding: 8px 16px 24px;
}

.support-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 28px;
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, #3a3358 0%, #2a2444 100%);
    color: #fff8df;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(11, 7, 20, 0.28);
    transition: transform 160ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out;
}

.support-home-btn:hover,
.support-home-btn:focus-visible {
    color: #20170b;
    background: linear-gradient(180deg, #ffe09a 0%, #f3c969 100%);
    border-color: #f3c969;
    text-decoration: none;
    transform: translateY(-2px);
}

.support-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: min(54vh, 560px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(244, 240, 255, 0.15);
    border-radius: 18px 18px 0 0;
    background: rgba(18, 14, 37, 0.74);
}

.support-empty {
    display: grid;
    place-items: center;
    min-height: 230px;
    color: #aaa2be;
    text-align: center;
    line-height: 1.6;
}

.support-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: min(82%, 580px);
}

.support-message.is-user {
    align-self: flex-end;
    align-items: flex-end;
}

.support-bubble {
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 16px 5px;
    background: #302853;
    color: #f8f4ff;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.support-message.is-user .support-bubble {
    border-radius: 16px 16px 5px 16px;
    background: #725b26;
    color: #fff8df;
}

.support-message-meta {
    color: #a79fba;
    font-size: 0.78rem;
}

.support-message-meta.is-read {
    color: #efd17d;
}

.support-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(244, 240, 255, 0.15);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    background: rgba(28, 22, 53, 0.92);
}

.support-compose textarea {
    width: 100%;
    min-height: 48px;
    max-height: 150px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: #151127;
    color: #f8f4ff;
    line-height: 1.45;
}

.support-compose textarea:focus {
    outline: 3px solid rgba(243, 201, 105, 0.25);
    border-color: #f3c969;
}

.support-send {
    align-self: stretch;
    min-width: 112px;
    border: 0;
    border-radius: 10px;
    background: #f3c969;
    color: #20170b;
    font-weight: 800;
    cursor: pointer;
}

.support-send:disabled {
    cursor: wait;
    opacity: 0.55;
}

.support-feedback {
    min-height: 24px;
    margin: 8px 2px 0;
    color: #beb6d1;
    font-size: 0.88rem;
}

.support-feedback.is-error {
    color: #ffaaa3;
}

@media (max-width: 600px) {
    .support-fab span:last-child {
        display: none;
    }

    .support-fab {
        width: 46px;
        justify-content: center;
        padding: 8px;
    }

    .support-shell {
        margin-top: 8px;
    }

    .support-heading {
        gap: 12px;
    }

    .support-heading h1 {
        font-size: 1.4rem;
    }

    .support-thread {
        min-height: 250px;
        padding: 14px;
    }

    .support-message {
        max-width: 92%;
    }

    .support-compose {
        grid-template-columns: 1fr;
    }

    .support-send {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .support-fab {
        transition: none;
    }
}
