.rx-support,
.rx-support * {
    box-sizing: border-box;
}

.rx-support {
    --rx-cyan: #34d9ff;
    --rx-blue: #2563eb;
    --rx-violet: #8b5cf6;
    --rx-green: #39ff9c;
    --rx-red: #ff5470;
    --rx-panel: #050916;
    position: fixed;
    z-index: 99990;
    inset-inline-end: 22px;
    inset-block-end: 22px;
    direction: rtl;
    font-family: inherit;
}

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

.rx-support-launcher {
    position: relative;
    width: 76px;
    min-height: 70px;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 8px 6px 7px;
    border: 1px solid rgba(52, 217, 255, .62);
    border-radius: 22px 8px 22px 8px;
    background:
        linear-gradient(135deg, rgba(52, 217, 255, .18), transparent 40%),
        linear-gradient(145deg, #07132a, #111a43 58%, #35166a);
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, .12),
        0 18px 48px rgba(13, 33, 88, .58),
        0 0 28px rgba(52, 217, 255, .18),
        inset 0 1px 0 rgba(255, 255, 255, .22);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: transform .22s ease, filter .22s ease, box-shadow .22s ease;
}

.rx-support-launcher::before,
.rx-support-launcher::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.rx-support-launcher::before {
    inset: -7px;
    border: 1px solid rgba(52, 217, 255, .28);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    animation: rx-support-pulse 2.4s ease-out infinite;
}

.rx-support-launcher::after {
    inset: 4px;
    border-top: 1px solid rgba(255,255,255,.2);
    border-right: 1px solid rgba(255,255,255,.08);
}

.rx-support-launcher:hover {
    transform: translateY(-4px) scale(1.025);
    filter: saturate(1.2);
    box-shadow:
        0 22px 58px rgba(13, 33, 88, .68),
        0 0 38px rgba(52, 217, 255, .28),
        inset 0 1px 0 rgba(255, 255, 255, .28);
}

.rx-support-launcher-core {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(52,217,255,.35);
    border-radius: 12px 4px 12px 4px;
    background: linear-gradient(145deg, rgba(52,217,255,.18), rgba(139,92,246,.28));
}

.rx-support-launcher svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.rx-support-launcher-label {
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 1.8px;
    color: #bdefff;
}

.rx-support-unread {
    position: absolute;
    inset-inline-start: -4px;
    inset-block-start: -4px;
    width: 16px;
    height: 16px;
    border: 3px solid #050916;
    border-radius: 50%;
    background: var(--rx-red);
    box-shadow: 0 0 0 4px rgba(255, 84, 112, .16), 0 0 18px rgba(255,84,112,.65);
}

