.floating-actions {
    position: fixed;
    z-index: 90;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.back-to-top,
.support-widget__button {
    pointer-events: auto;
    border: 0;
    color: #fff;
    background: #051626;
    box-shadow: 0 12px 30px rgba(5, 22, 38, .25);
    cursor: pointer;
    transition: opacity .22s ease, transform .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.back-to-top {
    --scroll-progress: 0%;
    inline-size: 54px;
    block-size: 54px;
    min-width: 54px;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    padding: 3px;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    background: conic-gradient(#00c8ee var(--scroll-progress), rgba(148, 177, 190, .32) var(--scroll-progress));
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { box-shadow: 0 14px 34px rgba(0, 103, 127, .35), 0 0 0 4px rgba(0, 200, 238, .1); transform: translateY(-2px); }
.back-to-top__inner {
    inline-size: 100%;
    block-size: 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    color: #fff;
    background: #051626;
    line-height: 1;
}
.back-to-top__inner .material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: none;
    width: 1em;
    height: 1em;
    overflow: visible;
    font-size: 1.25rem;
    line-height: 1;
}

.support-widget { position: relative; pointer-events: auto; }
.support-widget__button {
    min-width: 126px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border-radius: 999px;
    background: #00677f;
}
.support-widget__button:hover { background: #0086a3; transform: translateY(-2px); box-shadow: 0 15px 36px rgba(0, 103, 127, .36); }
.support-widget__button .material-symbols-outlined { font-size: 1.35rem; }
.support-widget__button-close { display: none; }
.support-widget.is-open .support-widget__button-open { display: none; }
.support-widget.is-open .support-widget__button-close { display: inline-block; }
.support-widget__button-label { font-weight: 700; }

.support-widget__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(380px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #dbe5eb;
    border-radius: 8px;
    color: #172b3a;
    background: #fff;
    box-shadow: 0 24px 65px rgba(5, 22, 38, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.97);
    transform-origin: right bottom;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}
.support-widget.is-open .support-widget__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }

.support-widget__header { min-height: 78px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; align-items: center; gap: 11px; padding: 14px 16px; color: #fff; background: #051626; }
.support-widget__avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #051626; background: #00c8ee; }
.support-widget__header h2 { margin: 0; font: 700 1rem "Plus Jakarta Sans", sans-serif; letter-spacing: 0; }
.support-widget__header p { margin: 3px 0 0; color: #aec3d0; font-size: .76rem; }
.support-widget__close { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #d9e5eb; background: transparent; cursor: pointer; }
.support-widget__close:hover { color: #fff; background: rgba(255,255,255,.1); }

.support-widget__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; border-bottom: 1px solid #e4ebef; background: #f5f8fa; }
.support-widget__tab { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; border: 0; border-radius: 6px; color: #64748b; background: transparent; font-weight: 700; cursor: pointer; }
.support-widget__tab .material-symbols-outlined { font-size: 1.15rem; }
.support-widget__tab.is-active { color: #fff; background: #00677f; }
.support-widget__content { min-height: 278px; padding: 18px; }
.support-widget__tabpanel { display: none; }
.support-widget__tabpanel.is-active { display: block; }
.support-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.support-message > .material-symbols-outlined { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #00677f; background: #e5f8fc; font-size: 1.05rem; }
.support-message p { margin: 0; padding: 12px; border-radius: 4px 8px 8px 8px; color: #405666; background: #f0f5f7; font-size: .88rem; line-height: 1.55; }
.ai-chat-messages { max-height: 235px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #9fcbd5 transparent; }
.ai-chat-messages .support-message + .support-message { margin-top: 10px; }
.support-message--user { display: flex; justify-content: flex-end; }
.support-message--user p { max-width: 84%; border-radius: 8px 4px 8px 8px; color: #fff; background: #00677f; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-message--bot p { white-space: pre-wrap; overflow-wrap: anywhere; }
.support-message--typing p { min-width: 58px; display: flex; align-items: center; gap: 4px; }
.support-message--typing i { width: 6px; height: 6px; border-radius: 50%; background: #6f8794; animation: support-typing 1s ease-in-out infinite; }
.support-message--typing i:nth-child(2) { animation-delay: .14s; }
.support-message--typing i:nth-child(3) { animation-delay: .28s; }
.ai-chat-suggestions { grid-column: 2; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.ai-chat-suggestion { width: auto; max-width: 100%; min-height: 34px; padding: 7px 10px; border: 1px solid #bcdde5; border-radius: 6px; color: #00677f; background: #f4fbfc; font-size: .7rem; font-weight: 700; line-height: 1.3; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.ai-chat-suggestion:hover { color: #fff; border-color: #00677f; background: #00677f; }
.ai-assistant-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 15px; padding: 11px; border: 1px solid #d9e8ee; border-radius: 7px; background: #f7fbfc; }
.ai-assistant-card__avatar { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #00677f; background: #dff7fb; }
.ai-assistant-card__avatar .material-symbols-outlined { font-size: 1.25rem; }
.ai-assistant-card__avatar i { position: absolute; right: 1px; bottom: 2px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: #21a366; }
.ai-assistant-card strong, .ai-assistant-card span { display: block; }
.ai-assistant-card strong { color: #172b3a; font-size: .82rem; }
.ai-assistant-card > div:nth-child(2) span { margin-top: 2px; color: #718693; font-size: .67rem; }
.ai-assistant-card__badge { padding: 4px 7px; border-radius: 999px; color: #00677f; background: #dff7fb; font-size: .61rem; font-weight: 700; white-space: nowrap; }
.ai-topic-area { margin-top: 15px; }
.ai-topic-area__label { display: block; margin-bottom: 7px; color: #718693; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ai-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ai-topic-grid button { min-height: 38px; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #dce7ec; border-radius: 6px; color: #526a78; background: #fff; font-size: .7rem; font-weight: 600; text-align: left; cursor: pointer; }
.ai-topic-grid button:hover { color: #00677f; border-color: #9bcdd8; background: #f4fbfc; }
.ai-topic-grid .material-symbols-outlined { color: #0087a3; font-size: 1rem; }
.support-widget__input-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; margin-top: 18px; }
.support-widget__input-row textarea, .support-widget__tabpanel textarea { width: 100%; border: 1px solid #cddae2; border-radius: 6px; color: #172b3a; background: #fff; font: inherit; outline: none; }
.support-widget__input-row textarea { height: 44px; min-height: 44px; max-height: 88px; padding: 10px 12px; resize: none; }
.support-widget__input-row button { border: 0; border-radius: 6px; color: #fff; background: #00677f; cursor: pointer; }
.support-widget__input-row button:hover { background: #0086a3; }
.support-widget__input-row button:disabled { color: #8aa0ad; background: #e6edf1; cursor: wait; }
.support-widget__note, .support-widget__privacy { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: #758996; font-size: .72rem; }
.support-widget__note .material-symbols-outlined, .support-widget__privacy .material-symbols-outlined { font-size: .9rem; }
.support-widget__intro { margin: 0 0 15px; color: #4f6472; font-size: .9rem; line-height: 1.55; }
.support-widget__label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 700; }
.support-widget__tabpanel [data-whatsapp-message] { min-height: 98px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
.support-widget__tabpanel textarea:focus { border-color: #00a8ca; box-shadow: 0 0 0 3px rgba(0, 168, 202, .12); }
.support-widget__whatsapp { width: 100%; min-height: 46px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 6px; color: #fff; background: #087f5b; font-weight: 700; cursor: pointer; }
.support-widget__whatsapp:hover { background: #066b4d; }
.support-widget button:focus-visible, .support-widget textarea:focus-visible, .back-to-top:focus-visible { outline: 3px solid #00c8ee; outline-offset: 3px; }

@keyframes support-typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 480px) {
    .floating-actions { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); gap: 9px; }
    .back-to-top {
        inline-size: 54px !important;
        block-size: 54px !important;
        min-width: 54px !important;
        width: 54px !important;
        height: 54px !important;
        flex-basis: 54px !important;
        padding: 3px;
    }
    .support-widget__button { min-width: 52px; width: 52px; height: 52px; padding: 0; }
    .support-widget__button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .support-widget__panel { right: 0; bottom: 64px; width: calc(100vw - 24px); max-height: calc(100dvh - 88px); overflow-x: hidden; overflow-y: auto; }
    .support-widget__content { min-height: 260px; padding: 15px; }
    .ai-chat-messages { max-height: 190px; }
    .ai-chat-suggestions { gap: 5px; }
    .ai-chat-suggestion { min-height: 32px; padding: 6px 8px; }
    .ai-assistant-card { grid-template-columns: 38px minmax(0, 1fr); }
    .ai-assistant-card__avatar { width: 38px; height: 38px; }
    .ai-assistant-card__badge { grid-column: 2; justify-self: start; }
}

@media (max-width: 360px) {
    .floating-actions { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); gap: 7px; }
    .back-to-top {
        inline-size: 54px !important;
        block-size: 54px !important;
        min-width: 54px !important;
        width: 54px !important;
        height: 54px !important;
        flex-basis: 54px !important;
    }
    .back-to-top__inner .material-symbols-outlined { font-size: 1.25rem; }
    .support-widget__button { min-width: 48px; width: 48px; height: 48px; }
    .support-widget__panel { bottom: 58px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top, .support-widget__button, .support-widget__panel { transition-duration: .01ms; }
    .support-message--typing i { animation: none; }
    html:focus-within { scroll-behavior: auto; }
}
