:root {
    --or-support-z: 2147483000;
    --or-support-primary: #0f766e;
    --or-support-primary-strong: #0b5f59;
    --or-support-panel-bg: #ffffff;
    --or-support-border: #d0d5dd;
    --or-support-surface: #f7faf9;
    --or-support-muted: #475467;
    --or-support-text: #0f172a;
    --or-support-user-bg: #0f766e;
    --or-support-user-text: #ffffff;
    --or-support-agent-bg: #ffffff;
    --or-support-agent-text: #0f172a;
    --or-support-shadow: 0 18px 44px rgba(16, 24, 40, 0.22);
}

.or-support-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--or-support-primary), #1a9a90);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: var(--or-support-shadow);
    z-index: var(--or-support-z);
}

.or-support-launcher:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 2px;
}

.or-support-panel {
    position: fixed;
    right: 18px;
    bottom: 86px;
    width: min(390px, calc(100vw - 36px));
    height: min(640px, calc(100vh - 112px));
    border: 1px solid var(--or-support-border);
    border-radius: 16px;
    background: var(--or-support-panel-bg);
    box-shadow: var(--or-support-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--or-support-z);
}

.or-support-panel.open {
    display: flex;
}

.or-support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, var(--or-support-primary), var(--or-support-primary-strong));
    color: #fff;
}

.or-support-heading-wrap {
    min-width: 0;
}

.or-support-heading {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.or-support-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.88;
}

.or-support-close {
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    flex: 0 0 auto;
}

.or-support-messages {
    flex: 1;
    padding: 12px;
    background: var(--or-support-surface);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.or-support-message {
    max-width: 92%;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid var(--or-support-border);
    line-height: 1.42;
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.or-support-message-text {
    font-size: 14px;
    color: var(--or-support-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.or-support-message.user {
    align-self: flex-end;
    background: var(--or-support-user-bg);
    border-color: var(--or-support-user-bg);
}

.or-support-message.user .or-support-message-text {
    color: var(--or-support-user-text);
}

.or-support-message.agent {
    align-self: flex-start;
    background: var(--or-support-agent-bg);
    border-color: var(--or-support-border);
}

.or-support-meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--or-support-muted);
}

.or-support-message.user .or-support-meta {
    color: rgba(255, 255, 255, 0.86);
}

.or-support-typing {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.or-support-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.or-support-typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #94a3b8;
    display: inline-block;
    animation: or-support-bounce 1.2s infinite ease-in-out;
}

.or-support-typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.or-support-typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes or-support-bounce {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.or-support-composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border-top: 1px solid var(--or-support-border);
    background: #fff;
}

.or-support-input {
    resize: none;
    border: 1px solid var(--or-support-border);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 14px;
    line-height: 1.35;
    min-height: 38px;
    max-height: 128px;
    font-family: inherit;
}

.or-support-input:focus {
    outline: 2px solid rgba(15, 118, 110, 0.25);
    border-color: var(--or-support-primary);
}

.or-support-send {
    border: 0;
    border-radius: 10px;
    background: var(--or-support-primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    min-width: 70px;
    height: 38px;
    cursor: pointer;
}

.or-support-send[disabled],
.or-support-panel.is-loading .or-support-input {
    opacity: 0.66;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .or-support-launcher {
        right: 12px;
        bottom: 12px;
        width: 54px;
        height: 54px;
    }

    .or-support-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 74px;
        height: min(74vh, 600px);
    }
}
