:root {
    --ttc-primary: #0073aa;
    --ttc-secondary: #005a87;
    --ttc-text: #ffffff;
    --ttc-bg: #ffffff;
    --ttc-chat-bg: #f7f8fa;
    --ttc-msg-bot-bg: #ffffff;
    --ttc-msg-bg: #f0f2f5;
    --ttc-msg-user-bg: var(--ttc-primary);
    --ttc-msg-user-text: #ffffff;
    --ttc-msg-bot-text: #1a1a2e;
    --ttc-border: var(--ttc-border-color, #e4e6ea);
    --ttc-border-focus: var(--ttc-primary);
    --ttc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ttc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --ttc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);
    --ttc-shadow-trigger: 0 4px 14px rgba(0, 0, 0, 0.2);
    --ttc-radius: 16px;
    --ttc-radius-sm: 8px;
    --ttc-radius-pill: 24px;
    --ttc-font: var(--ttc-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif);
    --ttc-font-size: 14px;
    --ttc-bubble-radius: 18px;
    --ttc-bubble-max-width: 82%;
    --ttc-widget-offset: 20px;
    --ttc-widget-width: 380px;
    --ttc-widget-height: 540px;
    --ttc-button-size: 60px;
    --ttc-z: 99999;
    --ttc-header-gradient: linear-gradient(135deg, var(--ttc-primary) 0%, var(--ttc-secondary) 100%);
    --ttc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --ttc-chip-bg: var(--ttc-bg);
    --ttc-chip-border: var(--ttc-primary);
    --ttc-chip-text: var(--ttc-primary);
    --ttc-muted: #6b7280;
    --ttc-presence-color: #4ade80;
    --ttc-header-avatar-size: 40px;
    --ttc-cta-color: var(--ttc-primary);
    --ttc-cta-text: #ffffff;
    --ttc-cta-radius: 8px;
    --ttc-pulse-duration: 2s;
}

/* --- Trigger Button --- */
.ttc-widget-trigger {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    z-index: var(--ttc-z);
    width: var(--ttc-button-size);
    height: var(--ttc-button-size);
    border-radius: 50%;
    background: var(--ttc-header-gradient);
    color: var(--ttc-text);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ttc-shadow-trigger);
    transition: transform var(--ttc-transition), box-shadow var(--ttc-transition);
    padding: 0;
    outline: none;
}

.ttc-widget-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ttc-widget-trigger:focus-visible {
    outline: 3px solid var(--ttc-primary);
    outline-offset: 3px;
}

.ttc-widget-trigger.ttc-position-right { right: 16px; }
.ttc-widget-trigger.ttc-position-left { left: 16px; }

.ttc-widget-trigger svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: transform var(--ttc-transition), opacity var(--ttc-transition);
}

.ttc-widget-trigger .ttc-close-icon { display: none; }
.ttc-widget-trigger.ttc-open .ttc-chat-icon,
.ttc-widget-trigger.ttc-open .ttc-message-icon,
.ttc-widget-trigger.ttc-open .ttc-help-icon,
.ttc-widget-trigger.ttc-open .ttc-headset-icon { display: none; }
.ttc-widget-trigger.ttc-open .ttc-close-icon { display: block; }

/* Pulse ring for first-time visitors and gentle periodic attention */
.ttc-widget-trigger.ttc-first-visit::after,
.ttc-widget-trigger.ttc-pulse-active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--ttc-primary);
    animation: ttc-pulse-ring var(--ttc-pulse-duration) cubic-bezier(0.4, 0, 0.6, 1) 1;
    pointer-events: none;
}

/* Trigger text bubble */
.ttc-trigger-text {
    position: fixed;
    bottom: calc(max(16px, env(safe-area-inset-bottom, 16px)) + var(--ttc-button-size) / 2 - 18px);
    background: var(--ttc-bg);
    color: var(--ttc-msg-bot-text);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: var(--ttc-shadow-md);
    font-size: 13px;
    font-family: var(--ttc-font);
    max-width: 220px;
    line-height: 1.4;
    animation: ttc-fade-in 0.3s ease;
    z-index: var(--ttc-z);
    border: 1px solid var(--ttc-border);
}

