.aj-webchat {
    --aj-chat-blue: #199eb8;
    --aj-chat-blue-dark: #0f7c93;
    --aj-chat-orange: #e04f00;
    --aj-chat-ink: #17212b;
    --aj-chat-muted: #64748b;
    --aj-chat-soft: #f6f9fb;
    --aj-chat-border: rgba(15, 23, 42, .10);
    font-family: "Roboto", Helvetica, Arial, sans-serif;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10000;
}

.aj-webchat-toggle {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--aj-chat-blue), var(--aj-chat-blue-dark));
    box-shadow: 0 12px 28px rgba(15, 23, 42, .26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.aj-webchat-toggle:hover,
.aj-webchat-toggle:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .30);
    outline: 3px solid rgba(25, 158, 184, .22);
}

.aj-webchat-panel {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: min(368px, calc(100vw - 28px));
    max-height: min(600px, calc(100dvh - 96px));
    background: #fff;
    border: 1px solid var(--aj-chat-border);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .24);
    display: none;
    overflow: hidden;
}

.aj-webchat.is-open .aj-webchat-panel {
    display: flex;
    flex-direction: column;
}

.aj-webchat-header {
    flex: 0 0 auto;
    padding: 10px 10px 9px 13px;
    background: linear-gradient(135deg, var(--aj-chat-blue), var(--aj-chat-blue-dark));
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-radius: 15px 15px 0 0;
}

.aj-webchat-heading {
    min-width: 0;
    flex: 1 1 auto;
}

.aj-webchat-title {
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .01em;
}

.aj-webchat-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    min-width: 0;
}

.aj-webchat-status {
    font-size: 11.5px;
    line-height: 1;
    opacity: .94;
    white-space: nowrap;
}

.aj-webchat-status span {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 999px;
    display: inline-block;
    margin-right: 5px;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, .18);
}

.aj-webchat-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.aj-webchat-secondary,
.aj-webchat-close {
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}

.aj-webchat-secondary {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
}

.aj-webchat-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
}

.aj-webchat-secondary:hover,
.aj-webchat-close:hover,
.aj-webchat-secondary:focus-visible,
.aj-webchat-close:focus-visible {
    background: rgba(255, 255, 255, .24);
    outline: 2px solid rgba(255, 255, 255, .44);
}

.aj-webchat-messages {
    flex: 1 1 auto;
    min-height: 180px;
    padding: 12px 12px 8px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(25, 158, 184, .08), transparent 32%),
        var(--aj-chat-soft);
}

.aj-webchat-message {
    max-width: 86%;
    margin: 0 0 9px;
    display: flex;
    flex-direction: column;
}

.aj-webchat-message--in {
    margin-left: auto;
    align-items: flex-end;
}

.aj-webchat-message--out {
    margin-right: auto;
    align-items: flex-start;
}

.aj-webchat-bubble {
    border-radius: 14px;
    padding: 8px 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.38;
    font-size: 13.5px;
}

.aj-webchat-message--in .aj-webchat-bubble {
    color: #fff;
    background: linear-gradient(135deg, var(--aj-chat-blue), var(--aj-chat-blue-dark));
    border-bottom-right-radius: 5px;
    box-shadow: 0 6px 14px rgba(25, 158, 184, .20);
}

.aj-webchat-message--out .aj-webchat-bubble {
    color: var(--aj-chat-ink);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-bottom-left-radius: 5px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .06);
}

.aj-webchat-bubble a {
    color: #0f7c93;
    font-weight: 700;
    word-break: break-word;
}

.aj-webchat-message--in .aj-webchat-bubble a {
    color: #fff;
    text-decoration: underline;
}

.aj-webchat-meta {
    color: var(--aj-chat-muted);
    font-size: 10.5px;
    margin-top: 3px;
}

.aj-webchat-typing {
    flex: 0 0 auto;
    color: var(--aj-chat-muted);
    font-size: 12px;
    padding: 0 13px 7px;
    background: var(--aj-chat-soft);
}