.rx-support-panel {
    position: absolute;
    width: min(420px, calc(100vw - 28px));
    height: min(650px, calc(100dvh - 112px));
    inset-inline-end: 0;
    inset-block-end: 88px;
    overflow: hidden;
    border: 1px solid rgba(52, 217, 255, .28);
    border-radius: 28px 9px 28px 9px;
    background:
        radial-gradient(circle at 84% -5%, rgba(52, 217, 255, .16), transparent 31%),
        radial-gradient(circle at 8% 86%, rgba(139, 92, 246, .15), transparent 36%),
        linear-gradient(160deg, rgba(5, 9, 22, .995), rgba(7, 12, 31, .99));
    color: #e9f4ff;
    box-shadow:
        0 34px 100px rgba(0, 0, 0, .74),
        0 0 0 1px rgba(139,92,246,.09),
        0 0 42px rgba(52,217,255,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(.955);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.rx-support-panel::before,
.rx-support-panel::after {
    content: "";
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.rx-support-panel::before {
    inset: 7px;
    border-top: 1px solid rgba(52,217,255,.18);
    border-right: 1px solid rgba(52,217,255,.08);
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
}

.rx-support-panel::after {
    width: 82px;
    height: 3px;
    top: 0;
    right: 34px;
    background: linear-gradient(90deg, transparent, var(--rx-cyan), transparent);
    box-shadow: 0 0 16px var(--rx-cyan);
}

.rx-support-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.rx-support-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .18;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(52,217,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52,217,255,.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 74%);
}

.rx-support-scanline {
    position: absolute;
    inset: -30% 0 auto;
    z-index: 1;
    height: 110px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(52,217,255,.045), transparent);
    animation: rx-support-scan 7s linear infinite;
}

.rx-support-header {
    position: relative;
    z-index: 3;
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(52,217,255,.13);
    background: linear-gradient(90deg, rgba(12, 24, 52, .9), rgba(11, 16, 39, .76));
    backdrop-filter: blur(16px);
}

.rx-support-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(52,217,255,.48);
    border-radius: 16px 5px 16px 5px;
    background:
        linear-gradient(135deg, rgba(52,217,255,.28), transparent 46%),
        linear-gradient(145deg, #0c2a4f, #49308e);
    color: #fff;
    font-size: 15px;
    font-weight: 950;
    letter-spacing: 1px;
    box-shadow: inset 0 0 20px rgba(52,217,255,.1), 0 0 20px rgba(52,217,255,.12);
}

.rx-support-avatar i {
    position: absolute;
    width: 8px;
    height: 8px;
    bottom: -2px;
    left: -2px;
    border: 2px solid #071020;
    border-radius: 50%;
    background: var(--rx-green);
    box-shadow: 0 0 12px var(--rx-green);
}

.rx-support-title {
    flex: 1 1 auto;
    min-width: 0;
}

.rx-support-title > * {
    display: block;
}

.rx-support-overline {
    margin-bottom: 3px;
    color: var(--rx-cyan);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 1.7px;
}

.rx-support-title strong {
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.rx-support-title small {
    margin-top: 4px;
    color: #8ca0bb;
    font-size: 9.5px;
}

.rx-support-title small i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 5px;
    border-radius: 50%;
    background: var(--rx-green);
    box-shadow: 0 0 9px rgba(57,255,156,.8);
}

.rx-support-identity-badge {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 1px solid rgba(57,255,156,.25);
    border-radius: 8px 3px 8px 3px;
    background: rgba(57,255,156,.07);
    color: #9fffc9;
    font-size: 8px;
    direction: ltr;
}

.rx-support-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 11px 4px 11px 4px;
    background: rgba(5, 9, 22, .74);
    color: #c7d5e7;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition: .2s ease;
}

.rx-support-close:hover {
    border-color: rgba(255,84,112,.45);
    color: #fff;
    background: rgba(255,84,112,.1);
}

.rx-support-identity-stage,
.rx-support-chat-stage {
    position: relative;
    z-index: 2;
    height: calc(100% - 84px);
}

.rx-support-identity-stage {
    display: flex;
    flex-direction: column;
    padding: 22px 18px 18px;
    overflow-y: auto;
}

.rx-support-access-card {
    display: flex;
    gap: 13px;
    padding: 15px;
    border: 1px solid rgba(52,217,255,.18);
    border-radius: 18px 6px 18px 6px;
    background: linear-gradient(135deg, rgba(52,217,255,.08), rgba(139,92,246,.07));
}

.rx-support-access-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(52,217,255,.35);
    border-radius: 13px 4px 13px 4px;
    color: var(--rx-cyan);
    font-weight: 950;
    font-size: 12px;
    letter-spacing: 1px;
    background: rgba(5,9,22,.7);
}