.ttc-trigger-text.ttc-position-right {
    right: calc(16px + var(--ttc-button-size) + 12px);
}

.ttc-trigger-text.ttc-position-left {
    left: calc(16px + var(--ttc-button-size) + 12px);
}

.ttc-trigger-text-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: var(--ttc-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    line-height: 1;
    opacity: 0.6;
}

.ttc-trigger-text-close:hover { opacity: 1; }

/* --- Chat Window (mobile-first: full-screen) --- */
.ttc-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--ttc-z);
    width: 100vw;
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
    max-width: 100vw;
    background: var(--ttc-bg);
    border-radius: 0;
    box-shadow: var(--ttc-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--ttc-font);
    font-size: var(--ttc-font-size);
    line-height: 1.5;
    color: var(--ttc-msg-bot-text);
    border: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                visibility 0s 0.3s;
}

.ttc-chat-window.ttc-visible {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                visibility 0s;
}

.ttc-chat-window.ttc-instant {
    transition: none !important;
}

@supports (height: 100dvh) {
    .ttc-chat-window {
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* --- Header --- */
.ttc-header {
    background: var(--ttc-header-gradient);
    color: var(--ttc-text);
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top, 12px));
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}

.ttc-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.ttc-header-avatar {
    width: var(--ttc-header-avatar-size);
    height: var(--ttc-header-avatar-size);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ttc-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttc-header-info {
    flex: 1;
    min-width: 0;
}

.ttc-header-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.ttc-header-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ttc-header-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ttc-presence-color);
    display: inline-block;
    flex-shrink: 0;
}

.ttc-header-status.ttc-presence-hidden::before { display: none; }
.ttc-header-status.ttc-presence-pulse::before { animation: ttc-presence-pulse 1.8s ease-in-out infinite; }

.ttc-header-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--ttc-text);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    opacity: 0.85;
    transition: opacity var(--ttc-transition), background var(--ttc-transition);
    display: flex;
    align-items: center;
}

.ttc-header-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.ttc-header-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.ttc-header-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --- Messages --- */
.ttc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    background: var(--ttc-chat-bg);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--ttc-border) transparent;
}

.ttc-messages::-webkit-scrollbar {
    width: 5px;
}

.ttc-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ttc-messages::-webkit-scrollbar-thumb {
    background: var(--ttc-border);
    border-radius: 3px;
}

.ttc-message {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: var(--ttc-bubble-radius);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.45;
    white-space: pre-wrap;
    position: relative;
}

.ttc-message-bot {
    align-self: flex-start;
    background: var(--ttc-msg-bot-bg);
    color: var(--ttc-msg-bot-text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--ttc-shadow-sm);
}

.ttc-message-user {
    align-self: flex-end;
    background: var(--ttc-msg-user-bg);
    color: var(--ttc-msg-user-text);
    border-bottom-right-radius: 4px;
    box-shadow: var(--ttc-shadow-sm);
}

.ttc-message a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ttc-message a:hover {
    text-decoration-thickness: 2px;
}

/* Message timestamp */
.ttc-msg-time {
    display: block;
    font-size: 10px;
    color: var(--ttc-muted);
    opacity: 0.6;
    margin-top: 3px;
    font-weight: 400;
}

.ttc-message-user .ttc-msg-time {
    text-align: right;
    color: var(--ttc-msg-user-text);
    opacity: 0.5;
}

/* --- Typing Indicator --- */
.ttc-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--ttc-msg-bot-bg);
    border-radius: var(--ttc-bubble-radius);
    border-bottom-left-radius: 4px;
    box-shadow: var(--ttc-shadow-sm);
    font-size: 13px;
    color: var(--ttc-muted);
}