.aj-webchat-quick-actions {
    flex: 0 0 auto;
    margin: 0;
    padding: 9px 10px;
    border-top: 1px solid var(--aj-chat-border);
    background: #fff;
}

.aj-webchat-quick-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    color: var(--aj-chat-muted);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .02em;
}

.aj-webchat-quick-title i {
    color: var(--aj-chat-blue);
    font-size: .95rem;
}

.aj-webchat-quick-actions button {
    width: 100%;
    min-height: 32px;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 10px;
    color: var(--aj-chat-ink);
    background: #fff;
    padding: 6px 8px;
    margin: 0 0 5px;
    display: grid;
    grid-template-columns: 22px minmax(18px, auto) 1fr 16px;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.aj-webchat-quick-actions button:last-child {
    margin-bottom: 0;
}

.aj-webchat-quick-actions button > i:first-child {
    color: var(--aj-chat-blue);
    font-size: .92rem;
}

.aj-webchat-quick-actions button > i:last-child {
    color: #94a3b8;
    font-size: .78rem;
    justify-self: end;
}

.aj-webchat-quick-number {
    color: var(--aj-chat-orange);
    font-weight: 900;
    min-width: 18px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.aj-webchat-quick-actions button:hover,
.aj-webchat-quick-actions button:focus-visible {
    background: #f8fcfd;
    border-color: rgba(25, 158, 184, .28);
    transform: translateY(-1px);
    outline: none;
}

.aj-webchat-form {
    flex: 0 0 auto;
    padding: 9px 10px 10px;
    border-top: 1px solid var(--aj-chat-border);
    background: #fff;
}

.aj-webchat-input-label {
    display: block;
    margin: 0 0 6px;
    color: var(--aj-chat-muted);
    font-size: 11.5px;
    font-weight: 800;
}

.aj-webchat-input-row {
    min-height: 42px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    border: 1px solid var(--aj-chat-border);
    border-radius: 14px;
    padding: 6px 6px 6px 10px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.aj-webchat-input-row:focus-within {
    border-color: var(--aj-chat-blue);
    box-shadow: 0 0 0 3px rgba(25, 158, 184, .12);
}

.aj-webchat-form textarea {
    flex: 1 1 auto;
    min-height: 28px;
    max-height: 88px;
    resize: none;
    border: 0;
    padding: 5px 0;
    color: var(--aj-chat-ink);
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.32;
}

.aj-webchat-form textarea:focus {
    outline: none;
}

.aj-webchat-form button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--aj-chat-orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .86rem;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.aj-webchat-form button:hover,
.aj-webchat-form button:focus-visible {
    filter: brightness(.96);
    transform: translateY(-1px);
    outline: 3px solid rgba(224, 79, 0, .16);
}

.aj-webchat-form button:disabled,
.aj-webchat-quick-actions button:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

.aj-webchat-error {
    flex: 0 0 auto;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    padding: 7px 9px;
    margin: 0 12px 8px;
    font-size: 12px;
}

@media (max-width: 640px) {
    .aj-webchat {
        right: 10px;
        bottom: 10px;
    }

    .aj-webchat-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .aj-webchat-panel {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 78px);
        right: 0;
        bottom: 60px;
        border-radius: 15px;
    }

    .aj-webchat-header {
        padding: 9px 9px 8px 12px;
    }

    .aj-webchat-title {
        font-size: 14px;
    }

    .aj-webchat-header-meta {
        gap: 6px;
    }

    .aj-webchat-secondary {
        padding: 4px 7px;
        font-size: 10.5px;
    }

    .aj-webchat-messages {
        min-height: 150px;
        padding: 10px;
    }

    .aj-webchat-quick-actions {
        padding: 8px 9px;
    }

    .aj-webchat-quick-actions button {
        min-height: 30px;
        font-size: 12.5px;
    }
}