.rx-support-access-card span {
    color: var(--rx-cyan);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.rx-support-access-card h3 {
    margin: 4px 0 5px;
    color: #fff;
    font-size: 16px;
}

.rx-support-access-card p {
    margin: 0;
    color: #8fa2bd;
    font-size: 10px;
    line-height: 1.9;
}

.rx-support-auth-fields {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.rx-support-auth-fields label > span {
    display: block;
    margin-bottom: 7px;
    color: #cfe7ff;
    font-size: 10px;
    font-weight: 800;
}

.rx-support-input-shell {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    align-items: center;
    min-height: 48px;
    border: 1px solid rgba(126, 158, 196, .2);
    border-radius: 14px 5px 14px 5px;
    background: rgba(3, 7, 18, .72);
    overflow: hidden;
    transition: .2s ease;
}

.rx-support-input-shell:focus-within {
    border-color: rgba(52,217,255,.65);
    box-shadow: 0 0 0 3px rgba(52,217,255,.075), 0 0 24px rgba(52,217,255,.08);
}

.rx-support-auth-fields label.has-error .rx-support-input-shell {
    border-color: rgba(255,84,112,.7);
    box-shadow: 0 0 0 3px rgba(255,84,112,.08);
}

.rx-support-input-shell b {
    height: 100%;
    display: grid;
    place-items: center;
    border-left: 1px solid rgba(126,158,196,.14);
    color: #78dff7;
    font-size: 9px;
    direction: ltr;
    background: rgba(52,217,255,.05);
}

.rx-support-input-shell input {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 12px;
    direction: ltr;
    text-align: left;
}

.rx-support-input-shell input::placeholder {
    color: #52647e;
}

.rx-support-auth-submit {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    border: 1px solid rgba(52,217,255,.55);
    border-radius: 15px 5px 15px 5px;
    background:
        linear-gradient(90deg, rgba(255,255,255,.1), transparent 25%),
        linear-gradient(135deg, #087ea4, #3356d8 55%, #7137bd);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255,255,255,.22);
    transition: .2s ease;
}

.rx-support-auth-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.rx-support-auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rx-support-auth-status {
    min-height: 18px;
    margin-top: 8px;
    color: #8092ab;
    font-size: 9px;
    line-height: 1.7;
}

.rx-support-auth-status.is-error {
    color: #ff9bad;
}

.rx-support-auth-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    color: #74869f;
    font-size: 9px;
    line-height: 1.9;
}

.rx-support-chat-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto auto;
    min-height: 0;
}

.rx-support-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 17px 14px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(52,217,255,.3) transparent;
}

.rx-chat-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    margin-bottom: 12px;
}

.rx-chat-user {
    justify-content: flex-start;
}

.rx-chat-support,
.rx-chat-system {
    justify-content: flex-end;
}

.rx-chat-agent {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(52,217,255,.3);
    border-radius: 9px 3px 9px 3px;
    background: linear-gradient(145deg, #0b4564, #4f2f8a);
    color: #fff;
    font-size: 8px;
    font-weight: 950;
}

.rx-chat-bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 16px 5px 16px 5px;
    font-size: 11.5px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.rx-chat-bubble strong,
.rx-chat-bubble p,
.rx-chat-bubble time,
.rx-chat-bubble span {
    display: block;
}

.rx-chat-bubble p {
    margin: 3px 0 0;
}

.rx-chat-bubble time {
    margin-top: 5px;
    opacity: .58;
    font-size: 8px;
    direction: ltr;
    text-align: end;
}

.rx-chat-user .rx-chat-bubble {
    border: 1px solid rgba(52,217,255,.2);
    background: linear-gradient(145deg, rgba(8,126,164,.9), rgba(37,86,216,.92));
    color: #fff;
    box-shadow: 0 8px 22px rgba(37,99,235,.18);
}

.rx-chat-support .rx-chat-bubble {
    border: 1px solid rgba(139,92,246,.2);
    background: linear-gradient(145deg, rgba(24,34,58,.94), rgba(31,24,67,.88));
    color: #e8f1ff;
}

.rx-chat-system .rx-chat-bubble {
    max-width: 94%;
    padding: 7px 11px;
    border: 1px dashed rgba(52,217,255,.24);
    background: rgba(52,217,255,.045);
    color: #9bdff0;
    font-size: 9px;
    text-align: center;
    letter-spacing: .2px;
}

.rx-chat-system .rx-chat-bubble span {
    margin-bottom: 2px;
    color: var(--rx-cyan);
    font-size: 6.5px;
    letter-spacing: 1.5px;
}

.rx-support-quick {
    display: flex;
    gap: 7px;
    padding: 5px 13px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.rx-support-quick::-webkit-scrollbar {
    display: none;
}

.rx-support-quick button {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid rgba(52,217,255,.17);
    border-radius: 10px 3px 10px 3px;
    background: rgba(52,217,255,.055);
    color: #bcefff;
    font: inherit;
    font-size: 8.8px;
    cursor: pointer;
    transition: .18s ease;
}

.rx-support-quick button:hover {
    border-color: rgba(52,217,255,.42);
    background: rgba(52,217,255,.1);
}

.rx-support-details {
    margin: 0 13px 8px;
    border: 1px solid rgba(126,158,196,.13);
    border-radius: 12px 4px 12px 4px;
    background: rgba(3,7,18,.38);
}

.rx-support-details summary {
    padding: 8px 10px;
    color: #8194af;
    font-size: 8.8px;
    cursor: pointer;
}

.rx-support-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 0 9px 9px;
}

.rx-support-fields input,
.rx-support-fields button {
    min-height: 36px;
    border: 1px solid rgba(126,158,196,.17);
    border-radius: 10px 3px 10px 3px;
    outline: none;
    background: rgba(5,9,22,.7);
    color: #e7f1ff;
    font: inherit;
    font-size: 9px;
}

.rx-support-fields input {
    width: 100%;
    min-width: 0;
    padding: 0 10px;
}

.rx-support-fields button {
    padding: 0 10px;
    color: #ffd1da;
    border-color: rgba(255,84,112,.2);
    cursor: pointer;
}

.rx-support-status {
    min-height: 0;
    margin: 0 14px 7px;
    color: #879ab4;
    font-size: 9px;
    line-height: 1.7;
}

.rx-support-status.is-error {
    color: #ff9bad;
}

.rx-support-status.is-success {
    color: #8fffc2;
}

.rx-support-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: end;
    gap: 9px;
    padding: 10px 12px 13px;
    border-top: 1px solid rgba(52,217,255,.1);
    background: rgba(4, 8, 20, .94);
}