.ttc-typing-label {
    font-weight: 600;
    color: var(--ttc-msg-bot-text);
    opacity: 0.7;
}

.ttc-typing-status {
    font-style: italic;
    opacity: 0.8;
}

.ttc-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}

.ttc-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ttc-primary);
    opacity: 0.5;
    animation: ttc-typing-wave 1.4s infinite ease-in-out;
}

.ttc-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.ttc-typing-dot:nth-child(3) { animation-delay: 0.32s; }

/* --- Chips --- */
.ttc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 10px 8px;
}

.ttc-chip {
    background: var(--ttc-chip-bg);
    color: var(--ttc-chip-text);
    border: 1.5px solid var(--ttc-chip-border);
    border-radius: var(--ttc-radius-pill);
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--ttc-transition), color var(--ttc-transition), transform var(--ttc-transition), box-shadow var(--ttc-transition);
    font-family: var(--ttc-font);
    font-weight: 500;
    line-height: 1.3;
    outline: none;
    white-space: nowrap;
}

.ttc-chip:hover {
    background: var(--ttc-primary);
    color: var(--ttc-text);
    transform: scale(1.03);
    box-shadow: var(--ttc-shadow-sm);
}

.ttc-chip:focus-visible {
    outline: 2px solid var(--ttc-primary);
    outline-offset: 2px;
}

/* --- CTA Container --- */
.ttc-cta-container {
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ttc-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ttc-cta-color);
    color: var(--ttc-cta-text);
    border: 1px solid var(--ttc-cta-color);
    border-radius: var(--ttc-cta-radius);
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--ttc-font);
    transition: transform var(--ttc-transition), box-shadow var(--ttc-transition), opacity var(--ttc-transition);
    letter-spacing: 0.01em;
    box-shadow: var(--ttc-shadow-sm);
    width: 100%;
}

.ttc-cta-button svg { width: 15px; height: 15px; fill: currentColor; flex: 0 0 auto; }
.ttc-cta-width-auto .ttc-cta-button { width: auto; }
.ttc-cta-width-full .ttc-cta-button { width: 100%; }
.ttc-cta-style-outline .ttc-cta-button { background: transparent; color: var(--ttc-cta-color); }
.ttc-cta-style-soft .ttc-cta-button { background: color-mix(in srgb, var(--ttc-cta-color) 12%, transparent); color: var(--ttc-cta-color); }

.ttc-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--ttc-shadow-md);
    opacity: 0.95;
}

.ttc-cta-button:focus-visible {
    outline: 2px solid var(--ttc-primary);
    outline-offset: 2px;
}

/* --- Input Area --- */
.ttc-input-area[hidden] {
    display: none !important;
}

.ttc-input-area {
    display: flex;
    align-items: flex-end;
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    border-top: 1px solid var(--ttc-border);
    gap: 8px;
    flex-shrink: 0;
    background: var(--ttc-bg);
}

.ttc-input {
    flex: 1;
    border: 1.5px solid var(--ttc-border);
    border-radius: var(--ttc-radius-pill);
    padding: 8px 14px;
    font-size: 16px;
    font-family: var(--ttc-font);
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 36px;
    line-height: 1.4;
    transition: border-color var(--ttc-transition), box-shadow var(--ttc-transition);
    background: var(--ttc-bg);
    color: var(--ttc-msg-bot-text);
    box-sizing: border-box;
}

.ttc-input:focus {
    border-color: var(--ttc-border-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ttc-primary) 12%, transparent);
}

.ttc-input::placeholder {
    color: var(--ttc-muted);
    opacity: 0.7;
}

.ttc-send-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ttc-primary);
    color: var(--ttc-text);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--ttc-transition), transform var(--ttc-transition);
    padding: 0;
    outline: none;
}

.ttc-send-button:hover {
    background: var(--ttc-secondary);
    transform: scale(1.06);
}

.ttc-send-button:focus-visible {
    outline: 2px solid var(--ttc-primary);
    outline-offset: 2px;
}

