.company-chatbot {
    --chatbot-blue: #1f7cfd;
    --chatbot-blue-dark: #155fc7;
    --chatbot-text: #1f2937;
    --chatbot-muted: #64748b;
    --chatbot-border: #e5eaf2;
    --chatbot-surface: #f5f8fc;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    color: var(--chatbot-text);
    font-family: inherit;
}

.company-chatbot[dir="rtl"] {
    text-align: right;
}

.company-chatbot__launcher {
    position: relative;
    isolation: isolate;
    display: grid;
    width: 66px;
    height: 66px;
    padding: 15px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #3892ff, #1468df);
    box-shadow: 0 8px 26px rgb(31 124 253 / 38%);
    color: #fff;
    cursor: pointer;
    animation: chatbot-launcher-glow 2.8s ease-in-out infinite;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.company-chatbot__launcher::before {
    position: absolute;
    z-index: -1;
    border: 1px solid rgb(31 124 253 / 38%);
    border-radius: inherit;
    content: "";
    inset: -5px;
    animation: chatbot-launcher-pulse 2.8s ease-out infinite;
}

.company-chatbot__launcher:hover {
    box-shadow: 0 10px 32px rgb(31 124 253 / 48%);
    transform: translateY(-3px) scale(1.03);
    animation-play-state: paused;
}

.company-chatbot__launcher svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    animation: chatbot-face-bob 2.8s ease-in-out infinite;
}

.company-chatbot__launcher-sparkle {
    position: absolute;
    top: 5px;
    right: 8px;
    z-index: 2;
    color: #fff3a6;
    font-size: 13px;
    line-height: 1;
    animation: chatbot-sparkle 1.8s ease-in-out infinite;
}

.company-chatbot__launcher:focus-visible,
.company-chatbot__close:focus-visible,
.company-chatbot__send:focus-visible,
.company-chatbot__form textarea:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.company-chatbot__launcher svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.company-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    height: min(560px, calc(100dvh - 120px));
    min-height: 340px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--chatbot-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgb(15 23 42 / 20%), 0 4px 14px rgb(15 23 42 / 8%);
    transform-origin: bottom right;
}

.company-chatbot[dir="rtl"] .company-chatbot__panel {
    transform-origin: bottom left;
}

.company-chatbot__panel[hidden] {
    display: none;
}

.company-chatbot__panel:not([hidden]) {
    animation: chatbot-panel-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.company-chatbot__header {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 13px;
    padding: 16px 18px;
    background: linear-gradient(120deg, #1f7cfd, #155fc7);
    color: #fff;
}

.company-chatbot__header-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 50%;
    background: rgb(255 255 255 / 18%);
    font-size: 19px;
}

.company-chatbot__heading {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.company-chatbot__heading strong {
    font-size: 15px;
    line-height: 1.3;
}

.company-chatbot__heading span {
    font-size: 12px;
    opacity: 0.9;
}

.company-chatbot__close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
}

.company-chatbot__close:hover {
    background: rgb(255 255 255 / 18%);
}

.company-chatbot__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 18px 16px;
    background:
        radial-gradient(ellipse at 100% 0%, rgb(31 124 253 / 5%), transparent 48%),
        var(--chatbot-surface);
    overscroll-behavior: contain;
}

.company-chatbot__message {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    animation: chatbot-message-in 180ms ease-out both;
}

.company-chatbot__message--assistant {
    align-self: flex-start;
    border: 1px solid var(--chatbot-border);
    border-bottom-left-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 6px rgb(15 23 42 / 4%);
}

.company-chatbot[dir="rtl"] .company-chatbot__message--assistant {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}

.company-chatbot__message--user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: linear-gradient(135deg, #318cff, #1f70e5);
    color: #fff;
    box-shadow: 0 3px 8px rgb(31 124 253 / 20%);
}

.company-chatbot[dir="rtl"] .company-chatbot__message--user {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 14px;
}

.company-chatbot__message--typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--chatbot-muted);
    font-size: 13px;
}

.company-chatbot__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.company-chatbot__typing-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--chatbot-blue);
    animation: chatbot-typing-dot 1.1s ease-in-out infinite;
}

.company-chatbot__typing-dots i:nth-child(2) {
    animation-delay: 150ms;
}

.company-chatbot__typing-dots i:nth-child(3) {
    animation-delay: 300ms;
}

.company-chatbot__welcome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 1px 2px;
    animation: chatbot-message-in 300ms ease-out both;
}

.company-chatbot__welcome-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgb(31 124 253 / 12%);
    border-radius: 14px;
    background: linear-gradient(145deg, #eaf3ff, #fff);
    color: var(--chatbot-blue);
    font-size: 18px;
}

.company-chatbot__welcome-kicker,
.company-chatbot__suggestions-label {
    color: var(--chatbot-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.company-chatbot[dir="rtl"] .company-chatbot__welcome-kicker,
.company-chatbot[dir="rtl"] .company-chatbot__suggestions-label {
    letter-spacing: 0;
}

.company-chatbot__welcome > strong {
    color: #172033;
    font-size: 20px;
    line-height: 1.3;
}

.company-chatbot__welcome > p {
    margin: -2px 0 2px;
    color: #526176;
    font-size: 13px;
    line-height: 1.6;
}

.company-chatbot__suggestions {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 7px;
}

.company-chatbot__suggestions button {
    border: 1px solid #dce8f8;
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    color: #2867b7;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1.3;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.company-chatbot__suggestions button:hover {
    transform: translateY(-1px);
    border-color: #a9ccf8;
    background: #eef6ff;
}

.company-chatbot__suggestions button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.company-chatbot__form {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 13px;
    border-top: 1px solid var(--chatbot-border);
    background: #fff;
}

.company-chatbot__form textarea {
    min-width: 0;
    min-height: 46px;
    max-height: 110px;
    flex: 1;
    resize: none;
    border: 1px solid #dce3ed;
    border-radius: 13px;
    padding: 12px 13px;
    color: var(--chatbot-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.company-chatbot__form textarea:focus {
    border-color: #77aef6;
    box-shadow: 0 0 0 3px rgb(31 124 253 / 10%);
    outline: 0;
}

.company-chatbot__send {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 13px;
    padding: 0 14px;
    background: linear-gradient(135deg, #318cff, #1f70e5);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: filter 150ms ease, transform 150ms ease;
}

.company-chatbot__send:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.company-chatbot__send:disabled,
.company-chatbot__form textarea:disabled {
    cursor: wait;
    opacity: 0.65;
}

@keyframes chatbot-launcher-glow {
    0%, 100% { box-shadow: 0 8px 26px rgb(31 124 253 / 32%); }
    50% { box-shadow: 0 10px 32px rgb(31 124 253 / 48%); }
}

@keyframes chatbot-launcher-pulse {
    0% { opacity: 0.75; transform: scale(0.94); }
    75%, 100% { opacity: 0; transform: scale(1.16); }
}

@keyframes chatbot-face-bob {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-1px) rotate(-2deg); }
}

@keyframes chatbot-sparkle {
    0%, 100% { opacity: 0.65; transform: scale(0.8) rotate(0); }
    50% { opacity: 1; transform: scale(1.12) rotate(18deg); }
}

@keyframes chatbot-panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chatbot-message-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes chatbot-typing-dot {
    0%, 60%, 100% { opacity: 0.45; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 480px) {
    .company-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .company-chatbot__panel {
        right: -4px;
        bottom: 72px;
        width: min(390px, calc(100vw - 24px));
        height: min(560px, calc(100dvh - 100px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .company-chatbot *,
    .company-chatbot *::before,
    .company-chatbot *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