.rx-support-composer textarea {
    width: 100%;
    min-height: 45px;
    max-height: 120px;
    resize: none;
    overflow-y: auto;
    padding: 11px 12px;
    border: 1px solid rgba(126,158,196,.18);
    border-radius: 14px 5px 14px 5px;
    outline: none;
    background: rgba(10,17,36,.92);
    color: #f6fbff;
    font: inherit;
    font-size: 11px;
    line-height: 1.7;
}

.rx-support-composer textarea:focus {
    border-color: rgba(52,217,255,.58);
    box-shadow: 0 0 0 3px rgba(52,217,255,.07);
}

.rx-support-composer button {
    position: relative;
    width: 48px;
    height: 45px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(52,217,255,.5);
    border-radius: 14px 5px 14px 5px;
    background: linear-gradient(145deg, #087ea4, #334ed1 58%, #7438b8);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37,99,235,.28), inset 0 1px 0 rgba(255,255,255,.2);
}

.rx-support-composer button.is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rx-support-spin .7s linear infinite;
}

.rx-support-composer button.is-loading svg {
    display: none;
}

.rx-support-composer button:disabled {
    opacity: .58;
    cursor: wait;
}

.rx-support-composer button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transform: rotate(180deg);
}

@keyframes rx-support-pulse {
    0% { opacity: .8; transform: scale(.9); }
    75%, 100% { opacity: 0; transform: scale(1.16); }
}

@keyframes rx-support-scan {
    from { transform: translateY(-40%); }
    to { transform: translateY(780%); }
}

@keyframes rx-support-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
    .rx-support {
        inset-inline-end: 12px;
        inset-block-end: 12px;
    }

    .rx-support-launcher {
        width: 66px;
        min-height: 62px;
    }

    .rx-support-panel {
        position: fixed;
        width: auto;
        height: min(78dvh, 680px);
        max-height: calc(100dvh - 88px);
        inset-inline: 9px;
        inset-block-end: 76px;
        transform-origin: bottom center;
    }
}

@media (max-width: 430px) {
    .rx-support-panel {
        height: calc(100dvh - 86px);
        inset-inline: 5px;
        inset-block-end: 70px;
        border-radius: 22px 7px 22px 7px;
    }

    .rx-support-header {
        min-height: 76px;
        padding: 11px 12px;
    }

    .rx-support-identity-stage,
    .rx-support-chat-stage {
        height: calc(100% - 76px);
    }

    .rx-support-identity-stage {
        padding: 17px 13px 14px;
    }

    .rx-support-messages {
        padding: 13px 10px 8px;
    }

    .rx-chat-bubble {
        max-width: 88%;
    }

    .rx-support-identity-badge {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rx-support-launcher::before,
    .rx-support-scanline,
    .rx-support-composer button.is-loading::after {
        animation: none;
    }

    .rx-support-launcher,
    .rx-support-panel,
    .rx-support-auth-submit {
        transition: none;
    }
}
