    .tba-chat {
        --tba-chat-blue: #0073FC;
        --tba-chat-blue-hover: #005BC7;
        --tba-chat-bg: #0E1114;
        --tba-chat-head-bg: #0B0D0D;
        --tba-chat-surface: rgba(255, 255, 255, 0.045);
        --tba-chat-surface-hover: rgba(255, 255, 255, 0.08);
        --tba-chat-border: rgba(255, 255, 255, 0.07);
        --tba-chat-text: #F3F5F7;
        --tba-chat-muted: rgba(243, 245, 247, 0.55);
        --tba-chat-agent-bubble: #1B2024;
        --tba-chat-input-bg: #15181C;
        --tba-chat-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);

        position: fixed;
        right: 24px;
        bottom: 24px;
        z-index: 99990;
        display: flex;
        flex-direction: column;
        width: 370px;
        height: min(520px, 70vh);
        height: min(520px, 70dvh);
        min-height: 380px;
        overflow: hidden;
        color: var(--tba-chat-text);
        background: var(--tba-chat-bg);
        border: 1px solid var(--tba-chat-border);
        border-radius: 20px;
        box-shadow: var(--tba-chat-shadow);
        font-family: var(--tk-body-font, 'TK Body', Poppins, system-ui, sans-serif);
        font-size: 14px;
        line-height: 1.5;
        opacity: 0;
        visibility: hidden;
        transform: translateY(16px) scale(0.98);
        transform-origin: bottom right;
        transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms;
    }

    html[data-tk-theme="light"] .tba-chat {
        --tba-chat-bg: #FFFFFF;
        --tba-chat-head-bg: #F5F6F8;
        --tba-chat-surface: #F5F6F8;
        --tba-chat-surface-hover: #EDF0F3;
        --tba-chat-border: rgba(15, 17, 21, 0.09);
        --tba-chat-text: #14161A;
        --tba-chat-muted: rgba(20, 22, 26, 0.55);
        --tba-chat-agent-bubble: #EDF0F3;
        --tba-chat-input-bg: #F5F6F8;
        --tba-chat-shadow: 0 24px 60px rgba(15, 17, 21, 0.18), 0 0 0 1px rgba(15, 17, 21, 0.04);
    }

    .tba-chat.is-open {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity 200ms ease, transform 200ms ease, visibility 0s;
    }

    .tba-chat *,
    .tba-chat *::before,
    .tba-chat *::after {
        box-sizing: border-box;
    }

    .tba-chat button {
        font: inherit;
        color: inherit;
        cursor: pointer;
    }

    /* Header */
    .tba-chat__head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 14px 14px 16px;
        background: var(--tba-chat-head-bg);
        border-bottom: 1px solid var(--tba-chat-border);
    }

    .tba-chat__logo {
        position: relative;
        flex: none;
        width: 42px;
        height: 42px;
    }

    .tba-chat__logo img {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        background: #F5F5F5;
    }

    .tba-chat__logo::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 1px;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: #22C55E;
        border: 2px solid var(--tba-chat-head-bg);
    }

    .tba-chat__title {
        flex: 1;
        min-width: 0;
    }

    .tba-chat__name {
        margin: 0;
        font-family: var(--tk-heading-font, 'TK Heading', Montserrat, system-ui, sans-serif);
        font-size: 15px;
        font-weight: 700;
        line-height: 1.25;
        color: var(--tba-chat-text);
    }

    .tba-chat__status {
        margin: 2px 0 0;
        font-size: 12px;
        color: var(--tba-chat-muted);
    }

    .tba-chat__icon-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--tba-chat-muted) !important;
        transition: background-color 150ms ease, color 150ms ease;
    }

    .tba-chat__icon-btn:hover,
    .tba-chat__icon-btn:focus-visible {
        background: var(--tba-chat-surface-hover);
        color: var(--tba-chat-text) !important;
    }

    .tba-chat__icon-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Messages */
    .tba-chat__log {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 18px 16px 8px;
        scrollbar-width: thin;
    }

    .tba-chat__intro {
        margin: 0 0 16px;
        text-align: center;
        font-size: 12px;
        color: var(--tba-chat-muted);
    }

    .tba-chat__row {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        margin-bottom: 12px;
    }

    .tba-chat__row--user {
        flex-direction: row-reverse;
    }

    .tba-chat__avatar {
        flex: none;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #F5F5F5;
        object-fit: cover;
    }

    .tba-chat__stack {
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-width: 78%;
    }

    .tba-chat__row--user .tba-chat__stack {
        align-items: flex-end;
    }

    .tba-chat__bubble {
        margin: 0;
        padding: 10px 14px;
        border-radius: 16px 16px 16px 4px;
        background: var(--tba-chat-agent-bubble);
        color: var(--tba-chat-text);
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }

    .tba-chat__row--user .tba-chat__bubble {
        border-radius: 16px 16px 4px 16px;
        background: var(--tba-chat-blue);
        color: #fff;
    }

    .tba-chat__meta {
        font-size: 11px;
        color: var(--tba-chat-muted);
    }

    .tba-chat__file-img {
        display: block;
        max-width: 220px;
        max-height: 180px;
        border-radius: 12px;
        border: 1px solid var(--tba-chat-border);
        object-fit: cover;
    }

    .tba-chat__file {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        max-width: 240px;
        padding: 9px 12px;
        border-radius: 12px;
        background: var(--tba-chat-surface);
        border: 1px solid var(--tba-chat-border);
        color: var(--tba-chat-text);
    }

    .tba-chat__file-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(0, 115, 252, 0.14);
        color: var(--tba-chat-blue);
    }

    .tba-chat__file-icon svg {
        width: 16px;
        height: 16px;
    }

    .tba-chat__file-text {
        min-width: 0;
        font-size: 12px;
        line-height: 1.35;
    }

    .tba-chat__file-name {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-weight: 600;
    }

    .tba-chat__file-size {
        color: var(--tba-chat-muted);
    }

    /* Typing indicator */
    .tba-chat__typing {
        display: inline-flex;
        gap: 4px;
        padding: 14px 16px;
        border-radius: 16px 16px 16px 4px;
        background: var(--tba-chat-agent-bubble);
    }

    .tba-chat__typing span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--tba-chat-muted);
        animation: tba-chat-typing 1.2s infinite ease-in-out;
    }

    .tba-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
    .tba-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

    @keyframes tba-chat-typing {
        0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
        30% { transform: translateY(-4px); opacity: 1; }
    }

    /* Quick replies */
    .tba-chat__chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 4px 0 12px 36px;
    }

    .tba-chat__chip {
        padding: 7px 12px;
        border: 1px solid rgba(0, 115, 252, 0.45);
        border-radius: 999px;
        background: rgba(0, 115, 252, 0.08);
        color: var(--tba-chat-text) !important;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        transition: background-color 150ms ease, border-color 150ms ease;
    }

    .tba-chat__chip:hover,
    .tba-chat__chip:focus-visible {
        background: rgba(0, 115, 252, 0.18);
        border-color: var(--tba-chat-blue);
    }

    /* Composer */
    .tba-chat__composer {
        padding: 10px 12px 12px;
        border-top: 1px solid var(--tba-chat-border);
        background: var(--tba-chat-bg);
    }

    .tba-chat__pending {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 8px;
    }

    .tba-chat__pending:empty {
        display: none;
    }

    .tba-chat__pending-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        max-width: 100%;
        padding: 4px 4px 4px 6px;
        border-radius: 10px;
        background: var(--tba-chat-surface);
        border: 1px solid var(--tba-chat-border);
        font-size: 12px;
    }

    .tba-chat__pending-thumb {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        object-fit: cover;
    }

    .tba-chat__pending-name {
        max-width: 140px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .tba-chat__pending-remove {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--tba-chat-muted) !important;
        font-size: 16px;
        line-height: 1;
    }

    .tba-chat__pending-remove:hover {
        background: var(--tba-chat-surface-hover);
        color: var(--tba-chat-text) !important;
    }

    .tba-chat__error {
        margin: 0 0 8px;
        font-size: 12px;
        color: #F87171;
    }

    .tba-chat__error:empty {
        display: none;
    }

    .tba-chat__field {
        display: flex;
        align-items: flex-end;
        gap: 6px;
        padding: 6px;
        border: 1px solid var(--tba-chat-border);
        border-radius: 16px;
        background: var(--tba-chat-input-bg);
        transition: border-color 150ms ease, box-shadow 150ms ease;
    }

    .tba-chat__field:focus-within {
        border-color: var(--tba-chat-blue);
        box-shadow: 0 0 0 3px rgba(0, 115, 252, 0.18);
    }

    .tba-chat__input {
        flex: 1;
        min-width: 0;
        max-height: 120px;
        margin: 0;
        padding: 8px 4px;
        border: 0 !important;
        outline: 0;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--tba-chat-text) !important;
        font: inherit;
        line-height: 1.45;
        resize: none;
    }

    .tba-chat__input::placeholder {
        color: var(--tba-chat-muted);
        opacity: 1;
    }

    .tba-chat__send {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: var(--tba-chat-blue);
        color: #fff !important;
        box-shadow: 0 6px 18px rgba(0, 115, 252, 0.25);
        transition: background-color 150ms ease, opacity 150ms ease;
    }

    .tba-chat__send:hover:not(:disabled) {
        background: var(--tba-chat-blue-hover);
    }

    .tba-chat__send:disabled {
        opacity: 0.4;
        box-shadow: none;
        cursor: default;
    }

    .tba-chat__send svg {
        width: 17px;
        height: 17px;
    }

    .tba-chat__note {
        margin: 8px 0 0;
        text-align: center;
        font-size: 11px;
        color: var(--tba-chat-muted);
    }

    .tba-chat__drop {
        position: absolute;
        inset: 0;
        z-index: 2;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 24px;
        border: 2px dashed var(--tba-chat-blue);
        border-radius: 20px;
        background: rgba(0, 115, 252, 0.12);
        backdrop-filter: blur(2px);
        font-weight: 700;
        text-align: center;
        pointer-events: none;
    }

    .tba-chat.is-dragging .tba-chat__drop {
        display: flex;
    }

    .tba-chat .tba-chat__sr {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    @media (max-width: 575.98px) {
        .tba-chat {
            right: 12px;
            bottom: 12px;
            width: calc(100% - 24px);
            height: 75vh;
            height: 75dvh;
            min-height: 0;
            border-radius: 18px;
            transform-origin: bottom center;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .tba-chat,
        .tba-chat.is-open {
            transform: none;
            transition: none;
        }

        .tba-chat__typing span {
            animation: none;
            opacity: 0.8;
        }
    }