.ttc-send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.ttc-send-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --- Branding --- */
.ttc-branding {
    text-align: center;
    padding: 6px 12px;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 4px));
    font-size: 11px;
    color: var(--ttc-muted);
    flex-shrink: 0;
    border-top: 1px solid var(--ttc-border);
    background: var(--ttc-bg);
    letter-spacing: 0.01em;
}

.ttc-branding a {
    color: var(--ttc-muted);
    text-decoration: none;
    font-weight: 500;
}

.ttc-branding a:hover {
    color: var(--ttc-primary);
}

/* --- Consent Banner --- */
.ttc-consent-banner {
    padding: 14px 16px;
    background: var(--ttc-chat-bg);
    border-top: 1px solid var(--ttc-border);
    font-size: 12px;
    color: var(--ttc-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
    line-height: 1.5;
}

.ttc-consent-actions {
    display: flex;
    gap: 8px;
}

.ttc-consent-accept {
    padding: 7px 16px;
    background: var(--ttc-primary);
    color: var(--ttc-text);
    border: none;
    border-radius: var(--ttc-radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--ttc-font);
    transition: background var(--ttc-transition);
}

.ttc-consent-accept:hover { background: var(--ttc-secondary); }

.ttc-consent-decline {
    padding: 7px 16px;
    background: transparent;
    color: var(--ttc-muted);
    border: 1.5px solid var(--ttc-border);
    border-radius: var(--ttc-radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-family: var(--ttc-font);
    transition: border-color var(--ttc-transition);
}

.ttc-consent-decline:hover { border-color: var(--ttc-muted); }

/* --- Language Selector --- */
.ttc-language-selector {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.ttc-language-button {
    padding: 2px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: var(--ttc-text);
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    font-family: var(--ttc-font);
    transition: background var(--ttc-transition), border-color var(--ttc-transition);
}

.ttc-language-button:hover { background: rgba(255, 255, 255, 0.15); }

.ttc-language-button.ttc-active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* --- Capture Field --- */
.ttc-capture-field {
    padding: 10px 16px;
    border-top: 1px solid var(--ttc-border);
    background: var(--ttc-chat-bg);
}

.ttc-capture-input {
    width: 100%;
    border: 1.5px solid var(--ttc-border);
    border-radius: var(--ttc-radius-sm);
    padding: 9px 14px;
    font-size: 14px;
    font-family: var(--ttc-font);
    outline: none;
    box-sizing: border-box;
    background: var(--ttc-bg);
    color: var(--ttc-msg-bot-text);
    transition: border-color var(--ttc-transition), box-shadow var(--ttc-transition);
}

.ttc-capture-input:focus {
    border-color: var(--ttc-border-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ttc-primary) 12%, transparent);
}

/* --- Animations --- */
@keyframes ttc-typing-wave {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes ttc-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ttc-scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes ttc-pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes ttc-send-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes ttc-presence-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ttc-presence-color) 55%, transparent); }
    50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ttc-presence-color) 0%, transparent); }
}

/* Configurable entry variants */
.ttc-window-animation-fade .ttc-chat-window { transform: none; }
.ttc-window-animation-scale .ttc-chat-window { transform: scale(0.92); }
.ttc-window-animation-scale .ttc-chat-window.ttc-visible { transform: scale(1); }
.ttc-window-animation-none .ttc-chat-window { transition: none !important; transform: none; }
.ttc-no-message-animation .ttc-message { animation: none !important; }
.ttc-no-trigger-pulse .ttc-widget-trigger.ttc-pulse-active::after { display: none; }

@media (prefers-reduced-motion: no-preference) {
    .ttc-message {
        animation: ttc-fade-in 0.25s ease backwards;
        animation-delay: calc(var(--ttc-msg-index, 0) * 60ms);
    }

    .ttc-widget-trigger.ttc-open .ttc-close-icon {
        animation: ttc-scale-in 0.2s ease;
    }

    .ttc-chip {
        animation: ttc-fade-in 0.2s ease;
    }

    .ttc-send-button.ttc-send-pulse {
        animation: ttc-send-pulse 0.3s ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.ttc-no-animations *, .ttc-no-animations *::before, .ttc-no-animations *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

/* --- Dark mode --- */
.ttc-dark .ttc-message-bot {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ttc-dark .ttc-message-user {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ttc-dark .ttc-trigger-text {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ========================================
   TABLET (>= 481px): windowed mode
   ======================================== */
@media (min-width: 481px) {
    .ttc-widget-trigger {
        bottom: var(--ttc-widget-offset);
    }

    .ttc-widget-trigger.ttc-position-right { right: var(--ttc-widget-offset); }
    .ttc-widget-trigger.ttc-position-left { left: var(--ttc-widget-offset); }

    .ttc-trigger-text.ttc-position-right {
        right: calc(var(--ttc-widget-offset) + var(--ttc-button-size) + 12px);
    }

    .ttc-trigger-text.ttc-position-left {
        left: calc(var(--ttc-widget-offset) + var(--ttc-button-size) + 12px);
    }

    .ttc-trigger-text {
        bottom: calc(var(--ttc-widget-offset) + var(--ttc-button-size) / 2 - 18px);
    }

    .ttc-chat-window {
        width: min(var(--ttc-widget-width), calc(100vw - 40px));
        height: min(var(--ttc-widget-height), calc(100vh - 100px));
        max-height: calc(100vh - 100px);
        max-width: var(--ttc-widget-width);
        top: auto;
        left: auto;
        right: auto;
        bottom: 80px;
        border-radius: var(--ttc-radius);
        border: 1px solid var(--ttc-border);
    }

    .ttc-chat-window.ttc-position-right { right: var(--ttc-widget-offset); }
    .ttc-chat-window.ttc-position-left { left: var(--ttc-widget-offset); }

    .ttc-header {
        padding: 14px 18px;
        padding-top: 14px;
    }

    .ttc-header-avatar {
        width: var(--ttc-header-avatar-size);
        height: var(--ttc-header-avatar-size);
        font-size: 20px;
    }

    .ttc-messages {
        padding: 16px 14px;
    }

    .ttc-message {
        max-width: var(--ttc-bubble-max-width);
    }

    .ttc-chips {
        padding: 4px 14px 10px;
    }

    .ttc-chip {
        font-size: 13px;
    }

    .ttc-cta-container {
        padding: 8px 14px;
    }

    .ttc-cta-button {
        font-size: 13px;
        padding: 10px 20px;
        width: auto;
    }

    .ttc-input-area {
        padding: 10px 14px;
    }

    .ttc-input {
        font-size: 14px;
        padding: 9px 16px;
        min-height: 38px;
    }

    .ttc-send-button {
        width: 38px;
        height: 38px;
    }

    .ttc-branding {
        padding-bottom: 6px;
    }
}

/* ========================================
   DESKTOP (>= 769px): full dimensions
   ======================================== */
@media (min-width: 769px) {
    .ttc-chat-window {
        bottom: 90px;
        max-height: calc(100vh - 120px);
    }

    .ttc-header {
        padding: 16px 18px;
    }

    .ttc-messages {
        padding: 18px 16px;
    }

    .ttc-chips {
        padding: 4px 16px 10px;
    }

    .ttc-cta-container {
        padding: 8px 16px;
    }

    .ttc-input-area {
        padding: 12px 14px;
    }
}

/* ========================================
   LARGE DESKTOP (>= 1200px)
   ======================================== */
@media (min-width: 1200px) {
    .ttc-chat-window {
        max-height: min(var(--ttc-widget-height), calc(100vh - 120px));
    }
}

/* --- Focus-visible for accessibility --- */
.ttc-chat-window *:focus-visible {
    outline: 2px solid var(--ttc-primary);
    outline-offset: 2px;
}

.ttc-chat-window *:focus:not(:focus-visible) {
    outline: none;
}
